[packages/tftp-hpa] - rel 6; added patch from fc
arekm
arekm at pld-linux.org
Wed Jan 22 18:47:08 CET 2020
commit e89f94a13e58f9c1f87fb9540db1003e46271893
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Wed Jan 22 18:47:00 2020 +0100
- rel 6; added patch from fc
tftp-enhanced-logging.patch | 84 +++++++++++++++++++++++++++++++++++++++++++++
tftp-hpa.spec | 6 ++--
2 files changed, 88 insertions(+), 2 deletions(-)
---
diff --git a/tftp-hpa.spec b/tftp-hpa.spec
index e120466..7f33474 100644
--- a/tftp-hpa.spec
+++ b/tftp-hpa.spec
@@ -5,10 +5,10 @@ Summary(pl.UTF-8): Klient TFTP (Trivial File Transfer Protocol)
Summary(tr.UTF-8): İlkel dosya aktarım protokolu (TFTP) için sunucu ve istemci
Name: tftp-hpa
Version: 5.2
-Release: 5
+Release: 6
License: BSD
Group: Applications/Networking
-Source0: ftp://ftp.kernel.org/pub/software/network/tftp/tftp-hpa/%{name}-%{version}.tar.xz
+Source0: https://www.kernel.org/pub/software/network/tftp/tftp-hpa/%{name}-%{version}.tar.xz
# Source0-md5: e86f58164166804e8ae5a46010f29317
Source1: tftpd-hpa.inetd
Source2: tftpd-hpa.init
@@ -22,6 +22,7 @@ Patch4: %{name}-0.49-fortify-strcpy-crash.patch
Patch5: tftp-0.49-cmd_arg.patch
Patch6: %{name}-0.49-stats.patch
Patch7: %{name}-5.2-pktinfo.patch
+Patch8: tftp-enhanced-logging.patch
URL: http://freshmeat.net/projects/tftp-hpa/
BuildRequires: readline-devel
BuildRequires: rpmbuild(macros) >= 1.268
@@ -142,6 +143,7 @@ standalone.
%patch5 -p1 -b .cmd_arg
%patch6 -p1 -b .stats
%patch7 -p1 -b .pktinfo
+%patch8 -p1
%build
%configure
diff --git a/tftp-enhanced-logging.patch b/tftp-enhanced-logging.patch
new file mode 100644
index 0000000..dce9ef9
--- /dev/null
+++ b/tftp-enhanced-logging.patch
@@ -0,0 +1,84 @@
+--- a/tftpd/tftpd.c 2016-03-02 11:32:30.710775130 +0100
++++ b/tftpd/tftpd.c 2016-03-02 11:36:24.086541019 +0100
+@@ -1056,14 +1056,14 @@ int main(int argc, char **argv)
+
+ static char *rewrite_access(char *, int, const char **);
+ static int validate_access(char *, int, const struct formats *, const char **);
+-static void tftp_sendfile(const struct formats *, struct tftphdr *, int);
++static void tftp_sendfile(const struct formats *, struct tftphdr *, int, char *);
+ static void tftp_recvfile(const struct formats *, struct tftphdr *, int);
+
+ struct formats {
+ const char *f_mode;
+ char *(*f_rewrite) (char *, int, const char **);
+ int (*f_validate) (char *, int, const struct formats *, const char **);
+- void (*f_send) (const struct formats *, struct tftphdr *, int);
++ void (*f_send) (const struct formats *, struct tftphdr *, int, char *);
+ void (*f_recv) (const struct formats *, struct tftphdr *, int);
+ int f_convert;
+ };
+@@ -1129,6 +1129,9 @@ int tftp(struct tftphdr *tp, int size)
+ nak(EACCESS, errmsgptr); /* File denied by mapping rule */
+ exit(0);
+ }
++ ecode =
++ (*pf->f_validate) (filename, tp_opcode, pf, &errmsgptr);
++
+ if (verbosity >= 1) {
+ tmp_p = (char *)inet_ntop(from.sa.sa_family, SOCKADDR_P(&from),
+ tmpbuf, INET6_ADDRSTRLEN);
+@@ -1147,9 +1150,14 @@ int tftp(struct tftphdr *tp, int size)
+ tp_opcode == WRQ ? "WRQ" : "RRQ",
+ tmp_p, origfilename,
+ filename);
++
++ if (ecode == 1) {
++ syslog(LOG_NOTICE, "Client %s File not found %s\n",
++ tmp_p,filename);
++ }
++
+ }
+- ecode =
+- (*pf->f_validate) (filename, tp_opcode, pf, &errmsgptr);
++
+ if (ecode) {
+ nak(ecode, errmsgptr);
+ exit(0);
+@@ -1172,12 +1180,12 @@ int tftp(struct tftphdr *tp, int size)
+ if (tp_opcode == WRQ)
+ (*pf->f_recv) (pf, (struct tftphdr *)ackbuf, ap - ackbuf);
+ else
+- (*pf->f_send) (pf, (struct tftphdr *)ackbuf, ap - ackbuf);
++ (*pf->f_send) (pf, (struct tftphdr *)ackbuf, ap - ackbuf, origfilename);
+ } else {
+ if (tp_opcode == WRQ)
+ (*pf->f_recv) (pf, NULL, 0);
+ else
+- (*pf->f_send) (pf, NULL, 0);
++ (*pf->f_send) (pf, NULL, 0, origfilename);
+ }
+ exit(0); /* Request completed */
+ }
+@@ -1557,7 +1565,7 @@ static int validate_access(char *filenam
+ /*
+ * Send the requested file.
+ */
+-static void tftp_sendfile(const struct formats *pf, struct tftphdr *oap, int oacklen)
++static void tftp_sendfile(const struct formats *pf, struct tftphdr *oap, int oacklen, char *filename)
+ {
+ struct tftphdr *dp;
+ struct tftphdr *ap; /* ack packet */
+@@ -1648,6 +1656,13 @@ static void tftp_sendfile(const struct f
+ if (!++block)
+ block = rollover_val;
+ } while (size == segsize);
++ tmp_p = (char *)inet_ntop(from.sa.sa_family, SOCKADDR_P(&from),
++ tmpbuf, INET6_ADDRSTRLEN);
++ if (!tmp_p) {
++ tmp_p = tmpbuf;
++ strcpy(tmpbuf, "???");
++ }
++ syslog(LOG_NOTICE, "Client %s finished %s",tmp_p,filename);
+ abort:
+ (void)fclose(file);
+ }
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/tftp-hpa.git/commitdiff/e89f94a13e58f9c1f87fb9540db1003e46271893
More information about the pld-cvs-commit
mailing list