Subject: Re: Using the kernel to get argv for a process.
To: Simon Burge <>
From: Giles Lean <>
List: tech-kern
Date: 04/28/2000 22:55:56
On Fri, 28 Apr 2000 00:24:25 +1000  Simon Burge wrote:

> So, is there any reasons not to add the equivalent of
> 	sysctl(CTL_KERN, KERN_PROC_ARGV, pid, buf, len)
> and
> 	sysctl(CTL_KERN, KERN_PROC_ENVP, pid, buf, len)
> and completely drop sgid from ps (and probably top and w/uptime as
> well)?

What effect will this have on processes that (try to) adjust argv[0]?
How this is done and if it is possible seems to vary from OS to OS;
the NetBSD magic incantation appears to involve __ps_strings as known
to setproctitle(3), but I've not looked at the kernel code.

Personally I don't care if the feature goes away -- a non-setuid ps is
preferred -- but sendmail administrators might miss the feature.