From rdm@cfcl.com  Mon Feb 26 22:51:42 2001
Return-Path: <rdm@cfcl.com>
Received: from cfcl.com (cpe-24-221-169-54.ca.sprintbbd.net [24.221.169.54])
	by hub.freebsd.org (Postfix) with ESMTP id 1465137B70A
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 26 Feb 2001 22:51:42 -0800 (PST)
	(envelope-from rdm@cfcl.com)
Received: (from rdm@localhost)
	by cfcl.com (8.9.3/8.9.3) id WAA21848;
	Mon, 26 Feb 2001 22:51:09 -0800 (PST)
	(envelope-from rdm)
Message-Id: <200102270651.WAA21848@cfcl.com>
Date: Mon, 26 Feb 2001 22:51:09 -0800 (PST)
From: Rich Morin <rdm@cfcl.com>
Reply-To: rdm@cfcl.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: misleading warning from catman(1), etc.
X-Send-Pr-Version: 3.2
X-GNATS-Notify: ru

>Number:         25405
>Category:       docs
>Synopsis:       misleading warning from catman(1), etc.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 26 23:00:01 PST 2001
>Closed-Date:    Tue May 21 00:04:31 PDT 2002
>Last-Modified:  Tue May 21 00:04:31 PDT 2002
>Originator:     Rich Morin
>Release:        FreeBSD 4.2-RELEASE i386
>Organization:
Canta Forda Computer Laboratory
>Environment:

	FreeBSD fb42.cfcl.com 4.2-RELEASE FreeBSD 4.2-RELEASE #0:
	Mon Nov 20 13:02:55 GMT 2000
        jkh@bento.FreeBSD.org:/usr/src/sys/compile/GENERIC  i386

>Description:

	If catman(1) is run as root, the message:

	  Don't start this program as root, use:
	  echo /usr/bin/catman  | nice -5 su -m man

        appears.  There are really several problems here:

        1)  The program should check whether catman is actually
            being run by root before issuing the warning.

        2)  If an error has occurred, the program should exit,
            rather then going on to write root-owned files in
            /usr/share/man/cat* (or wherever...).

        3)  The program should be clever enough to _do_ the
            necessary work, rather than telling the user how to
            do it.  Basically, the programmer has gratuitously
            broken the method of operation for a command.

        4)  The programmer's instructions to the user make use
            of an undocumented feature of man(1).  What, exactly,
	    is going on when we pipe this text string into man?

        In passing, I will note that the warning messages emitted
        by this command string:

	  Unknown FreeBSD version ``),'' at line 320
	  Unknown BSD version ``'' at line 5
	  Unknown BSD version ``'' at line 5
	
	are essentially useless, as the user has no way of knowing
        which man page is being discussed.
	

>How-To-Repeat:

	% su
        # catman

>Fix:

	Recode catman, as described above.
>Release-Note:
>Audit-Trail:

From: Ben Smithurst <csxbcs@comp.leeds.ac.uk>
To: Rich Morin <rdm@cfcl.com>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: docs/25405: misleading warning from catman(1), etc.
Date: Thu, 1 Mar 2001 11:03:32 +0000

 Rich Morin wrote:
 
 > 	  Don't start this program as root, use:
 > 	  echo /usr/bin/catman  | nice -5 su -m man
 > 
 >         appears.  There are really several problems here:
 > 
 >         1)  The program should check whether catman is actually
 >             being run by root before issuing the warning.
 > 
 >         2)  If an error has occurred, the program should exit,
 >             rather then going on to write root-owned files in
 >             /usr/share/man/cat* (or wherever...).
 > 
 >         3)  The program should be clever enough to _do_ the
 >             necessary work, rather than telling the user how to
 >             do it.  Basically, the programmer has gratuitously
 >             broken the method of operation for a command.
 > 
 >         4)  The programmer's instructions to the user make use
 >             of an undocumented feature of man(1).  What, exactly,
 > 	    is going on when we pipe this text string into man?
 
 RTFM...  That's not what you're doing, you're passing the text string
 into 'su', which simply runs a shell as user 'man' which then executes
 the command /usr/bin/catman as that user.
 
 That's not to say the other points aren't valid, but I'm a bit busy at
 the moment, sorry. :-( Hopefully someone else can deal with it.
 
 -- 
 Ben Smithurst / csxbcs@comp.leeds.ac.uk / ben@FreeBSD.org
Responsible-Changed-From-To: freebsd-doc->wosch 
Responsible-Changed-By: ru 
Responsible-Changed-When: Tue Aug 21 05:39:25 PDT 2001 
Responsible-Changed-Why:  
Over to the catman(1) maintainer to decide whether it should bail out 
if run under root. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=25405 
State-Changed-From-To: open->closed 
State-Changed-By: ru 
State-Changed-When: Tue May 21 00:03:30 PDT 2002 
State-Changed-Why:  
The remnants of this PR have been fixed by the C rewrite. 


Responsible-Changed-From-To: wosch->freebsd-bugs 
Responsible-Changed-By: ru 
Responsible-Changed-When: Tue May 21 00:03:30 PDT 2002 
Responsible-Changed-Why:  

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