diff options
author | gad <gad@FreeBSD.org> | 2004-05-22 23:11:44 +0000 |
---|---|---|
committer | gad <gad@FreeBSD.org> | 2004-05-22 23:11:44 +0000 |
commit | d284b0788668cc0867b2188a2249e2613ae2da87 (patch) | |
tree | 1e466aa41a48e59fff5766c9840c92739f50c7b0 /sys | |
parent | 2dbf0cc1979da719b4be271bc1f062672ab1ac92 (diff) | |
download | FreeBSD-src-d284b0788668cc0867b2188a2249e2613ae2da87.zip FreeBSD-src-d284b0788668cc0867b2188a2249e2613ae2da87.tar.gz |
Implement the new KERN_PROC_RGID option, and also implement the
KERN_PROC_SESSION option which had been previously defined but
never implemented.
PR: bin/65803 (a very tiny piece of the PR)`
Submitted by: Cyrille Lefevre
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_proc.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index b99f3dc..2bdd0ef 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -984,6 +984,22 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) } break; + case KERN_PROC_RGID: + if (p->p_ucred == NULL || + p->p_ucred->cr_rgid != (gid_t)name[0]) { + PROC_UNLOCK(p); + continue; + } + break; + + case KERN_PROC_SESSION: + if (p->p_session == NULL || + p->p_session->s_sid != (pid_t)name[0]) { + PROC_UNLOCK(p); + continue; + } + break; + case KERN_PROC_TTY: if ((p->p_flag & P_CONTROLT) == 0 || p->p_session == NULL) { @@ -1171,6 +1187,12 @@ SYSCTL_PROC(_kern_proc, KERN_PROC_ALL, all, CTLFLAG_RD|CTLTYPE_STRUCT, SYSCTL_NODE(_kern_proc, KERN_PROC_PGRP, pgrp, CTLFLAG_RD, sysctl_kern_proc, "Process table"); +SYSCTL_NODE(_kern_proc, KERN_PROC_RGID, rgid, CTLFLAG_RD, + sysctl_kern_proc, "Process table"); + +SYSCTL_NODE(_kern_proc, KERN_PROC_SESSION, sid, CTLFLAG_RD, + sysctl_kern_proc, "Process table"); + SYSCTL_NODE(_kern_proc, KERN_PROC_TTY, tty, CTLFLAG_RD, sysctl_kern_proc, "Process table"); @@ -1195,6 +1217,12 @@ SYSCTL_NODE(_kern_proc, KERN_PROC_SV_NAME, sv_name, CTLFLAG_RD, SYSCTL_NODE(_kern_proc, (KERN_PROC_PGRP | KERN_PROC_INC_THREAD), pgrp_td, CTLFLAG_RD, sysctl_kern_proc, "Process table"); +SYSCTL_NODE(_kern_proc, (KERN_PROC_RGID | KERN_PROC_INC_THREAD), rgid_td, + CTLFLAG_RD, sysctl_kern_proc, "Process table"); + +SYSCTL_NODE(_kern_proc, (KERN_PROC_SESSION | KERN_PROC_INC_THREAD), sid_td, + CTLFLAG_RD, sysctl_kern_proc, "Process table"); + SYSCTL_NODE(_kern_proc, (KERN_PROC_TTY | KERN_PROC_INC_THREAD), tty_td, CTLFLAG_RD, sysctl_kern_proc, "Process table"); |