Signed-off-by: Karel Zak <kzak@redhat.com>
return rc;
}
-
/**
* mnt_context_init_helper
* @cxt: mount context
return rc;
}
+/*
+ * libmount used in /sbin/[u]mount.<type> helper
+ */
+int mnt_context_within_helper(struct libmnt_context *cxt)
+{
+ return cxt && (cxt->flags & MNT_FL_HELPER);
+}
+
/**
* mnt_context_helper_setopt:
* @cxt: context
*/
if (mnt_context_is_restricted(cxt)
|| *tgt != '/'
- || (cxt->flags & MNT_FL_HELPER)
+ || mnt_context_within_helper(cxt)
|| mnt_context_is_force(cxt)
|| mnt_context_is_lazy(cxt)
|| mnt_context_is_nocanonicalize(cxt)
extern int mnt_context_utab_writable(struct libmnt_context *cxt);
extern const char *mnt_context_get_writable_tabpath(struct libmnt_context *cxt);
+extern int mnt_context_within_helper(struct libmnt_context *cxt);
+
extern int mnt_context_get_mountinfo(struct libmnt_context *cxt, struct libmnt_table **tb);
extern int mnt_context_get_mountinfo_for_target(struct libmnt_context *cxt,
struct libmnt_table **mountinfo, const char *tgt);