summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* tftpd: Canonicalize myaddr before address_is_local()HEADmasterH. Peter Anvin2015-08-071-1/+3
| | | | | | | | | The comparisons for forbidden addresses in address_is_local() only work on canonicalized addresses. Also, work in the case myaddr is NULL (if we ever call it that way...) Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* tftpd: Canonicalize all the addressesH. Peter Anvin2015-08-073-26/+25
| | | | | | | | We cannot canonicalize myaddr and not the from address. We need to canonicalize both of them, or else we'll try to create an IPv4 socket and bind an IPv6-mapped IPv4 address to it, which is going to fail. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Make configure an order-only prerequisite of aconfig.h.inRon Lee2014-07-311-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On filesystems with subsecond resolution, like ext4, we can't trust the timestamp of aconfig.h.in since autoheader leaves it truncated to second resolution (apparently touch -r and cp -p can do this at the very least) while configure has full subsecond resolution, so it can look newer even when it was cleanly created first, leading to the build system looping trying to recreate all of that again ... So in the initial stage of a clean build we can get something like this: $ make spotless $ make autoconf rm -rf MCONFIG configure config.log aconfig.h *.cache autoconf rm -f aconfig.h.in aconfig.h autoheader $ stat configure aconfig.h.in File: ‘configure’ Device: 807h/2055d Inode: 9443466 Links: 1 Access: 2014-07-31 03:27:27.599293442 +0930 Modify: 2014-07-31 03:27:27.711290270 +0930 Change: 2014-07-31 03:27:27.711290270 +0930 File: ‘aconfig.h.in’ Device: 807h/2055d Inode: 9443467 Links: 1 Access: 2014-07-31 03:27:27.000000000 +0930 Modify: 2014-07-31 03:27:27.000000000 +0930 Change: 2014-07-31 03:27:27.903284841 +0930 And with a parallel build, that can then leave 'make all' racing to remove and recreate aconfig.h (and possibly more things), while it begins to build the first targets. Which then fail horribly like we see here: https://buildd.debian.org/status/fetch.php?pkg=tftp-hpa&arch=i386&ver=5.2%2B20140608-1&stamp=1406736363 Possibly we also need to move the actual build job into the rule for the 'all' target, so that the build system update prerequisites are guaranteed to be completed before it runs (as opposed to running in parallel with them), but this change might be enough for now. Signed-off-by: Ron Lee <ron@debian.org> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* Update manpage to match source code for --map-fileDaniel Baumann2014-07-311-3/+3
| | | | | | | | | | The manpage had --mapfile but the code had --map-file. Closes: #606267 in the Debian BTS Reported-By: Jim Paris <jim@jtan.com> Signed-off-by: Ron Lee <ron@debian.org> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* __progname[] is provided by libcThorsten Glaser2014-07-311-5/+5
| | | | | | | | | | | Rename local variable to tftpd_progname to avoid a clash with glibc global symbols and work around Debian bug #519006 (Closes: #564052). [ hpa: specifically, double-underscore symbols in C are reserved for the implementation, i.e. compiler/libc. ] Signed-off-by: Ron Lee <ron@debian.org> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* tftp: drop "inline" from definition of usage()H. Peter Anvin2014-06-071-1/+1
| | | | | | It is pointless and newer gcc say it is a lose. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* tftpd.8: document IPv6 handling in remapping rulesH. Peter Anvin2014-06-071-5/+13
| | | | | | | Document the "4" and "6" conditionals as well as how \i and \x handle IPv6 addresses. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* tftpd: allow IPv4/6-specific remapping rulesH. Peter Anvin2014-06-073-13/+28
| | | | | | Allow remapping rules to be conditional on IPv4 vs IPv6. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* tftp: convert IPv6-mapped IPv4 addresses to IPv4H. Peter Anvin2014-06-071-0/+20
| | | | | | | If we receive IPv4 addresses mapped to IPv6, convert them back to IPv4 so that mapping scripts which use \i behave sanely. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Support IPv6 on MacOS X systemsH. Peter Anvin2012-03-012-5/+15
| | | | | | | | Add feature test macros for MacOS X, and don't require IPV6_RECVPKTINFO to exist. Reported-by: YJZ <vollkommen@gmx.net> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Update version for release 5.2tftp-hpa-5.2H. Peter Anvin2011-12-111-1/+1
|
* CHANGES: document is address local fixH. Peter Anvin2011-12-111-0/+5
| | | | Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* tftpd: the "is this address local" algorithm no longer works on LinuxH. Peter Anvin2011-12-081-16/+23
| | | | | | | | Linux no longer tries to match the local address with the remote one, so address_is_local() fails. Try instead to simply see if we can bind to the explicit address. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* spec: BuildPreReq -> BuildRequires; need -devel packagetftp-hpa-5.1H. Peter Anvin2011-06-221-1/+1
| | | | Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* Update version for release 5.1H. Peter Anvin2011-06-221-1/+1
|
* tftpd: add Intel copyright headerH. Peter Anvin2011-06-221-0/+1
| | | | | | Part of my Intel job now... Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* CHANGES: Document bug fixH. Peter Anvin2011-06-221-0/+2
| | | | Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* tftpd: simplify option parsingH. Peter Anvin2011-06-101-81/+73
| | | | | | | | | Simplify the option parsing to make use of the fact that all the options we support are integer options. This fixes a buffer overflow in the utimeout option. Reported-by: Timo Warns <warns@pre-sense.de> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* tftpd: try to handle duplicate WRQ packetsH. Peter Anvin2011-05-122-9/+41
| | | | | | | | | | | Duplicate WRQ packets can really hurt, since they end up accessing the same file. This attempts to lock the file, which should work for the case where a correctly implemented TFTP stack uses the same session ID (port number) for each retry; in any other case they look like multiple sessions to the same file and it is a crapshoot if we end up with the correct one. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Merge remote-tracking branch 'origin/master'H. Peter Anvin2011-05-093-1/+9
|\
| * CHANGES: document wraparound fixH. Peter Anvin2010-09-201-0/+3
| |
| * tftpd: Don't resend the OACK packet on block number wrapTim Newsome2010-09-201-0/+4
| | | | | | | | | | | | | | When uploading a file that is larger than 32MB (with standard block size), the block number will roll over. If it rolls over to 0, the code mistakenly resends the option ack frame instead of acknowledging the 0 data block. This change fixes that behavior.
| * recvfrom: fix the type of the fallthrough caseH. Peter Anvin2009-12-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | If we can't figure out the source address, we have the "fall on our face" version of myrecvfrom(); make sure its prototype matches. This handles building on machines where sockaddr_t != int and yet there is no way to get the source address. This apparently affects at least one version of Solaris. Reported-by: Georg Schwarz <georg.schwarz@freenet.de> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | tftpd: constipate struct formatsH. Peter Anvin2011-05-051-11/+12
| | | | | | | | | | | | | | struct formats should be static const; make it so and mark all users const. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | remap: change the mode argument from a boolean to a characterH. Peter Anvin2011-05-053-15/+11
|/ | | | | | | Instead of taking a boolean value for get/put, pass a character; this allows us to extend the number of possibilities in the future. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Update CHANGES for future 5.1 releaseH. Peter Anvin2009-09-141-0/+9
| | | | Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Fix man page formattingH. Peter Anvin2009-09-141-5/+5
|
* Implement the --pidfile optionFerenc Wagner2009-09-142-4/+50
| | | | | | | | Setting the umask moved later, right before entering the select loop, so that it does not affect the permissions of the pid file. Signed-off-by: Ferenc Wagner <wferi@niif.hu> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Untabify tftpd.cFerenc Wagner2009-09-141-4/+4
| | | | | Signed-off-by: Ferenc Wagner <wferi@niif.hu> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Fix comment typoFerenc Wagner2009-09-141-1/+1
| | | | | Signed-off-by: Ferenc Wagner <wferi@niif.hu> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Ensure that the log socket is available for the childFerenc Wagner2009-09-141-0/+9
| | | | | | | | Just in case syslog has been restarted, bounce the log socket before the chroot. Signed-off-by: Ferenc Wagner <wferi@niif.hu> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Downcase datarootdir, so mandir et al. find their defaultsFerenc Wagner2009-09-141-1/+1
| | | | | | | mandir et all uses $(datarootdir), not $(DATAROOTDIR) Signed-off-by: Ferenc Wagner <wferi@niif.hu> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* tftpd.8: we're no longer limited to IPv4H. Peter Anvin2009-02-241-3/+3
|
* tftpd.c: update copyright noticeH. Peter Anvin2009-02-241-0/+1
|
* autogen.sh: just do "make autoconf"H. Peter Anvin2009-02-161-2/+1
| | | | | We require GNU make, so we can have autoconf built from inside the Makefile. Just make autogen.sh do "make autoconf" for convenience.
* Update CHANGES for 5.0 releasetftp-hpa-5.0H. Peter Anvin2009-02-161-0/+6
|
* Update version for release 5.0H. Peter Anvin2009-02-161-1/+1
|
* tftpd: correctly disable PMTU discovery in standalone modeFlorian Lohoff2009-02-161-2/+2
| | | | Use the correct file descriptors so we correctly turn off PMTU.
* tftpd: implement the "rollover" optionH. Peter Anvin2009-02-022-2/+28
| | | | | | Implement the "rollover" option, to set the rollover block number to anything other than zero. Apparently some idiots have gotten the idea that block numbers should roll over to one, rather than zero.
* autogen.sh: script to run relevant autotoolsH. Peter Anvin2009-02-021-0/+3
|
* Cast IPv6 address from SOCKADDR_P() to struct in6_addr *Georg Schwarz2008-11-141-3/+4
| | | | | We need to cast IPv6 addresses from SOCKADDR_P() to struct in6_addr * on some platforms, including at least MacOS X.
* Document getaddrinfo() workaround.H. Peter Anvin2008-11-141-0/+5
|
* If AI_CANONNAME or AI_ADDRCONFIG don't exist, set them to zeroH. Peter Anvin2008-11-141-8/+8
| | | | | | | If the AI_CANONNAME or AI_ADDRCONFIG flags are missing, just set them to zero. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Update version for release 0.49tftp-hpa-0.49H. Peter Anvin2008-10-201-1/+1
|
* Update CHANGESH. Peter Anvin2008-10-201-0/+4
|
* Compilation of tftp-hpa's Git HEAD with no IPv6, and miscРоман Донченко2008-10-201-4/+10
| | | | | | | This patch does two things: a) makes tftp-hpa to compile on systems with no IPv6 support (there were some IPv6 macros used unconditionally); b) removes a stray binary character, which was annoying.
* Support editline instead of readlineH. Peter Anvin2008-08-091-7/+11
| | | | | | Support editline as an alternative to readline. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Fix numeric IPv6 address handlingSridhar Samudrala2008-08-091-1/+3
| | | | | | | | | | The following patch sets additional hints to restrict the addresses returned by getaddrinfo() to specify preferred socket type, protocol and a flag to return only v4/v6 addresses based on the configured addresses. Signed-off-by: Sridhar Samudrala <sri@us.ibm.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Add error messages if address types mismatchKarsten Keil2008-08-011-5/+19
| | | | | | | | | | | | | | | | If a user does supply a IPv4 or IPv6 address but force the other type with -4 or -6, give an error. The patch also fix the special [::ffff:127.0.1] address handling, it work now if you bind to this address but only if you not force IPv6 only, it seems that the kernel does not signal connections to a IPv6 socket listen on [::ffff:127.0.0.1], if it was bound IPv6 only. I think we can live with it and do not need a special test for this address. Signed-off-by: Karsten Keil <kkeil@suse.de> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Improve address type error handlingKarsten Keil2008-07-314-20/+56
| | | | | | | | | This patch detects numeric address types to avoid unnecessary warnings/errors. It also cleans up error printing to not print error messages on stderr in the deamon case. Signed-off-by: Karsten Keil <kkeil@suse.de> Signed-off-by: H. Peter Anvin <hpa@zytor.com>