aports/main/util-linux/mount-defaults.patch

56 lines
2.1 KiB
Diff

Patch-Source: https://github.com/util-linux/util-linux/pull/2250
--
From 06e05eb0f78566b68c44328c37d7c28d8655e9df Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= <thomas@t-8ch.de>
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=UTF-8
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 <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 | 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