lkml.org 
[lkml]   [2002]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] LSM changes for 2.5.52
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/
\
 
 \ /
  Last update: 2005-03-22 13:31    [W:0.048 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site