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 <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>
This commit is contained in:
Thomas Weißschuh 2023-05-21 19:58:47 +02:00
parent 01a0a55601
commit 06e05eb0f7
3 changed files with 3 additions and 3 deletions

View 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 */

View file

@ -1 +1 @@
/sbin/mount.mytest called with "/foo /bar -o rw"
/sbin/mount.mytest called with "/foo /bar -o rw,foo"

View file

@ -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