From dmagda@magda.ca  Fri Apr 18 10:31:04 2003
Return-Path: <dmagda@magda.ca>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id DD29037B404
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 18 Apr 2003 10:31:04 -0700 (PDT)
Received: from tomts21-srv.bellnexxia.net (tomts21-srv.bellnexxia.net [209.226.175.183])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 4199A43FE9
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 18 Apr 2003 10:31:03 -0700 (PDT)
	(envelope-from dmagda@magda.ca)
Received: from number6.magda.ca ([64.229.179.136])
          by tomts21-srv.bellnexxia.net
          (InterMail vM.5.01.04.19 201-253-122-122-119-20020516) with ESMTP
          id <20030418173102.DQLF20691.tomts21-srv.bellnexxia.net@number6.magda.ca>
          for <FreeBSD-gnats-submit@freebsd.org>;
          Fri, 18 Apr 2003 13:31:02 -0400
Received: from number6.magda.ca (localhost.magda.ca [127.0.0.1])
	by number6.magda.ca (8.12.9/8.12.7) with ESMTP id h3IHV1g3000453
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 18 Apr 2003 13:31:01 -0400 (EDT)
	(envelope-from dmagda@magda.ca)
Received: (from dmagda@localhost)
	by number6.magda.ca (8.12.9/8.12.7/Submit) id h3IHV1KL000452;
	Fri, 18 Apr 2003 13:31:01 -0400 (EDT)
	(envelope-from dmagda)
Message-Id: <200304181731.h3IHV1KL000452@number6.magda.ca>
Date: Fri, 18 Apr 2003 13:31:01 -0400 (EDT)
From: David Magda <dmagda+fbugs@magda.ca>
Reply-To: David Magda <dmagda+fbugs@ee.ryerson.ca>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: RSH environmental variable not described in rcmd(3)
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         51133
>Category:       docs
>Synopsis:       RSH environmental variable not described in rcmd(3)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    murray
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 18 10:40:07 PDT 2003
>Closed-Date:    Sat Jul 21 17:18:18 UTC 2012
>Last-Modified:  Sat Jul 21 17:18:18 UTC 2012
>Originator:     David Magda
>Release:        FreeBSD 4.8-PRERELEASE i386
>Organization:
We're organized?
>Environment:
System: FreeBSD number6.magda.ca 4.8-PRERELEASE FreeBSD 4.8-PRERELEASE #1: Fri Feb 21 18:37:45 EST 2003 dave@number6.magda.ca:/usr/obj/usr/src/sys/MYKERNELE i386

>Description:

A while back rcmd(3) was changed so that if a program was defined 
in the RSH environmental variable, it would be used when the rcmd(3) 
library function was called.

>How-To-Repeat:

man 3 rcmd
search for RSH: you won't find it 

>Fix:

Create a ENVIRONMENT section (.Sh ENVIRONMENT) in the rcmd(3) man 
page (and any others that are affected by RSH) stating what RSH does.

Mentioning this functionality in the DESCRIPTION may not be a bad
idea either. OpenBSD's rcmd(3) man page does this:

http://www.openbsd.org/cgi-bin/man.cgi?query=rcmdsh&sektion=3

NetBSD uses the RCMD_CMD variable:

http://netbsd.gw.com/cgi-bin/man-cgi?rcmd+3+NetBSD-current

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: murray 
State-Changed-When: Sun May 4 14:45:59 PDT 2003 
State-Changed-Why:  
Yes we should update these man pages.  Is there any chance the 
submitter can give us a patch to update the pages?  If not, I will 
work on this. 



Responsible-Changed-From-To: freebsd-doc->murray 
Responsible-Changed-By: murray 
Responsible-Changed-When: Sun May 4 14:45:59 PDT 2003 
Responsible-Changed-Why:  
Yes we should update these man pages.  Is there any chance the 
submitter can give us a patch to update the pages?  If not, I will 
work on this. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=51133 

From: David Magda <dmagda+fbugs@magda.ca>
To: freebsd-gnats-submit@FreeBSD.org
Cc: murray@FreeBSD.org
Subject: Re: docs/51133: RSH environmental variable not described in rcmd(3)
Date: Sun, 27 Jul 2003 21:17:17 -0400

 This is the message of the text that I sent to murray@ in response to
 his comment on the PR. I'm putting it in the PR so that if others
 want to act on it they can since no progress has been made:
 
 On Sun, May 04, 2003 at 02:46:50PM -0700, Murray Stokely wrote:
 > Yes we should update these man pages.  Is there any chance the
 > submitter can give us a patch to update the pages?  If not, I will
 > work on this.
 
 Don't know anything about groff (?) formatting so here's the text
 and I'll let someone who knows it get the details right.
 
 In the DESCRIPTION section, insert the following after the first
 sentence in first paragraph:
 
         If the calling process is not setuid, the RSH environment
         variable is set, and inport is ``shell/tcp'', rcmdsh(3) is
         called instead with the value of RSH. Alternately, if the
         user is not the superuser, rcmd() will invoke rcmdsh(3) to
         run the command via rsh(1). While rcmd() can handle IPv4
         cases only, the rcmd_af() function can handle other cases as
         well.
 
 Then start a new paragraph. Continue of with the rest of the text of
 the man page.
 This will basically make FreeBSD's man page match OpenBSD's 
 rcmd(3) [1].
 
 
 Next, create an ENVIRONMENT section and add the following text:
 
       RSH    When using the rcmd() function, this variable is used as
              the program to run instead of rsh(1).
 
 This part is taken from NetBSD's rcmd(3) [2]: the main change is that
 Net has a program rcmd(1) so that users could call rcmd(3) without
 having to be the super-user, and Net uses the variable RCMD_CMD.
 
 
 The above ENVIRONMENT section should also be added to dump(8) and
 restore(8) since they will run $RSH if it is defined. I sent an email
 suggesting so to docs@ but haven't received a reply and nothing's
 been committed to CVS. Doing a quick find/grep, rdist(1) also uses
 rcmd(3) so would probably be effective by $RSH.
 
 
 Also, just curious. Why does OpenBSD have the following code in
 rcmd.c [3]:
 
         if (!issetugid() && (p = getenv("RSH")) && *p) {
                 struct servent *sp = getservbyname("shell", "tcp");
 
 While FreeBSD has the following [4]:
 
       if (!issetugid() && (p = getenv("RSH"))) {
                  struct servent *sp = getservbyname("shell", "tcp");
 
 The difference being the "&& *p".
 
 This difference was introduced by the OpenBSD (by millet) in their
 rev. 1.37 [5] with the commit message of "Make sure $RSH is not the
 empty string."
 
 How beneficial would it be if this was added to FreeBSD's code?
 
 [1] http://www.openbsd.org/cgi-bin/man.cgi?query=rcmd
 [2] http://netbsd.gw.com/cgi-bin/man-cgi?rcmd+3
 [3] http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/net/rcmd.c?rev=1.45
 [4] http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/net/rcmd.c?rev=1.38
 [5] http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/net/rcmd.c.diff?r1=1.36&r2=1.37
 
 
State-Changed-From-To: analyzed->patched 
State-Changed-By: murray 
State-Changed-When: Mon Dec 15 00:26:25 UTC 2008 
State-Changed-Why:  
Committed to -CURRENT.  This is the reminder to MFC to 7.x/6.x-STABLE. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=51133 
State-Changed-From-To: patched->closed 
State-Changed-By: issyl0 
State-Changed-When: Sat Jul 21 17:18:16 UTC 2012 
State-Changed-Why:  
Close.  Committed several years ago. 

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