ChangeSet 1.899, 2002/12/18 14:58:27-08:00, wli@holomorphy.com
[PATCH] converting cap_set_pg() to for_each_task_pid()
cap_set_pg() wants to find all processes in a given process group. This
converts it to use for_each_task_pid().
diff -Nru a/kernel/capability.c b/kernel/capability.c
--- a/kernel/capability.c Wed Dec 18 15:13:37 2002
+++ b/kernel/capability.c Wed Dec 18 15:13:37 2002
@@ -84,13 +84,15 @@
kernel_cap_t *inheritable,
kernel_cap_t *permitted)
{
- task_t *g, *target;
+ task_t *g, *target;
+ struct list_head *l;
+ struct pid *pid;
- do_each_thread(g, target) {
- if (target->pgrp != pgrp)
- continue;
- security_capset_set(target, effective, inheritable, permitted);
- } while_each_thread(g, target);
+ for_each_task_pid(pgrp, PIDTYPE_PGID, g, l, pid) {
+ target = g;
+ while_each_thread(g, target)
+ security_capset_set(target, effective, inheritable, permitted);
+ }
}
/*
-
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/
This archive was generated by hypermail 2b29 : Mon Dec 23 2002 - 22:00:21 EST