|
@@ -371,8 +371,6 @@ struct cpu_vfs_cap_data {
|
|
struct dentry;
|
|
struct dentry;
|
|
struct user_namespace;
|
|
struct user_namespace;
|
|
|
|
|
|
-extern struct user_namespace init_user_ns;
|
|
|
|
-
|
|
|
|
struct user_namespace *current_user_ns(void);
|
|
struct user_namespace *current_user_ns(void);
|
|
|
|
|
|
extern const kernel_cap_t __cap_empty_set;
|
|
extern const kernel_cap_t __cap_empty_set;
|
|
@@ -541,34 +539,10 @@ static inline kernel_cap_t cap_raise_nfsd_set(const kernel_cap_t a,
|
|
cap_intersect(permitted, __cap_nfsd_set));
|
|
cap_intersect(permitted, __cap_nfsd_set));
|
|
}
|
|
}
|
|
|
|
|
|
-/**
|
|
|
|
- * has_capability - Determine if a task has a superior capability available
|
|
|
|
- * @t: The task in question
|
|
|
|
- * @cap: The capability to be tested for
|
|
|
|
- *
|
|
|
|
- * Return true if the specified task has the given superior capability
|
|
|
|
- * currently in effect, false if not.
|
|
|
|
- *
|
|
|
|
- * Note that this does not set PF_SUPERPRIV on the task.
|
|
|
|
- */
|
|
|
|
-#define has_capability(t, cap) (security_real_capable((t), &init_user_ns, (cap)) == 0)
|
|
|
|
-
|
|
|
|
-#define has_ns_capability(t, ns, cap) (security_real_capable((t), (ns), (cap)) == 0)
|
|
|
|
-
|
|
|
|
-/**
|
|
|
|
- * has_capability_noaudit - Determine if a task has a superior capability available (unaudited)
|
|
|
|
- * @t: The task in question
|
|
|
|
- * @cap: The capability to be tested for
|
|
|
|
- *
|
|
|
|
- * Return true if the specified task has the given superior capability
|
|
|
|
- * currently in effect, false if not, but don't write an audit message for the
|
|
|
|
- * check.
|
|
|
|
- *
|
|
|
|
- * Note that this does not set PF_SUPERPRIV on the task.
|
|
|
|
- */
|
|
|
|
-#define has_capability_noaudit(t, cap) \
|
|
|
|
- (security_real_capable_noaudit((t), &init_user_ns, (cap)) == 0)
|
|
|
|
-
|
|
|
|
|
|
+extern bool has_capability(struct task_struct *t, int cap);
|
|
|
|
+extern bool has_ns_capability(struct task_struct *t,
|
|
|
|
+ struct user_namespace *ns, int cap);
|
|
|
|
+extern bool has_capability_noaudit(struct task_struct *t, int cap);
|
|
extern bool capable(int cap);
|
|
extern bool capable(int cap);
|
|
extern bool ns_capable(struct user_namespace *ns, int cap);
|
|
extern bool ns_capable(struct user_namespace *ns, int cap);
|
|
extern bool task_ns_capable(struct task_struct *t, int cap);
|
|
extern bool task_ns_capable(struct task_struct *t, int cap);
|