diff options
Diffstat (limited to 'include/linux/capability.h')
| -rw-r--r-- | include/linux/capability.h | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/include/linux/capability.h b/include/linux/capability.h index 16ee8b49a200..4554db0cde86 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
| @@ -355,7 +355,12 @@ struct cpu_vfs_cap_data { | |||
| 355 | 355 | ||
| 356 | #define CAP_SYSLOG 34 | 356 | #define CAP_SYSLOG 34 |
| 357 | 357 | ||
| 358 | #define CAP_LAST_CAP CAP_SYSLOG | 358 | /* Allow triggering something that will wake the system */ |
| 359 | |||
| 360 | #define CAP_WAKE_ALARM 35 | ||
| 361 | |||
| 362 | |||
| 363 | #define CAP_LAST_CAP CAP_WAKE_ALARM | ||
| 359 | 364 | ||
| 360 | #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP) | 365 | #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP) |
| 361 | 366 | ||
| @@ -546,18 +551,7 @@ extern bool has_capability_noaudit(struct task_struct *t, int cap); | |||
| 546 | extern bool capable(int cap); | 551 | extern bool capable(int cap); |
| 547 | extern bool ns_capable(struct user_namespace *ns, int cap); | 552 | extern bool ns_capable(struct user_namespace *ns, int cap); |
| 548 | extern bool task_ns_capable(struct task_struct *t, int cap); | 553 | extern bool task_ns_capable(struct task_struct *t, int cap); |
| 549 | 554 | extern bool nsown_capable(int cap); | |
| 550 | /** | ||
| 551 | * nsown_capable - Check superior capability to one's own user_ns | ||
| 552 | * @cap: The capability in question | ||
| 553 | * | ||
| 554 | * Return true if the current task has the given superior capability | ||
| 555 | * targeted at its own user namespace. | ||
| 556 | */ | ||
| 557 | static inline bool nsown_capable(int cap) | ||
| 558 | { | ||
| 559 | return ns_capable(current_user_ns(), cap); | ||
| 560 | } | ||
| 561 | 555 | ||
| 562 | /* audit system wants to get cap info from files as well */ | 556 | /* audit system wants to get cap info from files as well */ |
| 563 | extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps); | 557 | extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps); |
