add tftp servers with filecase patch

git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/mds@886 6952d904-891a-0410-993b-d76249ca496b
This commit is contained in:
geos_one
2009-03-19 18:09:00 +00:00
parent 333bc089ef
commit bba081f507
20 changed files with 1027 additions and 0 deletions

242
net-ftp/tftp-hpa/ChangeLog Normal file
View File

@@ -0,0 +1,242 @@
# ChangeLog for net-ftp/tftp-hpa
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
# $Header: /var/cvsroot/gentoo-x86/net-ftp/tftp-hpa/ChangeLog,v 1.43 2009/03/18 18:06:20 ranger Exp $
18 Mar 2009; Brent Baude <ranger@gentoo.org> tftp-hpa-0.49-r1.ebuild:
stable ppc, bug 260516
14 Mar 2009; Raúl Porcel <armin76@gentoo.org> tftp-hpa-0.49-r1.ebuild:
arm/ia64/s390/sh stable wrt #260516
11 Mar 2009; Brent Baude <ranger@gentoo.org> tftp-hpa-0.49-r1.ebuild:
stable ppc64, bug 260516
09 Mar 2009; Friedrich Oslage <bluebird@gentoo.org>
tftp-hpa-0.49-r1.ebuild:
Stable on sparc, bug #260516
08 Mar 2009; Tobias Klausmann <klausman@gentoo.org>
tftp-hpa-0.49-r1.ebuild:
Stable on alpha, bug #260516
08 Mar 2009; Markus Meier <maekke@gentoo.org> tftp-hpa-0.49-r1.ebuild:
amd64/x86 stable, bug #260516
06 Mar 2009; Jeroen Roovers <jer@gentoo.org> tftp-hpa-0.49-r1.ebuild:
Stable for HPPA (bug #260516).
*tftp-hpa-0.49-r1 (27 Feb 2009)
27 Feb 2009; Raúl Porcel <armin76@gentoo.org> -tftp-hpa-0.49.ebuild,
+tftp-hpa-0.49-r1.ebuild:
Revbump to add ipv6 USE-flag, bug #253422
*tftp-hpa-0.49 (01 Nov 2008)
01 Nov 2008; Robin H. Johnson <robbat2@gentoo.org> +tftp-hpa-0.49.ebuild:
Version bump.
09 May 2008; Jeroen Roovers <jer@gentoo.org> tftp-hpa-0.48.ebuild:
Stable for HPPA too.
13 Aug 2007; Tobias Scherbaum <dertobi123@gentoo.org>
tftp-hpa-0.48.ebuild:
ppc. stable
26 Jul 2007; Raúl Porcel <armin76@gentoo.org> tftp-hpa-0.48.ebuild:
alpha stable
13 May 2007; Steve Dibb <beandog@gentoo.org> tftp-hpa-0.48.ebuild:
amd64 stable
10 May 2007; Doug Goldstein <cardoe@gentoo.org> metadata.xml:
Fix metadata
22 Apr 2007; Raúl Porcel <armin76@gentoo.org> tftp-hpa-0.48.ebuild:
ia64 stable
17 Apr 2007; Gustavo Zacarias <gustavoz@gentoo.org> tftp-hpa-0.48.ebuild:
Stable on sparc
16 Apr 2007; Markus Rothe <corsair@gentoo.org> tftp-hpa-0.48.ebuild:
Stable on ppc64
12 Mar 2007; Raúl Porcel <armin76@gentoo.org> tftp-hpa-0.48.ebuild:
x86 stable
*tftp-hpa-0.48 (01 Feb 2007)
01 Feb 2007; Mike Frysinger <vapier@gentoo.org> metadata.xml,
+tftp-hpa-0.48.ebuild:
Version bump.
*tftp-hpa-0.45-r1 (18 Jan 2007)
18 Jan 2007; Robin H. Johnson <robbat2@gentoo.org>
+tftp-hpa-0.45-r1.ebuild:
0.45 broke the conf.d file, need a new revision for this.
08 Jan 2007; Danny van Dyk <kugelfang@gentoo.org> -tftp-hpa-0.44.ebuild:
QA: Removed unused versions.
*tftp-hpa-0.45 (25 Dec 2006)
25 Dec 2006; Mike Frysinger <vapier@gentoo.org>
+files/tftp-hpa-0.45-parallel.patch, +tftp-hpa-0.45.ebuild:
Version bump and fix building in parallel.
*tftp-hpa-0.44 (13 Dec 2006)
13 Dec 2006; Charlie Shepherd <masterdriverz@gentoo.org>
-files/in.tftpd.confd-0.42, +files/in.tftpd.confd-0.44,
-tftp-hpa-0.42.ebuild, -tftp-hpa-0.42-r1.ebuild, +tftp-hpa-0.44.ebuild:
Bump to version 0.44; bug 156322; thanks to Axel Dyks
19 Nov 2006; Diego Pettenò <flameeyes@gentoo.org> +metadata.xml,
tftp-hpa-0.42-r1.ebuild:
Add ~x86-fsd keyword and maintainer-needed metadata.
21 Oct 2006; Tobias Scherbaum <dertobi123@gentoo.org>
tftp-hpa-0.40.1.ebuild:
ppc stable
*tftp-hpa-0.42-r1 (20 May 2006)
20 May 2006; Robin H. Johnson <robbat2@gentoo.org>
files/in.tftpd.confd-0.42, +tftp-hpa-0.42-r1.ebuild:
Bug #132889, argument over default service location leads to a safer default.
*tftp-hpa-0.42 (02 Apr 2006)
02 Apr 2006; Robin H. Johnson <robbat2@gentoo.org>
+files/in.tftpd.confd-0.42, +tftp-hpa-0.42.ebuild:
Bug #111006, version bump. Note that the /proc hackery for disable PMTU
discovery and local port numbers are now not needed.
10 Mar 2006; Aron Griffis <agriffis@gentoo.org> tftp-hpa-0.40.1.ebuild:
Mark 0.40.1 stable on ia64
07 Feb 2006; Aron Griffis <agriffis@gentoo.org> tftp-hpa-0.40.1.ebuild:
Mark 0.40.1 stable on alpha
04 Dec 2005; Tom Gall <tgall@gentoo.org> tftp-hpa-0.40.1.ebuild:
stable on ppc64
10 Nov 2005; Brent Baude <ranger@gentoo.org> tftp-hpa-0.40.1.ebuild:
Marking tftp-hpa-0.40.1 ~ppc64 for bug 112068
*tftp-hpa-0.40.1 (01 Oct 2005)
01 Oct 2005; Daniel Black <dragonheart@gentoo.org>
+tftp-hpa-0.40.1.ebuild:
version bump
18 Sep 2005; Mike Frysinger <vapier@gentoo.org> tftp-hpa-0.40-r1.ebuild:
Add support for USE=selinux #106354 by petre rodan and USE=tcpd/readline
#102867 by Francisco Javier.
15 Sep 2005; Aron Griffis <agriffis@gentoo.org> tftp-hpa-0.40-r1.ebuild:
Mark 0.40-r1 stable on alpha
13 Aug 2005; Michael Hanselmann <hansmi@gentoo.org>
tftp-hpa-0.40-r1.ebuild:
Stable on ppc.
02 Aug 2005; Gustavo Zacarias <gustavoz@gentoo.org>
tftp-hpa-0.40-r1.ebuild:
Stable on sparc
30 Jul 2005; Mike Frysinger <vapier@gentoo.org> files/in.tftpd.confd,
files/in.tftpd.rc6, tftp-hpa-0.40-r1.ebuild:
Clean up init scripts and stabilize for #90784 by Daniel Webert.
29 Jul 2005; Marcelo Goes <vanquirius@gentoo.org> -tftp-hpa-0.33.ebuild,
-tftp-hpa-0.40.ebuild, tftp-hpa-0.40-r1.ebuild:
Really fix bug 83325. Thanks to Dan Eisenhut <daniel.eisenhut@med.ge.com>.
*tftp-hpa-0.40-r1 (27 Feb 2005)
27 Feb 2005; Jon Hood <squinky86@gentoo.org> +metadata.xml,
+tftp-hpa-0.40-r1.ebuild:
Add sys-apps/tcp-wrappers to RDEPEND, #83325. Thanks Dan Eisenhut
<daniel.eisenhut@med.ge.com>.
29 Dec 2004; Ciaran McCreesh <ciaranm@gentoo.org> :
Change encoding to UTF-8 for GLEP 31 compliance
*tftp-hpa-0.40 (09 Dec 2004)
09 Dec 2004; Jon Hood <squinky86@gentoo.org> +files/in.tftpd.confd,
+files/in.tftpd.rc6, +tftp-hpa-0.33.ebuild, +tftp-hpa-0.34-r1.ebuild,
+tftp-hpa-0.40.ebuild:
Moved from net-misc/tftp-hpa to net-ftp/tftp-hpa.
*tftp-hpa-0.40 (09 Dec 2004)
09 Dec 2004; Jon Hood <squinky86@gentoo.org> +tftp-hpa-0.40.ebuild:
Version bump, #69600; thanks lison <bugzilla.gentoo@lison.com>.
01 Jul 2004; Jon Hood <squinky86@gentoo.org> tftp-hpa-0.33.ebuild,
tftp-hpa-0.34-r1.ebuild:
change virtual/glibc to virtual/libc, add IUSE
15 Jun 2004; Danny van Dyk <kugelfang@gentoo.org> tftp-hpa-0.34-r1.ebuild:
Marked stable on amd64.
08 Jun 2004; Bryan Østergaard <kloeri@gentoo.org> tftp-hpa-0.34-r1.ebuild:
Stable on alpha.
15 Apr 2004; Michael McCabe <randy@gentoo.org> tftp-hpa-0.34-r1.ebuild:
adding s390 keywords
21 Mar 2004; Jason Wever <weeve@gentoo.org> tftp-hpa-0.34-r1.ebuild:
Marked stable on sparc.
31 Oct 2003; Heinrich Wendel <lanius@gentoo.org> tftp-hpa-0.34-r1.ebuild,
tftp-hpa-0.34.ebuild:
stable, it's just a virtual ;D
*tftp-hpa-0.34-r1 (30 Oct 2003)
30 Oct 2003; Heinrich Wendel <lanius@gentoo.org> tftp-hpa-0.34-r1.ebuild:
virtual/tftp
*tftp-hpa-0.34 (29 Aug 2003)
29 Aug 2003; Martin Holzer <mholzer@gentoo.org> tftp-hpa-0.33.ebuild,
tftp-hpa-0.34.ebuild, files/in.tftpd.confd, files/in.tftpd.rc6:
Move app-admin/tftp-hpa net-misc/tftp-hpa
*tftp-hpa-0.34 (25 May 2003)
25 May 2003; Martin Holzer <mholzer@gentoo.org> tftp-hpa-0.16.ebuild,
tftp-hpa-0.29.ebuild, tftp-hpa-0.33.ebuild, tftp-hpa-0.34.ebuild:
Version bumped & SRC_URI now uses mirror://kernel
*tftp-hpa-0.33 (28 Mar 2003)
28 Mar 2003; Michael Imhof <tantive@gentoo.org>
Version bumped, thanks to Terje Kvernes <terjekv@math.uio.no>
for the hint. Should close #18327.
06 Dec 2002; Rodney Rees <manson@gentoo.org> : changed sparc ~sparc keywords
*tftp-hpa-0.29 (19 Apr 2002)
19 Apr 2002; J.Ritchie <jasonr@myrealbox.com> ChangeLog :
Updated to work with newest tftp-hpa version.
Added /etc/conf.d and /etc/init.d scripts for use with rc-update.
*tftp-hpa-0.16 (1 Feb 2002)
18 Sept 2002; Mike Frysinger <vapier@gentoo.org> :
Fixed HOMEPAGE variable
1 Feb 2002; G.Bevin <gbevin@gentoo.org> ChangeLog :
Added initial ChangeLog which should be updated whenever the package is
updated in any way. This changelog is targetted to users. This means that the
comments should well explained and written in clean English. The details about
writing correct changelogs are explained in the skel.ChangeLog file which you
can find in the root directory of the portage repository.

View File

@@ -0,0 +1,7 @@
AUX in.tftpd.confd-0.44 576 RMD160 718a437e2d44c1594ef359784fde89d0367c2a47 SHA1 e4a051f435f56007b9efb4173e2d272b12442436 SHA256 55e67f871f070db2b7fa1428dabf55777ca87fecdbba7fa3b03e63c63734f977
AUX in.tftpd.rc6 443 RMD160 e4a8d822b24cb9cf73b6e9601fcc58d40a203cb9 SHA1 7929ceb89811558576c7a9a4a4bb6d11bbd3c833 SHA256 3bceb3446bbebfae60d5276a2481c4311270d2e33c46e73a8bea66e330244ae0
AUX tftp-hpa-filecase.diff 2297 RMD160 8456ea7f755474dfe3ce41cf61c393d59925c172 SHA1 424cc545fdd561ac77e8a483ef8311eb46e77bea SHA256 fbe50acb8ea5377e4a96879e26cde163f42b254cacbb8efdcefe0e2b1e5c8dc5
DIST tftp-hpa-0.49.tar.bz2 91829 RMD160 d3a9a18f4b41dfd006c90b94b64a6473f577a7ed SHA1 28349027d7b672855414d5b8a6d45c8936e7c54d SHA256 9055064ea0aea223e82e99cbdead970dc46fa9456c91a7b3d6c0b37b62b6dd8c
EBUILD tftp-hpa-0.49-r2.ebuild 1363 RMD160 1c72f28d314bd086f482339b5f48a4b64c770e02 SHA1 4350c8fcf2ea0de8f101581403c4104ae8902dcd SHA256 1e9c4bff646ecb8ca8b140d9900cd61339538c36d33e0aeb02ab77cb91acca1a
MISC ChangeLog 8092 RMD160 4ff12a1cba5cad43208702585cba6092a06da6c4 SHA1 aebed90254c9793b7622e2684d9c28a510ecbe13 SHA256 49d9d5813965bc2558ea4ebc72a3696baae1532bdd5d127bc88ee08afbf50e4f
MISC metadata.xml 164 RMD160 f43cbec30b7074319087c9acffdb9354b17b0db3 SHA1 9c213f5803676c56439df3716be07d6692588856 SHA256 f5f2891f2a4791cd31350bb2bb572131ad7235cd0eeb124c9912c187ac10ce92

View File

@@ -0,0 +1,15 @@
# /etc/init.d/in.tftpd
# Path to server files from
# Depending on your application you may have to change this.
# This is commented out to force you to look at the file!
#INTFTPD_PATH="/var/tftp/"
#INTFTPD_PATH="/tftpboot/"
#INTFTPD_PATH="/tftproot/"
# For more options, see in.tftpd(8)
# -R 4096:32767 solves problems with ARC firmware, and obsoletes
# the /proc/sys/net/ipv4/ip_local_port_range hack.
# -s causes $INTFTPD_PATH to be the root of the TFTP tree.
# -l is passed by the init script in addition to these options.
INTFTPD_OPTS="-R 4096:32767 -s ${INTFTPD_PATH}"

View File

@@ -0,0 +1,20 @@
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-ftp/tftp-hpa/files/in.tftpd.rc6,v 1.2 2005/07/30 06:29:14 vapier Exp $
depend() {
need net
}
start() {
ebegin "Starting tftpd"
/usr/sbin/in.tftpd -l ${INTFTPD_OPTS}
eend $?
}
stop() {
ebegin "Stopping tftpd"
start-stop-daemon --stop --exec /usr/sbin/in.tftpd
eend $?
}

View File

@@ -0,0 +1,100 @@
Submitted By: Mario Fetka (mario dot fetka at gmail dot com)
Date: 2009-03-19
Initial Package Version: 0.49
Origin: http://oss.netfarm.it/guides/ris-linux.php
Upstream Status: unknown
Description: A patch for hpa-tftp to permit case insensitive file lookups
diff -Naur tftp-hpa-0.49.orig/tftpd/tftpd.c tftp-hpa-0.49/tftpd/tftpd.c
--- tftp-hpa-0.49.orig/tftpd/tftpd.c 2009-03-19 17:50:47.883141096 +0000
+++ tftp-hpa-0.49/tftpd/tftpd.c 2009-03-19 18:00:20.991735706 +0000
@@ -46,6 +46,7 @@
#include <pwd.h>
#include <limits.h>
#include <syslog.h>
+#include <dirent.h>
#include "common/tftpsubs.h"
#include "recvfrom.h"
@@ -972,6 +973,9 @@
static void tftp_sendfile(struct formats *, struct tftphdr *, int);
static void tftp_recvfile(struct formats *, struct tftphdr *, int);
+int lookup_entry(const char *comp, char *dest);
+void lookup_file(char *filename);
+
struct formats {
const char *f_mode;
char *(*f_rewrite) (char *, int, const char **);
@@ -1332,6 +1336,63 @@
}
#endif
+int lookup_entry(const char *comp, char *dest)
+{
+ DIR *dirp;
+ struct dirent *dptr;
+ dirp = opendir(dest[0] ? dest : ".");
+ if (!dirp) return 0;
+ while ((dptr = readdir(dirp)))
+ {
+ if (!strcasecmp(dptr->d_name, comp))
+ {
+ if (dest[0]) strcat(dest, "/");
+ strcat(dest, dptr->d_name);
+ closedir(dirp);
+ return 1;
+ }
+ }
+ closedir(dirp);
+ return 0;
+}
+
+
+void lookup_file(char *filename)
+{
+ int found = 0;
+ int len = 0;
+ char dest[1024];
+ char comp[1024];
+ char *check = filename;
+ char *seek = NULL;
+
+ dest[0] = 0;
+ check++;
+ while (*check)
+ {
+ seek = strchr(check, '\\');
+ if (!seek)
+ {
+ if ((*check) && (lookup_entry(check, dest)))
+ found = 1;
+ break;
+ }
+ len = seek - check;
+ memcpy(comp, check, len);
+ comp[len]=0;
+ if (!lookup_entry(comp, dest))
+ break;
+ check += len + 1;
+ }
+
+ if (found)
+ {
+ filename[0] = 0;
+ strcat(filename, dest);
+ }
+}
+
+
static FILE *file;
/*
* Validate file access. Since we
@@ -1357,6 +1418,7 @@
tsize_ok = 0;
*errmsg = NULL;
+ if (*filename == '\\') lookup_file(filename);
if (!secure) {
if (*filename != '/') {
*errmsg = "Only absolute filenames allowed";

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<herd>base-system</herd>
</pkgmetadata>

View File

@@ -0,0 +1,53 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-ftp/tftp-hpa/tftp-hpa-0.49-r1.ebuild,v 1.8 2009/03/18 18:06:20 ranger Exp $
inherit eutils
DESCRIPTION="port of the OpenBSD TFTP server"
HOMEPAGE="http://www.kernel.org/pub/software/network/tftp/"
SRC_URI="mirror://kernel/software/network/tftp/${P}.tar.bz2"
LICENSE="BSD"
SLOT="0"
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
IUSE="ipv6 readline selinux tcpd"
DEPEND="readline? ( sys-libs/readline )
tcpd? ( sys-apps/tcp-wrappers )
selinux? ( sec-policy/selinux-tftpd )
!virtual/tftp"
PROVIDE="virtual/tftp"
src_unpack() {
unpack ${A}
cd "${S}"
epatch "${FILESDIR}"/${PN}-filecase.diff
}
src_compile() {
econf \
$(use_with ipv6) \
$(use_with tcpd tcpwrappers) \
$(use_with readline) \
|| die
emake || die
}
src_install() {
emake INSTALLROOT="${D}" install || die
dodoc README* CHANGES tftpd/sample.rules
# iputils installs this
rm -f "${D}"/usr/share/man/man8/tftpd.8
newconfd "${FILESDIR}"/in.tftpd.confd-0.44 in.tftpd
newinitd "${FILESDIR}"/in.tftpd.rc6 in.tftpd
}
pkg_postinst() {
ewarn "After installation, please ensure you look at"
ewarn "/etc/conf.d/in.tftpd and set the correct path"
ewarn "for your application."
}