From: Yu Watanabe Date: Tue, 8 Aug 2023 17:02:23 +0000 (+0900) Subject: remount-fs: refuse to remount based on fstab when fstab=no kernel command line option... X-Git-Tag: v255-rc1~780^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F28728%2Fhead;p=thirdparty%2Fsystemd.git remount-fs: refuse to remount based on fstab when fstab=no kernel command line option specified 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. --- diff --git a/src/remount-fs/remount-fs.c b/src/remount-fs/remount-fs.c index 25e661105b0..2874a0390de 100644 --- a/src/remount-fs/remount-fs.c +++ b/src/remount-fs/remount-fs.c @@ -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)