Subject: Re: How to fix the name of the ftp server ?

From: [email-masked] (Ralf S. Engelschall)
Date: Sun, 1 Feb 1998 13:53:03 +0100 (MET)

Hello Daniel Clar, in a previous mail you wrote:

> My ftp server ftp.supelec.fr is an alias on my main internet server 
> supelec.supelec.fr. How can I manage so that people connecting to ftp.
> supelec.fr see this name instead of the true name ?

I use the appended patch to fix this canonical hostname problem by
using

virtual 192.76.162.40 root     /e/ftp/
virtual 192.76.162.40 banner   /e/ftp/etc/msgs/msg.banner
virtual 192.76.162.40 hostname ftp0.engelschall.com
virtual 192.76.162.43 root     /e/net.sw/ftp
virtual 192.76.162.43 banner   /e/net.sw/ftp/etc/msgs/msg.banner
virtual 192.76.162.43 hostname ftp0.netsw.org

in my ftpaccess. But you can also just use

    hostname foo.bar.com

in your ftpaccess which is also supported by the patch.

                                       Ralf S. Engelschall
                                       [email-masked]
                                       www.engelschall.com

*** wu-ftpd-2.4.2-beta-16.orig/src/ftpd.c	Mon Dec 22 00:25:06 1997
--- wu-ftpd-2.4.2-beta-16/src/tpd.c	Sun Feb  1 13:25:07 1998
***************
*** 743,748 ****
--- 743,756 ----
      access_init();
      authenticate();
      conv_init();
+ 
+ #ifdef HOSTNAME_COMMAND
+     entry = (struct aclmember *) NULL;
+     if (getaclentry("hostname", &entry) && !ARG0) {
+         strncpy(hostname, ARG0, sizeof(hostname));
+         hostname[sizeof(hostname)-1]='\0';
+     }
+ #endif
  #ifdef VIRTUAL
      virtual_len = sizeof(virtual_addr);
      if (getsockname(0, (struct sockaddr *) &virtual_addr, &virtual_len) == 0) {
***************
*** 770,775 ****
--- 778,789 ----
                      strncpy(virtual_banner, ARG2, MAXPATHLEN);
                      virtual_banner[MAXPATHLEN-1]='\0';
                  }
+ #ifdef HOSTNAME_COMMAND
+                 if(!strcmp(ARG1, "hostname")) {
+                     strncpy(hostname, ARG2, sizeof(hostname));
+                     hostname[sizeof(hostname)-1]='\0';
+                 }
+ #endif
                  if(!strcmp(ARG1, "logfile")) {
                      strncpy(logfile, ARG2, MAXPATHLEN);
                      logfile[MAXPATHLEN-1]='\0';