Subject: bin/18538: have su(1) document -c better
To: None <>
From: None <>
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
>Release:        NetBSD 1.6
System: NetBSD 1.6 NetBSD 1.6 (GENERIC) #0: Sun Sep 8 19:43:40 UTC 2002 i386
Architecture: i386
Machine: i386
I often read about problems about understanding su's -c option.
It is confusing with -c before or after login name.
Begin using su(1) and wonder why examples show -c with commands,
but man page says for login class.
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.
+.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.
+When a
+.Fl c
+option is included after the
+.Ar login
+name it is not a
+option, because any arguments after the
+.Ar login
+are passed to the shell. (See
+.Xr csh 1 ,
+.Xr ksh 1
+.Xr sh 1
+for details.)
 Only users in group
 .Dq wheel