Bump new tftp-hpa with filecase patch(for RIS). Fix version of old tftp-hpa ebuild

This commit is contained in:
Sergey Popov 2011-10-22 21:39:33 +04:00
parent b8e487e291
commit 42c9520ee1
4 changed files with 142 additions and 3 deletions

View File

@ -1,6 +1,9 @@
AUX in.tftpd.confd-0.44 576 RMD160 718a437e2d44c1594ef359784fde89d0367c2a47 SHA1 e4a051f435f56007b9efb4173e2d272b12442436 SHA256 55e67f871f070db2b7fa1428dabf55777ca87fecdbba7fa3b03e63c63734f977 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 in.tftpd.rc6 443 RMD160 e4a8d822b24cb9cf73b6e9601fcc58d40a203cb9 SHA1 7929ceb89811558576c7a9a4a4bb6d11bbd3c833 SHA256 3bceb3446bbebfae60d5276a2481c4311270d2e33c46e73a8bea66e330244ae0
AUX tftp-hpa-5.0-filecase.patch 1980 RMD160 ddd70d8128afbabb9ad60b497c9369ce3efda9ec SHA1 008092e1e7872755709c2d61dd02495d4af512a1 SHA256 23a4da7351540ad7b9c0480e2a2fefe128eb088879907983b6804fc7a93c4047 AUX tftp-hpa-5.0-filecase.patch 1980 RMD160 ddd70d8128afbabb9ad60b497c9369ce3efda9ec SHA1 008092e1e7872755709c2d61dd02495d4af512a1 SHA256 23a4da7351540ad7b9c0480e2a2fefe128eb088879907983b6804fc7a93c4047
AUX tftp-hpa-5.1-filecase.patch 1998 RMD160 eacc524c28c2a788be55d6034f016e78e468232a SHA1 6d54c4408c2a14697196e845b32dc54ea685833d SHA256 126f52def2b560f78d8f1bb3d34592926cbb659d4a7e5fbc651c2fcaa6d5dda9
AUX tftp.xinetd 219 RMD160 7927ad10668599d03bbbefe55700c9a018033858 SHA1 658125a31f5348d225367441f8f528afa10f2007 SHA256 044c1c262cbeddbcddf449a694c5c472cc236aba87ea89b5a4dc7a76a1bf90a5 AUX tftp.xinetd 219 RMD160 7927ad10668599d03bbbefe55700c9a018033858 SHA1 658125a31f5348d225367441f8f528afa10f2007 SHA256 044c1c262cbeddbcddf449a694c5c472cc236aba87ea89b5a4dc7a76a1bf90a5
DIST tftp-hpa-5.0.tar.bz2 93039 RMD160 fbafc398b40098343b9e9e82badcfe6bd0eb3932 SHA1 7f541f085a4af5a87bf86a249421b13a30150597 SHA256 96309871519efcab829fdfcc1cca546d772ed6a0e214c9e99e77ca7aea29f734 DIST tftp-hpa-5.0.tar.bz2 93039 RMD160 fbafc398b40098343b9e9e82badcfe6bd0eb3932 SHA1 7f541f085a4af5a87bf86a249421b13a30150597 SHA256 96309871519efcab829fdfcc1cca546d772ed6a0e214c9e99e77ca7aea29f734
EBUILD tftp-hpa-5.0-r1.ebuild 1275 RMD160 20b1fb3fcd69a8b56056a10252e9389cc3659e5f SHA1 4df2d79c4c220769906bb1a1f63bb294de93183e SHA256 9e3c68f2ff4a44643db2ac17e221258020e45615ba5756c97ca78294d8895f0c DIST tftp-hpa-5.1.tar.bz2 93919 RMD160 85591436968e176e1b92d2f7fe547bad34855a97 SHA1 4ccebeea0669c27a707cd38b7087d3713c485526 SHA256 fd3f92064f26367051af91ea44b2553566e3d96cd73b4ccdf28e547e18d0e24c
EBUILD tftp-hpa-5.0-r9999.ebuild 1275 RMD160 2a75f90c7be902b97368223e6ccd40b0dcfd339f SHA1 333f39aa79bd99e5142615ac6d5137d57e71de58 SHA256 25b6b53fca5ddfd78fa0d9063de2fe91e1e094c674a878deeb2450e2ee29ad54
EBUILD tftp-hpa-5.1-r9999.ebuild 1164 RMD160 6ab98488c713a772a0d009be4d58b088a8f08bc2 SHA1 84221a2935ce2561d66129452a70ce9d2410bcfc SHA256 03b2618ad721b30004251a7a9ad57a1f9f26da10c099aefe2625f9243db9867c

View File

@ -0,0 +1,91 @@
--- tftp-hpa-5.1/tftpd/tftpd.c.orig 2009-12-26 13:17:35.000000000 +0300
+++ tftp-hpa-5.1/tftpd/tftpd.c 2009-12-26 13:19:01.000000000 +0300
@@ -46,6 +46,7 @@
#include <pwd.h>
#include <limits.h>
#include <syslog.h>
+#include <dirent.h>
#include "common/tftpsubs.h"
#include "recvfrom.h"
@@ -975,6 +976,8 @@
static int validate_access(char *, int, const struct formats *, const char **);
static void tftp_sendfile(const struct formats *, struct tftphdr *, int);
static void tftp_recvfile(const struct formats *, struct tftphdr *, int);
+int lookup_entry(const char *comp, char *dest);
+void lookup_file(char *filename);
struct formats {
const char *f_mode;
@@ -1353,6 +1356,62 @@
}
#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
@@ -1378,6 +1437,8 @@
tsize_ok = 0;
*errmsg = NULL;
+ if (*filename == '\\') lookup_file(filename);
+
if (!secure) {
if (*filename != '/') {
*errmsg = "Only absolute filenames allowed";

View File

@ -14,11 +14,11 @@ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86
IUSE="ipv6 readline selinux tcpd" IUSE="ipv6 readline selinux tcpd"
RDEPEND="selinux? ( sec-policy/selinux-tftpd ) RDEPEND="selinux? ( sec-policy/selinux-tftpd )
!virtual/tftp" !net-ftp/atftp
!net-ftp/netkit-tftp"
DEPEND="${RDEPEND} DEPEND="${RDEPEND}
readline? ( sys-libs/readline ) readline? ( sys-libs/readline )
tcpd? ( sys-apps/tcp-wrappers )" tcpd? ( sys-apps/tcp-wrappers )"
PROVIDE="virtual/tftp"
src_compile() { src_compile() {
# additional patch for Windows clients # additional patch for Windows clients

View File

@ -0,0 +1,45 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
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"
RDEPEND="selinux? ( sec-policy/selinux-tftpd )
!net-ftp/atftp
!net-ftp/netkit-tftp"
DEPEND="${RDEPEND}
readline? ( sys-libs/readline )
tcpd? ( sys-apps/tcp-wrappers )"
src_compile() {
# additional patch for Windows clients
epatch "${FILESDIR}"/${P}-filecase.patch
#
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 "${D}"/usr/share/man/man8/tftpd.8 || die
newconfd "${FILESDIR}"/in.tftpd.confd-0.44 in.tftpd
newinitd "${FILESDIR}"/in.tftpd.rc6 in.tftpd
insinto /etc/xinetd.d
newins "${FILESDIR}"/tftp.xinetd tftp
}