History log of /netbsd-current/libexec/tftpd/tftpd.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726
# 1.45 20-Jul-2016 shm

CID 976523: add FALLTHROUGH


Revision tags: pgoyette-localcount-base
# 1.44 05-May-2015 buhrow

branches: 1.44.2;


Add a -b flag so that clients that return their acknowledgements to the
broadcast address can inter-operate with the tftpd server.
Discussed in bin/49868


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.43 04-Oct-2013 jnemeth

- complete renaming of -w to -c from 1.38
- update usage string to match
- this fixes PR/48234 by Jeff Woodall


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.42 04-Jul-2013 christos

Simplify error handling and make it actually return a useable error code.
(Maxime Villard)


# 1.41 03-Jul-2013 christos

Check snprintf for -1 (Maxime Villard)


# 1.40 28-Jun-2013 christos

Prevent buffer overflows; reported by Maxime Villard


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 yamt-pagecache-base5 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.39 29-Aug-2011 joerg

branches: 1.39.2; 1.39.8;
Use __dead


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.38 29-Apr-2010 hubertf

Rename -w to -c by popular demand
(allow file 'c'reation - 'w'riting was always available, with some twist;
plus there's already such a feature elsewhere, so let's try to not
diverge needlessly)


# 1.37 28-Apr-2010 hubertf

tftpd(8): Add -w so files can be uploaded without requiring them
to be created before the upload. See the section on security
considerations before enabling. [hubertf 20100429]

Addresses PR bin/43164.


# 1.36 09-Jan-2010 mbalmer

fix build


# 1.35 09-Jan-2010 christos

newer versions of NetBSD turn on -Wsign-compare


# 1.34 08-Jan-2010 wiz

Sync usage with man page.


# 1.33 08-Jan-2010 christos

Patrick Welche <prlw1@cam.ac.uk>
- add -p pathsep option
- make wrap to zero work, but produce a warning
While here:
- fix gcc warnings, in particular variable clobbered warnings
(compiling with fewer warnings does not really fix the problem)


Revision tags: matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.32 16-Mar-2009 lukem

fix shadowed variable


Revision tags: netbsd-5-1-5-RELEASE netbsd-5-1-4-RELEASE netbsd-5-1-3-RELEASE netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.31 21-Jul-2008 lukem

branches: 1.31.4; 1.31.6;
Remove the \n and tabs from the __COPYRIGHT() strings.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base hpcarm-cleanup-base wrstuden-fixsa-base abandoned-netbsd-4-base netbsd-4-base
# 1.30 09-May-2006 mrg

branches: 1.30.20;
change (mostly) int to socklen_t. GCC 4 doesn't like that int and
socklen_t are different signness.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.29 05-Nov-2004 dsl

Add (unsigned char) cast to ctype functions


# 1.28 05-May-2004 kleink

Make sure we tzset() before chroot(); after passing that point
it may no longer be accessible for syslog() to format messages.


Revision tags: netbsd-2-0-base
# 1.27 06-Jan-2004 briggs

branches: 1.27.2;
Remove duplicated headers. Pointed out by Peter Postma in PR bin/24002.


# 1.26 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22284, verified by myself.


# 1.25 11-Jun-2003 briggs

Support negotiation and use of TFTP Option Extension (rfc 2347) for the
'blksize' option (rfc 2348) and the 'timeout' and 'tsize' options (rfc 2349).

Contributed by Wasabi Systems, Inc.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 fvdl_fs64_base netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.24 09-Oct-2001 christos

Enable verbose debugging messages via tftpd.


# 1.23 19-Feb-2001 cgd

convert to use getprogname()


# 1.22 09-Jan-2001 lukem

convert to ansi knf
replace (sole use of) sprintf() with snprintf()
only syslog debug messages if logging


# 1.21 21-Nov-2000 itojun

make sure we do not overrun packet buffer when we set error message string.


# 1.20 21-Nov-2000 itojun

handle getnameinfo error properly


# 1.19 18-Oct-2000 dogcow

defs had 'short block' for blocksize; changed defs to be unsigned.
added note to tftpd.8 that this bug hits multiple tftp clients.


Revision tags: netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base
# 1.18 12-Jul-1999 itojun

branches: 1.18.8;
IPv6 support.


# 1.17 23-Jun-1999 carrel

If opening files for writing, be sure to truncate.


Revision tags: netbsd-1-4-RELEASE netbsd-1-4-base
# 1.16 07-Feb-1999 aidan

branches: 1.16.2;
Fix for bin/4637, mostly as discussed on current-users.
Allow relative file writes,
For relative file accesses, no longer continues searching dirlist once we find
_any_ file, even one for which we don't have access,
If no dirlist was given on the command line, apply same permissions check as
with 'absolute' requests before allowing access.


# 1.15 20-Sep-1998 explorer

Remember the interface the request comes in on, so we will reply to the
same address. This fixes tftp'ing to lo0 aliases.


# 1.14 29-Jul-1998 lukem

* implement -u user and -g group - to specify the username and/or
group to run as.
if -u isn't given, user defaults to "nobody".
if -g isn't given, group defaults to the primary group of user.
doesn't try and change uid or gid if they're already set ok.
should solve PR 4218.
* deprecate register
* deprecate trailing \n in syslog messages


# 1.13 26-Jul-1998 mycroft

const poisoning.


# 1.12 03-Jul-1998 mrg

clean up a bit of cruft.


# 1.11 06-Nov-1997 lukem

fix so syslog works after chroot, by adding LOG_NDELAY to openlog.
from Andreas Wrede <andreas@planix.com>, [bin/4429]


Revision tags: netbsd-1-3-base
# 1.10 19-Oct-1997 mycroft

branches: 1.10.2;
Use S_IS*(), not S_IF*.


# 1.9 07-Oct-1997 mrg

WARNS?=1. merge lite-2.


# 1.8 22-Apr-1997 mrg

get rid of supplementary groups.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.7 04-Jun-1995 jtc

The tftpd daemon must be invoked as root in order for the chroot()
call to succeed, and must give up those privledges as soon as the new
root has been aquired. Use setgid() & setuid() to explicitly set the
user and group IDs to non- priveleged values.

This change now requires tftpd to be executed by root. I haven't
studied the security implications of making it setuid root, so
inetd.conf needs to be changed to start it as root.


# 1.6 03-Jun-1995 mycroft

Fill in sin_len.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE netbsd-1-0-base
# 1.5 01-Mar-1994 cgd

From Christos Zoulas <christos@deshaw.com>:
As promised. the problem was that tftpd would core dump if given no arguments.
I fixed it to use getopt. I also changed 0 to fd, because I had added some
debugging code that allowed me to start it from the command line.


# 1.4 10-Jan-1994 mycroft

Add -s flag, per Roland McGrath, with changes and a manual page addition by me.


# 1.3 01-Aug-1993 mycroft

Add RCS identifiers.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.2 18-Apr-1993 mycroft

Cleanup for GCC 2.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision