Commit 36a04267 authored by Chris Wright's avatar Chris Wright Committed by Linus Torvalds

[PATCH] sys_capget should use current if the pid argument is 0

parent 78d78c9d
...@@ -54,11 +54,14 @@ asmlinkage long sys_capget(cap_user_header_t header, cap_user_data_t dataptr) ...@@ -54,11 +54,14 @@ asmlinkage long sys_capget(cap_user_header_t header, cap_user_data_t dataptr)
spin_lock(&task_capability_lock); spin_lock(&task_capability_lock);
read_lock(&tasklist_lock); read_lock(&tasklist_lock);
if (pid && pid != current->pid) {
target = find_task_by_pid(pid); target = find_task_by_pid(pid);
if (!target) { if (!target) {
ret = -ESRCH; ret = -ESRCH;
goto out; goto out;
} }
} else
target = current;
data.permitted = cap_t(target->cap_permitted); data.permitted = cap_t(target->cap_permitted);
data.inheritable = cap_t(target->cap_inheritable); data.inheritable = cap_t(target->cap_inheritable);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment