mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 14:41:27 +00:00
[PATCH] refactor capable() to one implementation, add __capable() helper
Move capable() to kernel/capability.c and eliminate duplicate implementations. Add __capable() function which can be used to check for capabiilty of any process. Signed-off-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
77d47582c2
commit
12b5989be1
5 changed files with 34 additions and 42 deletions
12
kernel/sys.c
12
kernel/sys.c
|
@ -224,18 +224,6 @@ int unregister_reboot_notifier(struct notifier_block * nb)
|
|||
|
||||
EXPORT_SYMBOL(unregister_reboot_notifier);
|
||||
|
||||
#ifndef CONFIG_SECURITY
|
||||
int capable(int cap)
|
||||
{
|
||||
if (cap_raised(current->cap_effective, cap)) {
|
||||
current->flags |= PF_SUPERPRIV;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(capable);
|
||||
#endif
|
||||
|
||||
static int set_one_prio(struct task_struct *p, int niceval, int error)
|
||||
{
|
||||
int no_nice;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue