aboutsummaryrefslogtreecommitdiff
path: root/libexec/tftpd/tests
Commit message (Collapse)AuthorAgeFilesLines
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* tftpd: Gracefully skip tests if networking is not enabled.Dag-Erling Smørgrav2023-03-101-1/+7
| | | | | | Sponsored by: Klara, Inc. Reviewed by: asomers Differential Revision: https://reviews.freebsd.org/D39012
* Do a sweep and remove most WARNS=6 settingsKyle Evans2020-10-011-1/+0
| | | | | | | | | | | | | | | Repeating the default WARNS here makes it slightly more difficult to experiment with default WARNS changes, e.g. if we did something absolutely bananas and introduced a WARNS=7 and wanted to try lifting the default to that. Drop most of them; there is one in the blake2 kernel module, but I suspect it should be dropped -- the default WARNS in the rest of the build doesn't currently apply to kernel modules, and I haven't put too much thought into whether it makes sense to make it so. Notes: svn path=/head/; revision=366304
* Remove tests for obsolete compilers in the build systemEric van Gyzen2020-05-121-3/+0
| | | | | | | | | | | | | | Assume gcc is at least 6.4, the oldest xtoolchain in the ports tree. Assume clang is at least 6, which was in 11.2-RELEASE. Drop conditions for older compilers. Reviewed by: imp (earlier version), emaste, jhb MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D24802 Notes: svn path=/head/; revision=360964
* tftpd: tests: raise targeted cstd to c11Kyle Evans2020-03-051-0/+1
| | | | | | | | | | r358556 added alignas() use to the functional tests, which isn't defined until C11. Raise the -std to C11 to fix the build under freebsd-gcc{6,9}. Reported by: mhorne, Jenkins/CI Notes: svn path=/head/; revision=358687
* Add support for the TFTP windowsize option described in RFC 7440.John Baldwin2020-03-021-0/+202
| | | | | | | | | | | | | | The windowsize option permits multiple blocks to be transmitted before the receiver sends an ACK improving throughput for larger files. Reviewed by: asomers MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23836 Notes: svn path=/head/; revision=358556
* Drop "All rights reserved" from the files I ownAlan Somers2019-03-111-1/+2
| | | | | | | | | Also, add SPDX tags where needed. MFC after: 2 weeks Notes: svn path=/head/; revision=345034
* tftpd: misc Coverity cleanup in the testsAlan Somers2018-03-221-7/+12
| | | | | | | | | | | | | A bunch of unchecked return values from open(2) and read(2) Reported by: Coverity CID: 1386900, 1386911, 1386926, 1386928, 1386932, 1386942 CID: 1386961, 1386979 MFC after: 8 days X-MFC-With: 330696 Notes: svn path=/head/; revision=331358
* tftpd: fix the build of tests on i386 after 330696Alan Somers2018-03-101-2/+2
| | | | | | | | | | | It's those darn printf format specifiers again Reported by: cy, kibab MFC after: 20 days X-MFC-With: 330696 Notes: svn path=/head/; revision=330742
* tftpd: reject unknown opcodesAlan Somers2018-03-101-1/+0
| | | | | | | | | | | | If tftpd receives a command with an unknown opcode, it simply exits 1. It doesn't send an ERROR packet, and the client will hang waiting for one. Fix it. PR: 226005 MFC after: 3 weeks Notes: svn path=/head/; revision=330720
* tftpd: Abort on an WRQ access violationAlan Somers2018-03-101-6/+0
| | | | | | | | | | | | | | | | | | On a WRQ (write request) tftpd checks whether the client has access permission for the file in question. If not, then the write is prevented. However, tftpd doesn't reply with an ERROR packet, nor does it abort. Instead, it tries to receive the packet anyway. The symptom is slightly different depending on the nature of the error. If the target file is nonexistent and tftpd lacks permission to create it, then tftpd will willingly receive the file, but not write it anywhere. If the file exists but is not writable, then tftpd will fail to ACK to WRQ. PR: 225996 MFC after: 3 weeks Notes: svn path=/head/; revision=330719
* tftpd: Verify world-writability for WRQ when using relative pathsAlan Somers2018-03-101-4/+9
| | | | | | | | | | | | | | | | | | tftpd(8) says that files may only be written if they already exist and are publicly writable. tftpd.c verifies that a file is publicly writable if it uses an absolute pathname. However, if the pathname is relative, that check is skipped. Fix it. Note that this is not a security vulnerability, because the transfer ultimately doesn't work unless the file already exists and is owned by user nobody. Also, this bug does not affect the default configuration, because the default uses the "-s" option which makes all pathnames absolute. PR: 226004 MFC after: 3 weeks Notes: svn path=/head/; revision=330718
* tftpd: Flush files as soon as they are fully receivedAlan Somers2018-03-091-8/+1
| | | | | | | | | | | | | | | | | | On an RRQ, tftpd doesn't exit as soon as it's finished receiving a file. Instead, it waits five seconds just in case the client didn't receive the server's last ACK and decides to resend the final DATA packet. Unfortunately, this created a 5 second delay from when the client thinks it's done sending the file, and when the file is available for other processes. Fix this bug by closing the file as soon as receipt is finished. PR: 157700 Reported by: Barry Mishler <barry_mishler@yahoo.com> MFC after: 3 weeks Notes: svn path=/head/; revision=330710
* Add some functional tests for tftpd(8)Alan Somers2018-03-092-0/+1020
tftpd(8) is difficult to test in isolation due to its relationship with inetd. Create a test program that mimics the behavior of tftp(1) and inetd(8) and verifies tftpd's response in several different scenarios. These test cases cover all of the basic TFTP protocol, but not the optional parts. PR: 157700 PR: 225996 PR: 226004 PR: 226005 MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D14310 Notes: svn path=/head/; revision=330696