NetBSD Problem Report #11223
Received: (qmail 10382 invoked from network); 14 Oct 2000 16:35:39 -0000
Message-Id: <Pine.SOL.4.21.0010141731310.3055-100000@draco.cus.cam.ac.uk>
Date: Sat, 14 Oct 2000 17:35:35 +0100 (BST)
From: Ben Harris <bjh21@netbsd.org>
Sender: Ben Harris <bjh21@cus.cam.ac.uk>
To: gnats-bugs@gnats.netbsd.org
Subject: POSIX.2: ps -G <grouplist> not supported
>Number: 11223
>Category: standards
>Synopsis: POSIX.2: ps -G <grouplist> not supported
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: jperkin
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Oct 14 16:36:00 +0000 2000
>Closed-Date: Fri Jun 04 08:04:27 +0000 2021
>Last-Modified: Fri Jun 04 18:10:00 +0000 2021
>Originator: Ben Harris
>Release: 2000-02-07
>Organization:
>Environment:
NetBSD cromarty 1.4X NetBSD 1.4X (CROMARTY) #9: Wed May 3 23:49:51 BST 2000
bjh21@cromarty:/usr/src/sys/arch/macppc/compile/CROMARTY macppc
>Description:
According to POSIX.2, ps should take a -G <grouplist> argument to allow
selection of processes by real group ID. NetBSD's doesn't.
>How-To-Repeat:
cromarty:~$ ps -G bjh21
ps: illegal option -- G
usage: ps [-aChjKlmrSTuvwx] [-O|o fmt] [-p pid] [-t tty]
[-M core] [-N system] [-W swap] [-U username]
ps [-L]
>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: standards-manager->simonb
Responsible-Changed-By: simonb
Responsible-Changed-When: Sat Oct 14 18:18:35 PDT 2000
Responsible-Changed-Why:
I'll take care of this one.
From: Jonathan Perkin <sketch@rd.bbc.co.uk>
To: gnats-bugs@gnats.netbsd.org
Cc: simonb@netbsd.org, bjh21@netbsd.org
Subject: Re: standards/11223: POSIX.2: ps -G <grouplist> not supported
Date: Thu, 13 Mar 2003 19:31:53 +0000
This patch adds support for a single group argument (as per -U allowing
single user argument). Supporting proper POSIX.2 user/group lists can
be done if you wish.
Also at http://www.perkin.org.uk/projects/netbsd/ps.patch
Index: ps.1
===================================================================
RCS file: /cvsroot/src/bin/ps/ps.1,v
retrieving revision 1.60
diff -u -r1.60 ps.1
--- ps.1 2003/03/06 09:04:21 1.60
+++ ps.1 2003/03/13 19:22:46
@@ -67,6 +67,9 @@
.Op Fl U Ar username
.Ek
.Bk -words
+.Op Fl G Ar groupname
+.Ek
+.Bk -words
.Op Fl W Ar swap
.Ek
.Nm
@@ -195,6 +198,11 @@
Displays processes belonging to the user whose username or uid has
been given to the
.Fl U
+switch.
+.It Fl G
+Displays processes belonging to the users whose groupname or gid has
+been given to the
+.Fl G
switch.
.It Fl u
Display information associated with the following keywords:
Index: ps.c
===================================================================
RCS file: /cvsroot/src/bin/ps/ps.c,v
retrieving revision 1.49
diff -u -r1.49 ps.c
--- ps.c 2003/03/06 09:02:16 1.49
+++ ps.c 2003/03/13 19:22:46
@@ -98,6 +98,7 @@
#include <err.h>
#include <errno.h>
#include <fcntl.h>
+#include <grp.h>
#include <kvm.h>
#include <limits.h>
#include <nlist.h>
@@ -114,8 +115,8 @@
* ARGOPTS must contain all option characters that take arguments
* (except for 't'!) - it is used in kludge_oldps_options()
*/
-#define GETOPTSTR "acCeghjk:LlM:mN:O:o:p:rSsTt:U:uvW:wx"
-#define ARGOPTS "kMNOopUW"
+#define GETOPTSTR "acCegG:hjk:LlM:mN:O:o:p:rSsTt:U:uvW:wx"
+#define ARGOPTS "GkMNOopUW"
struct kinfo_proc2 *kinfo;
struct varent *vhead, *sorthead;
@@ -197,6 +198,25 @@
break;
case 'g':
break; /* no-op */
+ case 'G':
+ if (*optarg != '\0') {
+ struct group *gr;
+ char *ep;
+
+ what = KERN_PROC_GID;
+ gr = getgrnam(optarg);
+ if (gr == NULL) {
+ errno = 0;
+ flag = strtoul(optarg, &ep, 10);
+ if (errno)
+ err(1, "%s", optarg);
+ if (*ep != '\0')
+ errx(1, "%s: illegal group",
+ optarg);
+ } else
+ flag = gr->gr_gid;
+ }
+ break;
case 'h':
prtheader = ws.ws_row > 5 ? ws.ws_row : 22;
break;
@@ -736,7 +756,7 @@
(void)fprintf(stderr,
"usage:\t%s\n\t %s\n\t%s\n",
"ps [-acCehjlmrsSTuvwx] [-k key] [-O|o fmt] [-p pid] [-t tty]",
- "[-M core] [-N system] [-W swap] [-U username]",
+ "[-M core] [-N system] [-W swap] [-U username] [-G groupname]",
"ps [-L]");
exit(1);
/* NOTREACHED */
--
Jonathan Perkin - Internet Operations Engineer - BBC Internet Services
24x7 Hotline: +44 (0)1628 407 777 (x37777) - http://support.bbc.co.uk/
Responsible-Changed-From-To: simonb->jperkin
Responsible-Changed-By: dholland@NetBSD.org
Responsible-Changed-When: Sat, 22 May 2021 00:22:27 +0000
Responsible-Changed-Why:
want to commit your patch?
State-Changed-From-To: open->closed
State-Changed-By: cjep@NetBSD.org
State-Changed-When: Fri, 04 Jun 2021 08:04:27 +0000
State-Changed-Why:
After discussing with simonb@ I'm closing this. The functionality is
partially implemented and we have noted the POSIX.2 list standard in the
bugs section of the man page.
From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: standards/11223 (POSIX.2: ps -G <grouplist> not supported)
Date: Fri, 4 Jun 2021 16:48:34 +0000
On Fri, Jun 04, 2021 at 08:04:27AM +0000, cjep@NetBSD.org wrote:
> After discussing with simonb@ I'm closing this. The functionality is
> partially implemented and we have noted the POSIX.2 list standard in the
> bugs section of the man page.
Important piece of context: prior to this point cjep committed the
patch. The commit message never made it to gnats, I guess becaues it's
a low-number PR.
--
David A. Holland
dholland@netbsd.org
From: Thomas Klausner <wiz@gatalith.at>
To: gnats-bugs@netbsd.org
Cc: jperkin@netbsd.org,
Ben Harris <bjh21@netbsd.org>
Subject: Re: standards/11223 (POSIX.2: ps -G <grouplist> not supported)
Date: Fri, 4 Jun 2021 19:26:17 +0200
> On 04.06.2021, at 18:50, David Holland <dholland-bugs@netbsd.org> =
wrote:
>=20
> The following reply was made to PR standards/11223; it has been noted =
by GNATS.
>=20
> From: David Holland <dholland-bugs@netbsd.org>
> To: gnats-bugs@netbsd.org
> Cc:=20
> Subject: Re: standards/11223 (POSIX.2: ps -G <grouplist> not =
supported)
> Date: Fri, 4 Jun 2021 16:48:34 +0000
>=20
> On Fri, Jun 04, 2021 at 08:04:27AM +0000, cjep@NetBSD.org wrote:
>> After discussing with simonb@ I'm closing this. The functionality is
>> partially implemented and we have noted the POSIX.2 list standard in =
the
>> bugs section of the man page.
>=20
> Important piece of context: prior to this point cjep committed the
> patch. The commit message never made it to gnats, I guess becaues it's
> a low-number PR.
Yes, only numbers 20,000 an above are accepted as PR numbers for the =
auto-forwarding to GNATS because of the use of the PR keyword in =
CHANGES/NEWS files by upstreams in pkgsrc.
Thomas=
From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: standards/11223 (POSIX.2: ps -G <grouplist> not supported)
Date: Fri, 4 Jun 2021 18:05:27 +0000
On Fri, Jun 04, 2021 at 05:30:02PM +0000, Thomas Klausner wrote:
> > Important piece of context: prior to this point cjep committed the
> > patch. The commit message never made it to gnats, I guess becaues it's
> > a low-number PR.
>
> Yes, only numbers 20,000 an above are accepted as PR numbers for the
> auto-forwarding to GNATS because of the use of the PR keyword in
> CHANGES/NEWS files by upstreams in pkgsrc.
Right, I'd just thought the limit was 10,000. Not that it probably
shouldn't be 30,000 at this point...
--
David A. Holland
dholland@netbsd.org
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.