All of lore.kernel.org
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: chris@wirex.com
Cc: greg@kroah.com, linux-kernel@vger.kernel.org
Subject: converting cap_set_pg() to for_each_task_pid()
Date: Tue, 17 Dec 2002 21:57:42 -0800	[thread overview]
Message-ID: <20021218055742.GE12812@holomorphy.com> (raw)

I have a pending patch that converts cap_set_pg() to the
for_each_task_pid() API. Could you review this, and if it
pass, include it in your tree?


Thanks,
Bill


cap_set_pg() wants to find all processes in a given process group. This
converts it to use for_each_task_pid().

 capability.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)


diff -urpN wli-2.5.51-bk1-4/kernel/capability.c wli-2.5.51-bk1-5/kernel/capability.c
--- wli-2.5.51-bk1-4/kernel/capability.c	2002-12-09 18:45:43.000000000 -0800
+++ wli-2.5.51-bk1-5/kernel/capability.c	2002-12-11 18:32:44.000000000 -0800
@@ -84,13 +84,15 @@ static inline void cap_set_pg(int pgrp, 
 			      kernel_cap_t *inheritable,
 			      kernel_cap_t *permitted)
 {
-     task_t *g, *target;
-
-     do_each_thread(g, target) {
-             if (target->pgrp != pgrp)
-                     continue;
-	     security_capset_set(target, effective, inheritable, permitted);
-     } while_each_thread(g, target);
+	task_t *g, *target;
+	struct list_head *l;
+	struct pid *pid;
+
+	for_each_task_pid(pgrp, PIDTYPE_PGID, g, l, pid) {
+		target = g;
+		while_each_thread(g, target)
+			security_capset_set(target, effective, inheritable, permitted);
+	}
 }
 
 /*

             reply	other threads:[~2002-12-18  5:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-18  5:57 William Lee Irwin III [this message]
2002-12-18  6:05 ` converting cap_set_pg() to for_each_task_pid() Greg KH
2002-12-18  6:17   ` William Lee Irwin III
2002-12-18 18:04 ` Chris Wright
2002-12-18 23:08 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021218055742.GE12812@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=chris@wirex.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.