From owner-freebsd-hackers Sat Dec 29 4:26:32 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from intranet.ru (tcms8.intranet.ru [212.164.0.135]) by hub.freebsd.org (Postfix) with ESMTP id 1D1F837B41E for ; Sat, 29 Dec 2001 04:26:25 -0800 (PST) Received: from [195.151.139.2] (account ) by intranet.ru (CommuniGate Pro WebUser 3.4.8) with HTTP id 7584539 for ; Sat, 29 Dec 2001 18:26:23 +0600 From: "Eugene Panchenko" Subject: Hiding other processes To: hackers@freebsd.org X-Mailer: CommuniGate Pro Web Mailer v.3.4.8 Date: Sat, 29 Dec 2001 18:26:23 +0600 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="KOI8-R" Content-Transfer-Encoding: 8bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hello! I know about sysctl "kern.ps_showallprocs", but it is not very convenient because in this case only root will be able to see all processes, and I want to wheel group to see them all as well. I modified kern_proc.c a bit, could you please comment on it, and say will it work or not, and how should I (if I should) possibly rewrite it? Thank you a lot! --- /sys/kern/kern_proc.c Tue May 1 20:39:06 2001 +++ kern_proc.c Fri Dec 28 21:00:11 2001 @@ -476,10 +476,14 @@ p = LIST_FIRST(&zombproc); for (; p != 0; p = LIST_NEXT(p, p_list)) { /* - * Show a user only their processes. + * Show a user only their processes + * unless he/she is in wheel group (gid = 0). */ - if ((!ps_showallprocs) && p_trespass(curproc, p)) - continue; + if (((!ps_showallprocs) || + (curproc->p_ucred == NULL || + curproc->p_ucred->cr_gid != (gid_t)0)) + && p_trespass(curproc, p) + continue; /* * Skip embryonic processes. */ ____________________________________________________________ Скоро Новый Год? Сделайте себе подарок - http://ngs.ru/tovar To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message