Re: wget & FTP_PASSIVE_MODE

2003-10-22 Thread Martin Johnson
On Mon, 2003-10-20 at 14:08, Dražen Kačar wrote:
> Martin Johnson wrote:
> > Hrvoje Niksic wrote:
> 
> > >> 1. Perhaps wget should obey the setting of environment variable
> > >> FTP_PASSIVE_MODE ("NO" or "YES")?
> > 
> > > Do other programs obey that variable?  Are its semantics defined
> > > somewhere?
> > 
> > Yes, FreeBSD's "fetch" command uses that, probably via "libftpio".  I think
> > the semantics are that "FTP_PASSIVE_MODE=No" (upper or lower case No) turns
> 
> Just "no" or whatever is returned by nl_langinfo(NOEXPR)? Or both?

Just "no"; although "both" would probably be more sensible!

The actual code on FreeBSD systems is in /usr/src/lib/libfetch/ftp.c :

int pasv;
...
pasv = CHECK_FLAG('p');
...
if (!pasv)
pasv = ((s = getenv("FTP_PASSIVE_MODE")) != NULL &&
strncasecmp(s, "no", 2) != 0);

There's a similar test in /usr/src/lib/libftpio/ftpio.c.

The nice thing about this environment variable is that you can set it
once in ".profile" or wherever, and then all your FTP downloads work OK
through the firewall :-)

With all best wishes,

-- 
Martin Johnson <[EMAIL PROTECTED]>



Re: wget & FTP_PASSIVE_MODE

2003-10-20 Thread Dražen Kačar
Martin Johnson wrote:
> Hrvoje Niksic wrote:

> >> 1. Perhaps wget should obey the setting of environment variable
> >> FTP_PASSIVE_MODE ("NO" or "YES")?
> 
> > Do other programs obey that variable?  Are its semantics defined
> > somewhere?
> 
> Yes, FreeBSD's "fetch" command uses that, probably via "libftpio".  I think
> the semantics are that "FTP_PASSIVE_MODE=No" (upper or lower case No) turns

Just "no" or whatever is returned by nl_langinfo(NOEXPR)? Or both?

-- 
 .-.   .-.Yes, I am an agent of Satan, but my duties are largely
(_  \ /  _)   ceremonial.
 |
 |[EMAIL PROTECTED]


Re: wget & FTP_PASSIVE_MODE

2003-10-20 Thread Martin Johnson
Hrvoje Niksic wrote:

>> Martin Johnson <[EMAIL PROTECTED]> writes:
>>
>> 2. Perhaps wget should implement:
>> --passive-ftp=on
>> --passive-ftp=off
>> as well as plain "--passive-ftp" (same as "-passive-ftp=on")
>
> This is not entirely obvious (to put it mildly), but you can always
> use `-e passive_ftp=off'.

Thanks!


>> 1. Perhaps wget should obey the setting of environment variable
>> FTP_PASSIVE_MODE (="NO" or "YES")?

> Do other programs obey that variable?  Are its semantics defined
> somewhere?

Yes, FreeBSD's "fetch" command uses that, probably via "libftpio".  I think
the semantics are that "FTP_PASSIVE_MODE=No" (upper or lower case No) turns
Passive Mode Off, while any other values turn Passive Mode On (but I can't
check the source code while I'm at work!).

FreeBSD's Ports use "fetch" to downloading source files;  but I think "wget"
is nicer.  Switching from "fetch" to "wget" is easy: you just change a
makefile include :-)


Many thanks!

- Martin.


Message sent using UebiMiau 2.7.2



Re: wget & FTP_PASSIVE_MODE

2003-10-20 Thread Hrvoje Niksic
Martin Johnson <[EMAIL PROTECTED]> writes:

> 2. Perhaps wget should implement:
>--passive-ftp=on
>--passive-ftp=off
> as well as plain "--passive-ftp" (same as "-passive-ftp=on")

This is not entirely obvious (to put it mildly), but you can always
use `-e passive_ftp=off'.

> 1. Perhaps wget should obey the setting of environment variable
> FTP_PASSIVE_MODE (="NO" or "YES")?

Do other programs obey that variable?  Are its semantics defined
somewhere?


wget & FTP_PASSIVE_MODE

2003-10-20 Thread Martin Johnson
Hi,

I had a little trouble turning off Passive FTP under FreeBSD 4.8. Fixed
OK by creating /usr/local/etc/wgetrc after looking at the source
code but here are two small ideas to make things easier:

1. Perhaps wget should obey the setting of environment variable
FTP_PASSIVE_MODE (="NO" or "YES")?

2. Perhaps wget should implement:
   --passive-ftp=on
   --passive-ftp=off
as well as plain "--passive-ftp" (same as "-passive-ftp=on")


Many thanks!

-- 
Martin Johnson <[EMAIL PROTECTED]>