From nobody@FreeBSD.org  Fri Feb  2 14:24:00 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 71A4037B491
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  2 Feb 2001 14:24:00 -0800 (PST)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.1/8.11.1) id f12MO0910725;
	Fri, 2 Feb 2001 14:24:00 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200102022224.f12MO0910725@freefall.freebsd.org>
Date: Fri, 2 Feb 2001 14:24:00 -0800 (PST)
From: doc_zero@hotmail.com
To: freebsd-gnats-submit@FreeBSD.org
Subject: scp(1) from OpenSSH package doesn't have a "-L" option
X-Send-Pr-Version: www-1.0

>Number:         24807
>Category:       bin
>Synopsis:       scp(1) from OpenSSH package doesn't have a "-L" option
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          wish
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 02 14:30:01 PST 2001
>Closed-Date:    Sun Feb 4 03:20:09 PST 2001
>Last-Modified:  Sun Feb 04 03:20:54 PST 2001
>Originator:     Alex Rebrik
>Release:        4.2-STABLE
>Organization:
N/A
>Environment:
FreeBSD possessed 4.2-STABLE FreeBSD 4.2-STABLE #0: Thu Jan 11 09:54:23 PST 2001     root@possessed:/usr/src/sys/compile/POSSESSED  i386

>Description:
The -L option available in SSH package from /usr/ports/security/ssh allows
to pass a -P option to ssh when using scp command. This is helpful when doing
a secure copy from a network where a firewall doesn't permit outgoing connections 
on privileged ports. In ssh itself this option is supported as -P and the manpage
reads:      

     -P      Use a non-privileged port for outgoing connections.  This can be
             used if your firewall does not permit connections from privileged
             ports.  Note that this option turns off RhostsAuthentication and
             RhostsRSAAuthentication.

I have included a patch to /usr/src/crypto/openssh/scp.c dated Fri Feb  2.

Sincerely,
Alex.

>How-To-Repeat:

>Fix:
*** scp.c.orig  Fri Feb  2 11:42:42 2001
--- scp.c       Fri Feb  2 13:52:24 2001
***************
*** 245,253 ****
        addargs("-oFallBackToRsh no");
  
        fflag = tflag = 0;
!       while ((ch = getopt(argc, argv, "dfprtvBCc:i:P:q46S:o:")) != EOF)
                switch (ch) {
                /* User-visible flags. */
                case '4':
                case '6':
                case 'C':
--- 245,255 ----
        addargs("-oFallBackToRsh no");
  
        fflag = tflag = 0;
!       while ((ch = getopt(argc, argv, "dfprtvBCLc:i:P:q46S:o:")) != EOF)
                switch (ch) {
                /* User-visible flags. */
+               case 'L':
+                       addargs("-P");
                case '4':
                case '6':
                case 'C':
***************
*** 943,949 ****
  usage()
  {
        (void) fprintf(stderr, "usage: scp "
!           "[-pqrvC46] [-S ssh] [-P port] [-c cipher] [-i identity] f1 f2; or:
\n"
            "       scp [options] f1 ... fn directory\n");
        exit(1);
  }
--- 945,951 ----
  usage()
  {
        (void) fprintf(stderr, "usage: scp "
!           "[-pqrvLC46] [-S ssh] [-P port] [-c cipher] [-i identity] f1 f2; or
:\n"
            "       scp [options] f1 ... fn directory\n");
        exit(1);
  }


>Release-Note:
>Audit-Trail:

From: Peter Pentchev <roam@orbitel.bg>
To: doc_zero@hotmail.com
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/24807: scp(1) from OpenSSH package doesn't have a "-L" option
Date: Sat, 3 Feb 2001 00:42:02 +0200

 On Fri, Feb 02, 2001 at 02:24:00PM -0800, doc_zero@hotmail.com wrote:
 > 
 > >Number:         24807
 > >Synopsis:       scp(1) from OpenSSH package doesn't have a "-L" option
 > >Responsible:    freebsd-bugs
 > >Class:          wish
 > >Originator:     Alex Rebrik
 > >Release:        4.2-STABLE
 > >Organization:
 > N/A
 > >Environment:
 > FreeBSD possessed 4.2-STABLE FreeBSD 4.2-STABLE #0: Thu Jan 11 09:54:23 PST 2001     root@possessed:/usr/src/sys/compile/POSSESSED  i386
 > 
 > >Description:
 > The -L option available in SSH package from /usr/ports/security/ssh allows
 > to pass a -P option to ssh when using scp command. This is helpful when doing
 > a secure copy from a network where a firewall doesn't permit outgoing connections 
 > on privileged ports. In ssh itself this option is supported as -P and the manpage
 > reads:      
 > 
 >      -P      Use a non-privileged port for outgoing connections.  This can be
 >              used if your firewall does not permit connections from privileged
 >              ports.  Note that this option turns off RhostsAuthentication and
 >              RhostsRSAAuthentication.
 > 
 > I have included a patch to /usr/src/crypto/openssh/scp.c dated Fri Feb  2.
 > 
 > Sincerely,
 > Alex.
 
 I don't think that this is a problem with FreeBSD's SSH per se.
 This is an issue you want to take up with the OpenSSH developers
 at www.OpenSSH.com (try sending mail to openssh@OpenSSH.com).
 However, they'll probably reply that scp can do this, albeit in
 a little bit more roundabout way:
 
 scp -o'PrivilegedPort no'
 
 ..does the trick for me.
 
 Anyway, I don't think that our OpenSSH maintainer would be too
 happy with making almost-gratuitious changes to software that is
 developed outside of the FreeBSD source tree.  Try talking to
 the folks at OpenSSH.com and tell us what they think about it.
 
 G'luck,
 Peter
 
 -- 
 What would this sentence be like if pi were 3?
 
State-Changed-From-To: open->feedback 
State-Changed-By: roam 
State-Changed-When: Fri Feb 2 14:50:47 PST 2001 
State-Changed-Why:  
Originator advised to talk to OpenSSH developers. 

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

From: "Alexei Rebrik" <doc_zero@hotmail.com>
To: roam@orbitel.bg
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/24807: scp(1) from OpenSSH package doesn't have a "-L" option
Date: Sat, 03 Feb 2001 15:33:21 -0800

 Heh - thanks :)
 
 I'll forward it to OpenSSH, doubdt they would like it though. I knew about 
 the -o but then again I'm working on a site where there are a lot of old 
 scriupts (bwueh!) that rely on the -L option. Thanks for your comments, for 
 now I am building a custom release anyway in which I plan to include my 
 patch to scp and a few other things and distribute it to the site here.
 
 Sincerely,
 Alex.
 _________________________________________________________________
 Get your FREE download of MSN Explorer at http://explorer.msn.com
 
 
State-Changed-From-To: feedback->closed 
State-Changed-By: roam 
State-Changed-When: Sun Feb 4 03:20:09 PST 2001 
State-Changed-Why:  
Originator agrees this is not a problem in the FreeBSD OpenSSH per se. 

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