diff -Nur netkit-tftp-0.17.dist/tftpd/tftpd.c netkit-tftp-0.17/tftpd/tftpd.c --- netkit-tftp-0.17.dist/tftpd/tftpd.c 2008-04-15 10:55:48.000000000 +1000 +++ netkit-tftp-0.17/tftpd/tftpd.c 2008-04-15 11:06:29.380174906 +1000 @@ -364,14 +364,17 @@ return(EACCESS); } } -#if 0 /* * #####stat() will fail in the case that mode is WRQ and the * file does not exist! In this case we should try to create * the file instead of just exit. */ - if (stat(filename, &stbuf) < 0) - return (errno == ENOENT ? ENOTFOUND : EACCESS); + if (stat(filename, &stbuf) < 0) { + if (mode != WRQ) { + return (errno == ENOENT ? ENOTFOUND : EACCESS); + } + } +#if 0 /* * The idea is that symlinks are dangerous. However, a symlink * in the tftp area has to have been put there by root, and it's