This commit is contained in:
milisbir 2018-07-03 10:42:19 +02:00
parent 675bd69b68
commit d3d2a490f2
3 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,25 @@
# Tanım: Resmi tftp sunucusu
# URL: http://www.kernel.org/pub/software/network/tftp/tftp-hpa/
# Paketçi: milisarge
# Gerekler:
# Grup: ağ
isim=tftp-hpa
surum=5.2
devir=1
kaynak=(http://www.kernel.org/pub/software/network/tftp/tftp-hpa/tftp-hpa-$surum.tar.gz
tftpd.conf
tftp-hpa-0.49-fortify-strcpy-crash.patch)
derle() {
cd ${isim}-${surum}
# fix #28103
patch -Np1 -i ../tftp-hpa-0.49-fortify-strcpy-crash.patch
./configure --prefix=/usr --mandir=/usr/share/man --sbindir=/usr/bin --without-tcpwrappers
make
make INSTALLROOT="${PKG}" install
install -D -m644 "${SRC}/tftpd.conf" "$PKG/etc/conf.d/tftpd"
install -d "${PKG}/srv/tftp"
# Remove conflict with iputils
rm "${PKG}/usr/share/man/man8/tftpd.8"
}

View File

@ -0,0 +1,26 @@
diff -urN tftp-hpa-0.49.orig/tftp/tftp.c tftp-hpa-0.49/tftp/tftp.c
--- tftp-hpa-0.49.orig/tftp/tftp.c 2008-10-20 18:08:31.000000000 -0400
+++ tftp-hpa-0.49/tftp/tftp.c 2009-08-05 09:47:18.072585848 -0400
@@ -279,15 +279,16 @@
struct tftphdr *tp, const char *mode)
{
char *cp;
+ size_t len;
tp->th_opcode = htons((u_short) request);
cp = (char *)&(tp->th_stuff);
- strcpy(cp, name);
- cp += strlen(name);
- *cp++ = '\0';
- strcpy(cp, mode);
- cp += strlen(mode);
- *cp++ = '\0';
+ len = strlen(name) + 1;
+ memcpy(cp, name, len);
+ cp += len;
+ len = strlen(mode) + 1;
+ memcpy(cp, mode, len);
+ cp += len;
return (cp - (char *)tp);
}

View File

@ -0,0 +1 @@
TFTPD_ARGS="--secure /srv/tftp/"