summaryrefslogtreecommitdiff
path: root/net/yale-tftpd
diff options
context:
space:
mode:
authornra <nra>2001-07-30 19:43:49 +0000
committernra <nra>2001-07-30 19:43:49 +0000
commit941682f25f6aac047fad9ebc97c26f2f198ccbb4 (patch)
tree6670d3f666f96a7d841ba4eb00d48a74a3a811b2 /net/yale-tftpd
parentbc6b2cd2fa459ee1a147bf100a55b24bf39fbcc8 (diff)
downloadpkgsrc-941682f25f6aac047fad9ebc97c26f2f198ccbb4.tar.gz
New package yale-tftpd version 3.0. PR 13177 by Stoned Elipot.
yale-tftpd is an improved (but slightly incompatible until you configure it) tftpd server. It has a powerful and configurable security setup and is well suited for people who want to boot network devices using their system as a TFTP server.
Diffstat (limited to 'net/yale-tftpd')
-rw-r--r--net/yale-tftpd/Makefile17
-rw-r--r--net/yale-tftpd/distinfo8
-rw-r--r--net/yale-tftpd/patches/patch-aa19
-rw-r--r--net/yale-tftpd/patches/patch-ab12
-rw-r--r--net/yale-tftpd/patches/patch-ac32
-rw-r--r--net/yale-tftpd/patches/patch-ad198
-rw-r--r--net/yale-tftpd/pkg/DESCR4
-rw-r--r--net/yale-tftpd/pkg/PLIST4
8 files changed, 294 insertions, 0 deletions
diff --git a/net/yale-tftpd/Makefile b/net/yale-tftpd/Makefile
new file mode 100644
index 00000000000..c51e41e7fe1
--- /dev/null
+++ b/net/yale-tftpd/Makefile
@@ -0,0 +1,17 @@
+# $NetBSD: Makefile,v 1.1.1.1 2001/07/30 19:43:49 nra Exp $
+# FreeBSD Id: ports/ftp/yale-tftpd/Makefile,v 1.14 2000/04/12 05:31:29 mharo Exp
+
+DISTNAME= yale-tftpd-3.0
+CATEGORIES= ftp
+MASTER_SITES= ftp://ftp.cert.dfn.de/pub/tools/net/yale-tftpd/
+
+MAINTAINER= packages@netbsd.org
+COMMENT= Enhanced tftpd(8) from Yale University and cisco Systems
+
+NO_WRKSUBDIR=
+
+post-configure:
+ ${MV} ${WRKSRC}/tftpd.8 ${WRKSRC}/tftpd.8.in
+ ${SED} -e "s|@PREFIX@|${PREFIX}|g" ${WRKSRC}/tftpd.8.in > ${WRKSRC}/tftpd.8
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/net/yale-tftpd/distinfo b/net/yale-tftpd/distinfo
new file mode 100644
index 00000000000..802b861610e
--- /dev/null
+++ b/net/yale-tftpd/distinfo
@@ -0,0 +1,8 @@
+$NetBSD: distinfo,v 1.1.1.1 2001/07/30 19:43:49 nra Exp $
+
+SHA1 (yale-tftpd-3.0.tar.gz) = 5f87e3d37feb5c5c8b7f2db34a0c87ee537727af
+Size (yale-tftpd-3.0.tar.gz) = 33469 bytes
+SHA1 (patch-aa) = a61c860d4ee1088a4b5b3e8976e6f042d57dae94
+SHA1 (patch-ab) = e6eb66ed95139b47ee1df07014a636803e89ad47
+SHA1 (patch-ac) = eb748d6a96e50475acb7acd6f38e4552972d73f5
+SHA1 (patch-ad) = 1743282699af3a17e4e95c825ad4989688349cd6
diff --git a/net/yale-tftpd/patches/patch-aa b/net/yale-tftpd/patches/patch-aa
new file mode 100644
index 00000000000..8da1e9c8faf
--- /dev/null
+++ b/net/yale-tftpd/patches/patch-aa
@@ -0,0 +1,19 @@
+$NetBSD: patch-aa,v 1.1.1.1 2001/07/30 19:43:49 nra Exp $
+
+--- Makefile.orig Fri Oct 7 01:41:10 1994
++++ Makefile
+@@ -2,10 +2,11 @@
+
+ SRCS= tftpd.c tftpsubs.c tftpyale.c config.c
+ PROG= tftpd
+-MAN8= tftpd.8
++MAN= tftpd.8
+
+-ETCDIR?=${DESTDIR}/etc
+-BINDIR?=${DESTDIR}/usr/libexec
++ETCDIR=${PREFIX}/etc
++BINDIR=${PREFIX}/libexec
++MANDIR=${PREFIX}/man
+
+ CFLAGS+=-DCONFIGFILE='"${ETCDIR}/tftpd.conf"'
+
diff --git a/net/yale-tftpd/patches/patch-ab b/net/yale-tftpd/patches/patch-ab
new file mode 100644
index 00000000000..2b3d082fc31
--- /dev/null
+++ b/net/yale-tftpd/patches/patch-ab
@@ -0,0 +1,12 @@
+$NetBSD: patch-ab,v 1.1.1.1 2001/07/30 19:43:49 nra Exp $
+
+--- classes/Makefile.orig Mon Mar 20 21:11:53 1995
++++ classes/Makefile
+@@ -5,6 +5,7 @@
+
+ NOPIC= true
+ NOPROFILE=true
++NOLINT= true
+
+ install:
+ @echo not installing libclasses.a
diff --git a/net/yale-tftpd/patches/patch-ac b/net/yale-tftpd/patches/patch-ac
new file mode 100644
index 00000000000..a267d48e4d0
--- /dev/null
+++ b/net/yale-tftpd/patches/patch-ac
@@ -0,0 +1,32 @@
+$NetBSD: patch-ac,v 1.1.1.1 2001/07/30 19:43:49 nra Exp $
+
+--- tftpd.8.orig Wed Oct 5 06:18:21 1994
++++ tftpd.8
+@@ -9,7 +9,7 @@
+ .SH NAME
+ tftpd \- DARPA Trivial File Transfer Protocol server
+ .SH SYNOPSIS
+-.B /etc/tftpd
++.B @PREFIX@/libexec/tftpd
+ [
+ .B \-d
+ ]
+@@ -60,7 +60,7 @@
+ If the optional configuration file argument is provided on the command
+ line,
+ .B tftpd
+-will use that, otherwise the default file is ``/usr/local/etc/tftpd.conf''.
++will use that, otherwise the default file is ``@PREFIX@/etc/tftpd.conf''.
+ .sp
+ Configuration commands are:
+ .IP defaultDirectory
+@@ -266,7 +266,7 @@
+ services(5),
+ inetd(8)
+ .SH "FILES"
+-.ta \w'/usr/local/etc/tftpd.conf~~'u
+-/usr/local/etc/tftpd.conf default tftpd configuration file
++.ta \w'@PREFIX@/etc/tftpd.conf~~'u
++@PREFIX@/etc/tftpd.conf default tftpd configuration file
+ .br
+ /etc/inetd.conf inetd configuration file
diff --git a/net/yale-tftpd/patches/patch-ad b/net/yale-tftpd/patches/patch-ad
new file mode 100644
index 00000000000..4838dc5f6bf
--- /dev/null
+++ b/net/yale-tftpd/patches/patch-ad
@@ -0,0 +1,198 @@
+$NetBSD: patch-ad,v 1.1.1.1 2001/07/30 19:43:49 nra Exp $
+
+--- tftpd.c.orig Mon Mar 20 21:14:39 1995
++++ tftpd.c
+@@ -56,6 +56,8 @@
+ #include <syslog.h>
+ #include <string.h>
+
++#include <unistd.h>
++
+ #define TIMEOUT 5
+
+ extern int errno;
+@@ -105,6 +107,8 @@
+
+ if (argc > 1 && strcmp (argv[1], "-d") == 0) {
+ setUpForDebugging();
++ argc--;
++ argv++;
+ }
+ if (ioctl(0, FIONBIO, &on) < 0) {
+ syslog(LOG_ERR, "ioctl(FIONBIO): %m\n");
+@@ -202,7 +206,7 @@
+ awaitInput(chan)
+ int chan;
+ {
+- int imask;
++ fd_set imask;
+ int nready;
+ struct timeval tv;
+ extern int maxInputWait;
+@@ -212,8 +216,9 @@
+ else
+ tv.tv_sec = 5*60; /* default: wait for 5 minutes */
+ tv.tv_usec = 0;
+- imask = 1<<chan;
+- nready = select (sizeof(imask)*8, &imask, (int*)0, (int*)0, &tv);
++ FD_ZERO(&imask);
++ FD_SET(chan, &imask);
++ nready = select (chan+1 , &imask, NULL, NULL, &tv);
+ return nready;
+ }
+
+@@ -294,7 +299,10 @@
+ }
+
+ int validate_access();
+-int sendfile(), recvfile();
++
++struct formats;
++int tftpsendfile(struct formats *);
++int tftprecvfile(struct formats *);
+
+ struct formats {
+ char *f_mode;
+@@ -303,8 +311,8 @@
+ int (*f_recv)();
+ int f_convert;
+ } formats[] = {
+- { "netascii", validate_access, sendfile, recvfile, 1 },
+- { "octet", validate_access, sendfile, recvfile, 0 },
++ { "netascii", validate_access, tftpsendfile, tftprecvfile, 1 },
++ { "octet", validate_access, tftpsendfile, tftprecvfile, 0 },
+ #ifdef notdef
+ { "mail", validate_user, sendmail, recvmail, 1 },
+ #endif
+@@ -355,13 +363,13 @@
+ exit(1);
+ }
+ if (tftpDebugLevel > 0) {
+- char buf[1024];
+- buf[0] = '\0';
+- getwd(buf);
++ char* buf;
++ buf = getcwd(NULL, 0);
+ syslog(LOG_DEBUG, "request %s '%s' from %s; cwd='%s'",
+ (tp->th_opcode == RRQ ? "read" : "write"),
+ filename, inet_ntoa(from.sin_addr),
+ buf);
++ free(buf);
+ }
+ ecode = (*pf->f_validate)(filename, tp->th_opcode);
+ if (ecode) {
+@@ -459,17 +467,25 @@
+
+ /* Rule 2:
+ */
+- if (tftpRootDirectory != 0 && IS_ROOTED(filename)) {
++ if ((tftpRootDirectory != 0 && IS_ROOTED(filename)) ||
++ (tftpDefaultDirectory != 0 && IS_ROOTED(filename))) {
+ char _tmp[1024];
++ char* realRootDir;
+ int maxPath;
+ int rootLen;
+
+- rootLen = strlen (tftpRootDirectory);
++ if (tftpRootDirectory != 0 ) {
++ realRootDir = tftpRootDirectory;
++ }
++ else {
++ realRootDir = tftpDefaultDirectory;
++ }
++
++ rootLen = strlen (realRootDir);
+
+ /* make sure the pathname doesn't already contain
+ * the virtual root.
+ */
+- if (strncmp(filename,tftpRootDirectory,rootLen) != 0) {
+
+ /* Insure our temporary space is big enough */
+ maxPath = ((sizeof _tmp) - 1) - rootLen;
+@@ -481,6 +497,8 @@
+ return EACCESS;
+ }
+
++ if (strncmp(filename,realRootDir,rootLen) != 0) {
++
+ /* Squeeze out any '.' or '..' components */
+ strcpy (tmpPath, filename);
+ if (realPath (tmpPath, _tmp) < 0) {
+@@ -492,21 +510,54 @@
+ /* Create the full pathname, prefixed by the
+ * virtual root.
+ */
+- strcpy (tmpPath, tftpRootDirectory);
++ strcpy (tmpPath, realRootDir);
+ strcat (tmpPath, _tmp);
+ filename = tmpPath;
+ }
++ else {
++ /* Squeeze out any '.' or '..' components */
++ strcpy (tmpPath, filename);
++ if (realPath (tmpPath, _tmp) < 0) {
++ if (tftpDebugLevel > 1)
++ syslog (LOG_DEBUG, "realPath fails");
++ return EACCESS;
++ }
++ /* Create the full pathname */
++ strcpy (tmpPath,_tmp);
++ filename = tmpPath;
++ if (strncmp(filename,realRootDir,rootLen) != 0) {
++ if (tftpDebugLevel > 1) {
++ syslog(LOG_DEBUG, "file=%s; invalid access denied", filename);
++ return EACCESS;
++ }
++ }
++ }
+ }
+
+ /* Rule 3:
+ */
+- if (!IS_ROOTED(filename) && tftpDefaultDirectory == 0) {
+- strcpy (tmpPath, tftpRootDirectory);
+- strcat (tmpPath, "/");
++ if ((!IS_ROOTED(filename) && tftpRootDirectory != 0) ||
++ (!IS_ROOTED(filename) && tftpDefaultDirectory != 0)) {
++ char _tmp[1024];
+ strcat (tmpPath, filename);
++ /* Squeeze out any '.' or '..' components */
++ strcpy (tmpPath, filename);
++ if (realPath (tmpPath, _tmp) < 0) {
++ if (tftpDebugLevel > 1)
++ syslog (LOG_DEBUG, "realPath fails");
++ return EACCESS;
++ }
++ if ( tftpDefaultDirectory == 0 ) {
++ strcpy (tmpPath, tftpRootDirectory);
++ }
++ else {
++ strcpy (tmpPath, tftpDefaultDirectory);
++ }
++ strcat (tmpPath, _tmp);
+ filename = tmpPath;
+ }
+
++
+ /* Check access lists */
+ /* Rules 4&5:
+ */
+@@ -593,7 +644,7 @@
+ /*
+ * Send the requested file.
+ */
+-sendfile(pf)
++tftpsendfile(pf)
+ struct formats *pf;
+ {
+ struct tftphdr *dp, *r_init();
+@@ -664,7 +715,7 @@
+ /*
+ * Receive a file.
+ */
+-recvfile(pf)
++tftprecvfile(pf)
+ struct formats *pf;
+ {
+ struct tftphdr *dp, *w_init();
diff --git a/net/yale-tftpd/pkg/DESCR b/net/yale-tftpd/pkg/DESCR
new file mode 100644
index 00000000000..c4d47718121
--- /dev/null
+++ b/net/yale-tftpd/pkg/DESCR
@@ -0,0 +1,4 @@
+yale-tftpd is an improved (but slightly incompatible until you configure it)
+tftpd server. It has a powerful and configurable security setup and is well
+suited for people who want to boot network devices using their system as a
+TFTP server.
diff --git a/net/yale-tftpd/pkg/PLIST b/net/yale-tftpd/pkg/PLIST
new file mode 100644
index 00000000000..23a52b9377c
--- /dev/null
+++ b/net/yale-tftpd/pkg/PLIST
@@ -0,0 +1,4 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2001/07/30 19:43:49 nra Exp $
+libexec/tftpd
+man/man8/tftpd.8
+man/cat8/tftpd.0