]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: don't pass option "defaults" to helper
authorThomas Weißschuh <thomas@t-8ch.de>
Sun, 21 May 2023 17:58:47 +0000 (19:58 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Sun, 21 May 2023 18:02:21 +0000 (20:02 +0200)
"defaults" is only a pseudo-option that expands to other options.
It should not be passed to helpers.

Reported-by: Quentin Rameau <quinq@fifth.space>
Closes: https://lore.kernel.org/util-linux/20230521181814.0b0f2d38.quinq@fifth.space/
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
libmount/src/optmap.c
tests/expected/mount/special
tests/ts/mount/special

index b15fd7ae07cdf22a6b32a9b60831b8174bf27a99..3a91f30d4177a1ee7e450c7f79def531c80b787c 100644 (file)
@@ -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 */
index 99997d354fb56e3fd1fd3e80bc656602ad90d59a..820a74a9fc53f22918d654a9851cf4e6ce8c224a 100644 (file)
@@ -1 +1 @@
-/sbin/mount.mytest called with "/foo /bar -o rw"
+/sbin/mount.mytest called with "/foo /bar -o rw,foo"
index 088a1ac78400d57f047e7636fa81112fe4f36072..87ebbf60f9d6f547835d460a2028ac86ae7bbb0f 100755 (executable)
@@ -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