From d5edb1003bf3f06c907ac5e3f342cef3e41bccf9 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 24 Feb 2020 13:02:09 +0100 Subject: [PATCH] umount: don't try it as non-suid if not found mountinfo entry Addresses: https://github.com/karelzak/util-linux/issues/961 Signed-off-by: Karel Zak --- sys-utils/umount.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys-utils/umount.c b/sys-utils/umount.c index 74d87d671b..056ffb895a 100644 --- a/sys-utils/umount.c +++ b/sys-utils/umount.c @@ -223,8 +223,10 @@ static int umount_one(struct libmnt_context *cxt, const char *spec) if (rc == -EPERM && mnt_context_is_restricted(cxt) + && mnt_context_tab_applied(cxt) && !mnt_context_syscall_called(cxt)) { - /* Failed somewhere in libmount, drop perms and try it again */ + /* Mountpoint exists, but failed something else in libmount, + * drop perms and try it again */ suid_drop(cxt); rc = mnt_context_umount(cxt); } -- 2.47.3