diff options
author | Chris Wright <chrisw@sous-sol.org> | 2006-03-25 06:07:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-25 11:22:56 -0500 |
commit | 12b5989be10011387a9da5dee82e5c0d6f9d02e7 (patch) | |
tree | 74da71d407bf26bf97c639bb2b473de233a736ac /kernel/sys.c | |
parent | 77d47582c2345e071df02afaf9191641009287c4 (diff) |
[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>
Diffstat (limited to 'kernel/sys.c')
-rw-r--r-- | kernel/sys.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index 19d058be49d4..421009cedb51 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
@@ -224,18 +224,6 @@ int unregister_reboot_notifier(struct notifier_block * nb) | |||
224 | 224 | ||
225 | EXPORT_SYMBOL(unregister_reboot_notifier); | 225 | EXPORT_SYMBOL(unregister_reboot_notifier); |
226 | 226 | ||
227 | #ifndef CONFIG_SECURITY | ||
228 | int capable(int cap) | ||
229 | { | ||
230 | if (cap_raised(current->cap_effective, cap)) { | ||
231 | current->flags |= PF_SUPERPRIV; | ||
232 | return 1; | ||
233 | } | ||
234 | return 0; | ||
235 | } | ||
236 | EXPORT_SYMBOL(capable); | ||
237 | #endif | ||
238 | |||
239 | static int set_one_prio(struct task_struct *p, int niceval, int error) | 227 | static int set_one_prio(struct task_struct *p, int niceval, int error) |
240 | { | 228 | { |
241 | int no_nice; | 229 | int no_nice; |