Free `f` if an unknown priority or facility is parsed with the function.
MFC after: 1 week
Reported by: Coverity
CID: 1368068
Sponsored by: Dell EMC Isilon
- main(..): free memory assigned to fdsr before calling die(..).
- allowaddr(..): free memory assigned to ap before returning from the
function early. Add a `err` goto label to reduce freeaddrinfo/free(ap)
logic duplication.
MFC after: 1 week
X-MFC notes: some of this is dependent on refactoring not MFCed
Reported by: clang static analyzer, Coverity
CID: 1367750 (ap leakage in allowaddr(..))
Submitted by: Tom Rix <trix@juniper.net>
Reviewed by: ngie
Sponsored by: Dell EMC Isilon, Juniper
Differential Revision: D10004
Leap-second smearing is an experimental option that may be specified in
ntp.conf(5) and the -x option on the command line to spread the effect
of a leap-second over an interval as specified by the leapsmearinterval
config file statement. Recommended values are between 7200 (2 hours) and
86400 (24 hours).
It is advised that leap-second smearing not be used for public NTP
servers (https://www.meinbergglobal.com/download/burnicki/Leap\
%20Second%20Smearing%20With%20NTP.pdf). It is also advised that NTP
clients not use a mix of NTP servers using leap-second smearing with
NTP servers not using leap-second smearing as that could cause
undefined client behaviour.
Leap-second smearing was committed to ports net/ntp and net/ntp-devel
by r426825 on 2016-11-22.
Suggested by: des
MFC after: 4 weeks
formats and parses UEFI standard Device Paths. In the future it will
also translate between FreeBSD driver names and UEFI Device Paths.
Sponsored by: Netflix
as if it were a device path.
Remove language about a=b syntax on the command line. This will not be
implemented due to its limited usefulness. UEFI variables are binary
blobs, on the whole, and a simple work around exists for
strings. Clarify that the new value of the variable is taken from
stdin. Update manual with history.
Sponsored by: Netflix
While here plug a memory leak upon error and postpose a multiplication
until after reallocation has succeded.
Hinted partially by: OpenBSD
Reviewed by: gad
MFC after: 2 weeks
-p only handles updating /etc/master.passwd and /etc/group . No more,
no less.
Also, mergemaster (and no other portions of the vanilla FreeBSD build
process) should be messing with __MAKECONF or SRCCONF as part of the
installworld or distribution process. Don't insinuate that mergemaster
does that as it's a false claim.
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Sentences should begin on new lines, per manlint.
Bump .Dd for the change
MFC after: 1 month
Reviewed by: bcr
Reported by: make manlint
Sponsored by: Dell EMC Isilon
Some of the changes I introduced to use .ALLSRC were correct in spirit,
but incorrect in reality -- in particular, ../Makefile.inc hadn't been
pulled in via bsd.init.mk (via bsd.lib.mk, bsd.prog.mk), so the value
of .ALLSRC (evaluated immediately) was empty. .include bsd.init.mk
explicitly so we can be certain that the values used as dependencies in
the targets are defined when the target recipe has been evaluated.
Reminder: thou shalt separate out separate functional changes before
committing them.
(YUGE) Pointyhat to: ngie
In collaboration with: bdrewery
MFC after: 1 month
Reported by: Jenkins, cy, ler, O. Hartmann, Michael Butler
Sponsored by: Dell EMC Isilon
My attempt to correct the sender/receiver behavior was incorrect.
The source port of the sender for forwarded datagrams is filtered
with -a, and my change in r314585 didn't clarify that point at all.
Wording is based on suggestion by hrs.
MFC after: 28 days
X-MFC with: r314563, r314585
Reported by: hrs
In collaboration with: hrs, rgrimes
Sponsored by: Dell EMC Isilon
`*` means that packets will be received from a remote peer on any port.
Since the point of interest is the syslogd instance (not the remote peer),
the appropriate verb is "received", not "sent".
MFC after: 1 month
X-MFC with: r314563
Sponsored by: Dell EMC Isilon
Move cxgbetool from tools/tools to usr.sbin. Compile and install it on
platforms where cxgbe(4) is built by default. Knobs (WITH_CXGBETOOL and
WITHOUT_CXGBETOOL) have been added so that the user can override the
default setting.
Reviewed by: ngie@, gnn@, bdrewery@
MFC after: 1 month
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D9854
- Clarify -p/-S options by using appropriate subject-verb modifiers
(verb and modifiers suggested that the subject should have been
singular).
- Simplify/correct -a description:
-- Be more terse when describing IPv4 (the "usual dotted notation"
isn't necessarily well understood by the reader). Being blunt and
saying "IPv4 address" with an optional netmask is.
-- prefixlen is the appropriate terminology for IPv6.
-- mask/prefixlen is optional, not required (as noted later on in the
section).
-- split up IPv4/IPv6 use so to clarify both forms.
-- Fix wordiness when describing the optional "service" specifier.
- -T: Use "cannot" instead of "can't" [*].
Bump .Dd for the changes.
MFC after: 1 month
Reported by: igor [*]
Reviewed by: hrs
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D9855
- Use SRCTOP-relative paths instead of .CURDIR-relative ones where possible
- Use :H to manipulate .CURDIR in areas instead of ..-relative paths.
MFC after: 1 week
Sponsored by: Dell EMC Isilon
- Use SRCTOP-relative paths to other directories instead of
.CURDIR-relative ones. This simplifies pathing in make/displayed output.
- Also, use :H where possible/sensical to manipulate .CURDIR-relative
paths
- Remove superfluous bsd.own.mk .includes which are already handled via
src.opts.mk .includes
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Also, use :H where possible/sensical to manipulate .CURDIR-relative paths
This simplifies pathing in make/displayed output.
MFC after: 1 week
Sponsored by: Dell EMC Isilon
The SRCTOP conversion simplifies pathing in make/displayed output.
Also, while here, change a hardcoded path to ${RPCDIR}/ypxfrd.x in
the make targets with ${.ALLSRC} .
MFC after: 1 week
Sponsored by: Dell EMC Isilon
The SRCTOP conversion simplifies pathing in make/displayed output.
Also, while here, change a hardcoded path to ${RPCDIR}/ypupdate_prot.x in
the make targets with ${.ALLSRC} .
MFC after: 1 week
Sponsored by: Dell EMC Isilon
This is a trivial simplification in the Makefile, meant to serve as
a good example for what to do with rules like this.
MFC after: 1 week
Sponsored by: Dell EMC Isilon
This is a trivial simplification in the Makefile, meant to serve as
a good example for what to do with rules like this.
MFC after: 1 week
Sponsored by: Dell EMC Isilon
The SRCTOP conversion simplifies pathing in make/displayed output.
Also, while here, change a hardcoded path to ar5523.bin.uu in the make target
with ${.ALLSRC} .
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.
Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96
This removes the hardcoded value for the field (16) and the equivalent
hardcoded lengths in logmsg(..).
This change is being done to help stage future work to add RFC5424/RFC5434
support to syslogd(8).
Obtained from: Isilon OneFS (dcd33d13da) (as part of a larger change)
Submitted by: John Bauman <john.bauman@isilon.com>
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Exit after printing a message on stderr when we can't get a
message. This is slightly different than linux, but keeps shell
scripts from thinking the value of the variable is the error message
and so is a net win.
Sponsored by: Netflix
As discussed previously, in order to introduce new OS hardening
defaults, we've added them to bsdinstall in 'off by default' mode.
It has been there for a while, so the next step is to change them
to 'on by defaul' mode, so that in future we could simply enable
them in base OS.
Reviewed by: brd
Approved by: adrian
Differential Revision: https://reviews.freebsd.org/D9641
The condition can be hit with simple user input, so it isn't an invariant.
Just error out.
PR: 217003
Reported by: Vladislav V. Prodan <admin at support.od.ua>
Sponsored by: Dell EMC Isilon
From NetBSD christos Sat Jan 26 00:19:39 2013 +0000
make the buffer functions look exactly like the kernel ones and add other
cruft to make the kernel files compile.
ffs.c 1.54
ffs/buf.c 1.13
ffs/buf.h 1.3
ffs/ffs_alloc.c 1.21
ffs/ffs_balloc.c 1.15
Reviewed by: marcel, ngie
Obtained from: NetBSD
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8404
ld.bfd generates two PT_LOAD segments, but certain linkers or linker
configurations generate three PT_LOAD segments (one additional for
RELRO).
PR: 216975
Reported by: Shawn Webb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
* 'blackhole' and 'reject' are mutually exclusive, replace printf() by errx()
when both are selected.
* 'trail' option is no longer supported since first import of arp from 4.4BSD.
XXX message was added 13 years ago in r128192. I believe it's time to remove
it.
* Use warnx() to print some informative messages instead of printf()
* Replace strncmp() by strcmp() when validating parameters and exit when invalid
parameter is found
Reviewed by: allanjude, vangyzen, cem
Approved by: allanjude
MFC after: 1 week
Sponsored by: Rubicon Communications (Netgate)
Differential Revision: https://reviews.freebsd.org/D9504
* DISTDIR_IS_UNIONFS is set every time BSDINSTALL_DISTDIR is mounted inside
BSDINSTALL_CHROOT. Use this flag to decide if it needs to be umounted
* BSDINSTALL_CHROOT/dev is mounted when 'bsdinstall mount' is called, there is
no need to mount it again when user goes to shell after installation
Reviewed by: allanjude
Obtained from: pfSense
MFC after: 1 week
Sponsored by: Rubicon Communications (Netgate)
Differential Revision: https://reviews.freebsd.org/D8573
This interface type ("a parent interface of wlanX") is not used since
r287197
Reviewed by: adrian, glebius
Differential Revision: https://reviews.freebsd.org/D9308
If "capacity" LU option is set, ramdisk backend now implements featured
thin provisioned disk, storing data in malloc(9) allocated memory blocks
of pblocksize bytes (default PAGE_SIZE or 4KB). Additionally ~0.2% of LU
size is used for indirection tree (bigger pblocksize reduce the overhead).
Backend supports all unmap and anchor operations. If configured capacity
is overflowed, proper error conditions are reported.
If "capacity" LU option is not set, the backend operates mostly the same
as before without allocating real storage: writes go to nowhere, reads
return zeroes, reporting that all LBAs are unmapped.
This backend is still mostly oriented on testing and benchmarking (it is
still a volatile RAM disk), but now it should allow to run real FS tests,
not only simple dumb dd.
MFC after: 2 weeks
CID 1341620 Fix a small memory leak
CID 1341630 Though this is technically a false positive, rearrange the
code for clarity.
CID 1341635 Eliminate dead code
CID 1368663 Fix a double mutex unlock in the error path
Also:
* Use sig_atomic_t for variables accessed from signal handlers
* Don't conditionalize free(3) on its argument being non-null
Reported by: Coverity
CID: 1341620 1341630 1341635 1368663
Reviewed by: ken
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9237
Replace archaic "busses" with modern form "buses."
Intentionally excluded:
* Old/random drivers I didn't recognize
* Old hardware in general
* Use of "busses" in code as identifiers
No functional change.
http://grammarist.com/spelling/buses-busses/
PR: 216099
Reported by: bltsrc at mail.ru
Sponsored by: Dell EMC Isilon
Connection parameters should remain at defaults until negotiated.
While there, remove sythetic limits, applied if kernel provided none.
iscsid has no own limitations, no configuration and no any idea what
values are good. Assume kernel knows what it requests.
If initiator does not negotiate some parameter, it expects one to get
default value, not some unknown remote hardware limit. On the side side,
if some parameter is negotiated, its default value from RFC should not
be used for anything.
- Only #include tcpd.h when LIBWRAP is true to avoid header include errors
- Only define whichaf when LIBWRAP is true to avoid -Wunused warning and
to avoid issues with structs being defined that should only be defined
when tcpd.h is included.
MFC after: 2 weeks
X-MFC with: r312105
Pointyhat to: ngie
Reported by: gcc tinderbox
Sponsored by: Dell EMC Isilon
This will allow inetd to stand by itself without libwrap.
MFC after: 2 weeks
Relnotes: yes
Reviewed by: hrs (earlier version)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D9056
case was the full disk image from the website, which was never
checked in to svn)
Regardless, the testcase still fails
PR: 214908
Sponsored by: Dell EMC Isilon
Disk image obtained from:
http://www.cfreds.nist.gov/dfr-images/dfr-01-xfat.dd.bz2 -- was ripped off the
first GPT partition and verified to be a FAT-like partition with file(1)/hexdump.
This testcase currently fails
PR: 214908
Sponsored by: Dell EMC Isilon
The variables in question are actually return arguments, but it's still good
form to initialize them.
Reported by: Coverity
CID: 979679 979680
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Reallow device selectors to have a trailing colon, as documented in the
manual page. This was broken along with some unrelated cleanups in
r295806.
PR: 215979
Reported by: David Boyd <David.Boyd49 at twc.com>
Sponsored by: Dell EMC Isilon
Fix a clang 4.0.0 warning about taking the address of a packed member of
struct mfi_evt in mfiutil:
usr.sbin/mfiutil/mfi_evt.c:583:30: error: taking address of packed
member 'members' of class or structure 'mfi_evt' may result in an
unaligned pointer value [-Werror,-Waddress-of-packed-member]
if (parse_locale(optarg, &filter.members.locale) < 0) {
^~~~~~~~~~~~~~~~~~~~~
Use a local variable instead, and copy that into the struct.
Reviewed by: jhb
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9069
This change also documents the modification harti made to a handful of
objects in r122758 (the max OCTET STRING width was increased from 15 to
31 octets)
MFC after: 1 week
- Mark the smilint target .PHONY so it's always executed when requested
- Leverage .PATH for BMIBS instead of spelling the path out longhand
for them
MFC after: 1 week
This prevented the device from attaching with a
Windows guest (most other guests use the device type
for matching)
PR: 212711
Submitted by: jbeich
MFC after: 3 days
in the first byte of the 3-byte mouse data report.
Plan9/9front requires this.
Switch over to using #defines for the data report bits.
Verified no regression on Win10/Fedora-live.
Reported and tested by: Trent Thompson (trentnthompson at gmail com)
MFC after: 1 week
This is being done to reduce wasted space, simplify complexity in
the code, and to quell a Coverity warning about buffer overruns.
warning about buffer overruns.
MFC after: 1 week
Reported by: Coverity
CID: 1006736
* CID 1198994: Don't run the speed disk on a disk with no sectors
* CID 1011442: Don't call close(2) if open(2) fails
* CID 1011161: Use snprintf instead of sprintf
* CID 1009825: Check the return value of lseek
Reported by: Coverity
CID: 1198994 1011442 1011161 1009825
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Although it increases the size of the bsnmp{get,set,walk} binaries by
four on my [amd64] system, it removes the need for producing .debug
files, profiled libraries, and for installing the library itself,
reducing the overall size use on disk by the utilities noted
previously.
Plus, it guards against ABI/API compatibility issues with the library
as it's only used internal to the tools themselves.
MFC after: 3 weeks
- snmp_pdu_free should be called before snmp_pdu_create is called
again
- snmp_pdu_free should be called on the resp to snmp_dialog when
successful
Tested with the following bsnmp commands:
% export SNMPUSER=bsnmp SNMPPASSWD=bsnmptest
% SNMP_ARGS="-A proto=sha -C context='' -K -P proto=des -v 3 -r 0"
% bsnmpset $SNMP_ARGS sysLocation="MyAgent"
% bsnmpget $SNMP_ARGS sysLocation
% bsnmpwalk $SNMP_ARGS
MFC after: 12 days
X-MFC with: r310729, r310892, r310894
on the stack
Some of the callers try to determine whether or not `object` is valid by
testing the value for NULL, which will never be true if it's a stack value,
so in order to be clear and correct down the call stack, use a heap
allocated object.
This also addresses a Coverity issue by initializing all of `object` via
calloc
MFC after: 1 week
Reported by: Coverity
CID: 1006392
- Set O_CLOEXEC to the signal pipe and /dev/klog.
- Use a single signal handler to catch both SIGHUP and SIGCHLD.
- Fix a bug which did FD_SET() the writer-end of the pipe.
The previous code always set value->v.octetstring.len to len, regardless
of the result from the malloc call. This misleads the caller on malloc
failure. Set .len to len on success and 0 on failure.
MFC after: 1 week
Reported by: Coverity
CID: 1007590
r310892 was on the right track, but unfortunately it was resolving
the problem incorrectly and accidentally leaking memory in the
process.
- Call snmp_pdu_free on req before calling snmp_pdu_create on it
at the bottom of the outer while loop
- Call snmp_pdu_free on resp after calling snmpwalk_nextpdu_create
in the inner loop
MFC after: 12 days
X-MFC with: r310729, r310892
Reported by: valgrind
the main I/O multiplex loop. select() now watches
a pipe which is written by the new skinny signal
handlers and the received signals are handled inside
the loop sequencially.
This eliminates a complex signal mask to guarantee
async-signal safety.
Don't close all file descriptors greater than STDERR_FILENO (2) in
waitdaemon(..) -- only close fd (file descriptor for /dev/null used in
subsequent calls to dup2) if it's greater than STDERR_FILENO.
Reported by: subbsd@gmail.com, danny@cs.huji.ac.il
Pointyhat to: hrs
X-MFC with: r310494
- Use warn instead of warnx + strerror(errno)
- Remove unnecessary trailing newline from a warnx call
- Add missing spaces following "," in syslog and warn* calls
MFC after: 2 weeks
sending SIGTERM to the process failed. It is an
unusual situation but it can happen.
- Split deadq_remove() into deadq_remove() and
deadq_removebypid().
- Normalize variable names of struct deadq_entry *.
Now that we have our sysctl tree annotated with aggregation labels,
let's go ahead and provide a very simple utility for exporting the
sysctl tree in Prometheus' format. It can either be used in conjunction
with the Prometheus node exporter or run through inetd(8).
The reason why I'm opting for having it in the base system is because it
has a pretty strong integration with some of sysctl's innards, such as
access to iterators, name lookups, metadata and type information. As I
am investigating whether we can add histograms as native types to sysctl
as well, this integration will only get stronger as we go along. That's
why it would be safer to oversee the development of this exporter
ourselves, as opposed to having it as an external project.
This exporter is remarkably compact, especially when compared to the
official Linux binary of the Prometheus node exporter (16 KB vs 12 MB).
I guess this could be an interesting aspect for monitoring embedded
FreeBSD-based systems.
Differential Revision: https://reviews.freebsd.org/D8792
now processed in struct socklist in a consistent manner.
- Add helper functions to add a new entry of struct socklist, filed, or peer.
- Use the same routine for -l, -p, and -S.
- Close /dev/klog when read(2) failed.
Add a '-f' option to force crontab '-r' to be non-interactive.
Submitted by: Sam Gwydir <sam at samgwydir.com>
Reviewed by: me, wblock (previous version)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D8815