Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Jul 1995 13:06:59 +0200
From:      Wolfram Schneider <wosch@cs.tu-berlin.de>
To:        hackers@freebsd.org
Subject:   [Remeber] Real UID in procfs
Message-ID:  <199507111106.NAA12929@caramba.cs.tu-berlin.de>

next in thread | raw e-mail | index | archive | help

--- 1.1	1995/07/01 14:57:47
+++ /sys/miscfs/procfs/procfs_status.c	1995/07/01 15:57:01
@@ -79,7 +79,10 @@
 	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 ... */
-
+/* ifdef PROCFS_RUID 
+comm pid ppid pgid sid maj,min ctty,sldr start ut st wmsg euid ruid groups ...
+   endif
+*/
 	ps = psbuf;
 	bcopy(p->p_comm, ps, MAXCOMLEN);
 	ps[MAXCOMLEN] = '\0';
@@ -126,7 +129,13 @@
 
 	cr = p->p_ucred;
 
+#if (!defined PROCFS_RUID)
 	ps += sprintf(ps, " %ld %ld", cr->cr_uid, cr->cr_gid);
+#else  /* have ruid */
+	ps += sprintf(ps, " %ld %ld %ld", 
+		      cr->cr_uid, p->p_cred->p_ruid, cr->cr_gid);
+#endif /* PROCFS_RUID */
+
 	for (i = 0; i < cr->cr_ngroups; i++)
 		ps += sprintf(ps, ",%ld", cr->cr_groups[i]);
 	ps += sprintf(ps, "\n");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199507111106.NAA12929>