split ftpd out to etc source; fix bug with sendport stuff
authorSam Leffler <sam@ucbvax.Berkeley.EDU>
Thu, 12 May 1983 13:03:12 +0000 (05:03 -0800)
committerSam Leffler <sam@ucbvax.Berkeley.EDU>
Thu, 12 May 1983 13:03:12 +0000 (05:03 -0800)
SCCS-vsn: usr.bin/ftp/Makefile 4.4
SCCS-vsn: usr.bin/ftp/cmds.c 4.6
SCCS-vsn: usr.bin/ftp/ftp.c 4.8
SCCS-vsn: usr.bin/ftp/main.c 4.7

usr/src/usr.bin/ftp/Makefile
usr/src/usr.bin/ftp/cmds.c
usr/src/usr.bin/ftp/ftp.c
usr/src/usr.bin/ftp/main.c

index 1e32255..9c9cf5f 100644 (file)
@@ -1,6 +1,6 @@
 #      @(#)Makefile    4.4     %G%
 #
 #      @(#)Makefile    4.4     %G%
 #
-ALL=   ftp ftpd
+ALL=   ftp
 DESTDIR=
 CFLAGS=        -O
 
 DESTDIR=
 CFLAGS=        -O
 
@@ -9,22 +9,14 @@ all:  ${ALL}
 ftp:   cmds.o cmdtab.o ftp.o glob.o main.o
        ${CC} cmds.o cmdtab.o ftp.o glob.o main.o -o ftp -ljobs
 
 ftp:   cmds.o cmdtab.o ftp.o glob.o main.o
        ${CC} cmds.o cmdtab.o ftp.o glob.o main.o -o ftp -ljobs
 
-ftp.o: ftp.h ftp_var.h
-cmds.o:        ftp.h ftp_var.h
+ftp.o: /usr/include/arpa/ftp.h ftp_var.h
+cmds.o:        /usr/include/arpa/ftp.h ftp_var.h
 cmdtab.o: ftp_var.h
 ftp.o: ftp_var.h
 main.o: ftp_var.h
 
 cmdtab.o: ftp_var.h
 ftp.o: ftp_var.h
 main.o: ftp_var.h
 
-ftpd:  ftpd.o ftpcmd.o vers.o glob.o
-       ${CC} ftpd.o ftpcmd.o glob.o -o ftpd vers.o -ljobs
-
-vers.o:        ftpd.c ftpcmd.y
-       sh newvers.sh
-       ${CC} -c vers.c
-
 install:
        install -s ftp ${DESTDIR}/usr/ucb/ftp
 install:
        install -s ftp ${DESTDIR}/usr/ucb/ftp
-       install -s ftpd ${DESTDIR}/etc/ftpd
 
 clean:
 
 clean:
-       rm -f ${ALL} *.o *.s errs core a.out t.? yacc.* y.tab.c
+       rm -f ${ALL} *.o *.s errs core a.out t.?
index 3147d56..3c30790 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)cmds.c     4.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)cmds.c     4.6 (Berkeley) %G%";
 #endif
 
 /*
 #endif
 
 /*
@@ -8,13 +8,14 @@ static char sccsid[] = "@(#)cmds.c    4.5 (Berkeley) %G%";
 #include <sys/param.h>
 #include <sys/socket.h>
 
 #include <sys/param.h>
 #include <sys/socket.h>
 
+#include <arpa/ftp.h>
+
 #include <signal.h>
 #include <stdio.h>
 #include <errno.h>
 #include <netdb.h>
 #include <stat.h>
 
 #include <signal.h>
 #include <stdio.h>
 #include <errno.h>
 #include <netdb.h>
 #include <stat.h>
 
-#include "ftp.h"
 #include "ftp_var.h"
 
 extern char *globerr;
 #include "ftp_var.h"
 
 extern char *globerr;
index 85c9d4e..364b49b 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)ftp.c      4.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)ftp.c      4.8 (Berkeley) %G%";
 #endif
 
 #include <sys/param.h>
 #endif
 
 #include <sys/param.h>
@@ -8,6 +8,7 @@ static char sccsid[] = "@(#)ftp.c       4.7 (Berkeley) %G%";
 #include <sys/socket.h>
 
 #include <netinet/in.h>
 #include <sys/socket.h>
 
 #include <netinet/in.h>
+#include <arpa/ftp.h>
 
 #include <stdio.h>
 #include <signal.h>
 
 #include <stdio.h>
 #include <signal.h>
@@ -15,7 +16,6 @@ static char sccsid[] = "@(#)ftp.c     4.7 (Berkeley) %G%";
 #include <errno.h>
 #include <netdb.h>
 
 #include <errno.h>
 #include <netdb.h>
 
-#include "ftp.h"
 #include "ftp_var.h"
 
 struct sockaddr_in hisctladdr;
 #include "ftp_var.h"
 
 struct sockaddr_in hisctladdr;
@@ -487,6 +487,11 @@ noport:
                perror("ftp: socket");
                return (1);
        }
                perror("ftp: socket");
                return (1);
        }
+       if (!sendport)
+               if (setsockopt(data, SOL_SOCKET, SO_REUSEADDR, 0, 0) < 0) {
+                       perror("ftp: setsockopt (resuse address)");
+                       goto bad;
+               }
        if (bind(data, (char *)&data_addr, sizeof (data_addr), 0) < 0) {
                perror("ftp: bind");
                goto bad;
        if (bind(data, (char *)&data_addr, sizeof (data_addr), 0) < 0) {
                perror("ftp: bind");
                goto bad;
index 69aaf9d..554f45c 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)main.c     4.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c     4.7 (Berkeley) %G%";
 #endif
 
 /*
 #endif
 
 /*
@@ -9,6 +9,8 @@ static char sccsid[] = "@(#)main.c      4.6 (Berkeley) %G%";
 #include <sys/socket.h>
 #include <sys/ioctl.h>
 
 #include <sys/socket.h>
 #include <sys/ioctl.h>
 
+#include <arpa/ftp.h>
+
 #include <signal.h>
 #include <stdio.h>
 #include <errno.h>
 #include <signal.h>
 #include <stdio.h>
 #include <errno.h>
@@ -16,7 +18,6 @@ static char sccsid[] = "@(#)main.c    4.6 (Berkeley) %G%";
 #include <netdb.h>
 #include <pwd.h>
 
 #include <netdb.h>
 #include <pwd.h>
 
-#include "ftp.h"
 #include "ftp_var.h"
 
 int    intr();
 #include "ftp_var.h"
 
 int    intr();