]> 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)
committerKarel Zak <kzak@redhat.com>
Mon, 8 Dec 2025 13:27:08 +0000 (14:27 +0100)
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>
(cherry picked from commit 24478afdf0a1941e9b7049ef263677f666e73c80)

libmount/src/context_mount.c
sys-utils/umount.c

index ee3eadb055e795520979f6edb2c05426de52978d..28e01309d8c3fd79806a5dfedb94acdee5ccca2c 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 d8ab3f7ca1d3e446d6b6b691c598b589ce60a974..ff7717038c9a8ba8f9d8a2ce4c5a5a9a5884a46d 100644 (file)
@@ -139,7 +139,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;