From: Karel Zak Date: Mon, 24 Feb 2020 12:02:09 +0000 (+0100) Subject: umount: don't try it as non-suid if not found mountinfo entry X-Git-Tag: v2.35.2~46 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=57d5160227fc4792c33bb9fef605939f893678ad;p=thirdparty%2Futil-linux.git 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 --- 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); }