]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
remount-fs: refuse to remount based on fstab when fstab=no kernel command line option... 28728/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 8 Aug 2023 17:02:23 +0000 (02:02 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 9 Aug 2023 08:59:41 +0000 (17:59 +0900)
Otherwise, if for some reasons remount-fs is invoked even when fstab=no is
specified, mounts may get unexpected options from fstab.

For safety, let's parse the kernel command line option.

src/remount-fs/remount-fs.c

index 25e661105b06b429f889c172b1eaeec22f2ab756..2874a0390de2d0cd0f44efdf1af221816e570437 100644 (file)
@@ -78,6 +78,9 @@ static int remount_by_fstab(Hashmap **ret_pids) {
 
         assert(ret_pids);
 
+        if (!fstab_enabled())
+                return 0;
+
         f = setmntent(fstab_path(), "re");
         if (!f) {
                 if (errno != ENOENT)