Thanks Daniel. I've been using the patch below, which differs only
slightly from the one you posted (code style matches the same lookup in
sys_capset). I'll follow up with the patch that removes the duplicate
code.
[PATCH] sys_capget should use current if the pid argument is 0
===== kernel/capability.c 1.5 vs edited =====
--- 1.5/kernel/capability.c Sun Sep 15 12:19:29 2002
+++ edited/kernel/capability.c Tue Nov 19 15:57:15 2002
@@ -54,11 +54,14 @@
spin_lock(&task_capability_lock);
read_lock(&tasklist_lock);
- target = find_task_by_pid(pid);
- if (!target) {
- ret = -ESRCH;
- goto out;
- }
+ if (pid && pid != current->pid) {
+ target = find_task_by_pid(pid);
+ if (!target) {
+ ret = -ESRCH;
+ goto out;
+ }
+ } else
+ target = current;
data.permitted = cap_t(target->cap_permitted);
data.inheritable = cap_t(target->cap_inheritable);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/