]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Rename USER_CREDS_SYNTHESIZE_FALLBACK to …_PREFER_NSS 9783/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 20 Aug 2018 14:06:41 +0000 (16:06 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 20 Aug 2018 14:06:41 +0000 (16:06 +0200)
src/basic/user-util.c
src/basic/user-util.h
src/run/run.c

index b6185597de935c1b4a18be4d3b0f0f137f364953..d410c9068b937cf2bb8f120820e40ce819d57826 100644 (file)
@@ -168,14 +168,14 @@ int get_user_creds(
         assert(username);
         assert(*username);
 
-        if (!FLAGS_SET(flags, USER_CREDS_SYNTHESIZE_FALLBACK) ||
+        if (!FLAGS_SET(flags, USER_CREDS_PREFER_NSS) ||
             (!home && !shell)) {
 
                 /* So here's the deal: normally, we'll try to synthesize all records we can synthesize, and override
-                 * the user database with that. However, if the user specifies USER_CREDS_SYNTHESIZE_FALLBACK then the
+                 * the user database with that. However, if the user specifies USER_CREDS_PREFER_NSS then the
                  * user database will override the synthetic records instead — except if the user is only interested in
                  * the UID and/or GID (but not the home directory, or the shell), in which case we'll always override
-                 * the user database (i.e. the USER_CREDS_SYNTHESIZE_FALLBACK flag has no effect in this case). Why?
+                 * the user database (i.e. the USER_CREDS_PREFER_NSS flag has no effect in this case). Why?
                  * Simply because there are valid usecase where the user might change the home directory or the shell
                  * of the relevant users, but changing the UID/GID mappings for them is something we explicitly don't
                  * support. */
@@ -215,7 +215,7 @@ int get_user_creds(
                 r = errno > 0 ? -errno : -ESRCH;
 
                 /* If the user requested that we only synthesize as fallback, do so now */
-                if (FLAGS_SET(flags, USER_CREDS_SYNTHESIZE_FALLBACK)) {
+                if (FLAGS_SET(flags, USER_CREDS_PREFER_NSS)) {
                         if (synthesize_user_creds(username, uid, gid, home, shell, flags) >= 0)
                                 return 0;
                 }
index a18f4d6f1ac9f1fa1a62d02622f41790ed169902..b6de0e4234040a782b75e96c505f04856dc16088 100644 (file)
@@ -26,9 +26,9 @@ char* getlogname_malloc(void);
 char* getusername_malloc(void);
 
 typedef enum UserCredsFlags {
-        USER_CREDS_SYNTHESIZE_FALLBACK = 1 << 0,  /* if set, only synthesize user records if database lacks them. Normally we bypass the userdb entirely for the records we can synthesize */
-        USER_CREDS_ALLOW_MISSING       = 1 << 1,  /* if a numeric UID string is resolved, be OK if there's no record for it */
-        USER_CREDS_CLEAN               = 1 << 2,  /* try to clean up shell and home fields with invalid data */
+        USER_CREDS_PREFER_NSS    = 1 << 0,  /* if set, only synthesize user records if database lacks them. Normally we bypass the userdb entirely for the records we can synthesize */
+        USER_CREDS_ALLOW_MISSING = 1 << 1,  /* if a numeric UID string is resolved, be OK if there's no record for it */
+        USER_CREDS_CLEAN         = 1 << 2,  /* try to clean up shell and home fields with invalid data */
 } UserCredsFlags;
 
 int get_user_creds(const char **username, uid_t *uid, gid_t *gid, const char **home, const char **shell, UserCredsFlags flags);
index effbbb62cc5e7e45f9e47f90768de7562a3925b2..dfbb3e2236e301372feec16c8fc5b35641479356 100644 (file)
@@ -1245,7 +1245,7 @@ static int start_transient_scope(
                 uid_t uid;
                 gid_t gid;
 
-                r = get_user_creds(&arg_exec_user, &uid, &gid, &home, &shell, USER_CREDS_CLEAN|USER_CREDS_SYNTHESIZE_FALLBACK);
+                r = get_user_creds(&arg_exec_user, &uid, &gid, &home, &shell, USER_CREDS_CLEAN|USER_CREDS_PREFER_NSS);
                 if (r < 0)
                         return log_error_errno(r, "Failed to resolve user %s: %m", arg_exec_user);