]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: don't access struct member, use API
authorKarel Zak <kzak@redhat.com>
Mon, 18 Nov 2019 15:19:15 +0000 (16:19 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 18 Nov 2019 15:19:15 +0000 (16:19 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context_mount.c
libmount/src/context_umount.c

index aae21d49037baf7e917875b4e5c1cd17c5857806..7ee747e603c0005b10d60ecbe675c55364863976 100644 (file)
@@ -354,7 +354,7 @@ static int fix_optstr(struct libmnt_context *cxt)
        }
 
 
-       if (!rc && cxt->restricted && (cxt->user_mountflags & MNT_MS_USER)) {
+       if (!rc && mnt_context_is_restricted(cxt) && (cxt->user_mountflags & MNT_MS_USER)) {
                ns_old = mnt_context_switch_origin_ns(cxt);
                if (!ns_old)
                        return -MNT_ERR_NAMESPACE;
index 999cdb0166419051683ad5c64ba2b411c70a4416..db6c432d067b3d808fbb7fa3c9ab9627e8d2aa6c 100644 (file)
@@ -789,7 +789,7 @@ static int do_umount(struct libmnt_context *cxt)
 
        DBG(CXT, ul_debugobj(cxt, "do umount"));
 
-       if (cxt->restricted && !mnt_context_is_fake(cxt)) {
+       if (mnt_context_is_restricted(cxt) && !mnt_context_is_fake(cxt)) {
                /*
                 * extra paranoia for non-root users
                 * -- chdir to the parent of the mountpoint and use NOFOLLOW