]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
userdb: fix enumeration of .membership files
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 26 Jun 2025 00:42:16 +0000 (09:42 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 27 Jun 2025 18:54:48 +0000 (03:54 +0900)
The man page nss-systemd(8) says

> The contents of these files are currently not read, and the files
> should be created empty.

But previously we filtered out such files, as the CONF_FILES_FILTER_MASKED
flag checks if a file is empty (or symlink to null), thus any empty files
were ignored.

To accept empty .membership files, let's use CONF_FILES_FILTER_MASKED_BY_SYMLINK.

Fixes #37945.

src/shared/userdb.c

index 2238073e01f0c8fdad574bce147ffbf533afd33d..49850ff216f92cd008f849d912ff50e51930f37b 100644 (file)
@@ -1669,7 +1669,7 @@ static void discover_membership_dropins(UserDBIterator *i, UserDBFlags flags) {
                         &i->dropins,
                         ".membership",
                         NULL,
-                        CONF_FILES_REGULAR|CONF_FILES_BASENAME|CONF_FILES_FILTER_MASKED,
+                        CONF_FILES_REGULAR|CONF_FILES_BASENAME|CONF_FILES_FILTER_MASKED_BY_SYMLINK,
                         USERDB_DROPIN_DIR_NULSTR("userdb"));
         if (r < 0)
                 log_debug_errno(r, "Failed to find membership drop-ins, ignoring: %m");