Subject: Fix to problem whereby dirs. created w/ different user/group than files.

From: Ethan Bradford <[email-masked]>
Date: Thu, 09 May 1996 13:29:04 -0700

In a previous message I complained that when directories are created
with mkdir, they don't get the owner and group that were specified in
the ftpaccess file.  This patch, which we have applied here and are
now testing, seems to fix that problem.

*** ftpd.c.orig	Thu May  9 11:41:42 1996
--- ftpd.c	Thu May  9 11:43:32 1996
***************
*** 2271,2276 ****
--- 2271,2288 ----
  	return;
      }
  
+     {   int oldid = geteuid();
+         int chown_status;
+         (void) seteuid((uid_t) 0);
+ 	chown_status = chown(name, uid, gid);
+         (void) seteuid(oldid);
+         if (chown_status < 0) {
+             perror_reply(550, "chown");
+             return;
+         }
+     }
+ 
+ 
      reply(257, "MKD command successful.");
  }