Subject: Re: bin/17340: the meaning of the "-c" option to /usr/bin/su is overloaded
To: David Laight <david@l8s.co.uk>
From: Greg A. Woods <woods@weird.com>
List: netbsd-bugs
Date: 06/21/2002 22:33:02
[ On Friday, June 21, 2002 at 23:32:46 (+0100), David Laight wrote: ]
> Subject: Re: bin/17340: the meaning of the "-c" option to /usr/bin/su is overloaded
>
> > When the '-' option was introduced (before System III), it was
> > implemented with a silly non-getopt() hack.  It was still that way in
> > SysVr3.2.  I don't know what happened when '-' was deprecated and '-l'
> > was introduced to replace it in order to bring 'su' closer to POSIX
> > compatability.
> 
> I found some SVR4 sources (probably UnixWare 2 ish) from around
> 1997.  su just looked at argv[1] to see if it was "-".
> No getopt() call, no other options.

Interesting.  (It's probably more or less unchanged since SysVr3.2)

I don't see '-l' documented in SunOS-5.6 either....

Unfortunately 'su' is (still) one of those implementation-defined
things, so the best one can do w.r.t. API standards is to show how it
should conform to the generic rules for command-line parameters.

Luckily it seems *BSD's implementation has conformed since at least the
4.2net2 release....

-- 
								Greg A. Woods

+1 416 218-0098;  <gwoods@acm.org>;  <g.a.woods@ieee.org>;  <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>