This is a patch that adds the configuration directive ftp_user. this directive can be used to change the email address used for anonymous ftp. Note that perl.com requires that the email address can be validated using SMTP VRFY (i.e. it has to be a valid email address) The patch is as always available on my web page http://www.his.se/ida/~squid/ /Henrik # If you want the anonymous login password to be more informative # (and enable the use of picky ftp servers), set this to something # resonable for your domain, like wwwuser@somewhere.net # # The reason why this is domainless by default is that the # request can be made on the behalf of a user in any domain. # depending on how the cache is used. # Some ftp server also validate that the email adress is valid # (for example perl.com). # # ftp_user Harvest@ diff -u -r -x *.o -x *.orig -X exclude_files squid-1.0.alpha5/src/cache_cf.c squid-1.0.alpha5.henrik/src/cache_cf.c --- squid-1.0.alpha5/src/cache_cf.c Fri Mar 29 22:14:32 1996 +++ squid-1.0.alpha5.henrik/src/cache_cf.c Thu Apr 4 02:23:28 1996 @@ -63,6 +63,7 @@ char *debugOptions; char *pidFilename; char *visibleHostname; + char *ftpUser; } Config; #define DefaultMemMaxSize (16 << 20) /* 16 MB */ @@ -121,6 +122,7 @@ #define DefaultSingleParentBypass 0 /* default off */ #define DefaultPidFilename (char *)NULL /* default NONE */ #define DefaultVisibleHostname (char *)NULL /* default NONE */ +#define DefaultFtpUser "Harvest@" /* Default withour domain */ extern char *config_file; @@ -968,6 +970,17 @@ Config.visibleHostname = xstrdup(token); } +static void parseFtpUserLine(line_in) + char *line_in; +{ + char *token; + token = strtok(NULL, w_space); + safe_free(Config.ftpUser); + if (token == (char *) NULL) + self_destruct(line_in); + Config.ftpUser = xstrdup(token); +} + int parseConfigFile(file_name) char *file_name; { @@ -1226,6 +1239,9 @@ else if (!strcmp(token, "visible_hostname")) parseVisibleHostnameLine(line_in); + else if (!strcmp(token, "ftp_user")) + parseFtpUserLine(line_in); + /* If unknown, treat as a comment line */ else { /* EMPTY */ ; @@ -1461,6 +1477,10 @@ { return Config.visibleHostname; } +char *getFtpUser() +{ + return Config.ftpUser; +} int setAsciiPortNum(p) int p; @@ -1542,6 +1562,7 @@ Config.Accel.withProxy = DefaultAccelWithProxy; Config.pidFilename = safe_xstrdup(DefaultPidFilename); Config.visibleHostname = safe_xstrdup(DefaultVisibleHostname); + Config.ftpUser = safe_xstrdup(DefaultFtpUser); } static void configDoConfigure() diff -u -r -x *.o -x *.orig -X exclude_files squid-1.0.alpha5/src/cache_cf.h squid-1.0.alpha5.henrik/src/cache_cf.h --- squid-1.0.alpha5/src/cache_cf.h Fri Mar 29 22:14:37 1996 +++ squid-1.0.alpha5.henrik/src/cache_cf.h Thu Apr 4 02:19:14 1996 @@ -50,6 +50,7 @@ extern char *getWaisRelayHost _PARAMS((void)); extern char *getPidFilename _PARAMS((void)); extern char *getVisibleHostname _PARAMS((void)); +extern char *getFtpUser _PARAMS((void)); extern double getCacheHotVmFactor _PARAMS((void)); extern int getAccelWithProxy _PARAMS((void)); extern int getAsciiPortNum _PARAMS((void)); diff -u -r -x *.o -x *.orig -X exclude_files squid-1.0.alpha5/src/cached.conf squid-1.0.alpha5.henrik/src/cached.conf --- squid-1.0.alpha5/src/cached.conf Fri Mar 29 22:14:51 1996 +++ squid-1.0.alpha5.henrik/src/cached.conf Thu Apr 4 03:19:43 1996 @@ -709,3 +709,15 @@ #debug_options #pid_filename #visible_hostname + +# If you want the anonymous login password to be more informative +# (and enable the use of picky ftp servers), set this to something +# resonable for your domain, like wwwuser@somewhere.net +# +# The reason why this is domainless by default is that the +# request can be made on the behalf of a user in any domain. +# depending on how the cache is used. +# Some ftp server also validate that the email adress is valid +# (for example perl.com). +# +#ftp_user Harvest@ diff -u -r -x *.o -x *.orig -X exclude_files squid-1.0.alpha5/src/ftp.c squid-1.0.alpha5.henrik/src/ftp.c --- squid-1.0.alpha5/src/ftp.c Tue Apr 2 02:51:53 1996 +++ squid-1.0.alpha5.henrik/src/ftp.c Thu Apr 4 02:39:06 1996 @@ -84,7 +84,7 @@ if (t < 3) { strcpy(host, user); /* no login/passwd information */ strcpy(user, "anonymous"); - strcpy(password, "harvest@"); + strcpy(password, getFtpUser()); } /* we need to convert user and password for URL encodings */ tmp = url_convert_hex(user);