]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/basic/user-util.c
Merge pull request #11827 from keszybz/pkgconfig-variables
[thirdparty/systemd.git] / src / basic / user-util.c
index b6185597de935c1b4a18be4d3b0f0f137f364953..260f3d20576baa2175c9230e50028ecbd2db4298 100644 (file)
@@ -87,7 +87,7 @@ char *getusername_malloc(void) {
         return uid_to_name(getuid());
 }
 
-static inline bool is_nologin_shell(const char *shell) {
+static bool is_nologin_shell(const char *shell) {
 
         return PATH_IN_SET(shell,
                            /* 'nologin' is the friendliest way to disable logins for a user account. It prints a nice
@@ -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;
                 }
@@ -733,10 +733,6 @@ int maybe_setgroups(size_t size, const gid_t *list) {
 }
 
 bool synthesize_nobody(void) {
-
-#ifdef NOLEGACY
-        return true;
-#else
         /* Returns true when we shall synthesize the "nobody" user (which we do by default). This can be turned off by
          * touching /etc/systemd/dont-synthesize-nobody in order to provide upgrade compatibility with legacy systems
          * that used the "nobody" user name and group name for other UIDs/GIDs than 65534.
@@ -750,7 +746,6 @@ bool synthesize_nobody(void) {
                 cache = access("/etc/systemd/dont-synthesize-nobody", F_OK) < 0;
 
         return cache;
-#endif
 }
 
 int putpwent_sane(const struct passwd *pw, FILE *stream) {