From gshapiro@sendmail.com  Fri Aug 15 11:55:42 2003
Return-Path: <gshapiro@sendmail.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id B052637B401
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 15 Aug 2003 11:55:42 -0700 (PDT)
Received: from spork.sendmail.com (spork.sendmail.com [209.246.26.39])
	by mx1.FreeBSD.org (Postfix) with ESMTP id B2B5D43F85
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 15 Aug 2003 11:55:41 -0700 (PDT)
	(envelope-from gshapiro@sendmail.com)
Received: from foon.sendmail.com (smtp.sendmail.com [209.246.26.40])
	by spork.sendmail.com (Switch-3.1.0/Switch-3.1.0) with ESMTP id h7FIteU3005886
	(version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK)
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 15 Aug 2003 11:55:40 -0700 (PDT)
Received: from scooter.smi.sendmail.com (natted.sendmail.com [63.211.143.38])
	by foon.sendmail.com (Switch-3.1.0/Switch-3.1.0) with ESMTP id h7FItdKJ008794
	(version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK)
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 15 Aug 2003 11:55:40 -0700
Received: from scooter.smi.sendmail.com (localhost [127.0.0.1])
	by scooter.smi.sendmail.com (8.12.9/8.12.9) with ESMTP id h7FItdUv096481
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 15 Aug 2003 11:55:39 -0700 (PDT)
	(envelope-from gshapiro@scooter.smi.sendmail.com)
Received: (from gshapiro@localhost)
	by scooter.smi.sendmail.com (8.12.9/8.12.9/Submit) id h7FItd1l096480;
	Fri, 15 Aug 2003 11:55:39 -0700 (PDT)
Message-Id: <200308151855.h7FItd1l096480@scooter.smi.sendmail.com>
Date: Fri, 15 Aug 2003 11:55:39 -0700 (PDT)
From: Gregory Neil Shapiro <gshapiro@freebsd.org>
Reply-To: Gregory Neil Shapiro <gshapiro@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: su man page confusing, probably incorrect
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         55613
>Category:       docs
>Synopsis:       su man page confusing, probably incorrect
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kensmith
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 15 12:00:11 PDT 2003
>Closed-Date:    Sun Sep 28 10:58:10 PDT 2003
>Last-Modified:  Sun Sep 28 10:58:10 PDT 2003
>Originator:     Gregory Neil Shapiro
>Release:        FreeBSD 4.8-STABLE i386
>Organization:
>Environment:
System: FreeBSD scooter.smi.sendmail.com 4.8-STABLE FreeBSD 4.8-STABLE #0: Wed Jul 2 11:53:30 PDT 2003 root@scooter.smi.sendmail.com:/usr/obj/usr/src/sys/SCOOTER i386

>Description:

The su man page describes -c as:

     -c class
             Use the settings of the specified login class.  Only allowed for
             the super-user.

Yet the examples say:

     su man -c catman
            Runs the command catman as user man.  You will be asked for man's
            password unless your real UID is 0.
     su man -c `catman /usr/share/man /usr/local/man /usr/X11R6/man'
            Same as above, but the target command consists of more than a sin-
            ...

Clearly the -c in these examples is not pointing at a login class.  It is
pointing at a command to run.  Sure a later example gives the even more
confusing:

     su -c staff man -c `catman /usr/share/man /usr/local/man /usr/X11R6/man'

However, -c is never documented in the man page as pointing to a command
to run, which it in fact does do.

Also note in the examples above that the quoting is wrong.  If someone
actually tries to run the given commands in the example, it will fail.
The first quote has to be a normal single quote, not a back quote.

>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:

From: underway@comcast.net (Gary W. Swearingen)
To: Gregory Neil Shapiro <gshapiro@FreeBSD.org>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: docs/55613: su man page confusing, probably incorrect
Date: Fri, 15 Aug 2003 13:44:38 -0700

 Gregory Neil Shapiro <gshapiro@FreeBSD.org> writes:
 
 > Clearly the -c in these examples is not pointing at a login class.  It is
 > pointing at a command to run.  Sure a later example gives the even more
 > confusing:
 >
 >      su -c staff man -c `catman /usr/share/man /usr/local/man /usr/X11R6/man'
 >
 > However, -c is never documented in the man page as pointing to a command
 > to run, which it in fact does do.
 
 That example actually contains a hint.  The syntax is
 
      su [-] [-flms] [-c class] [login [args]]
 
 so in all examples, "man" is the "login"** and the "-c" which follows
 "man" is the "args" (to the login shell).  The "-c" is documented in
 the "sh" (or is it "csh"?) manpages, on the assumption that the reader
 is using a shell which supports such a "-c" option.
 
 If it tripped you up, it could trip up others and should be improved.
 
 
 ** I almost wrote a PR once on that use of "login" in the syntax
 and description.  "user" (as used by "passwd"), "username",
 "user-name", "login-name" or almost anything would be better than
 "login", especially in the text where it should be even longer,
 like "user account name".  (The "login" "man" doesn't even log in. :)
Responsible-Changed-From-To: freebsd-doc->kensmith 
Responsible-Changed-By: kensmith 
Responsible-Changed-When: Thu Sep 25 20:55:23 PDT 2003 
Responsible-Changed-Why:  

I'll give this one a try. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=55613 
State-Changed-From-To: open->closed 
State-Changed-By: kensmith 
State-Changed-When: Sun Sep 28 10:56:18 PDT 2003 
State-Changed-Why:  

- Added clarification to how arguments are handled, as 
discussed with submitter. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=55613 
>Unformatted:
