remove old version of tftp-hpa
This commit is contained in:
parent
bed01402e5
commit
3f780c6625
@ -1,9 +1,6 @@
|
||||
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-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
|
||||
DIST tftp-hpa-5.0.tar.bz2 93039 RMD160 fbafc398b40098343b9e9e82badcfe6bd0eb3932 SHA1 7f541f085a4af5a87bf86a249421b13a30150597 SHA256 96309871519efcab829fdfcc1cca546d772ed6a0e214c9e99e77ca7aea29f734
|
||||
DIST tftp-hpa-5.1.tar.xz 89288 RMD160 44dcf64d083aa7a988a4f377954c31bb24da2009 SHA1 ade09d8aba5cb1155d0309c42ac427358cd41853 SHA256 f736417a4d436512168ec34fe0ed13845388a3f01b862baa50b7b427e7ab5e42
|
||||
EBUILD tftp-hpa-5.0-r9999.ebuild 1275 RMD160 2a75f90c7be902b97368223e6ccd40b0dcfd339f SHA1 333f39aa79bd99e5142615ac6d5137d57e71de58 SHA256 25b6b53fca5ddfd78fa0d9063de2fe91e1e094c674a878deeb2450e2ee29ad54
|
||||
EBUILD tftp-hpa-5.1-r9999.ebuild 1244 RMD160 dbf5b64d14fdb4b4ebc0388c64ac63e32cd63c6f SHA1 1c1ad1c56b244718c44dab5e7e85bcf1e8a4f0d5 SHA256 7be72bd1c7f7b3c1e7fd226fee7bf36b171f4af973193d6964e874e9ba1ccfdb
|
||||
|
@ -1,91 +0,0 @@
|
||||
--- tftp-hpa-5.0/tftpd/tftpd.c.orig 2009-12-26 13:17:35.000000000 +0300
|
||||
+++ tftp-hpa-5.0/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, struct formats *, const char **);
|
||||
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;
|
||||
@@ -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";
|
@ -1,46 +0,0 @@
|
||||
# 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-5.0.ebuild,v 1.3 2009/10/20 08:35:19 vapier 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"
|
||||
|
||||
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
|
||||
}
|
Loading…
Reference in New Issue
Block a user