diff options
Diffstat (limited to 'include/linux/capability.h')
| -rw-r--r-- | include/linux/capability.h | 29 |
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 | ||
| 208 | extern bool has_capability(struct task_struct *t, int cap); | 209 | extern bool has_capability(struct task_struct *t, int cap); |
| 209 | extern bool has_ns_capability(struct task_struct *t, | 210 | extern 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); |
| 214 | extern bool capable(int cap); | 215 | extern bool capable(int cap); |
| 215 | extern bool ns_capable(struct user_namespace *ns, int cap); | 216 | extern bool ns_capable(struct user_namespace *ns, int cap); |
| 217 | #else | ||
| 218 | static inline bool has_capability(struct task_struct *t, int cap) | ||
| 219 | { | ||
| 220 | return true; | ||
| 221 | } | ||
| 222 | static inline bool has_ns_capability(struct task_struct *t, | ||
| 223 | struct user_namespace *ns, int cap) | ||
| 224 | { | ||
| 225 | return true; | ||
| 226 | } | ||
| 227 | static inline bool has_capability_noaudit(struct task_struct *t, int cap) | ||
| 228 | { | ||
| 229 | return true; | ||
| 230 | } | ||
| 231 | static inline bool has_ns_capability_noaudit(struct task_struct *t, | ||
| 232 | struct user_namespace *ns, int cap) | ||
| 233 | { | ||
| 234 | return true; | ||
| 235 | } | ||
| 236 | static inline bool capable(int cap) | ||
| 237 | { | ||
| 238 | return true; | ||
| 239 | } | ||
| 240 | static inline bool ns_capable(struct user_namespace *ns, int cap) | ||
| 241 | { | ||
| 242 | return true; | ||
| 243 | } | ||
| 244 | #endif /* CONFIG_MULTIUSER */ | ||
| 216 | extern bool capable_wrt_inode_uidgid(const struct inode *inode, int cap); | 245 | extern bool capable_wrt_inode_uidgid(const struct inode *inode, int cap); |
| 217 | extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap); | 246 | extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap); |
| 218 | 247 | ||
