Public bug reported:
We were getting an error message like this in the logs:
Oct 9 01:21:39 hostname in.tftpd[192773]: sending NAK (4, Missing mode)
to 10.0.0.10
This caused much confusion until we realized that the problem was our
TFTP client was sending an RRQ message with a zero-length filename.
Looking at the code, it doesn't check that case so it gives the wrong
error about the mode instead.
I took a look at the source and I propose this patch to fix the problem:
diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c
index 364e7d2..e2659e0 100644
--- a/tftpd/tftpd.c
+++ b/tftpd/tftpd.c
@@ -1085,6 +1085,11 @@ int tftp(struct tftphdr *tp, int size)
end = (char *)tp + size;
+ if (!*cp) {
+ nak(EBADOP, "Zero-length filename.");
+ exit(0);
+ }
+
while (cp < end && *cp) {
do {
cp++;
$ lsb_release -rd
Description: Ubuntu 20.04.2 LTS
Release: 20.04
$ apt-cache policy tftpd-hpa
tftpd-hpa:
Installed: 5.2+20150808-1ubuntu4
Candidate: 5.2+20150808-1ubuntu4
Version table:
*** 5.2+20150808-1ubuntu4 500
500 http://us.archive.ubuntu.com/ubuntu focal/main amd64 Packages
100 /var/lib/dpkg/status
** Affects: tftp-hpa (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1946550
Title:
tftpd-hpa sends a confusing error message if the filename is zero-
length.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/tftp-hpa/+bug/1946550/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs