Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Apr 2000 22:30:03 -0700 (PDT)
From:      "Eric D. Futch" <efutch@nyct.net>
To:        freebsd-bugs@FreeBSD.org
Subject:   RE: bin/18103: [PATCH] FTP_PASSIVE_MODE and libftpio
Message-ID:  <200004200530.WAA98895@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/18103; it has been noted by GNATS.

From: "Eric D. Futch" <efutch@nyct.net>
To: Mike Heffner <spock@techfour.net>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: RE: bin/18103: [PATCH] FTP_PASSIVE_MODE and libftpio
Date: Thu, 20 Apr 2000 01:22:37 -0400 (EDT)

 That looks better than my method.  I knew it could have been cleaned
 up.  Here's is a new version of the patch.  You can also find it at
 http://quake.nyct.net/~efutch/FreeBSD/ftpio.c.patch-2
 
 [snip here]
 Index: src/lib/libftpio/ftpio.c
 ===================================================================
 RCS file: /home/ncvs/src/lib/libftpio/ftpio.c,v
 retrieving revision 1.33
 diff -u -r1.33 ftpio.c
 --- src/lib/libftpio/ftpio.c    1999/09/28 13:33:13     1.33
 +++ src/lib/libftpio/ftpio.c    2000/04/20 05:19:15
 @@ -498,8 +498,12 @@
  static void
  check_passive(FILE *fp)
  {
 -    if (getenv("FTP_PASSIVE_MODE"))
 -       ftpPassive(fp, TRUE);
 +    char *cp;
 +    cp = getenv("FTP_PASSIVE_MODE");
 +    if (cp && strncasecmp(cp, "YES", 3)==0)
 +        ftpPassive(fp, TRUE);
 +    else
 +        ftpPassive(fp, FALSE);
  }
  
  static void
 [snip here]
 
 Thanks!
 
 --
 Eric Futch              New York Connect.Net, Ltd.
 efutch@nyct.net         Technical Support Staff
 http://www.nyct.net     (212) 293-2620
 "Bringing New York The Internet Access It Deserves"
 
 
 On Thu, 20 Apr 2000, Mike Heffner wrote:
 
 >
 >On 20-Apr-2000 efutch@nyct.net wrote:
 >  | Apply this patch.  Patch can also be found at:
 >  | http://quake.nyct.net/~efutch/FreeBSD/ftpio.c.patch
 >  | 
 >  | Index: src/lib/libftpio/ftpio.c
 >  | ===================================================================
 >  | RCS file: /home/ncvs/src/lib/libftpio/ftpio.c,v
 >  | retrieving revision 1.33
 >  | diff -u -r1.33 ftpio.c
 >  | --- src/lib/libftpio/ftpio.c    1999/09/28 13:33:13     1.33
 >  | +++ src/lib/libftpio/ftpio.c    2000/04/20 02:28:20
 >  | @@ -498,8 +498,13 @@
 >  |  static void
 >  |  check_passive(FILE *fp)
 >  |  {
 >  | -    if (getenv("FTP_PASSIVE_MODE"))
 >  | -       ftpPassive(fp, TRUE);
 >  | +    char *cp;
 >  | +    cp = getenv("FTP_PASSIVE_MODE");
 >  | +    printf("debug: cp(%s)",cp);
 >  | +    if (!cp || (cp && (strncmp(cp,"NO",2)==0)))
 >  | +        ftpPassive(fp, FALSE);
 >  | +    if (cp && (strncmp(cp,"YES",3)==0))
 >  | +        ftpPassive(fp, TRUE);
 >  |  }
 >  |  
 > 
 >Maybe it should do the comparison without depending on the string case?
 >
 >How about this:
 >
 >{
 >        char *cp;
 >        cp = getenv("FTP_PASSIVE_MODE");
 >        if (cp && strncasecmp(cp, "YES", 3)==0)
 >                ftpPassive(fp, TRUE);
 >        else
 >                ftpPassive(fp, FALSE);
 >}
 >
 >
 >/****************************************
 > * Mike Heffner <spock@techfour.net>    *
 > * Fredericksburg, VA      ICQ# 882073  *
 > * Sent at: 20-Apr-2000 -- 00:37:28 EST *
 > * http://my.ispchannel.com/~mheffner   *
 > ****************************************/
 >
 
 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200004200530.WAA98895>