History log of /freebsd-current/libexec/tftpd/tftp-io.c
Revision Date Author Comments
# 4d09eb87 10-May-2024 Dag-Erling Smørgrav <des@FreeBSD.org>

tftpd: Satisfy clang-analyzer.

* Replace `random()` with `arc4random()`.
* Change some variable types.
* Drop some unused assignments.

MFC after: 3 days
Sponsored by: Klara, Inc.
Reviewed by: imp, markj
Differential Revision: https://reviews.freebsd.org/D45132


# a6fe717c 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

libexec: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

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


# e3b4cb1b 10-Mar-2023 Dag-Erling Smørgrav <des@FreeBSD.org>

tftpd: Use poll() instead of alarm() + setjmp().

While there, don't log an error when timing out waiting for a possible retransmit after a successful transfer.

Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D38966


# b15e052e 18-Nov-2022 Dag-Erling Smørgrav <des@FreeBSD.org>

tftpd: Plug memory leaks in option handling code.

Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37423


# bacb00ab 17-Nov-2022 Dag-Erling Smørgrav <des@FreeBSD.org>

tftpd: whitespace cleanup


# eb0292d9 15-Nov-2022 Dag-Erling Smørgrav <des@FreeBSD.org>

tftpd: cleanup

Sponsored by: Klara, Inc.


# a1c4a3ea 06-Dec-2020 Michael Tuexen <tuexen@FreeBSD.org>

When dropping packets (RRQ or WRQ) for debugging, report the send
operation as successful. Reporting a failure stops the transfer
instead of using timeouts.

MFC after: 1 week


# ca2d3691 22-Jul-2018 Alan Somers <asomers@FreeBSD.org>

Fix several Coverity warnings in tftp

Some of the changes are in the libexec/tftpd directory, but to functions that
are only used by tftp(1) (they share some code).

* strcpy => strlcpy (1006793, 1006794, 1006796, 1006741)
* Unchecked return value and TOCTTOU (1009314)
* NULL pointer dereference (1018035, 1018036)

Reported by: Coverity
CID: 1006793, 1006794, 1006796, 1006741, 1009314, 1018035
CID: 1018036
MFC after: 2 weeks


# 3c0fa265 22-Jul-2018 Alan Somers <asomers@FreeBSD.org>

Fix multiple Coverity warnings in tftpd(8)

* Initialize uninitialized variable (CID 1006502)
* strcpy => strlcpy (CID 1006792, 1006791, 1006790)
* Check function return values (CID 1009442, 1009441, 1009440)
* Delete dead code in receive_packet (not reported by Coverity)
* Remove redundant alarm(3) in receive_packet (not reported by Coverity)

Reported by: Coverity
CID: 1006502, 1006792, 1006791, 1006790, 1009442, 1009441, 1009440
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D11287


# e6209940 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

libexec: adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.


# b713097a 30-Jan-2013 Marius Strobl <marius@FreeBSD.org>

Mark tftp_log() as __printflike() (which would have caught the bug
fixed in r246106) and deal with the fallout.

MFC after: 2 weeks


# 663a6522 29-Jan-2013 Sean Bruno <sbruno@FreeBSD.org>

Remove extra %s from debug statement that ends up crashing tftpd if
debug is set very high (like -d15 in my case).

Obtained from: Yahoo! Inc
MFC after: 2 weeks


# 3496d72c 25-Dec-2012 Antoine Brodin <antoine@FreeBSD.org>

Use correct size in snprintf.
Remove unused buffer.

PR: 174631
Submitted by: Henning Petersen
MFC after: 1 month


# ae824d80 18-Oct-2012 Ed Schouten <ed@FreeBSD.org>

Fix warnings found by -Wmising-variable-declarations.

This self-written compiler warning, which is hopefully going to be
committed into LLVM sources soon, warns about potentially missing
`static' keywords, similar to -Wmissing-prototypes.

- bin/pax: Move external declaration of chdname and s_mask into extern.h.
- bin/setfacl: Move setfacl.c-specific stuff out of setfacl.h.
- sbin/mount_fusefs: Remove char *progname; use getprogname().
- others: add `static' where possible.


# 9a2856b4 21-Feb-2012 Ed Maste <emaste@FreeBSD.org>

Avoid error log for transfer stop w/o error code.

A number of tftp clients, including the one in Intel's pxe boot loader,
may intentionally stop a transfer using error code 0 (i.e., EUNDEF).
These are not real errors. Avoid spamming log files with these by
logging them at level LOG_DEBUG instead.

Discussed on -hackers with an initial patch proposal; this change is an
improved approach suggested by kan@.


# 3e519b7c 09-Jan-2012 Eitan Adler <eadler@FreeBSD.org>

Fix warning when compiling with gcc46:
error: variable 'bp' set but not use

Approved by: dim
MFC After: 3 days


# 1acf0dba 07-Jan-2012 Ulrich Spörlein <uqs@FreeBSD.org>

Spelling fixes for libexec/


# 3b6bd978 26-May-2011 Craig Rodrigues <rodrigc@FreeBSD.org>

Fix tftp_log() usage.


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# 3dc2fd3f 15-Sep-2010 Warner Losh <imp@FreeBSD.org>

Move the pfrom initialization from before the setjmp to after the
setjmp to avoid warnings on the powerpc build...


# e7ff5475 04-May-2010 Warner Losh <imp@FreeBSD.org>

Bring in new files from edwin's tftp