%n NetKit-B %v 0.08 %c * %l * %b * %d * %f * %t NetKit-B-0.08.tgz %w Linux %% %setup patch -u -p1 <<'ENDPATCH' diff -ru2N NetKit-B-0.08/MCONFIG NetKit-B-MCC/MCONFIG --- NetKit-B-0.08/MCONFIG Fri Aug 23 01:50:39 1996 +++ NetKit-B-MCC/MCONFIG Sat Aug 31 19:35:54 1996 @@ -71,6 +71,6 @@ CC=gcc -CFLAGS=-O2 $(WARNINGS) -D__USE_BSD_SIGNAL -LDFLAGS= +CFLAGS=-O6 -fomit-frame-pointer $(WARNINGS) -D__USE_BSD_SIGNAL +LDFLAGS=-Wl,-warn-common LIBS= # You could also use "YACC=yacc", if you have BSD yacc. diff -ru2N NetKit-B-0.08/Makefile NetKit-B-MCC/Makefile --- NetKit-B-0.08/Makefile Fri Aug 23 01:50:58 1996 +++ NetKit-B-MCC/Makefile Sat Aug 31 19:56:29 1996 @@ -2,8 +2,6 @@ # You can also run make directly in the subdirs. -SUB = biff comsat finger fingerd ftp inetd \ - ping rcp rexecd rlogin rlogind rpcgen \ - rpc.rusersd rpc.rwalld rpcinfo rsh rshd rusers rwall rwho rwhod \ - slattach talk talkd telnet telnetd tftp tftpd timed +SUB = finger fingerd ftp ftpd fingerd inetd ping rcp rexecd rlogin \ + rlogind rpcgen rpcinfo rsh rshd slattach talk talkd telnet telnetd # These subdirs are not buildable - don't enable them: diff -ru2N NetKit-B-0.08/ftp/ftp_var.h NetKit-B-MCC/ftp/ftp_var.h --- NetKit-B-0.08/ftp/ftp_var.h Thu Aug 15 00:27:40 1996 +++ NetKit-B-MCC/ftp/ftp_var.h Sat Aug 31 19:39:47 1996 @@ -50,5 +50,5 @@ #define Extern extern #endif - +#define trace ftp_trace /* diff -ru2N NetKit-B-0.08/ftp/glob.c NetKit-B-MCC/ftp/glob.c --- NetKit-B-0.08/ftp/glob.c Thu Aug 15 00:27:40 1996 +++ NetKit-B-MCC/ftp/glob.c Sat Aug 31 22:39:55 1996 @@ -90,5 +90,5 @@ static char *strspl(const char *, const char *); static char *strend(char *); -static char **copyblk(entry *); +char **copyblk(entry *); static char **cloneblk(const centry *); @@ -678,5 +678,4 @@ } -static char ** copyblk(entry *v) diff -ru2N NetKit-B-0.08/ftpd/Makefile NetKit-B-MCC/ftpd/Makefile --- NetKit-B-0.08/ftpd/Makefile Fri Aug 23 00:57:03 1996 +++ NetKit-B-MCC/ftpd/Makefile Sat Aug 31 22:21:34 1996 @@ -1,4 +1,3 @@ -all: - @echo "Please don't use this program." +all: ftpd include ../MCONFIG @@ -7,5 +6,4 @@ # comment this out, if you don't have shadow passwords on your system # This will affect the compilation of the subdirs: ftpd -HAVE_SHADOW_PASSWORDS=true ifdef HAVE_SHADOW_PASSWORDS @@ -14,5 +12,5 @@ endif -CFLAGS += -include ftphack.h -DSETPROCTITLE -I../ftp +CFLAGS += -DSETPROCTITLE -I../ftp -I/usr/include/bsd YACC = bison -y diff -ru2N NetKit-B-0.08/ftpd/ftpcmd.y NetKit-B-MCC/ftpd/ftpcmd.y --- NetKit-B-0.08/ftpd/ftpcmd.y Sun Jul 14 21:24:37 1996 +++ NetKit-B-MCC/ftpd/ftpcmd.y Sat Aug 31 22:17:55 1996 @@ -46,4 +46,6 @@ #endif /* not lint */ +#include +#include #include #include @@ -62,4 +64,5 @@ #include #include +#include "ftphack.h" extern struct sockaddr_in data_dest; @@ -215,21 +218,21 @@ | RETR check_login SP pathname CRLF = { - if ($2 && $4 != NULL) + if ($2 && $4 != 0) retrieve((char *) 0, (char *) $4); - if ($4 != NULL) + if ($4 != 0) free((char *) $4); } | STOR check_login SP pathname CRLF = { - if ($2 && $4 != NULL) + if ($2 && $4 != 0) _store((char *) $4, "w", 0); - if ($4 != NULL) + if ($4 != 0) free((char *) $4); } | APPE check_login SP pathname CRLF = { - if ($2 && $4 != NULL) + if ($2 && $4 != 0) _store((char *) $4, "a", 0); - if ($4 != NULL) + if ($4 != 0) free((char *) $4); } @@ -241,7 +244,7 @@ | NLST check_login SP STRING CRLF = { - if ($2 && $4 != NULL) + if ($2 && $4 != 0) send_file_list((char *) $4); - if ($4 != NULL) + if ($4 != 0) free((char *) $4); } @@ -253,14 +256,14 @@ | LIST check_login SP pathname CRLF = { - if ($2 && $4 != NULL) + if ($2 && $4 != 0) retrieve("/bin/ls -lgA %s", (char *) $4); - if ($4 != NULL) + if ($4 != 0) free((char *) $4); } | STAT check_login SP pathname CRLF = { - if ($2 && $4 != NULL) + if ($2 && $4 != 0) statfilecmd((char *) $4); - if ($4 != NULL) + if ($4 != 0) free((char *) $4); } @@ -271,7 +274,7 @@ | DELE check_login SP pathname CRLF = { - if ($2 && $4 != NULL) + if ($2 && $4 != 0) _delete((char *) $4); - if ($4 != NULL) + if ($4 != 0) free((char *) $4); } @@ -298,7 +301,7 @@ | CWD check_login SP pathname CRLF = { - if ($2 && $4 != NULL) + if ($2 && $4 != 0) cwd((char *) $4); - if ($4 != NULL) + if ($4 != 0) free((char *) $4); } @@ -328,14 +331,14 @@ | MKD check_login SP pathname CRLF = { - if ($2 && $4 != NULL) + if ($2 && $4 != 0) makedir((char *) $4); - if ($4 != NULL) + if ($4 != 0) free((char *) $4); } | RMD check_login SP pathname CRLF = { - if ($2 && $4 != NULL) + if ($2 && $4 != 0) removedir((char *) $4); - if ($4 != NULL) + if ($4 != 0) free((char *) $4); } @@ -385,5 +388,5 @@ | SITE SP CHMOD check_login SP octal_number SP pathname CRLF = { - if ($4 && ($8 != NULL)) { + if ($4 && ($8 != 0)) { if ($6 > 0777) reply(501, @@ -394,5 +397,5 @@ reply(200, "CHMOD command successful."); } - if ($8 != NULL) + if ($8 != 0) free((char *) $8); } @@ -419,7 +422,7 @@ | STOU check_login SP pathname CRLF = { - if ($2 && $4 != NULL) + if ($2 && $4 != 0) _store((char *) $4, "w", 1); - if ($4 != NULL) + if ($4 != 0) free((char *) $4); } @@ -447,7 +450,7 @@ | SIZE check_login SP pathname CRLF = { - if ($2 && $4 != NULL) + if ($2 && $4 != 0) sizecmd((char *) $4); - if ($4 != NULL) + if ($4 != 0) free((char *) $4); } @@ -464,8 +467,8 @@ | MDTM check_login SP pathname CRLF = { - if ($2 && $4 != NULL) { + if ($2 && $4 != 0) { struct stat stbuf; if (stat((char *) $4, &stbuf) < 0) - perror_reply(550, "%s", (char *) $4); + perror_reply(550, (char *) $4); else if ((stbuf.st_mode&S_IFMT) != S_IFREG) { reply(550, "%s: not a plain file.", @@ -473,5 +476,4 @@ } else { register struct tm *t; - struct tm *gmtime(); t = gmtime(&stbuf.st_mtime); reply(213, @@ -481,5 +483,5 @@ } } - if ($4 != NULL) + if ($4 != 0) free((char *) $4); } @@ -496,5 +498,4 @@ rcmd: RNFR check_login SP pathname CRLF = { - char *renamefrom(); restart_point = (off_t) 0; @@ -508,6 +509,4 @@ | REST SP byte_size CRLF = { - long atol(); - fromname = (char *) 0; restart_point = $3; @@ -638,5 +637,5 @@ if (globerr != NULL) { reply(550, globerr); - $$ = NULL; + $$ = 0; } free((char *) $1); @@ -699,12 +698,4 @@ #define NSTR 8 /* Number followed by a string */ -struct tab { - char *name; - short token; - short state; - short implemented; /* 1 if command is implemented */ - char *help; -}; - struct tab cmdtab[] = { /* In order defined in RFC 765 */ { "USER", USER, STR1, 1, " username" }, @@ -767,7 +758,5 @@ struct tab * -lookup(p, cmd) - register struct tab *p; - char *cmd; +lookup(register struct tab *p, char *cmd) { @@ -784,7 +773,5 @@ */ char * -getline(s, n, iop) - char *s; - register FILE *iop; +getline(char *s, int n, register FILE *iop) { register c; @@ -843,5 +830,5 @@ static void -toolong() +toolong(void) { time_t now; @@ -858,5 +845,5 @@ } -yylex() +int yylex(void) { static int cpos, state; @@ -864,5 +851,5 @@ register struct tab *p; int n; - char c, *copy(); + char c; for (;;) { @@ -1075,6 +1062,5 @@ } -upper(s) - register char *s; +void upper(register char *s) { while (*s != '\0') { @@ -1086,6 +1072,5 @@ char * -copy(s) - char *s; +copy(char *s) { char *p; @@ -1098,7 +1083,5 @@ } -help(ctab, s) - struct tab *ctab; - char *s; +void help(struct tab *ctab, char *s) { register struct tab *c; @@ -1162,6 +1145,5 @@ } -sizecmd(filename) -char *filename; +void sizecmd(char *filename) { switch (type) { diff -ru2N NetKit-B-0.08/ftpd/ftpd.c NetKit-B-MCC/ftpd/ftpd.c --- NetKit-B-0.08/ftpd/ftpd.c Sat Jul 20 20:51:48 1996 +++ NetKit-B-MCC/ftpd/ftpd.c Sat Aug 31 22:37:55 1996 @@ -46,4 +46,8 @@ * FTP server. */ +#include +#include +#undef __USE_BSD_SIGNAL +#include #include #include @@ -74,5 +78,5 @@ #include #include -#include +#include #include #include @@ -86,16 +90,7 @@ */ #include "pathnames.h" +#include "ftphack.h" -static int dolog(struct sockaddr_in *sin); -static void fatal(const char *s); - -extern int errno; -extern char version[]; -extern char *home; /* pointer to home directory for glob */ -extern FILE *ftpd_popen(), *fopen(), *freopen(); -extern int ftpd_pclose(), fclose(); -extern char *getline(); -extern char cbuf[]; -extern off_t restart_point; +static void dolog(struct sockaddr_in *sin); struct sockaddr_in ctrl_addr; @@ -106,5 +101,5 @@ int data; -sigjmp_buf errcatch, urgcatch; +jmp_buf errcatch, urgcatch; int logged_in; struct passwd *pw; @@ -131,4 +126,5 @@ char hostname[MAXHOSTNAMELEN]; char remotehost[MAXHOSTNAMELEN]; +const char *home = "/"; /* @@ -143,7 +139,4 @@ int swaitint = SWAITINT; -void lostconn(), myoob(); -FILE *getdatasock(), *dataconn(); - #ifdef SETPROCTITLE char **Argv = NULL; /* pointer to argument vector */ @@ -153,5 +146,5 @@ int -main(int argc, char *argv[], char *envp[]) +main(int argc, char **argv, char **envp) { int addrlen, on = 1, tos; @@ -267,5 +260,5 @@ (void) gethostname(hostname, sizeof (hostname)); reply(220, "%s FTP server (%s) ready.", hostname, version); - (void) sigsetjmp(errcatch); + (void) setjmp(errcatch); for (;;) (void) yyparse(); @@ -274,5 +267,5 @@ void -lostconn() +lostconn(void) { if (debug) @@ -287,6 +280,5 @@ */ char * -sgetsave(s) - char *s; +sgetsave(char *s) { char *new = malloc((unsigned) strlen(s) + 1); @@ -307,10 +299,8 @@ */ struct passwd * -sgetpwnam(name) - char *name; +sgetpwnam(char *name) { static struct passwd save; register struct passwd *p; - char *sgetsave(); #ifdef SHADOW_PWD struct spwd *sp; @@ -357,10 +347,8 @@ */ void -user(name) - char *name; +user(char *name) { register char *cp; char *shell; - char *getusershell(); if (logged_in) { @@ -384,5 +372,5 @@ return; } - if (pw = sgetpwnam(name)) { + if ((pw = sgetpwnam(name))) { if ((shell = pw->pw_shell) == NULL || *shell == 0) shell = _PATH_BSHELL; @@ -415,6 +403,5 @@ */ int -checkuser(name) - char *name; +checkuser(char *name) { register FILE *fd; @@ -441,5 +428,5 @@ */ void -end_login() +end_login(void) { @@ -453,6 +440,5 @@ void -pass(passwd) - char *passwd; +pass(char *passwd) { char *xpasswd, *salt; @@ -522,6 +508,6 @@ #ifdef SETPROCTITLE sprintf(proctitle, "%s: anonymous/%.*s", remotehost, - sizeof(proctitle) - sizeof(remotehost) - - sizeof(": anonymous/"), passwd); + (int) (sizeof(proctitle) - sizeof(remotehost) - + sizeof(": anonymous/")), passwd); setproctitle(proctitle); #endif /* SETPROCTITLE */ @@ -548,10 +534,9 @@ void -retrieve(cmd, name) - char *cmd, *name; +retrieve(char *cmd, char *name) { FILE *fin, *dout; struct stat st; - int (*closefunc)(); + int (*closefunc) __P((FILE *)); if (cmd == 0) { @@ -606,12 +591,9 @@ } -_store(name, mode, unique) - char *name, *mode; - int unique; +void _store(char *name, char *mode, int unique) { FILE *fout, *din; struct stat st; - int (*closefunc)(); - char *gunique(); + int (*closefunc) __P((FILE *)); if (unique && stat(name, &st) == 0 && @@ -673,6 +655,5 @@ FILE * -getdatasock(mode) - char *mode; +getdatasock(char *mode) { int s, on = 1, tries; @@ -712,8 +693,5 @@ FILE * -dataconn(name, size, mode) - char *name; - off_t size; - char *mode; +dataconn(char *name, off_t size, char *mode) { char sizebuf[32]; @@ -792,7 +770,5 @@ */ void -send_data(instr, outstr, blksize) - FILE *instr, *outstr; - off_t blksize; +send_data(FILE *instr, FILE *outstr, off_t blksize) { register int c, cnt; @@ -801,5 +777,5 @@ transflag++; - if (sigsetjmp(urgcatch)) { + if (setjmp(urgcatch)) { transflag = 0; return; @@ -880,6 +856,5 @@ * N.B.: Form isn't handled. */ -receive_data(instr, outstr) - FILE *instr, *outstr; +int receive_data(FILE *instr, FILE *outstr) { register int c; @@ -888,5 +863,5 @@ transflag++; - if (sigsetjmp(urgcatch)) { + if (setjmp(urgcatch)) { transflag = 0; return (-1); @@ -957,6 +932,5 @@ void -statfilecmd(filename) - char *filename; +statfilecmd(char *filename) { char line[BUFSIZ]; @@ -989,5 +963,5 @@ void -statcmd() +statcmd(void) { struct sockaddr_in *sin; @@ -1041,5 +1015,5 @@ } -static void +void fatal(const char *s) { @@ -1050,38 +1024,36 @@ } -/* VARARGS2 */ void -reply(n, fmt, p0, p1, p2, p3, p4, p5) - int n; - char *fmt; +reply(int n, const char *fmt, ...) { - printf("%d ", n); - printf(fmt, p0, p1, p2, p3, p4, p5); - printf("\r\n"); + va_list ap; + va_start(ap, fmt); + (void)printf("%d ", n); + (void)vprintf(fmt, ap); + (void)printf("\r\n"); (void)fflush(stdout); if (debug) { syslog(LOG_DEBUG, "<--- %d ", n); - syslog(LOG_DEBUG, fmt, p0, p1, p2, p3, p4, p5); -} + vsyslog(LOG_DEBUG, fmt, ap); + } } -/* VARARGS2 */ -lreply(n, fmt, p0, p1, p2, p3, p4, p5) - int n; - char *fmt; +void +lreply(int n, const char *fmt, ...) { - printf("%d- ", n); - printf(fmt, p0, p1, p2, p3, p4, p5); - printf("\r\n"); + va_list ap; + va_start(ap, fmt); + (void)printf("%d- ", n); + (void)vprintf(fmt, ap); + (void)printf("\r\n"); (void)fflush(stdout); if (debug) { syslog(LOG_DEBUG, "<--- %d- ", n); - syslog(LOG_DEBUG, fmt, p0, p1, p2, p3, p4, p5); + vsyslog(LOG_DEBUG, fmt, ap); } } void -ack(s) - char *s; +ack(char *s) { reply(250, "%s command successful.", s); @@ -1089,6 +1061,5 @@ void -nack(s) - char *s; +nack(char *s) { reply(502, "%s command not implemented.", s); @@ -1097,10 +1068,9 @@ /* ARGSUSED */ void -yyerror(s) - char *s; +yyerror(char *s) { char *cp; - if (cp = index(cbuf,'\n')) + if ((cp = index(cbuf,'\n'))) *cp = '\0'; reply(500, "'%s': command not understood.", cbuf); @@ -1108,6 +1078,5 @@ void -_delete(name) - char *name; +_delete(char *name) { struct stat st; @@ -1133,6 +1102,5 @@ void -cwd(path) - char *path; +cwd(char *path) { if (chdir(path) < 0) @@ -1143,6 +1111,5 @@ void -makedir(name) - char *name; +makedir(char *name) { if (mkdir(name, 0777) < 0) @@ -1153,6 +1120,5 @@ void -removedir(name) - char *name; +removedir(char *name) { if (rmdir(name) < 0) @@ -1163,8 +1129,7 @@ void -pwd() +pwd(void) { char path[MAXPATHLEN + 1]; - extern char *getwd(); if (getwd(path) == (char *)NULL) @@ -1175,6 +1140,5 @@ char * -renamefrom(name) - char *name; +renamefrom(char *name) { struct stat st; @@ -1189,6 +1153,5 @@ void -renamecmd(from, to) - char *from, *to; +renamecmd(char *from, char *to) { if (rename(from, to) < 0) @@ -1203,6 +1166,5 @@ struct hostent *hp = gethostbyaddr((char *)&sin->sin_addr, sizeof (struct in_addr), AF_INET); - time_t t, time(); - extern char *ctime(); + time_t t; if (hp) @@ -1228,6 +1190,5 @@ */ void -dologout(status) - int status; +dologout(int status) { if (logged_in) { @@ -1240,5 +1201,5 @@ void -myoob() +myoob(void) { char *cp; @@ -1275,5 +1236,5 @@ */ void -passive() +passive(void) { int len; @@ -1320,6 +1281,5 @@ */ char * -gunique(local) - char *local; +gunique(char *local) { static char new[MAXPATHLEN]; @@ -1352,7 +1312,5 @@ */ void -perror_reply(code, string) - int code; - char *string; +perror_reply(int code, char *string) { reply(code, "%s: %s.", string, strerror(errno)); @@ -1365,6 +1323,5 @@ void -send_file_list(whichfiles) - char *whichfiles; +send_file_list(char *whichfiles) { struct stat st; @@ -1374,8 +1331,6 @@ register char **dirlist, *dirname; int simple = 0; - char *strpbrk(); if (strpbrk(whichfiles, "~{[*?") != NULL) { - extern char **ftpglob(), *globerr; globerr = NULL; @@ -1395,9 +1350,9 @@ } - if (sigsetjmp(urgcatch)) { + if (setjmp(urgcatch)) { transflag = 0; return; } - while (dirname = *dirlist++) { + while ((dirname = *dirlist++)) { if (stat(dirname, &st) < 0) { /* @@ -1494,14 +1449,14 @@ * often doesn't have much of an environment or arglist to overwrite. */ - -/*VARARGS1*/ -setproctitle(fmt, a, b, c) -char *fmt; +void +setproctitle(const char *fmt, ...) { - register char *p, *bp, ch; - register int i; - char buf[BUFSIZ]; + int i; + va_list ap; + char *p, *bp, ch; + char buf[LINE_MAX]; - (void) sprintf(buf, fmt, a, b, c); + va_start(ap, fmt); + (void)vsnprintf(buf, sizeof(buf), fmt, ap); /* make ps print our process name */ diff -ru2N NetKit-B-0.08/ftpd/ftphack.h NetKit-B-MCC/ftpd/ftphack.h --- NetKit-B-0.08/ftpd/ftphack.h Mon May 23 10:03:47 1994 +++ NetKit-B-MCC/ftpd/ftphack.h Sat Aug 31 22:41:44 1996 @@ -1,2 +1,67 @@ +#include +#include + +struct tab { + char *name; + short token; + short state; + short implemented; /* 1 if command is implemented */ + char *help; +}; + +struct passwd *sgetpwnam(char *name); +char *sgetsave(char *s); +void user(char *name); +int yyparse (void); +int checkuser(char *name); +void lreply(int n, const char *fmt, ...); +void end_login(void); +void send_data(FILE *instr, FILE *outstr, off_t blksize); +void reply(int n, const char *fmt, ...); +void dologout(int status); +void perror_reply(int code, char *string); +void fatal(const char *s); +void lostconn(void); +void pass(char *passwd); +void retrieve(char *cmd, char *name); +void _store(char *name, char *mode, int unique); +FILE *getdatasock(char *mode); +FILE *dataconn(char *name, off_t size, char *mode); +int receive_data(FILE *instr, FILE *outstr); +void statfilecmd(char *filename); +void statcmd(void); +void ack(char *s); +void nack(char *s); +void yyerror(char *s); +void _delete(char *name); +void cwd(char *path); +void makedir(char *name); +void removedir(char *name); +void pwd(void); +char *renamefrom(char *name); +void renamecmd(char *from, char *to); +void myoob(void); +void passive(void); +char *gunique(char *local); +void send_file_list(char *whichfiles); +void setproctitle(const char *fmt, ...); +void logwtmp(char *line, char *name, char *host); +FILE *ftpd_popen(char *program, char *type); +int ftpd_pclose(FILE *iop); +char **ftpglob(const char *v); +void blkfree(char **av); +struct tab *lookup(register struct tab *p, char *cmd); +char *getline(char *s, int n, register FILE *iop); +int yylex(void); +void upper(register char *s); +char *copy(char *s); +void help(struct tab *ctab, char *s); +void sizecmd(char *filename); + +extern char version[]; extern struct tab cmdtab[]; extern struct tab sitetab[]; +extern const char *home; +extern char cbuf[]; +extern off_t restart_point; +extern char *globerr; diff -ru2N NetKit-B-0.08/ftpd/logwtmp.c NetKit-B-MCC/ftpd/logwtmp.c --- NetKit-B-0.08/ftpd/logwtmp.c Thu Aug 15 08:16:03 1996 +++ NetKit-B-MCC/ftpd/logwtmp.c Sat Aug 31 22:51:41 1996 @@ -30,18 +30,23 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * */ -/* - * From: @(#)logwtmp.c 5.7 (Berkeley) 2/25/91 - */ -static char logwtmp_rcsid[] = - "$Id: logwtmp.c,v 1.3 1996/08/15 07:15:59 dholland Exp $"; +#ifndef lint +/*static char sccsid[] = "from: @(#)logwtmp.c 5.7 (Berkeley) 2/25/91";*/ +static char rcsid[] = "$Id: logwtmp.c,v 1.2 1996/07/14 20:24:23 dholland Exp $"; +#endif /* not lint */ -#include -#include -#include -#include +#include +#include +#include #include +#include +#include +#include +#include +#include "ftphack.h" +static int fd = -1; /* @@ -50,16 +55,16 @@ * after login, but before logout). */ -void -logwtmp(const char *line, const char *name, const char *host) +void logwtmp(char *line, char *name, char *host) { struct utmp ut; struct stat buf; - static int fd = -1; + time_t time(); + char *strncpy(); if (fd < 0 && (fd = open(_PATH_WTMP, O_WRONLY|O_APPEND, 0)) < 0) return; if (fstat(fd, &buf) == 0) { - ut.ut_pid = getpid(); ut.ut_type = (name[0] != '\0')? USER_PROCESS : DEAD_PROCESS; + ut.ut_pid = getpid(); strncpy(ut.ut_id, "", 2); strncpy(ut.ut_line, line, sizeof(ut.ut_line)); @@ -67,5 +72,6 @@ strncpy(ut.ut_host, host, sizeof(ut.ut_host)); time(&ut.ut_time); - if (write(fd, &ut, sizeof(struct utmp)) != sizeof(struct utmp)) + if (write(fd, (char *)&ut, sizeof(struct utmp)) != + sizeof(struct utmp)) ftruncate(fd, buf.st_size); } diff -ru2N NetKit-B-0.08/ftpd/popen.c NetKit-B-MCC/ftpd/popen.c --- NetKit-B-0.08/ftpd/popen.c Sun Jul 14 21:24:43 1996 +++ NetKit-B-MCC/ftpd/popen.c Sat Aug 31 22:41:11 1996 @@ -41,4 +41,5 @@ #endif /* not lint */ +#include #include #include @@ -48,4 +49,5 @@ #include #include +#include "ftphack.h" /* @@ -58,6 +60,5 @@ FILE * -ftpd_popen(program, type) - char *program, *type; +ftpd_popen(char *program, char *type) { register char *cp; @@ -65,7 +66,6 @@ int argc, gargc, pdes[2], pid; char **pop, *argv[100], *gargv[1000], *vv[2]; - extern char **ftpglob(), **copyblk(); - if (*type != 'r' && *type != 'w' || type[1]) + if ((*type != 'r' && *type != 'w') || type[1]) return(NULL); @@ -142,6 +142,5 @@ } -ftpd_pclose(iop) - FILE *iop; +int ftpd_pclose(FILE *iop) { register int fdes; diff -ru2N NetKit-B-0.08/ftpd/vers.c NetKit-B-MCC/ftpd/vers.c --- NetKit-B-0.08/ftpd/vers.c Sun Jul 14 21:24:46 1996 +++ NetKit-B-MCC/ftpd/vers.c Sat Aug 31 21:17:31 1996 @@ -36,4 +36,5 @@ static char rcsid[] = "$Id: vers.c,v 1.1 1996/07/14 20:24:23 dholland Exp $"; #endif /* not lint */ +#include "ftphack.h" char version[] = "Version 5.60"; diff -ru2N NetKit-B-0.08/mcc-install NetKit-B-MCC/mcc-install --- NetKit-B-0.08/mcc-install Thu Jan 1 01:00:00 1970 +++ NetKit-B-MCC/mcc-install Sat Aug 31 19:34:18 1996 @@ -0,0 +1,19 @@ +install -s -m 4555 ping/ping /bin +for i in finger ftp rpcgen talk telnet;do \ + install -s -m 555 $i/$i /usr/bin;done +install -s -m 4555 rcp/rcp rlogin/rlogin rsh/rsh /usr/bin +for i in inetd rpcinfo slattach;do \ + install -s -m 544 $i/$i /usr/sbin;done +for i in fingerd ftpd rexecd rlogind rshd telnetd;do \ + install -s -m 544 $i/$i /usr/libexec/in.$i;done +chmod 555 /usr/libexec/in.fingerd +install -s -m 544 talkd/talkd /usr/libexec/in.ntalkd +for i in finger ftp rcp rlogin rpcgen rsh talk telnet;do \ + install -m 444 $i/$i.1 /usr/man/man1;done +install -m 444 telnetd/issue.net.5 /usr/man/man5 +for i in inetd ping rpcinfo slattach;do \ + install -m 444 $i/$i.8 /usr/man/man8;done +for i in fingerd ftpd rexecd rlogind rshd telnetd;do \ + install -m 444 $i/$i.8 /usr/man/man8/in.$i.8;done +install -m 444 talkd/talkd.8 /usr/man/man8/in.ntalkd.8 +gzip -9f /usr/man/man1/*.1 /usr/man/man5/*.5 /usr/man/man8/*.8 ENDPATCH make * sh -x ./mcc-install %%