DragonFly BSD
DragonFly kernel List (threaded) for 2004-07
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: questions on kern.ps_showallthreads


From: "Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx>
Date: Sat, 17 Jul 2004 17:46:03 +0200

On 17.07.2004, at 13:42, Devon H. O'Dell wrote:

This probably isn't the most clean fix for this problem (it'd be nice to put it in the comparison section of the for (;;) loop), but the following diff should fix this problem.

--Devon
ÿþIndex: kern_proc.c
=================================== ================================
RCS file: /home/pf4df/pf4df/sys/kern/ kern_proc.c,v
retrieving revision 1.1.1.1
diff -u -u -r1.1.1.1 kern_proc.c
--- kern_proc.c 15 Jul 2004 19:50:11 -0000 1.1.1.1
+++ kern_proc.c 17 Jul 2004 11:40:04 -0000
@@ -601,10 +601,12 @@
* cpu.
*/
origcpu = mycpu->gd_cpuid;
- for (n = 1; ps_showallthreads && n <= ncpus; ++n) {
+ for (n = 1; n <= ncpus; ++n) {
globaldata_t rgd;
int nid;

+ if (0 == ps_showallthreads && 0 != p->p_ucred->cr_uid)
+ return (0);

This might introduce unwanted visibility in jail()ed parts of the system. Maybe
if (!ps_showallthreads || suser_proc(p))
would be a better solution. Untested, no warranty included.


cheers
  simon

--
/"\
\ /
 \     ASCII Ribbon Campaign
/ \  Against HTML Mail and News

Attachment: PGP.sig
Description: This is a digitally signed message part



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]