]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
umount: don't try it as non-suid if not found mountinfo entry
authorKarel Zak <kzak@redhat.com>
Mon, 24 Feb 2020 12:02:09 +0000 (13:02 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 15 May 2020 09:47:28 +0000 (11:47 +0200)
Addresses: https://github.com/karelzak/util-linux/issues/961
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/umount.c

index 74d87d671b726a37d9fd2e15739b17c3e4d90809..056ffb895a4a04fe7d5abb42f936278d739652f9 100644 (file)
@@ -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);
        }