mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org, linux-security-module@wirex.com
Subject: [PATCH] LSM changes for 2.5.52
Date: Wed, 18 Dec 2002 15:27:15 -0800	[thread overview]
Message-ID: <20021218232714.GC1782@kroah.com> (raw)
In-Reply-To: <20021218232125.GB1782@kroah.com>

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);
+	}
 }
 
 /*

  reply	other threads:[~2002-12-18 23:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-18 23:19 [BK PATCH] " Greg KH
2002-12-18 23:21 ` Greg KH
2002-12-18 23:27   ` Greg KH [this message]
2002-12-18 23:28     ` [PATCH] " Greg KH
2002-12-18 23:29       ` 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=20021218232714.GC1782@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@wirex.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome