From 9422991c921471ccc66b28599a4c42d608c9af2c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Sun, 21 May 2023 19:58:47 +0200 Subject: [PATCH] libmount: don't pass option "defaults" to helper MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit "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 --- libmount/src/optmap.c | 2 +- tests/expected/mount/special | 2 +- tests/ts/mount/special | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 -- 2.47.3