]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
umount: consider helper return status for success message
authorChristian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Sun, 12 Oct 2025 03:09:27 +0000 (23:09 -0400)
committerChristian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Mon, 13 Oct 2025 15:52:14 +0000 (11:52 -0400)
If a helper function was executed to unmount, we simply return
without any user feedback. That can unintentionally surpress
verbose messages (`--verbose`) for non-root users who use udisks2
to mount filesystems, and unmount via the unmount.udisks2 helper.

It would be better to check the helper return status as well for
completeness and a more reliable way to test the success of the
unmount operation.

mnt_context_get_helper_status() is only called if the helper was
executed, i.e. mnt_context_helper_executed == 1, anything else
wouldnt make sense anyways.

Addresses: #3790
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
libmount/src/context_mount.c
sys-utils/umount.c

index 04734b73cd7e3700aaa3257b8955c82bf0e48a3d..c6d854f7a639b702d7cc99898a6e2c791f1c804e 100644 (file)
@@ -198,7 +198,7 @@ static int evaluate_permissions(struct libmnt_context *cxt)
                /*
                 * superuser mount
                 *
-                * Let's convert user, users, owenr and groups to MS_* flags
+                * Let's convert user, users, owner and groups to MS_* flags
                 * to be compatible with non-root execution.
                 *
                 * The old deprecated way is to use mnt_optstr_get_flags().
index 18824e09f235d81a50537211e127fc0186557a09..db2a4bee2f714d234d4bbee6959e6e82ec9e8bfe 100644 (file)
@@ -138,7 +138,8 @@ static void success_message(struct libmnt_context *cxt)
 {
        const char *tgt, *src;
 
-       if (mnt_context_helper_executed(cxt)
+       if ((mnt_context_helper_executed(cxt)
+           && mnt_context_get_helper_status(cxt))
            || mnt_context_get_status(cxt) != 1)
                return;