From owner-freebsd-current Thu Feb 28 7:14:49 2002 Delivered-To: freebsd-current@freebsd.org Received: from rina.r.dl.itc.u-tokyo.ac.jp (rina.r.dl.itc.u-tokyo.ac.jp [133.11.199.247]) by hub.freebsd.org (Postfix) with ESMTP id 078E337B4B1 for ; Thu, 28 Feb 2002 07:14:04 -0800 (PST) Received: from sohgo.carrots.uucp.r.dl.itc.u-tokyo.ac.jp (sohgo.carrots.uucp.r.dl.itc.u-tokyo.ac.jp [IPv6:3ffe:b80:5b0:3:200:e8ff:fe14:9f8a]) by rina.r.dl.itc.u-tokyo.ac.jp (8.12.2/3.7W-rina.r-Nankai-Koya) with ESMTP id g1SFDh0j004576 ; Fri, 1 Mar 2002 00:13:44 +0900 (JST) Received: from sohgo.carrots.uucp.r.dl.itc.u-tokyo.ac.jp (localhost [IPv6:::1]) by sohgo.carrots.uucp.r.dl.itc.u-tokyo.ac.jp (8.12.2/3.7W-carrots-Tokyu-Meguro) with ESMTP id g1SFDYnG003879 ; Fri, 1 Mar 2002 00:13:35 +0900 (JST) Received: (from root@localhost) by sohgo.carrots.uucp.r.dl.itc.u-tokyo.ac.jp (8.12.2/3.7W-submit-carrots-Tokyu-Meguro) with UUCP id g1SFDVX1003877 ; Fri, 1 Mar 2002 00:13:32 +0900 (JST) Received: from bunko.r.dl.itc.u-tokyo.ac.jp (localhost [127.0.0.1]) by bunko (8.12.2/3.7W-nkth.carrots-Saitama-Misono) with ESMTP id g1SEH0Gd031607 ; Thu, 28 Feb 2002 23:17:00 +0900 (JST) Message-Id: <200202281417.g1SEH0Gd031607@bunko> Date: Thu, 28 Feb 2002 23:17:00 +0900 From: Seigo Tanimura To: Bruce Evans Cc: Seigo Tanimura , Takanori Saneto , Subject: Re: setpgrp(1, 1) does not FAIL In-Reply-To: <20020228220337.V52334-100000@gamplex.bde.org> References: <200202271703.g1RH2xwo042796@silver.carrots.uucp.r.dl.itc.u-tokyo.ac.jp> <20020228220337.V52334-100000@gamplex.bde.org> User-Agent: Wanderlust/2.8.1 (Something) SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (=?ISO-8859-1?Q?Unebigory=F2mae?=) APEL/10.3 MULE XEmacs/21.1 (patch 14) (Cuyahoga Valley) (i386--freebsd) Organization: Digital Library Research Division, Information Techinology Centre, The University of Tokyo MIME-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, 28 Feb 2002 22:14:56 +1100 (EST), Bruce Evans said: Takanori> Can you look into PR kern/29844 as well? Takanori> I think after your fix, it should fail even when invoked by super Takanori> user. >> >> The superuser fails as well. bde> setpgrp() is the same as setpgid() in FreeBSD, and the POSIX.1-200x-draft7 bde> documentation for setpgid() doesn't seem to have any special cases for bde> the superuser, so I think the documentation change in the PR is correct. While we are here, it would be even better to clarify the requirements of setpgid(2) like this: The affected process must: o be a descendant of the invoking process, and o belong to the same session as the invoking process does. Takanori's test fails even by the superuser because pid 1 belongs to a different session from curproc's one. bde> POSIX now has setpgrp(), but it is quite different from setpgid() :-(. Not sure if this is what you mean, but setpgrp(2) of Solaris is somewhat like setpgid(0, 0). Spaking of Solaris, the required condition of setpgid(2) in Solaris is a little bit more strict than that in FreeBSD. Solaris prohibits the grandchildren of the curproc to be the target of setpgid(2), while FreeBSD allows that. -- Seigo Tanimura To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message