]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mount-setup: relabel items mentioned directly in relabel-extra.d
authorBenjamin Gilbert <bgilbert@redhat.com>
Wed, 11 Sep 2019 03:23:59 +0000 (23:23 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 16 Sep 2019 07:04:22 +0000 (09:04 +0200)
relabel_extra() relabels the descendants of directories listed in
relabel-extra.d, but doesn't relabel the files or directories
explicitly named there.  This makes it impossible to use
relabel-extra.d to relabel the root of a filesystem.  Fix by
relabeling the named items too.

src/core/mount-setup.c

index ea7b0a80cbd379a081f229351ee04ca5fa544ccb..fc6c5f6bef38c6f862877cc940e490882f879ffa 100644 (file)
@@ -486,6 +486,7 @@ static int relabel_extra(void) {
                         }
 
                         log_debug("Relabelling additional file/directory '%s'.", line);
+                        (void) label_fix(line, 0);
                         (void) nftw(line, nftw_cb, 64, FTW_MOUNT|FTW_PHYS|FTW_ACTIONRETVAL);
                         c++;
                 }