summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorwosch <wosch@FreeBSD.org>1996-02-02 05:19:20 +0000
committerwosch <wosch@FreeBSD.org>1996-02-02 05:19:20 +0000
commitec52b9e55db5192e771db603f5c2e590634dfd2d (patch)
treec5f475ed9ba25efc79fe8581d263f3bd898afbda /sys/fs
parentbcba98f11c6a123ddd952bb89e6b722add86fb4d (diff)
downloadFreeBSD-src-ec52b9e55db5192e771db603f5c2e590634dfd2d.zip
FreeBSD-src-ec52b9e55db5192e771db603f5c2e590634dfd2d.tar.gz
add ruid and rgid to file 'status'
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/procfs/procfs_status.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/sys/fs/procfs/procfs_status.c b/sys/fs/procfs/procfs_status.c
index f129022..87292cb 100644
--- a/sys/fs/procfs/procfs_status.c
+++ b/sys/fs/procfs/procfs_status.c
@@ -36,7 +36,7 @@
*
* @(#)procfs_status.c 8.3 (Berkeley) 2/17/94
*
- * $Id: procfs_status.c,v 1.3 1994/10/10 07:55:38 phk Exp $
+ * $Id: procfs_status.c,v 1.4 1995/05/30 08:07:10 rgrimes Exp $
*/
#include <sys/param.h>
@@ -78,8 +78,9 @@ procfs_dostatus(curp, p, pfs, uio)
sess = p->p_pgrp->pg_session;
sid = sess->s_leader ? sess->s_leader->p_pid : 0;
-/* comm pid ppid pgid sid maj,min ctty,sldr start ut st wmsg uid groups ... */
-
+/* comm pid ppid pgid sid maj,min ctty,sldr start ut st wmsg
+ euid ruid rgid,egid,groups[1 .. NGROUPS]
+*/
ps = psbuf;
bcopy(p->p_comm, ps, MAXCOMLEN);
ps[MAXCOMLEN] = '\0';
@@ -126,7 +127,14 @@ procfs_dostatus(curp, p, pfs, uio)
cr = p->p_ucred;
- ps += sprintf(ps, " %ld %ld", cr->cr_uid, cr->cr_gid);
+ ps += sprintf(ps, " %ld %ld %ld",
+ cr->cr_uid, /* euid */
+ p->p_cred->p_ruid, /* ruid */
+ p->p_cred->p_rgid); /* rgid */
+
+ /* egid (p->p_cred->p_svgid) is equal to cr_ngroups[0]
+ see also getegid(2) in /sys/kern/kern_prot.c */
+
for (i = 0; i < cr->cr_ngroups; i++)
ps += sprintf(ps, ",%ld", cr->cr_groups[i]);
ps += sprintf(ps, "\n");
OpenPOWER on IntegriCloud