summaryrefslogtreecommitdiffstats
path: root/sys-utils/umount.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys-utils/umount.c')
-rw-r--r--sys-utils/umount.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys-utils/umount.c b/sys-utils/umount.c
index b8e4b7fe6..47db5b480 100644
--- a/sys-utils/umount.c
+++ b/sys-utils/umount.c
@@ -198,6 +198,12 @@ static int mk_exit_code(struct libmnt_context *cxt, int rc)
/*
* libmount errors (extra library checks)
*/
+ if (rc == -EPERM && !mnt_context_tab_applied(cxt)) {
+ /* failed to evaluate permissions because not found
+ * relevant entry in mtab */
+ warnx(_("%s: not mounted"), tgt);
+ return MOUNT_EX_USAGE;
+ }
return handle_generic_errors(rc, _("%s: umount failed"), tgt);
} else if (mnt_context_get_syscall_errno(cxt) == 0) {