Subject: bin/18538: have su(1) document -c better
To: None <gnats-bugs@gnats.netbsd.org>
From: None <reed@reedmedia.net>
List: netbsd-bugs
Date: 10/05/2002 02:16:05
>Number: 18538
>Category: bin
>Synopsis: su -c can be confusing
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Sat Oct 05 02:16:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:
>Release: NetBSD 1.6
>Organization:
>Environment:
System: NetBSD kids.reedmedia.net 1.6 NetBSD 1.6 (GENERIC) #0: Sun Sep 8 19:43:40 UTC 2002 autobuild@tgm.daemon.org:/autobuild/i386/OBJ/autobuild/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
I often read about problems about understanding su's -c option.
It is confusing with -c before or after login name.
>How-To-Repeat:
Begin using su(1) and wonder why examples show -c with commands,
but man page says for login class.
>Fix:
The manual page does explain it. But hopefully this patch will help
explain it some more.
--- usr.bin/su/su.1.orig Sat Dec 8 11:17:03 2001
+++ usr.bin/su/su.1 Sat Oct 5 02:12:03 2002
@@ -98,6 +98,9 @@
.It Fl c
Specify a login class.
You may only override the default class if you're already root.
+See
+.Xr login.conf 5
+for details.
.It Fl f
If the invoked shell is
.Xr csh 1 ,
@@ -154,6 +157,21 @@
.Fl m
options are mutually exclusive; the last one specified
overrides any previous ones.
+.Pp
+When a
+.Fl c
+option is included after the
+.Ar login
+name it is not a
+.Nm
+option, because any arguments after the
+.Ar login
+are passed to the shell. (See
+.Xr csh 1 ,
+.Xr ksh 1
+or
+.Xr sh 1
+for details.)
.Pp
Only users in group
.Dq wheel
>Release-Note:
>Audit-Trail:
>Unformatted: