Read mode should return ENOTFOUND instead of EUNDEF for files that do not exist.

Bug #217537 reported by Jerry Kotland
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
netkit-tftp (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

G'day,

tftpd.c:validate_access was changed so that the file stat was not called. The comment indicates that this was done so that it wouldn't report ENOTFOUND in write mode which is the correct behaviour. Unfortunately, this meant that the code would fall through and return an EUNDEF when doing a read for a non-existant file.

I've attached a patch to fix where the stat is re-enabled but only returns an ENOTFOUND if the mode is not Write, ie, Read.

Please let me know if I can help further.

Cheers,
Jerry

Related branches

Revision history for this message
Jerry Kotland (jerry-kotland) wrote :
description: updated
Revision history for this message
Stefan Lesicnik (stefanlsd) wrote :

Hi Jerry!

Thanks for taking the time to report this bug. I am busy completing a merge of the latest Debian version netkit-tftp 0.17-16 and I have noticed the bug is still present.

I would like this bug to be fixed upstream and would be great if you could report it to the netkit-tftp developers. I will evaluate the included patch for revision in our Ubuntu build.

Thanks!

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package netkit-tftp - 0.17-16ubuntu1

---------------
netkit-tftp (0.17-16ubuntu1) intrepid; urgency=low

  * Merge from debian unstable, remaining changes:
    - No remaining changes.
  * debian/rules:
    - Removed the sed to add -g to CFLAGS. This was not working as
      currently defined (extra \$), and debug (-g) is not required.
    - Created if statement to check for the presence of MCONFIG to
      decide if to run make distclean.
  * Added debian/watch to monitor for new versions.
  * debian/control:
    - Added Homepage field.
  * Patch to return ENOTFOUND instead of EUNDEF for files that
    do not exist applied to tftpd/tftpd.c
    (Jerry Kotland - closes LP: #217537)

netkit-tftp (0.17-16) unstable; urgency=high

  * tftpd.c: Fixed security bug that made tftpd serve files from
    the filesystem root directory when the tftpd root directory
    was wrongly specified. Thanks Tomasz Nowiński for finding this
    out.
  * tftpd.c: Return 1 (File Not Found) instead of 0 (Not defined) to conform
    to TFTP RFC.
  * Revert patch that allowed uploading NEW files to the server.
    Behaving just like the man page states (Closes: #335200)
  * Bumped Standards-Version to 3.8.0.0, no change.
  * Removed debian/tftpd.prerm, no need for it.
  * Removed inetd entry on package removal (Closes: #351867)
  * Replaced netbase Depends with openbsd-inetd | inet-superserver.
    (Closes: #401888)
  * Mention in package description that tftpd is not suitable for PXE
    booting. (Closes: #401288)

 -- Stefan Lesicnik <email address hidden> Fri, 08 Aug 2008 14:15:39 +0200

Changed in netkit-tftp:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.