Only in tftp: Code.bin
Only in tftp: ID
diff -c tftp.old/Makefile tftp/Makefile
*** tftp.old/Makefile	Sun Dec 12 10:05:06 1999
--- tftp/Makefile	Tue Sep  5 21:43:49 2000
***************
*** 1,20 ****
! all: tftp
  
  include ../MCONFIG
  include ../MRULES
  
  OBJS = tftp.o main.o tftpsubs.o
  
! tftp: $(OBJS)
  	$(CC) $(LDFLAGS) $^ $(LIBS) -o $@
  
  $(OBJS): tftpsubs.h
  tftp.o: ../version.h
  
! install: tftp
! 	install -s -m$(BINMODE) tftp $(INSTALLROOT)$(BINDIR)
  	install -m$(MANMODE) tftp.1 $(INSTALLROOT)$(MANDIR)/man1
  
  clean:
! 	rm -f *.o tftp
  
--- 1,20 ----
! all: tftp-linksys
  
  include ../MCONFIG
  include ../MRULES
  
  OBJS = tftp.o main.o tftpsubs.o
  
! tftp-linksys: $(OBJS)
  	$(CC) $(LDFLAGS) $^ $(LIBS) -o $@
  
  $(OBJS): tftpsubs.h
  tftp.o: ../version.h
  
! install: tftp-linksys
! 	install -s -m$(BINMODE) tftp-linksys $(INSTALLROOT)$(BINDIR)
  	install -m$(MANMODE) tftp.1 $(INSTALLROOT)$(MANDIR)/man1
  
  clean:
! 	rm -f *.o tftp-linksys
  
Only in tftp: TAGS
diff -c tftp.old/main.c tftp/main.c
*** tftp.old/main.c	Tue Sep 28 19:01:31 1999
--- tftp/main.c	Wed Sep  6 15:00:21 2000
***************
*** 67,79 ****
  #define	TIMEOUT		5		/* secs between rexmt's */
  
  struct sockaddr_in s_inn;
  int f;
  int trace;
  int verbose;
  int rexmtval = TIMEOUT;
  int maxtimeout = 5 * TIMEOUT;
  sigjmp_buf toplevel;
! void sendfile(int fd, char *name, char *modestr);
  void recvfile(int fd, char *name, char *modestr);
  
  
--- 67,80 ----
  #define	TIMEOUT		5		/* secs between rexmt's */
  
  struct sockaddr_in s_inn;
+ char *password = NULL;
  int f;
  int trace;
  int verbose;
  int rexmtval = TIMEOUT;
  int maxtimeout = 5 * TIMEOUT;
  sigjmp_buf toplevel;
! void sendfile(int fd, char *name, char *modestr, char *option);
  void recvfile(int fd, char *name, char *modestr);
  
  
***************
*** 83,89 ****
  static char line[200];
  static int margc;
  static char *margv[20];
! static const char *prompt = "tftp";
  static struct servent *sp;
  
  static void intr(int);
--- 84,90 ----
  static char line[200];
  static int margc;
  static char *margv[20];
! static const char *prompt = "tftp-linksys";
  static struct servent *sp;
  
  static void intr(int);
***************
*** 106,111 ****
--- 107,113 ----
  void setmode(const char *newmode);
  void putusage(const char *s);
  void getusage(const char *s);
+ void setpass(int argc, char *argv[]);
  
  #define HELPINDENT ((int) sizeof("connect"))
  
***************
*** 128,133 ****
--- 130,136 ----
  char	ihelp[] = "set total retransmission timeout";
  char    ashelp[] = "set mode to netascii";
  char    bnhelp[] = "set mode to octet";
+ char	phelp[] = "password for remote tftp";
  
  struct cmd cmdtab[] = {
  	{ "connect",	chelp,		setpeer },
***************
*** 142,147 ****
--- 145,151 ----
  	{ "ascii",      ashelp,         setascii },
  	{ "rexmt",	xhelp,		setrexmt },
  	{ "timeout",	ihelp,		settimeout },
+ 	{ "password",	phelp,		setpass },
  	{ "?",		hhelp,		help },
  	{ 0,0,0 }
  };
***************
*** 236,241 ****
--- 240,269 ----
  	connected = 1;
  }
  
+ void
+ setpass(int argc, char *argv[])
+ {
+ 	size_t len;
+ 
+ 	if (argc < 2) {
+ 		strcpy(line, "Password ");
+ 		printf("(string) ");
+ 		len = strlen(line);
+ 		fgets(line+len, sizeof(line)-len, stdin);
+ 		makeargv();
+ 		argc = margc;
+ 		argv = margv;
+ 	}
+ 	if (argc > 3) {
+ 		printf("usage: %s passwordn", argv[0]);
+ 		return;
+ 	}
+ 	if (password) {
+ 	  free(password);
+ 	}
+ 	password = strdup(argv[1]);
+ }
+ 
  struct	modes {
  	const char *m_name;
  	const char *m_mode;
***************
*** 375,381 ****
  			printf("putting %s to %s:%s [%s]n",
  				ccp, hostname, targ, mode);
  		s_inn.sin_port = port;
! 		sendfile(fd, targ, mode);
  		return;
  	}
  				/* this assumes the target is a directory */
--- 403,409 ----
  			printf("putting %s to %s:%s [%s]n",
  				ccp, hostname, targ, mode);
  		s_inn.sin_port = port;
! 		sendfile(fd, targ, mode, password);
  		return;
  	}
  				/* this assumes the target is a directory */
***************
*** 393,399 ****
  			printf("putting %s to %s:%s [%s]n",
  				argv[n], hostname, targ, mode);
  		s_inn.sin_port = port;
! 		sendfile(fd, targ, mode);
  	}
  }
  
--- 421,427 ----
  			printf("putting %s to %s:%s [%s]n",
  				argv[n], hostname, targ, mode);
  		s_inn.sin_port = port;
! 		sendfile(fd, targ, mode, password);
  	}
  }
  
***************
*** 561,566 ****
--- 589,597 ----
  		verbose ? "on" : "off", trace ? "on" : "off");
  	printf("Rexmt-interval: %d seconds, Max-timeout: %d secondsn",
  		rexmtval, maxtimeout);
+ 	if (password) {
+ 	  printf("TFTP Password: %sn", password);
+ 	}
  }
  
  static
Only in tftp: main.o
Only in tftp: tftp-linksys
diff -c tftp.old/tftp.1 tftp/tftp.1
*** tftp.old/tftp.1	Tue Dec 14 04:53:07 1999
--- tftp/tftp.1	Tue Sep  5 21:54:45 2000
***************
*** 157,162 ****
--- 157,167 ----
  .Pp
  .It Cm verbose
  Toggle verbose mode.
+ .Pp
+ .It Cm password Ar password
+ Set the
+ .Ar password
+ for transfers.
  .El
  .Sh BUGS
  .Pp
diff -c tftp.old/tftp.c tftp/tftp.c
*** tftp.old/tftp.c	Sun Dec 12 10:05:06 1999
--- tftp/tftp.c	Tue Sep  5 20:57:39 2000
***************
*** 62,74 ****
  #include "../version.h"
  
  extern  struct sockaddr_in s_inn;         /* filled in by main */
  extern  int     f;                      /* the opened socket */
  extern  int     trace;
  extern  int     verbose;
  extern  int     rexmtval;
  extern  int     maxtimeout;
  extern sigjmp_buf toplevel;
! void sendfile(int fd, char *name, char *modestr);
  void recvfile(int fd, char *name, char *modestr);
  
  
--- 62,75 ----
  #include "../version.h"
  
  extern  struct sockaddr_in s_inn;         /* filled in by main */
+ extern  char *password;
  extern  int     f;                      /* the opened socket */
  extern  int     trace;
  extern  int     verbose;
  extern  int     rexmtval;
  extern  int     maxtimeout;
  extern sigjmp_buf toplevel;
! void sendfile(int fd, char *name, char *modestr, char *option);
  void recvfile(int fd, char *name, char *modestr);
  
  
***************
*** 79,85 ****
  
  
  static int makerequest(int request, char *name, 
! 		       struct tftphdr *tp, char *mode);
  static void nak(int errnor);
  static void tpacket(const char *s, struct tftphdr *tp, int n);
  static void startclock(void);
--- 80,86 ----
  
  
  static int makerequest(int request, char *name, 
! 		       struct tftphdr *tp, char *mode, char *option);
  static void nak(int errnor);
  static void tpacket(const char *s, struct tftphdr *tp, int n);
  static void startclock(void);
***************
*** 104,110 ****
   * Send the requested file.
   */
  void
! sendfile(int fd, char *name, char *mode)
  {
  	register struct tftphdr *ap;       /* data and ack packets */
  	struct tftphdr *dp;
--- 105,111 ----
   * Send the requested file.
   */
  void
! sendfile(int fd, char *name, char *mode, char *option)
  {
  	register struct tftphdr *ap;       /* data and ack packets */
  	struct tftphdr *dp;
***************
*** 125,131 ****
  	signal(SIGALRM, timer);
  	do {
  		if (block == 0)
! 			size = makerequest(WRQ, name, dp, mode) - 4;
  		else {
  		/*      size = read(fd, dp->th_data, SEGSIZE);   */
  			size = readit(file, &dp, convert);
--- 126,132 ----
  	signal(SIGALRM, timer);
  	do {
  		if (block == 0)
! 			size = makerequest(WRQ, name, dp, mode, option) - 4;
  		else {
  		/*      size = read(fd, dp->th_data, SEGSIZE);   */
  			size = readit(file, &dp, convert);
***************
*** 227,233 ****
  	signal(SIGALRM, timer);
  	do {
  		if (firsttrip) {
! 			size = makerequest(RRQ, name, ap, mode);
  			firsttrip = 0;
  		} else {
  			ap->th_opcode = htons((u_short)ACK);
--- 228,234 ----
  	signal(SIGALRM, timer);
  	do {
  		if (firsttrip) {
! 			size = makerequest(RRQ, name, ap, mode, password);
  			firsttrip = 0;
  		} else {
  			ap->th_opcode = htons((u_short)ACK);
***************
*** 308,314 ****
  }
  
  int
! makerequest(int request, char *name, struct tftphdr *tp, char *mode)
  {
  	register char *cp;
  
--- 309,316 ----
  }
  
  int
! makerequest(int request, char *name, struct tftphdr *tp, char *mode,
! 	    char *option)
  {
  	register char *cp;
  
***************
*** 320,325 ****
--- 322,332 ----
  	strcpy(cp, mode);
  	cp += strlen(mode);
  	*cp++ = '';
+ 	if (option) {
+ 	  strcpy(cp, option);
+ 	  cp += strlen(option);
+ 	  *cp++ = '';
+ 	}
  	return (cp - (char *)tp);
  }
  
Only in tftp: tftp.o
Only in tftp: tftpsubs.o