From schweikh@schweikhardt.net  Sun May 19 15:20:26 2002
Return-Path: <schweikh@schweikhardt.net>
Received: from bremen.shuttle.de (bremen.shuttle.de [194.95.249.251])
	by hub.freebsd.org (Postfix) with ESMTP id EF78C37B413
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 19 May 2002 15:20:24 -0700 (PDT)
Received: from bremen.shuttle.de (localhost [127.0.0.1])
	by bremen.shuttle.de (Postfix) with ESMTP id 2377A17E18
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 20 May 2002 00:09:34 +0200 (CEST)
Received: (from uucp@localhost)
	by bremen.shuttle.de (8.12.3/8.12.3/Debian -4) with UUCP id g4JM9Xxn011170
	for FreeBSD-gnats-submit@freebsd.org; Mon, 20 May 2002 00:09:33 +0200
Received: from hal9000.schweikhardt.net (localhost [127.0.0.1])
	by hal9000.schweikhardt.net (8.12.3/8.12.3) with ESMTP id g4JM9neC067781
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 20 May 2002 00:09:49 +0200 (CEST)
	(envelope-from schweikh@hal9000.schweikhardt.net)
Received: (from schweikh@localhost)
	by hal9000.schweikhardt.net (8.12.3/8.12.3/Submit) id g4JM9mCd067780;
	Mon, 20 May 2002 00:09:48 +0200 (CEST)
Message-Id: <200205192209.g4JM9mCd067780@hal9000.schweikhardt.net>
Date: Mon, 20 May 2002 00:09:48 +0200 (CEST)
From: Jens Schweikhardt <schweikh@schweikhardt.net>
Reply-To: Jens Schweikhardt <schweikh@schweikhardt.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: su(1) prints bogus help message; inconsistent man page
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         38308
>Category:       bin
>Synopsis:       su(1) prints bogus help message; inconsistent man page
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 19 15:30:09 PDT 2002
>Closed-Date:    Sun May 26 23:23:38 PDT 2002
>Last-Modified:  Sun May 26 23:23:38 PDT 2002
>Originator:     Jens Schweikhardt
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
Digital Details
>Environment:
System: FreeBSD hal9000.schweikhardt.net 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Wed May 1 14:49:52 CEST 2002 toor@hal9000.schweikhardt.net:/usr/obj/src/current/sys/HAL9000 i386


>Description:
	su(1) prints bogus help message; there is no --help option:
    root@hal9000:/home/schweikh # /usr/bin/su uucp -c ls 
    Usage: su [options]
    Use su --help for help
    root@hal9000:/home/schweikh # /usr/bin/su --help    
	#                     <-- huh? A shell prompt...


    The man page says:
SYNOPSIS
     su [-] [-flm] [-c class] [login [args]]
...
     -c class
             Use the settings of the specified login class.  Only allowed for
             the super-user.
...
EXAMPLES
     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-
            gle word and hence is quoted for use with the -c option being
            passed to the shell.  (Most shells expect the argument to -c to be
            a single word).
     su -c staff man -c 'catman /usr/share/man /usr/local/man /usr/X11R6/man'
            Same as above, but the target command is run with the resource
            limits of the login class ``staff''.  Note: in this example, the
            first -c option applies to su while the second is an argument to
            the shell being invoked.

It seems -c is used in the examples to specify a command AND a class.

>How-To-Repeat:
	See above.
>Fix:


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: jmallett 
State-Changed-When: Sun May 26 23:18:17 PDT 2002 
State-Changed-Why:  
If -c is specified after the login, it is passed to the shell, just like every 
thing that occurs after the login, which is logically the first argument when 
getopt(3) completes.  If it is before, it specifies the login class. 

As for the --help error, I can't for the life of me find where su(1) has EVER 
printed that usage message.  It seems to always have printed a traditional BSD 
usage message. 

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