From: Thomas Weißschuh Date: Sun, 21 May 2023 17:58:47 +0000 (+0200) Subject: libmount: don't pass option "defaults" to helper X-Git-Tag: v2.40-rc1~461 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=06e05eb0f78566b68c44328c37d7c28d8655e9df;p=thirdparty%2Futil-linux.git libmount: don't pass option "defaults" to helper "defaults" is only a pseudo-option that expands to other options. It should not be passed to helpers. Reported-by: Quentin Rameau Closes: https://lore.kernel.org/util-linux/20230521181814.0b0f2d38.quinq@fifth.space/ Signed-off-by: Thomas Weißschuh --- diff --git a/libmount/src/optmap.c b/libmount/src/optmap.c index b15fd7ae07..3a91f30d41 100644 --- a/libmount/src/optmap.c +++ b/libmount/src/optmap.c @@ -147,7 +147,7 @@ static const struct libmnt_optmap linux_flags_map[] = */ static const struct libmnt_optmap userspace_opts_map[] = { - { "defaults", 0, 0 }, /* default options */ + { "defaults", 0, MNT_NOHLPS }, /* default options */ { "auto", MNT_MS_NOAUTO, MNT_NOHLPS | MNT_INVERT | MNT_NOMTAB }, /* Can be mounted using -a */ { "noauto", MNT_MS_NOAUTO, MNT_NOHLPS | MNT_NOMTAB }, /* Can only be mounted explicitly */ diff --git a/tests/expected/mount/special b/tests/expected/mount/special index 99997d354f..820a74a9fc 100644 --- a/tests/expected/mount/special +++ b/tests/expected/mount/special @@ -1 +1 @@ -/sbin/mount.mytest called with "/foo /bar -o rw" +/sbin/mount.mytest called with "/foo /bar -o rw,foo" diff --git a/tests/ts/mount/special b/tests/ts/mount/special index 088a1ac784..87ebbf60f9 100755 --- a/tests/ts/mount/special +++ b/tests/ts/mount/special @@ -35,7 +35,7 @@ echo "$0 called with \"$*\"" EOF chmod +x $MOUNTER -$TS_CMD_MOUNT -t mytest /foo /bar &> $TS_OUTPUT +$TS_CMD_MOUNT -t mytest -o foo,defaults /foo /bar &> $TS_OUTPUT rm -f $MOUNTER ts_finalize