aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/capability.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/capability.h')
-rw-r--r--include/linux/capability.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/linux/capability.h b/include/linux/capability.h
index aa93e5ef594c..af9f0b9e80e6 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -205,6 +205,7 @@ static inline kernel_cap_t cap_raise_nfsd_set(const kernel_cap_t a,
205 cap_intersect(permitted, __cap_nfsd_set)); 205 cap_intersect(permitted, __cap_nfsd_set));
206} 206}
207 207
208#ifdef CONFIG_MULTIUSER
208extern bool has_capability(struct task_struct *t, int cap); 209extern bool has_capability(struct task_struct *t, int cap);
209extern bool has_ns_capability(struct task_struct *t, 210extern bool has_ns_capability(struct task_struct *t,
210 struct user_namespace *ns, int cap); 211 struct user_namespace *ns, int cap);
@@ -213,6 +214,34 @@ extern bool has_ns_capability_noaudit(struct task_struct *t,
213 struct user_namespace *ns, int cap); 214 struct user_namespace *ns, int cap);
214extern bool capable(int cap); 215extern bool capable(int cap);
215extern bool ns_capable(struct user_namespace *ns, int cap); 216extern bool ns_capable(struct user_namespace *ns, int cap);
217#else
218static inline bool has_capability(struct task_struct *t, int cap)
219{
220 return true;
221}
222static inline bool has_ns_capability(struct task_struct *t,
223 struct user_namespace *ns, int cap)
224{
225 return true;
226}
227static inline bool has_capability_noaudit(struct task_struct *t, int cap)
228{
229 return true;
230}
231static inline bool has_ns_capability_noaudit(struct task_struct *t,
232 struct user_namespace *ns, int cap)
233{
234 return true;
235}
236static inline bool capable(int cap)
237{
238 return true;
239}
240static inline bool ns_capable(struct user_namespace *ns, int cap)
241{
242 return true;
243}
244#endif /* CONFIG_MULTIUSER */
216extern bool capable_wrt_inode_uidgid(const struct inode *inode, int cap); 245extern bool capable_wrt_inode_uidgid(const struct inode *inode, int cap);
217extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap); 246extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap);
218 247