summaryrefslogtreecommitdiff
path: root/usr.sbin/tftpd
AgeCommit message (Collapse)Author
2015-10-18Add "dns" to the pledges. Previously these worked because of "inet",Theo de Raadt
alas "dns" is now a mandatory statement if you want to do dns!
2015-10-10pledge "stdio rpath wpath cpath fattr inet" after chroot and suchTheo de Raadt
appears to be good enough for the main loop processing.
2015-10-06do not need ioctl.hTheo de Raadt
2015-08-20use SOCK_NONBLOCK when making a socket instead of ioctl FIONBIO.David Gwynne
for guenther@
2015-07-20tweak the /etc/random.seed interception so it provides a FILE* viaDavid Gwynne
fmemopen for the rest of the code to chew on, rather than having special casing for seed generation in the sending code. this also means our fake random.seed files will get proper netascii encoding by being read via the fgetc api instead of directly from a buffer. ok deraadt@ mcbride@
2015-07-18Have tftpd provide a block of random data when clients request the fileRyan Thomas McBride
/etc/random.seed. This allows netbooted systems to inject entropy early in the kernel start. pxeboot requests it already, so no configuration or change is needed on the client side. ok deraadt@ beck@
2015-01-16Replace <sys/param.h> with <limits.h> and other less dirty headers whereTheo de Raadt
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
2014-12-17the easier way to put a buffer on the stack is to put it on the stack,Ted Unangst
not with alloca(). found by dickman; ok kettenis
2014-11-25evbuffer_read and evbuffer_write are wrappers around read and write,David Gwynne
so you have to check their return values in the same way and handle errors the same way. returning 0 from evbuffer_read means the other end of the socket has gone away. we should try again on both evbuffer_read and evbuffer_write if we get EAGAIN or EINTR. ok millert@ bluhm@
2014-11-19move to stravis so doug@ will stop laughing at my misuse of strnvis.David Gwynne
ok doug@ millert@
2014-08-13Always call freeaddrinfo after getaddrinfo.Tobias Stoeckmann
ok dlg@
2014-08-13use errc instead of juggling errno values in tftpd_listen.David Gwynne
2014-08-13setsockopt sets errno on failure, so we can use err instead of errx whenDavid Gwynne
handling the error.
2014-04-21th_code is in network byte orderDavid Gwynne
2013-11-26unsigned char for ctypeTheo de Raadt
2013-11-12ensure there are prototypesTheo de Raadt
2013-08-13when handling puts from a client (ie, tftpd is writing a file toDavid Gwynne
disk), we maintain the client state after we've finished writing the file in case the client loses our ack of the last write. unfortunately we didnt close the file we'd just written when we knew it was finished, but only after we clean up the client state after that wait. because we use FILE stuff to write the file out, its likely some io flushed to disk until we finish that wait and close the file as part of cleaning up the client state. if something is coordinating a bunch of uploads and expects the file to be there after the client is happy its there, this can be "not good". this closes the file after we know its finished before proceeding to hang to handle lost acks to the client. found by and ok henning@
2013-06-01use the standardized names instead of S_IREAD and S_IWRITETheo de Raadt
ok guenther dtucker
2013-05-07getpwnam doesnt set errno on failure, so use errx, not err, to say itDavid Gwynne
failed.
2013-03-17i missed the bit of maxime villards diff that took the client_free out ofDavid Gwynne
oack on error. his fix is better, so this marges all of it in.
2013-03-15let oack use the full buffer space to build its packet, not just the sizeDavid Gwynne
negotiated for data tranfsers. this lets people negotiate 2 byte transfers with other options too if they want. im looking at you Maxime Villard.
2013-03-15"correct" the order of calloc arguments.David Gwynne
2013-03-15fix up some lwarn()s that should be lwarnx()sDavid Gwynne
2013-03-15fix a huge bug in tftpd.David Gwynne
there was a double free if an option ack failed. if oack fails, the client gets freed, then the oack caller tries to free the options which were just freed. found by Maxime Villard who provided a fix. unfortunately his fix still had a double free but it was pretty close. ok MALLOC_OPTIONS=S
2012-09-12Define empty CDIAGFLAGS for programs that use Werror.Christiano F. Haesbaert
Makes "make build" build with WARNINGS=Yes on amd64. ok espie
2012-07-13zap trailing whitespace; no binary changeGleydson Soares
ok dlg
2012-07-10fix the last outstanding functionality difference i could find betweenDavid Gwynne
libexec and usr.sbin tftpd. libexec waitied around after finishing a wrq in case our ack for the last write from a client got lost. this does the same dance, or an arguably better version of it compared to libexec tftpd.
2012-07-10libexec/tftpd handled the case where we'd get an ack for the previousDavid Gwynne
block by flushing the data on the socket and waiting for a retransmit by timeout to occur. my stuff (usr.sbin/tftpd) had XXXs and failure in those places. this diff fixes that. this should address the problems that sthen and jcs have been having (and which i was finally able to reproduce here). it also avoids reusing the clients buffer to both send and recv frames. we recv onto the stack now so retry always sends what we originally built for the peer. tested by and ok jcs@ sthen@
2012-03-15Add sys/queue.h. ok dlgNicholas Marriott
2012-03-08-pedantic wasnt supposed to be commited.David Gwynne
reported by steve andre
2012-03-07dont mix code and declarations.David Gwynne
2012-03-04tweak the description of -r further;Jason McIntyre
2012-03-04document what tftpd expects when talking to the rewrite socket.David Gwynne
with help from jmc@
2012-03-02tweaks;Jason McIntyre
2012-03-02CFLAGS+= -Wall -Werror and the resulting cleanupDavid Gwynne
2012-03-02a persistent event driven tftp daemon.David Gwynne
because tftpd out of inetd doesnt cope with a lot of concurrent requests. ok deraadt@ krw@ henning@