Subject: Stupid newbie questions

From: "Jim Bacon" <[email-masked]>
Date: Fri, 27 Sep 1996 14:29:33 -0500

I have just compiled (without apparent errors) wu-ftpd 2.4.2-beta.11 on a
Solaris 2.4 P90 with -DVIRTUAL in the Makefiles.  I have place entries in
ftpaccess for a test site.

When I ftp to the test site, I still get login'ed and banners as if on the
primary machine.

Am I missing something?

Too, where are the archives (searchable if possible) for this mailing list
so i can avoid most of these Stupid Newbie Questions?

(Seems strange to call myself a newbie, just haven't had a call for virtual
FTP before).

-- 
Jim Bacon (JB211), System Administrator                   [email-masked]
Turning Point Information Services, Inc.          finger for PGP public key
Operations: (512) 404-5739              "Only the good die young, I'm gonna
Sales: (512) 404-5713                       live to be a 100!" -- Anonymous

---

From: [email-masked] (Bob Myers)
Date: Fri, 27 Sep 1996 12:59:41 -0700

On Sep 27, 14:29, "Jim Bacon" wrote:
} Subject: Stupid newbie questions
> When I ftp to the test site, I still get login'ed and banners as if on the

Banners have a special "virtual" command in the ftpaccess file 
for each virtual host. For example:

> virtual 204.182.162.46 banner /opt/ftpd/bobtest.intelenet.net/banner

As far as login comments and error messages, etc., I have a patch! :-)

I added a new "virtual" command to set the hostname, so that you
can say:

> virtual 204.182.162.46 hostname bobtest.intelenet.net

in the ftpaccess file and the login prompts, etc. would use the 
hostname listed. 

*** ftpd.c.~1~	Sun Apr 14 22:51:11 1996
--- ftpd.c	Wed Aug  7 23:26:22 1996
***************
*** 216,221 ****
--- 216,222 ----
  char virtual_root[MAXPATHLEN];
  char virtual_banner[MAXPATHLEN];
  char virtual_logfile[MAXPATHLEN];
+ char virtual_hostname[MAXHOSTNAMELEN];
  #endif
  
  int data;
***************
*** 667,672 ****
--- 668,675 ----
             strncpy(virtual_banner, ARG2, MAXPATHLEN);
           if(!strcmp(ARG1, "logfile")) 
             strncpy(virtual_logfile, ARG2, MAXPATHLEN);
+ 	 if(!strcmp(ARG1, "hostname"))
+ 	   strncpy(virtual_hostname, ARG2, MAXHOSTNAMELEN);
         }
        }
      }
***************
*** 675,680 ****
--- 678,689 ----
      if (is_shutdown(1) != 0) {
          syslog(LOG_INFO, "connection refused (server shut down) from %s [%s]",
                 remotehost, remoteaddr);
+ #ifdef VIRTUAL
+ 	if (virtual_mode)
+ 	  reply(500, "%s FTP server shut down -- please try again later.",
+ 		virtual_hostname);
+ 	else
+ #endif
          reply(500, "%s FTP server shut down -- please try again later.",
                hostname);
          exit(0);
***************
*** 726,732 ****
--- 735,747 ----
      }
      strcat(ls_short," %s");
  
+ #ifdef VIRTUAL
+     if(virtual_mode)
+       reply(220, "%s FTP server (%s) ready.", virtual_hostname, version);
+     else
+ #endif
      reply(220, "%s FTP server (%s) ready.", hostname, version);
+ 
      (void) setjmp(errcatch);
  
      for (;;)
***************
*** 1430,1441 ****
      if (anonymous || guest) {
          /* We MUST do a chdir() after the chroot. Otherwise the old current
           * directory will be accessible as "." outside the new root! */
  #ifdef VIRTUAL
!       if (virtual_mode) {
!         strcpy(pw->pw_dir, virtual_root);
!       }
  #endif 
-         if (anonymous) {
              if (chroot(pw->pw_dir) < 0 || chdir("/") < 0) {
                  reply(550, "Can't set guest privileges.");
                  goto bad;
--- 1445,1456 ----
      if (anonymous || guest) {
          /* We MUST do a chdir() after the chroot. Otherwise the old current
           * directory will be accessible as "." outside the new root! */
+         if (anonymous) {
  #ifdef VIRTUAL
! 	    if (virtual_mode) {
! 	        strcpy(pw->pw_dir, virtual_root);
! 	    }
  #endif 
              if (chroot(pw->pw_dir) < 0 || chdir("/") < 0) {
                  reply(550, "Can't set guest privileges.");
                  goto bad;
***************
*** 2460,2465 ****
--- 2475,2485 ----
      u_char *a,
       *p;
  
+ #ifdef VIRTUAL
+     if(virtual_mode)
+       lreply(211, "%s FTP server status:", virtual_hostname);
+     else
+ #endif
      lreply(211, "%s FTP server status:", hostname);
      printf("     %s\r\n", version);
      printf("     Connected to %s", remotehost);

-- 
Bob Myers                              InteleNet Communications, Inc.
Email: [email-masked]               30 Executive Park, Suite 150
Phone: 714-851-8250 x227               Irvine, CA 92614
Fax:   714-851-1088                    http://www.intelenet.net/

---

From: "Jim Bacon" <[email-masked]>
Date: Fri, 27 Sep 1996 16:59:17 -0500

Bingo!  Didn't see that in the docs.  Must have been wearing my blinders.

Thanks Paul!

----------
> From: [email-masked]
> To: [email-masked]
> Subject: Re: Stupid newbie questions
> Date: Friday, September 27, 1996 6:17 PM
> 
> Hi There
> 
> Make sure you have wu-ftd -a in your inetd.conf file. sounds obvious 
> but I had that problem once !
> 
> Paul
>