summaryrefslogtreecommitdiff
path: root/net/yale-tftpd/patches/patch-ad
diff options
context:
space:
mode:
Diffstat (limited to 'net/yale-tftpd/patches/patch-ad')
-rw-r--r--net/yale-tftpd/patches/patch-ad38
1 files changed, 21 insertions, 17 deletions
diff --git a/net/yale-tftpd/patches/patch-ad b/net/yale-tftpd/patches/patch-ad
index 7d7445dd747..cb762a23219 100644
--- a/net/yale-tftpd/patches/patch-ad
+++ b/net/yale-tftpd/patches/patch-ad
@@ -1,8 +1,8 @@
-$NetBSD: patch-ad,v 1.5 2007/10/02 20:23:08 heinz Exp $
+$NetBSD: patch-ad,v 1.6 2011/09/06 11:20:19 obache Exp $
---- tftpd.c.orig 1995-03-20 21:14:39.000000000 +0100
+--- tftpd.c.orig 1995-03-20 20:14:39.000000000 +0000
+++ tftpd.c
-@@ -43,6 +43,9 @@ static char sccsid[] = "@(#)tftpd.c 5.12
+@@ -43,9 +43,13 @@ static char sccsid[] = "@(#)tftpd.c 5.12
#include <sys/signal.h>
#include <sys/time.h>
#include <sys/param.h>
@@ -12,7 +12,11 @@ $NetBSD: patch-ad,v 1.5 2007/10/02 20:23:08 heinz Exp $
#include <netinet/in.h>
-@@ -56,17 +59,22 @@ static char sccsid[] = "@(#)tftpd.c 5.12
++#include <arpa/inet.h>
+ #include <arpa/tftp.h>
+
+ #include <netdb.h>
+@@ -56,17 +60,22 @@ static char sccsid[] = "@(#)tftpd.c 5.12
#include <syslog.h>
#include <string.h>
@@ -39,7 +43,7 @@ $NetBSD: patch-ad,v 1.5 2007/10/02 20:23:08 heinz Exp $
struct sockaddr_in from;
int fromlen;
-@@ -105,6 +113,8 @@ char **argv;
+@@ -105,6 +114,8 @@ char **argv;
if (argc > 1 && strcmp (argv[1], "-d") == 0) {
setUpForDebugging();
@@ -48,7 +52,7 @@ $NetBSD: patch-ad,v 1.5 2007/10/02 20:23:08 heinz Exp $
}
if (ioctl(0, FIONBIO, &on) < 0) {
syslog(LOG_ERR, "ioctl(FIONBIO): %m\n");
-@@ -202,7 +212,7 @@ setUpForDebugging()
+@@ -202,7 +213,7 @@ setUpForDebugging()
awaitInput(chan)
int chan;
{
@@ -57,7 +61,7 @@ $NetBSD: patch-ad,v 1.5 2007/10/02 20:23:08 heinz Exp $
int nready;
struct timeval tv;
extern int maxInputWait;
-@@ -212,8 +222,9 @@ int chan;
+@@ -212,8 +223,9 @@ int chan;
else
tv.tv_sec = 5*60; /* default: wait for 5 minutes */
tv.tv_usec = 0;
@@ -69,7 +73,7 @@ $NetBSD: patch-ad,v 1.5 2007/10/02 20:23:08 heinz Exp $
return nready;
}
-@@ -294,7 +305,10 @@ int n;
+@@ -294,7 +306,10 @@ int n;
}
int validate_access();
@@ -81,7 +85,7 @@ $NetBSD: patch-ad,v 1.5 2007/10/02 20:23:08 heinz Exp $
struct formats {
char *f_mode;
-@@ -303,8 +317,8 @@ struct formats {
+@@ -303,8 +318,8 @@ struct formats {
int (*f_recv)();
int f_convert;
} formats[] = {
@@ -92,7 +96,7 @@ $NetBSD: patch-ad,v 1.5 2007/10/02 20:23:08 heinz Exp $
#ifdef notdef
{ "mail", validate_user, sendmail, recvmail, 1 },
#endif
-@@ -355,13 +369,13 @@ again:
+@@ -355,13 +370,13 @@ again:
exit(1);
}
if (tftpDebugLevel > 0) {
@@ -109,7 +113,7 @@ $NetBSD: patch-ad,v 1.5 2007/10/02 20:23:08 heinz Exp $
}
ecode = (*pf->f_validate)(filename, tp->th_opcode);
if (ecode) {
-@@ -459,17 +473,25 @@ validate_access(filename, mode)
+@@ -459,17 +474,25 @@ validate_access(filename, mode)
/* Rule 2:
*/
@@ -138,7 +142,7 @@ $NetBSD: patch-ad,v 1.5 2007/10/02 20:23:08 heinz Exp $
/* Insure our temporary space is big enough */
maxPath = ((sizeof _tmp) - 1) - rootLen;
-@@ -481,6 +503,8 @@ validate_access(filename, mode)
+@@ -481,6 +504,8 @@ validate_access(filename, mode)
return EACCESS;
}
@@ -147,7 +151,7 @@ $NetBSD: patch-ad,v 1.5 2007/10/02 20:23:08 heinz Exp $
/* Squeeze out any '.' or '..' components */
strcpy (tmpPath, filename);
if (realPath (tmpPath, _tmp) < 0) {
-@@ -492,21 +516,54 @@ validate_access(filename, mode)
+@@ -492,21 +517,54 @@ validate_access(filename, mode)
/* Create the full pathname, prefixed by the
* virtual root.
*/
@@ -206,7 +210,7 @@ $NetBSD: patch-ad,v 1.5 2007/10/02 20:23:08 heinz Exp $
/* Check access lists */
/* Rules 4&5:
*/
-@@ -565,7 +622,7 @@ validate_access(filename, mode)
+@@ -565,7 +623,7 @@ validate_access(filename, mode)
* This will be done with the effective permissions of the TFTPD
* process.
*/
@@ -215,7 +219,7 @@ $NetBSD: patch-ad,v 1.5 2007/10/02 20:23:08 heinz Exp $
if (fd < 0) {
syslog (LOG_DEBUG, "open fails; errno = %d", errno);
return errno+100;
-@@ -593,7 +650,7 @@ void timer()
+@@ -593,7 +651,7 @@ void timer()
/*
* Send the requested file.
*/
@@ -224,7 +228,7 @@ $NetBSD: patch-ad,v 1.5 2007/10/02 20:23:08 heinz Exp $
struct formats *pf;
{
struct tftphdr *dp, *r_init();
-@@ -664,7 +721,7 @@ void justquit()
+@@ -664,7 +722,7 @@ void justquit()
/*
* Receive a file.
*/
@@ -233,7 +237,7 @@ $NetBSD: patch-ad,v 1.5 2007/10/02 20:23:08 heinz Exp $
struct formats *pf;
{
struct tftphdr *dp, *w_init();
-@@ -688,7 +745,7 @@ send_ack:
+@@ -688,7 +746,7 @@ send_ack:
write_behind(file, pf->f_convert);
for ( ; ; ) {
alarm(rexmtval);