From 916a3f8d298a05678016d81548029270b27ee5f3 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 18 Nov 2019 16:19:15 +0100 Subject: [PATCH] libmount: don't access struct member, use API Signed-off-by: Karel Zak --- libmount/src/context_mount.c | 2 +- libmount/src/context_umount.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c index aae21d4903..7ee747e603 100644 --- a/libmount/src/context_mount.c +++ b/libmount/src/context_mount.c @@ -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; diff --git a/libmount/src/context_umount.c b/libmount/src/context_umount.c index 999cdb0166..db6c432d06 100644 --- a/libmount/src/context_umount.c +++ b/libmount/src/context_umount.c @@ -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 -- 2.47.2