diff -ruN wu-ftpd-2.6.0/config.h.in wu-ftpd-2.6.0-mysql/config.h.in
--- wu-ftpd-2.6.0/config.h.in	Sat Sep 18 23:26:10 1999
+++ wu-ftpd-2.6.0-mysql/config.h.in	Wed Nov 17 15:43:22 1999
@@ -331,3 +331,34 @@
  * Define this to support quota mechanisms...
  */
 #undef QUOTA
+
+
+/*
+ * MYSQL
+ */
+#define USE_MYSQL_AUTH
+#define USE_MYSQL_LOG
+
+/*  MySQL auth */
+#define PASS_MY_DB "mypassdb"
+#define PASS_MY_TABLE "mypasstable"
+#define PASS_MY_SERVER "localhost"
+#define PASS_MY_USER ""
+#define PASS_MY_PASS ""
+#define PASS_MY_SOCKET "/tmp/mysql.sock"
+#define PASS_MY_PORT 3306
+#define FIELD_USER "id"
+#define FIELD_PASS "crypt"
+#define FIELD_UID  "uid"
+#define FIELD_GID  "gid"
+#define FIELD_SHELL "shell"
+#define FIELD_HOME  "home"
+
+/*  MySQL log */
+#define LOG_MY_SERVER "localhost"
+#define LOG_MY_DB "ftp_logs"
+#define LOG_MY_TABLE "main_ip"
+#define LOG_MY_USER ""
+#define LOG_MY_PASS ""
+#define LOG_MY_SOCKET "/tmp/mysql.sock"
+#define LOG_MY_PORT 3306
diff -ruN wu-ftpd-2.6.0/config.h.noac wu-ftpd-2.6.0-mysql/config.h.noac
--- wu-ftpd-2.6.0/config.h.noac	Thu Oct 14 00:15:28 1999
+++ wu-ftpd-2.6.0-mysql/config.h.noac	Wed Nov 17 15:43:22 1999
@@ -378,3 +378,27 @@
  * CONSUMES ALL AVAILABLE MEMORY.
  */
 #undef SITE_NEWER
+
+/*  MySQL auth */
+#define PASS_MY_DB "mypassdb"
+#define PASS_MY_TABLE "mypasstable"
+#define PASS_MY_SERVER "localhost"
+#define PASS_MY_USER ""
+#define PASS_MY_PASS ""
+#define PASS_MY_SOCKET "/tmp/mysql.sock"
+#define PASS_MY_PORT 3306
+#define FIELD_USER "id"
+#define FIELD_PASS "crypt"
+#define FIELD_UID  "uid"
+#define FIELD_GID  "gid"
+#define FIELD_SHELL "shell"
+#define FIELD_HOME  "home"
+
+/*  MySQL log */
+#define LOG_MY_SERVER "localhost"
+#define LOG_MY_DB "ftp_logs"
+#define LOG_MY_TABLE "main_ip"
+#define LOG_MY_USER ""
+#define LOG_MY_PASS ""
+#define LOG_MY_SOCKET "/tmp/mysql.sock"
+#define LOG_MY_PORT 3306
diff -ruN wu-ftpd-2.6.0/src/Makefile.in wu-ftpd-2.6.0-mysql/src/Makefile.in
--- wu-ftpd-2.6.0/src/Makefile.in	Wed Sep 22 10:35:11 1999
+++ wu-ftpd-2.6.0-mysql/src/Makefile.in	Wed Nov 17 15:43:22 1999
@@ -27,6 +27,9 @@
 # Generic Makefile for autoconf'ed build
 #
 
+MYSQL_INCLUDE=-I/usr/include
+MYSQL_LIBS=/usr/lib/mysql/libmysqlclient.a -lm -lz -lcrypt -lnsl
+
 CC=@CC@
  
 #WNOERROR=-Werror
@@ -51,7 +54,7 @@
 	restrict.o domain.o wu_fnmatch.o timeout.o
 
 .c.o:
-	$(CC) $(CFLAGS) -I.. -I../support -c -o $@ $<
+	$(CC) $(CFLAGS) -I.. -I../support $(MYSQL_INCLUDE) -c -o $@ $<
 
 all: ftpd ftpcount ftpshut ftprestart ckconfig
 
@@ -74,7 +77,7 @@
 	$(CC) $(CFLAGS) -o $@ ${UTIL_OBJS} ckconfig.o rdservers.o -L../support $(LIBS)
 
 ftpd: ${OBJS}
-	$(CC) $(CFLAGS) -o $@ ${OBJS} -L../support $(LIBS)
+	$(CC) $(CFLAGS) -o $@ ${OBJS} -L../support $(LIBS) $(MYSQL_LIBS)
 
 vers.c: ftpcmd.c
 	sh newvers.sh
diff -ruN wu-ftpd-2.6.0/src/ftpd.c wu-ftpd-2.6.0-mysql/src/ftpd.c
--- wu-ftpd-2.6.0/src/ftpd.c	Thu Oct 14 23:41:47 1999
+++ wu-ftpd-2.6.0-mysql/src/ftpd.c	Wed Nov 17 15:52:10 1999
@@ -34,6 +34,9 @@
 #include <sys/socket.h>
 #include <sys/file.h>
 #include <sys/wait.h>
+#if defined(USE_MYSQL_AUTH) || defined(USE_MYSQL_LOG)
+#include <mysql/mysql.h>
+#endif
 
 #ifdef AIX
 #include <sys/id.h>
@@ -376,6 +379,31 @@
 int log_incoming_xfers = 0;
 char logfile[MAXPATHLEN];
 
+/* MySQL auth */
+#ifdef USE_MYSQL_AUTH
+char mypass_db[MAXPATHLEN];
+char mypass_table[MAXPATHLEN];
+char mypass_server[MAXPATHLEN];
+char mypass_user[MAXPATHLEN];
+char mypass_pass[MAXPATHLEN];
+int mypass_port;
+char mypass_sock[MAXPATHLEN];
+struct passwd *Mysql_Getpwnam(char *u);
+struct passwd my_dpw;
+#endif
+
+/* DB table logging */
+#ifdef USE_MYSQL_LOG
+MYSQL sql_server,*mysql=NULL;
+char mylog_db[MAXPATHLEN];
+char mylog_table[MAXPATHLEN];
+char mylog_server[MAXPATHLEN];
+char mylog_user[MAXPATHLEN];
+char mylog_pass[MAXPATHLEN];
+char mylog_sock[MAXPATHLEN];
+int mylog_port;
+#endif
+
 /* Allow use of lreply(); this is here since some older FTP clients don't
  * support continuation messages.  In violation of the RFCs... */
 int dolreplies = 1;
@@ -1037,6 +1065,48 @@
     route_vectored = routevector();
     conv_init();
 
+
+#ifdef USE_MYSQL_LOG
+	/* get default and global host's mysql log tables. */
+    sprintf(mylog_server,"%s",LOG_MY_SERVER);
+    sprintf(mylog_db,"%s",LOG_MY_DB);
+    sprintf(mylog_table,"%s",LOG_MY_TABLE);
+    sprintf(mylog_user,"%s",LOG_MY_USER);
+    sprintf(mylog_pass,"%s",LOG_MY_PASS);
+    sprintf(mylog_sock,"%s",LOG_MY_SOCKET);
+    mylog_port = LOG_MY_PORT;
+
+    entry = (struct aclmember *) NULL;
+    if (getaclentry("mylog_server", &entry) && ARG0 && (int)strlen(ARG0) > 0) {
+          strncpy(mylog_server,ARG0, sizeof(mylog_server));
+          if (ARG1 && (int)strlen(ARG1) > 0) {
+            if (isdigit(ARG1[0])) { mylog_port=atoi(ARG1); }
+          }
+          if (ARG2 && (int)strlen(ARG2) > 0)
+	    { strncpy(mylog_sock, ARG2, sizeof(mylog_sock)); }
+    }
+    entry = (struct aclmember *) NULL;
+    if (getaclentry("mylog_db", &entry) && ARG0 && (int)strlen(ARG0) > 0) {
+          strncpy(mylog_db,ARG0, sizeof(mylog_db));
+    }
+    entry = (struct aclmember *) NULL;
+    if (getaclentry("mylog_table", &entry) && ARG0 && (int)strlen(ARG0) > 0) {
+          strncpy(mylog_table,ARG0, sizeof(mylog_table));
+    }
+    entry = (struct aclmember *) NULL;
+    if (getaclentry("mylog_user", &entry) && ARG0 && (int)strlen(ARG0) > 0) {
+          strncpy(mylog_user,ARG0, sizeof(mylog_user));
+    }
+    entry = (struct aclmember *) NULL;
+    if (getaclentry("mylog_pass", &entry) && ARG0 && (int)strlen(ARG0) > 0) {
+          strncpy(mylog_pass,ARG0, sizeof(mylog_pass));
+    }
+
+    if (debug)
+      syslog(LOG_DAEMON,"mysql log: %s,%s,%s,%s,%s,%d,%s\n",mylog_server,mylog_db,mylog_table,mylog_user,mylog_pass,mylog_port,mylog_sock);
+#endif
+
+
 #ifdef MAIL_ADMIN
     incmails = 0;
     mailfrom = NULL;
@@ -1121,6 +1191,36 @@
 			    incmail[incmails++] = strdup(ARG2);
 		    }
 #endif
+
+#ifdef USE_MYSQL_LOG
+		    /* set virtual host's mysql log tables. */
+		    if (!strcasecmp(ARG1, "mylog_server"))
+		    {
+		      strncpy(mylog_server,ARG2, sizeof(mylog_server));
+                      if (ARG3) {
+                        if (isdigit(ARG3[0])) { mylog_port=atoi(ARG3); }
+                      }
+                      if (ARG4)
+                        { strncpy(mylog_sock, ARG4, sizeof(mylog_sock)); }
+		    }
+		    if (!strcasecmp(ARG1, "mylog_db")) {
+		      strncpy(mylog_db,ARG2,sizeof(mylog_db));
+		    }
+		    if (!strcasecmp(ARG1, "mylog_table")) {
+		      strncpy(mylog_table,ARG2, sizeof(mylog_table));
+		    }
+		    if (!strcasecmp(ARG1, "mylog_user"))
+		    {
+		      strncpy(mylog_user,ARG1, sizeof(mylog_user));
+		    }
+		    if (!strcasecmp(ARG1, "mylog_pass"))
+		    {
+		      strncpy(mylog_pass,ARG1, sizeof(mylog_pass));
+		    }
+		    if (debug)
+		      syslog(LOG_DAEMON,"mysql log (virtual): %s,%s,%s,%s,%s,%d,%s\n",mylog_server,mylog_db,mylog_table,mylog_user,mylog_pass,mylog_port,mylog_sock);
+#endif
+
 		}
 	    }
 	    if (!virtual_mode) {
@@ -1163,7 +1263,7 @@
     }
     lreply(220, "logfile == %s", logfile);
 #endif
-#endif
+#endif /* ifdef VIRTUAL */
 
     if (is_shutdown(1, 1) != 0) {
 	syslog(LOG_INFO, "connection refused (server shut down) from %s",
@@ -1189,6 +1289,44 @@
 
     show_banner(220);
 
+#ifdef USE_MYSQL_AUTH
+    sprintf(mypass_db,"%s",PASS_MY_DB);
+    sprintf(mypass_table,"%s",PASS_MY_TABLE);
+    sprintf(mypass_server,"%s",PASS_MY_SERVER);
+    sprintf(mypass_user,"%s",PASS_MY_USER);
+    sprintf(mypass_pass,"%s",PASS_MY_PASS);
+    sprintf(mypass_sock,"%s",PASS_MY_SOCKET);
+    mypass_port = PASS_MY_PORT;
+    entry = (struct aclmember *) NULL;
+    if (getaclentry("myauth_db", &entry) && ARG0 && (int)strlen(ARG0) > 0) {
+          strncpy(mypass_db,ARG0, sizeof(mypass_db));
+    }
+    entry = (struct aclmember *) NULL;
+    if (getaclentry("myauth_table", &entry) && ARG0 && (int)strlen(ARG0) > 0) {
+          strncpy(mypass_table,ARG0, sizeof(mypass_table));
+    }
+    entry = (struct aclmember *) NULL;
+    if (getaclentry("myauth_server", &entry) && ARG0 && (int)strlen(ARG0) > 0) {
+          strncpy(mypass_server,ARG0, sizeof(mypass_server));
+          if (ARG1 && (int)strlen(ARG1) > 0) {
+            if (isdigit(ARG1[0])) { mypass_port=atoi(ARG1); }
+          }
+          if (ARG2 && (int)strlen(ARG2) > 0)
+	    { strncpy(mypass_sock, ARG2, sizeof(mypass_sock)); }
+    }
+    entry = (struct aclmember *) NULL;
+    if (getaclentry("myauth_user", &entry) && ARG0 && (int)strlen(ARG0) > 0) {
+          strncpy(mypass_user,ARG0, sizeof(mypass_user));
+    }
+    entry = (struct aclmember *) NULL;
+    if (getaclentry("myauth_pass", &entry) && ARG0 && (int)strlen(ARG0) > 0) {
+          strncpy(mypass_pass,ARG0, sizeof(mypass_pass));
+    }
+
+    if (debug)
+      syslog(LOG_DAEMON,"mysql auth: %s,%s,%s,%s,%s,%d,%s\n",mypass_server,mypass_db,mypass_table,mypass_user,mypass_pass,mypass_port,mypass_sock);
+#endif
+
 #ifndef INTERNAL_LS
     entry = (struct aclmember *) NULL;
     if (getaclentry("lslong", &entry) && ARG0 && (int) strlen(ARG0) > 0) {
@@ -1476,6 +1614,10 @@
 {
     static struct passwd save;
     register struct passwd *p;
+#ifdef USE_MYSQL_AUTH
+    int flag_mysql;
+#endif /* USE_MYSQL_AUTH */
+
 #ifdef M_UNIX
     struct passwd *ret = (struct passwd *) NULL;
 #endif
@@ -1488,12 +1630,18 @@
     struct pr_passwd *pr;
 #endif
 
+
+#ifdef USE_MYSQL_AUTH
+    flag_mysql=0;
+#endif /* USE_MYSQL_AUTH */
+
 #ifdef KERBEROS
     init_krb();
     q = getauthuid(p->pw_uid);
     end_krb();
 #endif /* KERBEROS */
 
+
 #ifdef M_UNIX
 #if defined(SecureWare) || defined(HPUX_10_TRUSTED)
     if ((pr = getprpwnam(name)) == NULL)
@@ -1507,7 +1655,15 @@
 	return ((struct passwd *) pr);
 #endif /* SecureWare || HPUX_10_TRUSTED */
     if ((p = getpwnam(name)) == NULL)
+    {
+  #ifdef USE_MYSQL_AUTH
+      if ((p = Mysql_Getpwnam(name)) == NULL)
+  #endif
 	return (p);
+  #ifdef USE_MYSQL_AUTH
+      flag_mysql=1;
+  #endif /* USE_MYSQL_AUTH */
+    }
 #endif /* M_UNIX */
 
     if (save.pw_name)
@@ -1524,6 +1680,7 @@
     save = *p;
 
     save.pw_name = sgetsave(p->pw_name);
+    save.pw_uid = p->pw_uid;  save.pw_gid = p->pw_gid;
 
 #ifdef KERBEROS
     save.pw_passwd = sgetsave(q->a_password);
@@ -1535,6 +1692,11 @@
 #else
     save.pw_passwd = sgetsave(p->pw_passwd);
 #endif
+
+#ifdef USE_MYSQL_AUTH
+    if (flag_mysql!=1)
+      {
+#endif /* USE_MYSQL_AUTH */
 #ifdef SHADOW_PASSWORD
     if (p) {
 	struct spwd *spw;
@@ -1570,6 +1732,10 @@
 	endspent();
     }
 #endif
+#ifdef USE_MYSQL_AUTH
+      }
+#endif /* USE_MYSQL_AUTH */
+
     save.pw_gecos = sgetsave(p->pw_gecos);
     save.pw_dir = sgetsave(p->pw_dir);
     save.pw_shell = sgetsave(p->pw_shell);
@@ -2742,6 +2908,27 @@
 	}
     }
 
+#ifdef USE_MYSQL_LOG
+    if ((log_outbound_xfers || log_incoming_xfers)
+	&& strlen(mylog_table)>0)
+    { /* open sql link */
+      mysql_init(&sql_server);
+      if (!(mysql=(mysql_real_connect(&sql_server, mylog_server
+					  ,mylog_user,mylog_pass
+					  ,NULL,mylog_port
+					  ,mylog_sock,0) ) ) )
+	{
+	      syslog(LOG_ERR, "cannot connect to logging database : %s,%s,%s,%s,%d",mylog_server,mylog_db,mylog_user,mylog_sock,mylog_port);
+	} else {
+	      if (mysql_select_db(mysql,mylog_db)) {
+		syslog(LOG_ERR, "cannot select %s database", mylog_db);
+		mysql_close(mysql);
+		mysql=NULL;
+	      }
+	}
+    }
+#endif /* USE_MYSQL_LOG */
+
 #ifdef DEBUG
 /* I had a lot of trouble getting xferlog working, because of two factors:
    acl_setfunctions making stupid assumptions, and sprintf LOSING.  _H */
@@ -3185,6 +3372,12 @@
     /* Forget all about it... */
     if (xferlog)
 	close(xferlog);
+#ifdef USE_MYSQL_LOG
+    if (mysql) {
+      mysql_close(mysql);
+      mysql=NULL;
+    }
+#endif /* USE_MYSQL_LOG */
     xferlog = 0;
     end_login();
     return;
@@ -4190,6 +4383,44 @@
 	if (syslogmsg != 0)
 	    syslog(LOG_INFO, "xferlog (send): %s", msg + 25);
     }
+
+#ifdef USE_MYSQL_LOG
+    if (log_outbound_xfers && mysql && (cmd == 0)) {
+    	char query[2048];
+	size_t querylen;		/* for stupid_sprintf */
+        int xfertime = time(NULL) - start_time;
+        time_t curtime = time(NULL);
+        int loop;
+
+        if (!xfertime)
+            xfertime++;
+#ifdef XFERLOG_REALPATH 
+        wu_realpath((logname != NULL) ? logname : name, &namebuf[0], chroot_path);
+#else 
+        fb_realpath((logname != NULL) ? logname : name, &namebuf[0]);
+#endif 
+        for (loop = 0; namebuf[loop]; loop++)
+            if (isspace(namebuf[loop]) || iscntrl(namebuf[loop]))
+                namebuf[loop] = '_';
+
+	sprintf(query, "INSERT INTO %s (address,file,anon_passwd,transfer_type,login_type,time_stamp,xfertime,filesize,directions)",
+		mylog_table);
+	querylen = strlen(query);
+	snprintf(query+querylen, sizeof(query)-querylen,
+                 " VALUES ('%s','%s','%s','%c','%c',%ld,%ld,%ld,'o')",
+		 remotehost,
+		 namebuf,
+		 anonymous ? guestpw : pw->pw_name,
+		 (type == TYPE_A) ? 'a' : 'b',
+		 anonymous ? 'a' : (guest ? 'g' : 'r'),
+		 curtime,
+		 xfertime,
+		 byte_count
+            );
+        mysql_query(mysql,query);
+    }
+#endif /* USE_MYSQL_LOG */
+
     data = -1;
     pdata = -1;
   done:
@@ -4492,12 +4723,20 @@
     }
 #endif /* MAIL_ADMIN */
 
+#ifdef USE_MYSQL_LOG
+    if (log_incoming_xfers) {
+#else
     if (log_incoming_xfers && (xferlog || syslogmsg)) {
+#endif
 	char namebuf[MAXPATHLEN], msg[MAXPATHLEN + 2 * MAXHOSTNAMELEN + 100 + 128];	/* AUTHNAMESIZE is 100 */
 	size_t msglen;		/* for stupid_sprintf */
 	int xfertime = time(NULL) - start_time;
 	time_t curtime = time(NULL);
 	int loop;
+#ifdef USE_MYSQL_LOG
+	char query[2048];
+	size_t querylen;
+#endif
 
 	if (!xfertime)
 	    xfertime++;
@@ -4532,10 +4771,33 @@
 	/* Ensure msg always ends with '\n' */
 	if (strlen(msg) == sizeof(msg) - 1)
 	    msg[sizeof(msg) - 2] = '\n';
+#ifdef USE_MYSQL_LOG
+	if (xferlog || syslogmsg) {
+#endif
 	if (syslogmsg != 1)
 	    write(xferlog, msg, strlen(msg));
 	if (syslogmsg != 0)
 	    syslog(LOG_INFO, "xferlog (recv): %s", msg + 25);
+#ifdef USE_MYSQL_LOG
+	}
+	if (mysql) {
+	  sprintf(query, "INSERT INTO %s (address,file,anon_passwd,transfer_type,login_type,time_stamp,xfertime,filesize,directions)",
+              mylog_table);
+	  querylen = strlen(query);
+	  snprintf(query+querylen, sizeof(query)-querylen,
+                 " VALUES ('%s','%s','%s','%c','%c',%ld,%ld,%ld,'i')",
+               remotehost,
+               namebuf,
+               anonymous ? guestpw : pw->pw_name,
+               (type == TYPE_A) ? 'a' : 'b',
+               anonymous ? 'a' : (guest ? 'g' : 'r'),
+               curtime,
+               xfertime,
+               byte_count
+               );
+	  mysql_query(mysql,query);
+	}
+#endif /* USE_MYSQL_LOG */
     }
     data = -1;
     pdata = -1;
@@ -5946,6 +6208,11 @@
 	syslog(LOG_INFO, "FTP session closed");
     if (xferlog)
 	close(xferlog);
+#ifdef USE_MYSQL_LOG
+    if (mysql) {
+      mysql_close(mysql);
+    }
+#endif /* USE_MYSQL_LOG */
     acl_remove();
     close(data);		/* H* fix: clean up a little better */
     close(pdata);
@@ -7290,3 +7557,62 @@
     }
     *out = '\0';
 }
+
+/*  MySQL Authentication */
+#ifdef USE_MYSQL_AUTH
+char m_name[65],m_gecos[65],m_pass[33],m_shell[65],m_dir[256];
+
+struct passwd *Mysql_Getpwnam (char *name)
+{
+  MYSQL sql, *d_mysql=NULL;
+  MYSQL_RES *result;
+  MYSQL_ROW sql_row;
+  MYSQL_FIELD *field;
+  char query[2048], c;
+  int length, i, len;
+
+  mysql_init(&sql);
+  if (!(d_mysql=(mysql_real_connect(&sql,mypass_server
+				    ,mypass_user,mypass_pass
+				    ,NULL,mypass_port
+				    ,mypass_sock,0)))   )
+    {
+      syslog(LOG_ERR, "can't connect to SQL database.. Mysql_Getpwnam: %s %s %s %d %s"
+	     ,mypass_server,mypass_user,mypass_db,mypass_port,mypass_sock);
+      return(NULL);
+    }
+
+  if (mysql_select_db(d_mysql, mypass_db)) {
+      syslog(LOG_ERR, "can't select database: %s",mypass_db);
+      return(NULL);
+  }
+
+  snprintf(query,2047,"SELECT %s,%s,%s,%s,%s,%s FROM %s WHERE %s='%s' AND active=1 AND start_date<=CURDATE() AND expire_date>CURDATE()",
+	   FIELD_USER, FIELD_PASS, FIELD_UID, FIELD_GID, FIELD_HOME, FIELD_SHELL,
+	   mypass_table,
+	   FIELD_USER, name);
+
+  mysql_query(d_mysql,query);
+  result = mysql_store_result(&sql);
+
+  if (!result ) { mysql_free_result(result); return(NULL);}
+
+  if (mysql_num_rows(result) !=1 ) { mysql_free_result(result); return(NULL);}
+
+  sql_row = mysql_fetch_row(result);
+
+  snprintf(m_name,64,"%s",sql_row[0]);   snprintf(m_gecos,64,"%s",sql_row[0]);
+  snprintf(m_pass,32,"%s",sql_row[1]);
+  snprintf(m_dir,255,"%s",sql_row[4]);
+  snprintf(m_shell,64,"%s",sql_row[5]);
+
+  my_dpw.pw_name = m_name;  my_dpw.pw_gecos = m_gecos;
+  my_dpw.pw_passwd = m_pass;
+  my_dpw.pw_uid = atoi(sql_row[2]);   my_dpw.pw_gid = atoi(sql_row[3]);
+  my_dpw.pw_dir = m_dir;
+  my_dpw.pw_shell = m_shell;
+
+  mysql_close(d_mysql);
+  return(&my_dpw);
+}
+#endif
diff -ruN wu-ftpd-2.6.0/src/makefiles/common wu-ftpd-2.6.0-mysql/src/makefiles/common
--- wu-ftpd-2.6.0/src/makefiles/common	Sun Oct  3 21:51:35 1999
+++ wu-ftpd-2.6.0-mysql/src/makefiles/common	Wed Nov 17 15:43:22 1999
@@ -22,6 +22,8 @@
 # 
 # $Id: common,v 1.15 1999/10/03 12:51:35 wuftpd Exp $
 #
+MYSQL_INCLUDE=-I/usr/include
+MYSQL_LIBS=/usr/lib/mysql/libmysqlclient.a -lm -lz -lcrypt -lnsl -ldl
 
 UTIL_SRC  = COPYRIGHT.c vers.c
 UTIL_OBJS = COPYRIGHT.o vers.o
@@ -47,8 +49,11 @@
 ftprestart: ${UTIL_OBJS} ftprestart.o rdservers.o ../support/libsupport.a
 	${CC} ${LFLAGS} -o $@ ${UTIL_OBJS} ftprestart.o rdservers.o ${XLIBS}
 
+ftpd.o:	ftpd.c config.h conversions.h extensions.h pathnames.h ../config.h
+	${CC} ${CFLAGS} ${MYSQL_INCLUDE} -c ftpd.c
+	
 ftpd: ${OBJS} ${XOBJS} ../support/libsupport.a
-	${CC} ${LFLAGS} -o $@ ${OBJS} ${XOBJS} ${XLIBS}
+	${CC} ${LFLAGS} -o $@ ${OBJS} ${XOBJS} ${XLIBS} ${MYSQL_LIBS}
 
 ckconfig: ${UTIL_OBJS} ckconfig.o rdservers.o 
 	${CC} ${LFLAGS} -o $@ ${UTIL_OBJS} ckconfig.o rdservers.o ${XLIBS}
