public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/tftp] rawhide: rebase to the latest upstream release
Date: Thu, 09 Jul 2026 20:16:35 GMT	[thread overview]
Message-ID: <178362819551.1.1969246364539801776.rpms-tftp-bd72f25d7676@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/tftp
            Branch : rawhide
            Commit : bd72f25d76768aac22f03954243463b291287b42
            Author : Lukáš Zaoral <lzaoral@redhat.com>
            Date   : 2026-07-09T17:07:51+02:00
            Stats  : +232/-460 in 14 file(s)
            URL    : https://src.fedoraproject.org/rpms/tftp/c/bd72f25d76768aac22f03954243463b291287b42?branch=rawhide

            Log:
            rebase to the latest upstream release

- add gpg verification

Resolves: rhbz#2497090

---
diff --git a/.gitignore b/.gitignore
index 3b0dd17..cda16ac 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,5 @@ tftp-hpa-0.49.tar.bz2
 /tftp-hpa-5.1.tar.bz2
 /tftp-hpa-5.2.tar.bz2
 /tftp-hpa-5.3.tar.gz
+/tftp-hpa-5.4.tar.gz
+/tftp-hpa-5.4.tar.sign

diff --git a/hpa.gpg b/hpa.gpg
new file mode 100644
index 0000000..af92d9b
--- /dev/null
+++ b/hpa.gpg
@@ -0,0 +1,78 @@
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+
+mQINBGVThGwBEADFuXV8tEFv2dGflwjvS5IEUfTQKQSMFd8cVMlJx6a86H+G643q
+5mL4H6oqw1EnTzyjj6ko29RZ/78/pdm/QSdVuVvWqwY4BuWgYl+xY7mZTa4RAdtL
+EJbZczHuAi0NfQjhzzBq/1Hd4acTmWrmkS3ELTGmtQEeiEifqXBqS78HOEL82/AQ
+bB1hFy/QS0BLQbvXK4ndxDVhDflHpBp22iVrRzKtbfEjFTVw1Mo2gvakpyqqbKSo
+TZSwUBEJAXRHZq+BkvL+00ijN9de+srBVH+2Q+kf66SZ9iLRehOfIxSJujDKmlvH
++Vr2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F2/7ppTOaOwPZ4Emmju+TOTLpsF4Dnstv2ePWtOk9d9jor7x5Pcs
+tL7RyfgAk84BRc8s6HKuIPoQsjRuqCCsqP9VWsCOLhwjNH+H/9NchmuyVO2pK/Zr
+2ln/N/+h0HwK4ACt6Fo9A8dVE5TyaM92+TcJ2hXy5oXE6qaKElUJLhrgAZTj63St
+y99GG4IENy/i
+=vWRx
+-----END PGP PUBLIC KEY BLOCK-----

diff --git a/sources b/sources
index 566ed25..a4ae615 100644
--- a/sources
+++ b/sources
@@ -1 +1,2 @@
-SHA512 (tftp-hpa-5.3.tar.gz) = 919eefca1b702b72824957b77cc89547cd9ed67a44761cf7ed010baeab4b972bb6befa1002fd09943af628c2a5b1c181339396b6aa9d2766d9b10b97623068a3
+SHA512 (tftp-hpa-5.4.tar.gz) = a7f42f7e128b553da4f5b67cb494cb0f95ec6b05300bd0ed650ccf2ce658cc9fee9b462f0a08d92800275608d830d243e2016d6a50d9ba656beefb9beb892739
+SHA512 (tftp-hpa-5.4.tar.sign) = a8db01ccb5e71b0b4e200112964fede7480134b9412232a1ed58923ed5fcc3758ed80f1496761146f4274b68b46afc3530bbbdc57621fe570ea71a78fb320d17

diff --git a/tftp-0.42-tftpboot.patch b/tftp-0.42-tftpboot.patch
index a0de58d..98b92f9 100644
--- a/tftp-0.42-tftpboot.patch
+++ b/tftp-0.42-tftpboot.patch
@@ -1,19 +1,8 @@
-diff -up tftp-hpa-0.48/tftp-xinetd.tftpboot tftp-hpa-0.48/tftp-xinetd
---- tftp-hpa-0.48/tftp-xinetd.tftpboot	2007-01-31 00:51:05.000000000 +0100
-+++ tftp-hpa-0.48/tftp-xinetd	2008-05-20 12:05:53.000000000 +0200
-@@ -10,7 +10,7 @@ service tftp
- 	wait			= yes
- 	user			= root
- 	server			= /usr/sbin/in.tftpd
--	server_args		= -s /tftpboot
-+	server_args		= -s /var/lib/tftpboot
- 	disable			= yes
- 	per_source		= 11
- 	cps			= 100 2
-diff -up tftp-hpa-0.48/README.security.tftpboot tftp-hpa-0.48/README.security
---- tftp-hpa-0.48/README.security.tftpboot	2008-05-29 17:36:32.000000000 +0200
-+++ tftp-hpa-0.48/README.security	2008-05-29 17:37:21.000000000 +0200
-@@ -17,10 +17,10 @@ probably the following:
+diff --git a/README.security b/README.security
+index 644babb..24f5103 100644
+--- a/README.security
++++ b/README.security
+@@ -13,10 +13,10 @@ probably the following:
  
  1. Create a separate "tftpd" user and group only used for tftpd;
  2. Have all your boot files in a single directory tree (usually called 
@@ -27,7 +16,7 @@ diff -up tftp-hpa-0.48/README.security.tftpboot tftp-hpa-0.48/README.security
     umask is appropriate for your setup.)
  
  	       =======================================
-@@ -40,12 +40,12 @@ directly.  Thus, if your /etc/inetd.conf
+@@ -36,12 +36,12 @@ directly.  Thus, if your /etc/inetd.conf looks like this (all on one
  line):
  
  tftp	dgram	udp	wait	root	/usr/sbin/tcpd
@@ -42,10 +31,24 @@ diff -up tftp-hpa-0.48/README.security.tftpboot tftp-hpa-0.48/README.security
  
  You should make sure that you are using "wait" option in tftpd; you
  also need to have tftpd spawned as root in order for chroot (-s) to
-diff -up tftp-hpa-0.48/tftpd/sample.rules.tftpboot tftp-hpa-0.48/tftpd/sample.rules
---- tftp-hpa-0.48/tftpd/sample.rules.tftpboot	2008-05-29 17:38:46.000000000 +0200
-+++ tftp-hpa-0.48/tftpd/sample.rules	2008-05-29 17:38:05.000000000 +0200
-@@ -30,5 +30,5 @@ rg	\\		/		# Convert backslashes to slash
+diff --git a/tftp-xinetd b/tftp-xinetd
+index 982fe09..d04b48a 100644
+--- a/tftp-xinetd
++++ b/tftp-xinetd
+@@ -10,7 +10,7 @@ service tftp
+ 	wait			= yes
+ 	user			= root
+ 	server			= /usr/sbin/in.tftpd
+-	server_args		= -s /tftpboot
++	server_args		= -s /var/lib/tftpboot
+ 	disable			= yes
+ 	per_source		= 11
+ 	cps			= 100 2
+diff --git a/tftpd/sample.rules b/tftpd/sample.rules
+index 55b56be..1741a4c 100644
+--- a/tftpd/sample.rules
++++ b/tftpd/sample.rules
+@@ -29,5 +29,5 @@ rg	\\		/		# Convert backslashes to slashes
  rg	\#		@		# Convert hash marks to @ signs
  rg	/../		/..no../	# Convert /../ to /..no../
  e	^ok/				# These are always ok

diff --git a/tftp-doc.patch b/tftp-doc.patch
index 041e902..c3733d9 100644
--- a/tftp-doc.patch
+++ b/tftp-doc.patch
@@ -1,6 +1,6 @@
---- tftp-hpa-5.2/tftp/main.c	2013-04-19 09:34:09.737410319 +0200
-+++ tftp-hpa-5.2/tftp/main.c	2013-04-19 09:42:53.559946374 +0200
-@@ -195,9 +195,11 @@
+--- a/tftp/main.c
++++ b/tftp/main.c
+@@ -165,9 +165,11 @@ static void usage(int errcode)
  {
      fprintf(stderr,
  #ifdef HAVE_IPV6
@@ -12,5 +12,5 @@
 +            "Usage: %s [-v][-V][-l][-m mode] [-R port:port] "
 +			"[host [port]] [-c command]\n",
  #endif
-             program);
+             _progname);
      exit(errcode);

diff --git a/tftp-enhanced-logging.patch b/tftp-enhanced-logging.patch
index 4d548a9..cfb345f 100644
--- a/tftp-enhanced-logging.patch
+++ b/tftp-enhanced-logging.patch
@@ -1,51 +1,25 @@
-diff -up tftp-hpa-5.3/tftpd/tftpd.c.logging tftp-hpa-5.3/tftpd/tftpd.c
---- tftp-hpa-5.3/tftpd/tftpd.c.logging	2025-12-26 22:35:01.117565067 +0100
-+++ tftp-hpa-5.3/tftpd/tftpd.c	2025-12-26 22:36:09.040318780 +0100
-@@ -1053,14 +1053,14 @@ int main(int argc, char **argv)
- 
- static char *rewrite_access(char *, int, int, const char **);
+--- a/tftpd/tftpd.c
++++ b/tftpd/tftpd.c
+@@ -1089,7 +1089,7 @@ int main(int argc, char **argv)
+ static char *rewrite_access(const struct formats *,
+ 			    char *, int, 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, 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;
- };
-@@ -1125,6 +1125,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);
-@@ -1143,9 +1146,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);
-@@ -1168,12 +1176,12 @@ int tftp(struct tftphdr *tp, int size)
+ static const struct formats formats[] = {
+@@ -1180,6 +1180,9 @@ int tftp(struct tftphdr *tp, int size)
+ 	    if (!file) {
+ 		ecode =
+ 		    (*pf->f_validate) (filename, tp_opcode, pf, &errmsgptr);
++		if (ecode == 1)
++		    tftpd_log(LOG_NOTICE, "Client %s File not found %s\n",
++			      tmp_p, filename);
+ 		if (ecode) {
+ 		    nak(ecode, errmsgptr);
+ 		    exit(0);
+@@ -1203,12 +1206,12 @@ int tftp(struct tftphdr *tp, int size)
          if (tp_opcode == WRQ)
              (*pf->f_recv) (pf, (struct tftphdr *)ackbuf, ap - ackbuf);
          else
@@ -60,7 +34,7 @@ diff -up tftp-hpa-5.3/tftpd/tftpd.c.logging tftp-hpa-5.3/tftpd/tftpd.c
      }
      exit(0);                    /* Request completed */
  }
-@@ -1555,7 +1563,7 @@ static int validate_access(char *filenam
+@@ -1655,7 +1658,7 @@ static int validate_access(char *filename, int mode,
  /*
   * Send the requested file.
   */
@@ -69,17 +43,28 @@ diff -up tftp-hpa-5.3/tftpd/tftpd.c.logging tftp-hpa-5.3/tftpd/tftpd.c
  {
      struct tftphdr *dp;
      struct tftphdr *ap;         /* ack packet */
-@@ -1646,6 +1654,13 @@ static void tftp_sendfile(const struct f
+@@ -1746,6 +1749,13 @@ static void tftp_sendfile(const struct formats *pf, struct tftphdr *oap, int oac
  	if (!++block)
  	  block = rollover_val;
      } while (size == segsize);
 +    tmp_p = (char *)inet_ntop(from.sa.sa_family, SOCKADDR_P(&from),
-+                                          tmpbuf, INET6_ADDRSTRLEN);
++                              tmpbuf, INET6_ADDRSTRLEN);
 +    if (!tmp_p) {
 +            tmp_p = tmpbuf;
 +            strcpy(tmpbuf, "???");
 +    }
-+    syslog(LOG_NOTICE, "Client %s finished %s",tmp_p,filename);
++    tftpd_log(LOG_NOTICE, "Client %s finished %s", tmp_p, filename);
    abort:
      (void)fclose(file);
  }
+--- a/tftpd/tftpd.h
++++ b/tftpd/tftpd.h
+@@ -33,7 +33,7 @@ struct formats {
+     const char *f_mode;
+     char *(*f_rewrite) (const struct formats *, char *, int, 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;
+ };

diff --git a/tftp-hpa-5.2-osh.patch b/tftp-hpa-5.2-osh.patch
index 4a955aa..7435a3e 100644
--- a/tftp-hpa-5.2-osh.patch
+++ b/tftp-hpa-5.2-osh.patch
@@ -1,9 +1,9 @@
 # Fix leaked_handle: Handle variable "fd" going out of scope leaks the handle.
 diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c
-index 364e7d2..cbd6093 100644
+index 6dcf14f..b267364 100644
 --- a/tftpd/tftpd.c
 +++ b/tftpd/tftpd.c
-@@ -1505,6 +1505,7 @@ static int validate_access(char *filename, int mode,
+@@ -1616,6 +1623,7 @@ static int validate_access(char *filename, int mode,
  
      if (mode == RRQ) {
          if (!unixperms && (stbuf.st_mode & (S_IREAD >> 6)) == 0) {
@@ -11,7 +11,7 @@ index 364e7d2..cbd6093 100644
              *errmsg = "File must have global read permissions";
              return (EACCESS);
          }
-@@ -1514,6 +1515,7 @@ static int validate_access(char *filename, int mode,
+@@ -1625,6 +1633,7 @@ static int validate_access(char *filename, int mode,
      } else {
          if (!unixperms) {
              if ((stbuf.st_mode & (S_IWRITE >> 6)) == 0) {
@@ -19,7 +19,7 @@ index 364e7d2..cbd6093 100644
                  *errmsg = "File must have global write permissions";
                  return (EACCESS);
              }
-@@ -1522,6 +1524,7 @@ static int validate_access(char *filename, int mode,
+@@ -1633,6 +1642,7 @@ static int validate_access(char *filename, int mode,
  #ifdef HAVE_FTRUNCATE
  	/* We didn't get to truncate the file at open() time */
  	if (ftruncate(fd, (off_t) 0)) {
@@ -28,40 +28,10 @@ index 364e7d2..cbd6093 100644
  	  return (EACCESS);
  	}
 
-
-# Patches for negative_returns: "fd" is passed to a parameter of pmtu_discovery_off
-# that cannot be negative
-From 0b44159b3a2f51d350f309d3f6d14a17e74e8231 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= <lzaoral@redhat.com>
-Date: Wed, 6 Apr 2022 09:33:33 +0200
-Subject: [PATCH 1/2] tftpd: Correctly disable path MTU discovery in
- standalone mode
-
----
- tftpd/tftpd.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c
-index 364e7d2..00fa1cf 100644
---- a/tftpd/tftpd.c
-+++ b/tftpd/tftpd.c
-@@ -769,7 +769,7 @@ int main(int argc, char **argv)
-     }
- 
-     /* Disable path MTU discovery */
--    pmtu_discovery_off(fd);
-+    pmtu_discovery_off(fdmax);
- 
-     /* This means we don't want to wait() for children */
- #ifdef SA_NOCLDWAIT
--- 
-2.35.1
-
-
 From 5f60355c4bd10b866847a0d58a9582bda7db72aa Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= <lzaoral@redhat.com>
 Date: Wed, 6 Apr 2022 09:34:46 +0200
-Subject: [PATCH 2/2] tftpd: Fix a possible usage of -1 file descriptor in
+Subject: [PATCH] tftpd: Fix a possible usage of -1 file descriptor in
  standalone mode
 
 ---
@@ -72,7 +42,7 @@ diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c
 index 00fa1cf..afd595d 100644
 --- a/tftpd/tftpd.c
 +++ b/tftpd/tftpd.c
-@@ -622,6 +622,13 @@ int main(int argc, char **argv)
+@@ -672,6 +672,13 @@ int main(int argc, char **argv)
                          exit(EX_USAGE);
                      }
                      ai_fam = AF_INET6;
@@ -88,4 +58,3 @@ index 00fa1cf..afd595d 100644
  #endif
 -- 
 2.35.1
-

diff --git a/tftp-hpa-5.3-cmd_arg.patch b/tftp-hpa-5.3-cmd_arg.patch
deleted file mode 100644
index 51583fd..0000000
--- a/tftp-hpa-5.3-cmd_arg.patch
+++ /dev/null
@@ -1,148 +0,0 @@
-diff -up tftp-hpa-5.3/config.h.cmd_arg tftp-hpa-5.3/config.h
---- tftp-hpa-5.3/config.h.cmd_arg	2024-05-30 00:40:13.000000000 +0200
-+++ tftp-hpa-5.3/config.h	2025-12-26 22:27:30.933202754 +0100
-@@ -277,6 +277,7 @@ typedef int socklen_t;
- /* Prototypes for libxtra functions */
- 
- void *xmalloc(size_t);
-+void *xrealloc(void *, size_t);
- char *xstrdup(const char *);
- 
- #ifndef HAVE_SIGHANDLER_T
-diff -up tftp-hpa-5.3/lib/xrealloc.c.cmd_arg tftp-hpa-5.3/lib/xrealloc.c
---- tftp-hpa-5.3/lib/xrealloc.c.cmd_arg	2025-12-26 22:19:59.751870026 +0100
-+++ tftp-hpa-5.3/lib/xrealloc.c	2025-12-26 22:19:59.751870026 +0100
-@@ -0,0 +1,20 @@
-+/*
-+ * xrealloc.c
-+ *
-+ * Simple error-checking version of realloc()
-+ *
-+ */
-+
-+#include "config.h"
-+
-+void *xrealloc(void *ptr, size_t size)
-+{
-+    void *p = realloc(ptr, size);
-+
-+    if (!p) {
-+        fprintf(stderr, "Out of memory!\n");
-+        exit(128);
-+    }
-+
-+    return p;
-+}
-diff -up tftp-hpa-5.3/tftp/main.c.cmd_arg tftp-hpa-5.3/tftp/main.c
---- tftp-hpa-5.3/tftp/main.c.cmd_arg	2024-05-30 00:40:13.000000000 +0200
-+++ tftp-hpa-5.3/tftp/main.c	2025-12-26 22:19:59.752870023 +0100
-@@ -89,11 +89,14 @@ int connected;
- const struct modes *mode;
- #ifdef WITH_READLINE
- char *line = NULL;
-+char *remote_pth = NULL;
- #else
- char line[LBUFLEN];
-+char remote_pth[LBUFLEN];
- #endif
- int margc;
--char *margv[20];
-+char **margv;
-+int sizeof_margv=0;
- const char *prompt = "tftp> ";
- sigjmp_buf toplevel;
- void intr(int);
-@@ -379,6 +382,10 @@ static void getmoreargs(const char *part
-         free(line);
-         line = NULL;
-     }
-+    if (remote_pth) {
-+        free(remote_pth);
-+        remote_pth = NULL;
-+    }
-     line = xmalloc(len + elen + 1);
-     strcpy(line, partial);
-     strcpy(line + len, eline);
-@@ -535,6 +542,7 @@ void put(int argc, char *argv[])
-     int fd;
-     int n, err;
-     char *cp, *targ;
-+    long dirlen, namelen, lastlen=0;
- 
-     if (argc < 2) {
-         getmoreargs("send ", "(file) ");
-@@ -588,9 +596,22 @@ void put(int argc, char *argv[])
-     }
-     /* this assumes the target is a directory */
-     /* on a remote unix system.  hmmmm.  */
--    cp = strchr(targ, '\0');
--    *cp++ = '/';
-+    dirlen = strlen(targ)+1;
-+#ifdef WITH_READLINE
-+    remote_pth = xmalloc(dirlen+1);
-+#endif
-+    strcpy(remote_pth, targ);
-+    remote_pth[dirlen-1] = '/';
-+    cp = remote_pth + dirlen;
-     for (n = 1; n < argc - 1; n++) {
-+#ifdef WITH_READLINE
-+        namelen = strlen(tail(argv[n])) + 1;
-+        if (namelen > lastlen) {
-+            remote_pth = xrealloc(remote_pth, dirlen + namelen + 1);
-+            cp = remote_pth + dirlen;
-+            lastlen = namelen;
-+        }
-+#endif
-         strcpy(cp, tail(argv[n]));
-         fd = open(argv[n], O_RDONLY | mode->m_openflags);
-         if (fd < 0) {
-@@ -600,9 +621,9 @@ void put(int argc, char *argv[])
-         }
-         if (verbose)
-             printf("putting %s to %s:%s [%s]\n",
--                   argv[n], hostname, targ, mode->m_mode);
-+                   argv[n], hostname, remote_pth, mode->m_mode);
-         sa_set_port(&peeraddr, port);
--        tftp_sendfile(fd, targ, mode->m_mode);
-+        tftp_sendfile(fd, remote_pth, mode->m_mode);
-     }
- }
- 
-@@ -801,6 +822,10 @@ static void command(void)
-             free(line);
-             line = NULL;
-         }
-+        if (remote_pth) {
-+            free(remote_pth);
-+            remote_pth = NULL;
-+        }
-         line = readline(prompt);
-         if (!line)
-             exit(0);            /* EOF */
-@@ -872,7 +897,13 @@ struct cmd *getcmd(char *name)
- static void makeargv(void)
- {
-     char *cp;
--    char **argp = margv;
-+    char **argp;
-+
-+    if (!sizeof_margv) {
-+        sizeof_margv = 20;
-+        margv = xmalloc(sizeof_margv * sizeof(char *));
-+    }
-+    argp = margv;
- 
-     margc = 0;
-     for (cp = line; *cp;) {
-@@ -882,6 +913,11 @@ static void makeargv(void)
-             break;
-         *argp++ = cp;
-         margc += 1;
-+        if (margc == sizeof_margv) {
-+            sizeof_margv += 20;
-+            margv = xrealloc(margv, sizeof_margv * sizeof(char *));
-+            argp = margv + margc;
-+        }
-         while (*cp != '\0' && !isspace(*cp))
-             cp++;
-         if (*cp == '\0')

diff --git a/tftp-hpa-5.3-pktinfo.patch b/tftp-hpa-5.3-pktinfo.patch
deleted file mode 100644
index 716b27c..0000000
--- a/tftp-hpa-5.3-pktinfo.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-diff -up tftp-hpa-5.3/tftpd/recvfrom.c.pktinfo tftp-hpa-5.3/tftpd/recvfrom.c
---- tftp-hpa-5.3/tftpd/recvfrom.c.pktinfo	2024-05-30 00:40:13.000000000 +0200
-+++ tftp-hpa-5.3/tftpd/recvfrom.c	2025-12-26 22:30:37.142522362 +0100
-@@ -170,16 +170,16 @@ myrecvfrom(int s, void *buf, int len, un
- 
-     /* Try to enable getting the return address */
- #ifdef IP_RECVDSTADDR
--    if (from->sa.sa_family == AF_INET)
-+    if (from->sa.sa_family == AF_INET || !from->sa.sa_family)
-         setsockopt(s, IPPROTO_IP, IP_RECVDSTADDR, &on, sizeof(on));
- #endif
- #ifdef IP_PKTINFO
--    if (from->sa.sa_family == AF_INET)
-+    if (from->sa.sa_family == AF_INET || !from->sa.sa_family)
-         setsockopt(s, IPPROTO_IP, IP_PKTINFO, &on, sizeof(on));
- #endif
- #ifdef HAVE_IPV6
- #ifdef IPV6_RECVPKTINFO
--    if (from->sa.sa_family == AF_INET6)
-+    if (from->sa.sa_family == AF_INET6 || !from->sa.sa_family)
-         setsockopt(s, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, sizeof(on));
- #endif
- #endif

diff --git a/tftp-hpa-5.3-setjmp.patch b/tftp-hpa-5.3-setjmp.patch
deleted file mode 100644
index d8b053e..0000000
--- a/tftp-hpa-5.3-setjmp.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From b9f2335e88dcb3939015843c7143f1533c755a46 Mon Sep 17 00:00:00 2001
-From: "H. Peter Anvin" <hpa@zytor.com>
-Date: Wed, 29 May 2024 17:35:14 -0700
-Subject: tftpd: shut up one more setjmp complaint
-
-One more place where the compiler complains about setjmp. Work around
-it by creating yet another static variable. Ugly, but it works.
-
-Signed-off-by: H. Peter Anvin <hpa@zytor.com>
----
- tftpd/tftpd.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c
-index 14182f3..d9b3f46 100644
---- a/tftpd/tftpd.c
-+++ b/tftpd/tftpd.c
-@@ -1660,17 +1660,21 @@ static void tftp_sendfile(const struct formats *pf, struct tftphdr *oap, int oac
- /*
-  * Receive a file.
-  */
--static void tftp_recvfile(const struct formats *pf, struct tftphdr *oap, int oacklen)
-+static void tftp_recvfile(const struct formats *pf,
-+			  struct tftphdr *oack, int oacklen)
- {
-     struct tftphdr *dp;
-     int n, size;
-     /* These are "static" to avoid longjmp funnies */
-+    static struct tftphdr *oap;
-     static struct tftphdr *ap;  /* ack buffer */
-     static u_short block = 0;
-     static int acksize;
-     u_short dp_opcode, dp_block;
-     unsigned long r_timeout;
- 
-+    oap = oack;
-+
-     dp = w_init();
-     do {
-         timeout = rexmtval;
--- 
-cgit 1.2.3-korg
-

diff --git a/tftp-hpa-5.3-stats.patch b/tftp-hpa-5.3-stats.patch
index e770465..571ab30 100644
--- a/tftp-hpa-5.3-stats.patch
+++ b/tftp-hpa-5.3-stats.patch
@@ -1,4 +1,4 @@
-From 1b6c4905ded296dd1e593d8a75ef565a8e16f4fa Mon Sep 17 00:00:00 2001
+From 7b1051cafcfb4fd61c840e489cecea8380177aa4 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= <lzaoral@redhat.com>
 Date: Tue, 14 Apr 2026 17:58:41 +0200
 Subject: [PATCH] =?UTF-8?q?tftp:=20correctly=20convert=20=CE=BCs=20to=20s?=
@@ -23,10 +23,10 @@ Signed-off-by: Lukáš Zaoral <lzaoral@redhat.com>
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/tftp/tftp.c b/tftp/tftp.c
-index 33a4175..2ba3de2 100644
+index 14c3a75..e161527 100644
 --- a/tftp/tftp.c
 +++ b/tftp/tftp.c
-@@ -398,8 +398,8 @@ static void printstats(const char *direction, unsigned long amount)
+@@ -406,8 +406,8 @@ static void printstats(const char *direction, unsigned long amount)
  {
      double delta;
  
@@ -38,5 +38,5 @@ index 33a4175..2ba3de2 100644
          printf("%s %lu bytes in %.1f seconds", direction, amount, delta);
          printf(" [%.0f bit/s]", (amount * 8.) / delta);
 -- 
-2.53.0
+2.55.0
 

diff --git a/tftp-hpa-5.3-tftp-exit-code-cmdmode.patch b/tftp-hpa-5.3-tftp-exit-code-cmdmode.patch
index d1cb572..47c8351 100644
--- a/tftp-hpa-5.3-tftp-exit-code-cmdmode.patch
+++ b/tftp-hpa-5.3-tftp-exit-code-cmdmode.patch
@@ -1,4 +1,4 @@
-From 662053b769c1c15ad0ff2a9eee72cb74ccede34a Mon Sep 17 00:00:00 2001
+From 817a17dfddca3c1213a8a5dc848b043caefee139 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= <lzaoral@redhat.com>
 Date: Wed, 16 Jul 2025 15:03:43 +0200
 Subject: [PATCH] tftp: propagate errors to exit code in single command mode
@@ -10,10 +10,10 @@ Subject: [PATCH] tftp: propagate errors to exit code in single command mode
  3 files changed, 94 insertions(+), 64 deletions(-)
 
 diff --git a/tftp/extern.h b/tftp/extern.h
-index 9c578e6..7923eac 100644
+index 9fd424b..c1e1980 100644
 --- a/tftp/extern.h
 +++ b/tftp/extern.h
-@@ -36,8 +36,8 @@
+@@ -10,8 +10,8 @@
  
  #include "config.h"
  
@@ -25,10 +25,10 @@ index 9c578e6..7923eac 100644
  
  #endif
 diff --git a/tftp/main.c b/tftp/main.c
-index ac06330..74f63f8 100644
+index eed02bf..e7b338c 100644
 --- a/tftp/main.c
 +++ b/tftp/main.c
-@@ -102,20 +102,20 @@ int portrange = 0;
+@@ -77,20 +77,20 @@ int portrange = 0;
  unsigned int portrange_from = 0;
  unsigned int portrange_to = 0;
  
@@ -63,7 +63,7 @@ index ac06330..74f63f8 100644
  
  static void command(void);
  
-@@ -129,7 +129,7 @@ static void settftpmode(const struct modes *);
+@@ -104,7 +104,7 @@ static void settftpmode(const struct modes *);
  struct cmd {
      const char *name;
      const char *help;
@@ -72,16 +72,16 @@ index ac06330..74f63f8 100644
  };
  
  struct cmd cmdtab[] = {
-@@ -188,7 +188,7 @@ char *xstrdup(const char *);
+@@ -161,7 +161,7 @@ char *tail(char *);
  
- const char *program;
+ char *xstrdup(const char *);
  
 -static void usage(int errcode)
 +static int usage(int errcode)
  {
      fprintf(stderr,
  #ifdef HAVE_IPV6
-@@ -203,7 +203,7 @@ static void usage(int errcode)
+@@ -176,7 +176,7 @@ static void usage(int errcode)
  int main(int argc, char *argv[])
  {
      union sock_addr sa;
@@ -90,7 +90,7 @@ index ac06330..74f63f8 100644
      static int pargc, peerargc;
      static int iscmd = 0;
      char **pargv;
-@@ -342,8 +342,8 @@ int main(int argc, char *argv[])
+@@ -315,8 +315,8 @@ int main(int argc, char *argv[])
                      pargv[1]);
              exit(EX_USAGE);
          }
@@ -101,7 +101,7 @@ index ac06330..74f63f8 100644
      }
  #ifdef WITH_READLINE
  #ifdef HAVE_READLINE_HISTORY_H
-@@ -398,7 +398,7 @@ static void getmoreargs(const char *partial, const char *mprompt)
+@@ -371,7 +371,7 @@ static void getmoreargs(const char *partial, const char *mprompt)
  #endif
  }
  
@@ -110,7 +110,7 @@ index ac06330..74f63f8 100644
  {
      int err;
  
-@@ -410,7 +410,7 @@ void setpeer(int argc, char *argv[])
+@@ -383,7 +383,7 @@ void setpeer(int argc, char *argv[])
      }
      if ((argc < 2) || (argc > 3)) {
          printf("usage: %s host-name [port]\n", argv[0]);
@@ -119,7 +119,7 @@ index ac06330..74f63f8 100644
      }
  
      peeraddr.sa.sa_family = ai_fam;
-@@ -419,7 +419,7 @@ void setpeer(int argc, char *argv[])
+@@ -392,7 +392,7 @@ void setpeer(int argc, char *argv[])
          printf("Error: %s\n", gai_strerror(err));
          printf("%s: unknown host\n", argv[1]);
          connected = 0;
@@ -128,7 +128,7 @@ index ac06330..74f63f8 100644
      }
      ai_fam = peeraddr.sa.sa_family;
      if (f == -1) { /* socket not open */
-@@ -456,7 +456,7 @@ void setpeer(int argc, char *argv[])
+@@ -429,7 +429,7 @@ void setpeer(int argc, char *argv[])
              if (*ep || myport > 65535UL) {
                  printf("%s: bad port number\n", argv[2]);
                  connected = 0;
@@ -137,7 +137,7 @@ index ac06330..74f63f8 100644
              }
              port = htons((u_short) myport);
          }
-@@ -472,16 +472,17 @@ void setpeer(int argc, char *argv[])
+@@ -445,16 +445,17 @@ void setpeer(int argc, char *argv[])
                 hostname, tp, (unsigned int)ntohs(port));
      }
      connected = 1;
@@ -157,7 +157,7 @@ index ac06330..74f63f8 100644
      }
      if (argc == 2) {
          for (p = modes; p->m_name; p++)
-@@ -489,7 +490,7 @@ void modecmd(int argc, char *argv[])
+@@ -462,7 +463,7 @@ void modecmd(int argc, char *argv[])
                  break;
          if (p->m_name) {
              settftpmode(p);
@@ -166,7 +166,7 @@ index ac06330..74f63f8 100644
          }
          printf("%s: unknown mode\n", argv[1]);
          /* drop through and print usage message */
-@@ -503,21 +504,23 @@ void modecmd(int argc, char *argv[])
+@@ -476,21 +477,23 @@ void modecmd(int argc, char *argv[])
              sep = " | ";
      }
      printf(" ]\n");
@@ -193,7 +193,7 @@ index ac06330..74f63f8 100644
  }
  
  static void settftpmode(const struct modes *newmode)
-@@ -530,7 +533,7 @@ static void settftpmode(const struct modes *newmode)
+@@ -503,7 +506,7 @@ static void settftpmode(const struct modes *newmode)
  /*
   * Send file(s).
   */
@@ -202,7 +202,7 @@ index ac06330..74f63f8 100644
  {
      int fd;
      int n, err;
-@@ -544,14 +547,14 @@ void put(int argc, char *argv[])
+@@ -517,14 +520,14 @@ void put(int argc, char *argv[])
      }
      if (argc < 2) {
          putusage(argv[0]);
@@ -219,7 +219,7 @@ index ac06330..74f63f8 100644
              }
          cp = argv[argc - 1];
          targ = strchr(cp, ':');
-@@ -562,14 +565,14 @@ void put(int argc, char *argv[])
+@@ -535,14 +538,14 @@ void put(int argc, char *argv[])
              printf("Error: %s\n", gai_strerror(err));
              printf("%s: unknown host\n", argv[1]);
              connected = 0;
@@ -236,7 +236,7 @@ index ac06330..74f63f8 100644
      }
      if (argc < 4) {
          cp = argc == 2 ? tail(targ) : argv[1];
-@@ -587,14 +590,14 @@ void put(int argc, char *argv[])
+@@ -550,17 +553,18 @@ void put(int argc, char *argv[])
          if (fd < 0) {
              fprintf(stderr, "tftp: ");
              perror(cp);
@@ -254,34 +254,32 @@ index ac06330..74f63f8 100644
      }
      /* this assumes the target is a directory */
      /* on a remote unix system.  hmmmm.  */
-@@ -605,6 +608,7 @@ void put(int argc, char *argv[])
-     strcpy(remote_pth, targ);
-     remote_pth[dirlen-1] = '/';
-     cp = remote_pth + dirlen;
 +    err = 0;
      for (n = 1; n < argc - 1; n++) {
- #ifdef WITH_READLINE
-         namelen = strlen(tail(argv[n])) + 1;
-@@ -619,14 +623,17 @@ void put(int argc, char *argv[])
+         const char *base = tail(argv[n]);
+         char *remotepath = xmalloc(strlen(targ) + 1 + strlen(base) + 1);
+@@ -570,6 +574,7 @@ void put(int argc, char *argv[])
          if (fd < 0) {
              fprintf(stderr, "tftp: ");
              perror(argv[n]);
 +            err = EX_OSERR;
+             free(remotepath);
              continue;
          }
-         if (verbose)
+@@ -577,9 +582,11 @@ void put(int argc, char *argv[])
              printf("putting %s to %s:%s [%s]\n",
-                    argv[n], hostname, remote_pth, mode->m_mode);
+                    argv[n], hostname, remotepath, mode->m_mode);
          sa_set_port(&peeraddr, port);
--        tftp_sendfile(fd, remote_pth, mode->m_mode);
-+        err |= tftp_sendfile(fd, remote_pth, mode->m_mode);
+-        tftp_sendfile(fd, remotepath, mode->m_mode);
++        err |= tftp_sendfile(fd, remotepath, mode->m_mode);
+         free(remotepath);
      }
 +
 +    return err;
  }
  
  static void putusage(char *s)
-@@ -615,10 +622,10 @@ static void putusage(char *s)
+@@ -591,10 +598,10 @@ static void putusage(char *s)
  /*
   * Receive file(s).
   */
@@ -294,7 +292,7 @@ index ac06330..74f63f8 100644
      char *cp;
      char *src;
  
-@@ -630,28 +637,28 @@ void get(int argc, char *argv[])
+@@ -606,28 +613,28 @@ void get(int argc, char *argv[])
      }
      if (argc < 2) {
          getusage(argv[0]);
@@ -327,7 +325,7 @@ index ac06330..74f63f8 100644
                  continue;
              }
              ai_fam = peeraddr.sa.sa_family;
-@@ -664,13 +671,13 @@ void get(int argc, char *argv[])
+@@ -640,13 +647,13 @@ void get(int argc, char *argv[])
              if (fd < 0) {
                  fprintf(stderr, "tftp: ");
                  perror(cp);
@@ -343,7 +341,7 @@ index ac06330..74f63f8 100644
              break;
          }
          cp = tail(src);         /* new .. jdg */
-@@ -679,14 +686,16 @@ void get(int argc, char *argv[])
+@@ -655,14 +662,16 @@ void get(int argc, char *argv[])
          if (fd < 0) {
              fprintf(stderr, "tftp: ");
              perror(cp);
@@ -361,7 +359,7 @@ index ac06330..74f63f8 100644
  }
  
  static void getusage(char *s)
-@@ -697,7 +706,7 @@ static void getusage(char *s)
+@@ -673,7 +682,7 @@ static void getusage(char *s)
  
  int rexmtval = TIMEOUT;
  
@@ -370,7 +368,7 @@ index ac06330..74f63f8 100644
  {
      int t;
  
-@@ -709,18 +718,19 @@ void setrexmt(int argc, char *argv[])
+@@ -685,18 +694,19 @@ void setrexmt(int argc, char *argv[])
      }
      if (argc != 2) {
          printf("usage: %s value\n", argv[0]);
@@ -392,7 +390,7 @@ index ac06330..74f63f8 100644
  {
      int t;
  
-@@ -732,24 +742,26 @@ void settimeout(int argc, char *argv[])
+@@ -708,24 +718,26 @@ void settimeout(int argc, char *argv[])
      }
      if (argc != 2) {
          printf("usage: %s value\n", argv[0]);
@@ -422,7 +420,7 @@ index ac06330..74f63f8 100644
  {
      (void)argc;
      (void)argv;                 /* Quiet unused warning */
-@@ -762,6 +774,7 @@ void status(int argc, char *argv[])
+@@ -738,6 +750,7 @@ void status(int argc, char *argv[])
             literal ? "on" : "off");
      printf("Rexmt-interval: %d seconds, Max-timeout: %d seconds\n",
             rexmtval, maxtimeout);
@@ -430,7 +428,7 @@ index ac06330..74f63f8 100644
  }
  
  void intr(int sig)
-@@ -891,7 +904,7 @@ static void makeargv(void)
+@@ -872,7 +885,7 @@ static void makeargv(void)
      *argp++ = 0;
  }
  
@@ -439,7 +437,7 @@ index ac06330..74f63f8 100644
  {
      (void)argc;
      (void)argv;                 /* Quiet unused warning */
-@@ -901,7 +914,7 @@ void quit(int argc, char *argv[])
+@@ -882,7 +895,7 @@ void quit(int argc, char *argv[])
  /*
   * Help command.
   */
@@ -448,7 +446,7 @@ index ac06330..74f63f8 100644
  {
      struct cmd *c;
  
-@@ -911,7 +924,7 @@ void help(int argc, char *argv[])
+@@ -892,7 +905,7 @@ void help(int argc, char *argv[])
          printf("Commands may be abbreviated.  Commands are:\n\n");
          for (c = cmdtab; c->name; c++)
              printf("%-*s\t%s\n", (int)HELPINDENT, c->name, c->help);
@@ -457,7 +455,7 @@ index ac06330..74f63f8 100644
      }
      while (--argc > 0) {
          char *arg;
-@@ -924,22 +937,25 @@ void help(int argc, char *argv[])
+@@ -905,22 +918,25 @@ void help(int argc, char *argv[])
          else
              printf("%s\n", c->help);
      }
@@ -486,10 +484,10 @@ index ac06330..74f63f8 100644
 +    return 0;
  }
 diff --git a/tftp/tftp.c b/tftp/tftp.c
-index 33a4175..19e60dc 100644
+index e161527..8e5bb65 100644
 --- a/tftp/tftp.c
 +++ b/tftp/tftp.c
-@@ -61,11 +61,11 @@ static void tpacket(const char *, struct tftphdr *, int);
+@@ -45,11 +45,11 @@ static void tpacket(const char *, struct tftphdr *, int);
  /*
   * Send the requested file.
   */
@@ -503,15 +501,15 @@ index 33a4175..19e60dc 100644
      volatile int is_request;
      volatile u_short block;
      volatile int size, convert;
-@@ -83,6 +83,7 @@ void tftp_sendfile(int fd, const char *name, const char *mode)
+@@ -67,6 +67,7 @@ void tftp_sendfile(int fd, const char *name, const char *mode)
      block = 0;
      is_request = 1;             /* First packet is the actual WRQ */
      amount = 0;
 +    err = 0;
  
-     tftp_signal(SIGALRM, timer);
+     tftp_signal(SIGALRM, timer, 0);
      do {
-@@ -93,6 +94,7 @@ void tftp_sendfile(int fd, const char *name, const char *mode)
+@@ -81,6 +82,7 @@ void tftp_sendfile(int fd, const char *name, const char *mode)
              size = readit(file, &dp, convert);
              if (size < 0) {
                  nak(errno + 100, NULL);
@@ -519,7 +517,7 @@ index 33a4175..19e60dc 100644
                  break;
              }
              dp->th_opcode = htons((u_short) DATA);
-@@ -107,6 +109,7 @@ void tftp_sendfile(int fd, const char *name, const char *mode)
+@@ -95,6 +97,7 @@ void tftp_sendfile(int fd, const char *name, const char *mode)
                     &peeraddr.sa, SOCKLEN(&peeraddr));
          if (n != size + 4) {
              perror("tftp: sendto");
@@ -527,7 +525,7 @@ index 33a4175..19e60dc 100644
              goto abort;
          }
          read_ahead(file, convert);
-@@ -120,6 +123,7 @@ void tftp_sendfile(int fd, const char *name, const char *mode)
+@@ -108,6 +111,7 @@ void tftp_sendfile(int fd, const char *name, const char *mode)
              alarm(0);
              if (n < 0) {
                  perror("tftp: recvfrom");
@@ -535,7 +533,7 @@ index 33a4175..19e60dc 100644
                  goto abort;
              }
              sa_set_port(&peeraddr, SOCKPORT(&from));  /* added */
-@@ -130,6 +134,7 @@ void tftp_sendfile(int fd, const char *name, const char *mode)
+@@ -118,6 +122,7 @@ void tftp_sendfile(int fd, const char *name, const char *mode)
              ap_block = ntohs((u_short) ap->th_block);
              if (ap_opcode == ERROR) {
                  printf("Error code %d: %s\n", ap_block, ap->th_msg);
@@ -543,7 +541,7 @@ index 33a4175..19e60dc 100644
                  goto abort;
              }
              if (ap_opcode == ACK) {
-@@ -162,16 +167,18 @@ void tftp_sendfile(int fd, const char *name, const char *mode)
+@@ -150,16 +155,18 @@ void tftp_sendfile(int fd, const char *name, const char *mode)
      stopclock();
      if (amount > 0)
          printstats("Sent", amount);
@@ -564,15 +562,15 @@ index 33a4175..19e60dc 100644
      volatile u_short block;
      volatile int size, firsttrip;
      volatile unsigned long amount;
-@@ -189,6 +196,7 @@ void tftp_recvfile(int fd, const char *name, const char *mode)
+@@ -177,6 +184,7 @@ void tftp_recvfile(int fd, const char *name, const char *mode)
      block = 1;
      firsttrip = 1;
      amount = 0;
 +    err = 0;
  
-     tftp_signal(SIGALRM, timer);
+     tftp_signal(SIGALRM, timer, 0);
      do {
-@@ -210,6 +218,7 @@ void tftp_recvfile(int fd, const char *name, const char *mode)
+@@ -202,6 +210,7 @@ void tftp_recvfile(int fd, const char *name, const char *mode)
                     SOCKLEN(&peeraddr)) != size) {
              alarm(0);
              perror("tftp: sendto");
@@ -580,7 +578,7 @@ index 33a4175..19e60dc 100644
              goto abort;
          }
          write_behind(file, convert);
-@@ -223,6 +232,7 @@ void tftp_recvfile(int fd, const char *name, const char *mode)
+@@ -215,6 +224,7 @@ void tftp_recvfile(int fd, const char *name, const char *mode)
              alarm(0);
              if (n < 0) {
                  perror("tftp: recvfrom");
@@ -588,7 +586,7 @@ index 33a4175..19e60dc 100644
                  goto abort;
              }
              sa_set_port(&peeraddr, SOCKPORT(&from));  /* added */
-@@ -233,6 +243,7 @@ void tftp_recvfile(int fd, const char *name, const char *mode)
+@@ -225,6 +235,7 @@ void tftp_recvfile(int fd, const char *name, const char *mode)
              dp_block = ntohs((u_short) dp->th_block);
              if (dp_opcode == ERROR) {
                  printf("Error code %d: %s\n", dp_block, dp->th_msg);
@@ -596,7 +594,7 @@ index 33a4175..19e60dc 100644
                  goto abort;
              }
              if (dp_opcode == DATA) {
-@@ -257,6 +268,7 @@ void tftp_recvfile(int fd, const char *name, const char *mode)
+@@ -249,6 +260,7 @@ void tftp_recvfile(int fd, const char *name, const char *mode)
          size = writeit(file, &dp, n - 4, convert);
          if (size < 0) {
              nak(errno + 100, NULL);
@@ -604,7 +602,7 @@ index 33a4175..19e60dc 100644
              break;
          }
          amount += size;
-@@ -271,6 +283,8 @@ void tftp_recvfile(int fd, const char *name, const char *mode)
+@@ -263,6 +275,8 @@ void tftp_recvfile(int fd, const char *name, const char *mode)
      stopclock();
      if (amount > 0)
          printstats("Received", amount);
@@ -614,5 +612,5 @@ index 33a4175..19e60dc 100644
  
  static int
 -- 
-2.52.0
+2.55.0
 

diff --git a/tftp-off-by-one.patch b/tftp-off-by-one.patch
deleted file mode 100644
index 98b0874..0000000
--- a/tftp-off-by-one.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-Resolves: #1485943
-
---- a/tftpd/tftpd.c       2017-08-28 09:12:11.681299000 +0200
-+++ b/tftpd/tftpd.c       2017-08-28 13:30:03.109312000 +0200
-@@ -1388,24 +1388,25 @@
-             return strlen(p);
- 
-     case 'x':
--        if (output) {
--            if (from.sa.sa_family == AF_INET) {
-+        if (from.sa.sa_family == AF_INET) {
-+            if (output) {
-                 sprintf(output, "%08lX",
-                     (unsigned long)ntohl(from.si.sin_addr.s_addr));
--                l = 8;
-+            }
-+            l = 8;
- #ifdef HAVE_IPV6
--            } else {
--                unsigned char *c = (unsigned char *)SOCKADDR_P(&from);
--                p = tb;
--                for (l = 0; l < 16; l++) {
--                    sprintf(p, "%02X", *c);
--                    c++;
--                    p += 2;
--                }
-+        } else {
-+            unsigned char *c = (unsigned char *)SOCKADDR_P(&from);
-+            p = tb;
-+            for (l = 0; l < 16; l++) {
-+                sprintf(p, "%02X", *c);
-+                c++;
-+                p += 2;
-+            }
-+            if (output)
-                 strcpy(output, tb);
--                l = strlen(tb);
-+            l = strlen(tb);
- #endif
--            }
-         }
-         return l;
- 
-

diff --git a/tftp.spec b/tftp.spec
index 287b17d..793980e 100644
--- a/tftp.spec
+++ b/tftp.spec
@@ -2,21 +2,20 @@
 
 Summary: The client for the Trivial File Transfer Protocol (TFTP)
 Name: tftp
-Version: 5.3
-Release: 4%{?dist}
+Version: 5.4
+Release: 1%{?dist}
 License: BSD-4-Clause-UC
 URL: http://www.kernel.org/pub/software/network/tftp/
-Source0: https://git.kernel.org/pub/scm/network/tftp/tftp-hpa.git/snapshot/tftp-hpa-%{version}.tar.gz
-Source1: tftp.socket
-Source2: tftp.service
-Source3: tftp-server-tmpfiles.conf
-
-# Upstream patches
-# https://git.kernel.org/pub/scm/network/tftp/tftp-hpa.git/patch/?id=b9f2335e88dcb3939015843c7143f1533c755a46
-Patch: tftp-hpa-5.3-setjmp.patch
+Source0: https://www.kernel.org/pub/software/network/tftp/tftp-hpa/tftp-hpa-5.4.tar.gz
+Source1: https://www.kernel.org/pub/software/network/tftp/tftp-hpa/tftp-hpa-5.4.tar.sign
+# gpg --keyserver pgp.mit.edu --recv-key 6D0107BC69EE5A274FD9B60C2DB3C3321B6DDF86
+# gpg --output hpa.gpg --armor --export hpa@zytor.com
+Source2: hpa.gpg
+Source3: tftp.socket
+Source4: tftp.service
+Source5: tftp-server-tmpfiles.conf
 
 # To-be upstreamed patches
-Patch: tftp-hpa-5.3-cmd_arg.patch
 # https://www.syslinux.org/archives/2026-April/026959.html
 Patch: tftp-hpa-5.3-stats.patch
 Patch: tftp-doc.patch
@@ -26,13 +25,9 @@ Patch: tftp-hpa-5.3-tftp-exit-code-cmdmode.patch
 
 # Downstream-only patches
 Patch: tftp-0.42-tftpboot.patch
-# Code removed upstream in https://git.kernel.org/pub/scm/network/tftp/tftp-hpa.git/patch/?id=b6d9029420315dc60237d1d4fb29306ae172c120
-Patch: tftp-hpa-5.3-pktinfo.patch
-# Code removed upstream in https://git.kernel.org/pub/scm/network/tftp/tftp-hpa.git/patch/?id=04d7b0db0672ef5c7c36886e00f136672881a9ef
-Patch: tftp-off-by-one.patch
 
-BuildRequires: autoconf
 BuildRequires: gcc
+BuildRequires: gpgverify
 BuildRequires: make
 BuildRequires: readline-devel
 BuildRequires: systemd-rpm-macros
@@ -59,26 +54,21 @@ enabled unless it is expressly needed.  The TFTP server is run by using
 systemd socket activation, and is disabled by default.
 
 %prep
+gzip -cd '%{SOURCE0}' > 'tftp-hpa-%{version}.tar'
+%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='tftp-hpa-%{version}.tar'
 %autosetup -p1 -n tftp-hpa-%{version}
 
 %build
-autoreconf
 %configure
 %make_build
 
 %install
-mkdir -p ${RPM_BUILD_ROOT}%{_bindir}
-mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man{1,8}
-mkdir -p ${RPM_BUILD_ROOT}%{_sbindir}
-mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/lib/tftpboot
-mkdir -p ${RPM_BUILD_ROOT}%{_tmpfilesdir}
-mkdir -p ${RPM_BUILD_ROOT}%{_unitdir}
-
 %make_install INSTALLROOT=%{buildroot} SBINDIR=%{_sbindir} MANDIR=%{_mandir}
 
-install -p -m 644 %SOURCE1 ${RPM_BUILD_ROOT}%{_unitdir}
-install -p -m 644 %SOURCE2 ${RPM_BUILD_ROOT}%{_unitdir}
-install -p -m 644 %SOURCE3 ${RPM_BUILD_ROOT}%{_tmpfilesdir}/%{name}.conf
+mkdir -p %{buildroot}%{_localstatedir}/lib/tftpboot
+install -D -p -m 644 %SOURCE3 %{buildroot}%{_unitdir}/%{name}.socket
+install -D -p -m 644 %SOURCE4 %{buildroot}%{_unitdir}/%{name}.service
+install -D -p -m 644 %SOURCE5 %{buildroot}%{_tmpfilesdir}/%{name}.conf
 
 %post server
 %systemd_post tftp.socket
@@ -106,6 +96,10 @@ install -p -m 644 %SOURCE3 ${RPM_BUILD_ROOT}%{_tmpfilesdir}/%{name}.conf
 %{_unitdir}/tftp.socket
 
 %changelog
+* Thu Jul 09 2026 Lukáš Zaoral <lzaoral@redhat.com> - 5.4-1
+- rebase to the latest upstream release (rhbz#2497090)
+- add gpg verification
+
 * Wed Apr 15 2026 Lukáš Zaoral <lzaoral@redhat.com> - 5.3-4
 - clean-up patches
 

                 reply	other threads:[~2026-07-09 20:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178362819551.1.1969246364539801776.rpms-tftp-bd72f25d7676@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox