Date: Wed, 19 Apr 2000 22:32:13 -0400 (EDT) From: "Eric D. Futch" <efutch@nyct.net> To: Ross A Lippert <ripper@plato.nmia.com> Cc: sean@stat.Duke.EDU, freebsd-mobile@FreeBSD.ORG Subject: Re: ftp passive? Message-ID: <Pine.BSF.4.21.0004192230330.60586-100000@bsd1.nyct.net> In-Reply-To: <m12i08P-0011c0C@plato.nmia.com>
next in thread | previous in thread | raw e-mail | index | archive | help
I was just digging around in the libftpio source code. It does only check to see if the FTP_PASSIVE_MODE environment variable is defined at all. I made this small patch to it that I think makes enough sense almost to have it comitted. With this patch it makes libftpio also understand the YES or NO value of FTP_PASSIVE_MODE. It's a diff against src/lib/libftpio.c rev 1.33 from 4.0-STABLE. Check out this patch and let me know if it works for you. The if statements could probably be cleaned up a little :), but it works. [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 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); } static void [snip here] -- 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 Wed, 19 Apr 2000, Ross A Lippert wrote: > >So, here is something that might be a bug. I set FTP_PASSIVE_MODE="NO" >and low and behold, ftp started working again. I thought I could >make use of ports now but nooooo. The problem now is in fetch. The >funny thing about fetch is that while ftp will be active when >FTP_PASSIVE_MODE='NO', fetch will go into passive mode if FTP_PASSIVE_MODE >is set at all. In order to make any ports, one must unsetenv >FTP_PASSIVE_MODE-- setting it to 'NO' is not enough. > >If that don't beat all. > > >-r > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0004192230330.60586-100000>