Subject: Re: ps(1) sysv silliness
To: Simon Burge <simonb@netbsd.org>
From: Jaromír Doleček <dolecek@ibis.cz>
List: tech-userlevel
Date: 06/08/2000 11:01:11
I think such feature would be useful. I think that following
should be done
1) when ps is run as ps-sysv, it should use the SysV-style
arguments
2) a flag should be added to force either behaviour
3) if ps not run as ps-sysv nor the flag is given, ps should
process it's arguments and if it finds a svrish one (such
as -f), switch to SysV-style and restart the argument parsing
process - this should be pretty streightforward and easy
implement, and should DTRT in most cases
Jaromir
Simon Burge wrote:
> ITOH Yasufumi wrote:
>
> > simonb@netbsd.org writes:
> > > Ummm:
> > >
> > > alpha:~ 6> ps Uroot
> > > PID TT STAT TIME COMMAND
> > > 198 E0 Is+ 0:00.02 /usr/libexec/getty std.9600 console
> > > alpha:~ 7> ps -Uroot
> > > PID TT STAT TIME COMMAND
> > > 198 E0 Is+ 0:00.02 /usr/libexec/getty std.9600 console
> >
> > Ummmm,
> > pino% ps Uroot
> > ps: rooT: illegal user name
> > pino%
> >
> > Does your machine have a user named "rooT"?
>
> Ahh, well I sort of have a user "rooT" - I use hesiod over DNS for
> passwd:
>
> alpha:src/bin/ps 14> host -c hs -t txt rooT.passwd.supp.cpr.itg.telecom.com.au.
> rooT.passwd.supp.cpr.itg.telecom.com.au descriptive text "root:xxxxxxxxxxxxx:0:1:Da Boss:/:/bin/tcsh"
>
> It looks like the problem is in ps.c around:
>
> 480 /*
> 481 * if last letter is a 't' flag with no argument (in the context
> 482 * of the oldps options -- option string NOT starting with a '-' --
> 483 * then convert to 'T' (meaning *this* terminal, i.e. ttyname(0)).
> 484 */
> 485 if (*cp == 't' && *s != '-')
> 486 *cp = 'T';
> 487 else {
>
> And the fix will involve some of the logic from around line 503 as well.
> I'll look into it further...
>
> Simon.
>
--
Jaromir Dolecek <jdolecek@NetBSD.org> http://www.ics.muni.cz/~dolecek/
@@@@ Wanna a real operating system ? Go and get NetBSD, damn! @@@@