]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
locale-util: on overlayfs FTW_MOUNT causes nftw(3) to not list *any* files
authorFranck Bui <fbui@suse.com>
Wed, 13 Jun 2018 16:15:55 +0000 (18:15 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 14 Jun 2018 08:19:33 +0000 (10:19 +0200)
On overlayfs, FTW_MOUNT causes nftw to not list *any* files because the
condition used by glibc to verify that it's on the same mountpoint doesn't work
on overlayfs, see https://bugzilla.suse.com/show_bug.cgi?id=1096807 for the
details.

However using FTW_MOUNT doesn't seem to be really needed when walking through
the keymap directorie tree. So until the glibc or the kernel is fixed (which
might take some time), let's make localectl works with overlayfs.

There's a small side effect here, by which regular (non-directory) files with
bind mounts will be parsed while they were skipped by the previous logic.

src/basic/locale-util.c

index 8b6bc51bda8822cfa351108baea9739042ac93fc..b382af192d0ef41fa5704af2c6beb46f8aa59115 100644 (file)
@@ -306,7 +306,7 @@ int get_keymaps(char ***ret) {
                 return -ENOMEM;
 
         NULSTR_FOREACH(dir, KBD_KEYMAP_DIRS) {
-                r = nftw(dir, nftw_cb, 20, FTW_MOUNT|FTW_PHYS|FTW_ACTIONRETVAL);
+                r = nftw(dir, nftw_cb, 20, FTW_PHYS|FTW_ACTIONRETVAL);
 
                 if (r == FTW_STOP)
                         log_debug("Directory not found %s", dir);