From: Christian Goeschel Ndjomouo Date: Sun, 12 Oct 2025 03:09:27 +0000 (-0400) Subject: umount: consider helper return status for success message X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=24478afdf0a1941e9b7049ef263677f666e73c80;p=thirdparty%2Futil-linux.git umount: consider helper return status for success message 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 --- diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c index 04734b73c..c6d854f7a 100644 --- a/libmount/src/context_mount.c +++ b/libmount/src/context_mount.c @@ -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(). diff --git a/sys-utils/umount.c b/sys-utils/umount.c index 18824e09f..db2a4bee2 100644 --- a/sys-utils/umount.c +++ b/sys-utils/umount.c @@ -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;