NetBSD Problem Report #18538

Received: (qmail 7413 invoked by uid 605); 5 Oct 2002 09:15:30 -0000
Message-Id: <200210050916.g959G5G04763@kids.reedmedia.net>
Date: Sat, 5 Oct 2002 02:16:05 -0700 (PDT)
From: reed@reedmedia.net
Sender: gnats-bugs-owner@netbsd.org
Reply-To: reed@reedmedia.net
To: gnats-bugs@gnats.netbsd.org
Subject: have su(1) document -c better
X-Send-Pr-Version: 3.95

>Number:         18538
>Category:       bin
>Synopsis:       su -c can be confusing
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Oct 05 09:16:00 +0000 2002
>Closed-Date:    Sat Oct 05 14:08:03 +0000 2002
>Last-Modified:  Sat Oct 05 14:09:00 +0000 2002
>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:
State-Changed-From-To: open->closed 
State-Changed-By: hubertf 
State-Changed-When: Sat Oct 5 07:07:13 PDT 2002 
State-Changed-Why:  
I've committed the text, but to the examples section. 
Thanks! 


- Hubert 

From: Hubert Feyrer <hubertf@netbsd.org>
To: gnats-bugs@gnats.netbsd.org
Cc:  
Subject: pr/18538 CVS commit: basesrc/usr.bin/su
Date: Sat,  5 Oct 2002 17:07:06 +0300 (EEST)

 Module Name:	basesrc
 Committed By:	hubertf
 Date:		Sat Oct  5 14:07:05 UTC 2002

 Modified Files:
 	basesrc/usr.bin/su: su.1

 Log Message:
 Make example clearer, that the -c _after_ the login is passed to the shell.
 Addresses PR 18538 by reed@reedmedia.net


 To generate a diff of this commit:
 cvs rdiff -r1.23 -r1.24 basesrc/usr.bin/su/su.1

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.