summaryrefslogtreecommitdiffstats
path: root/usr.sbin
Commit message (Collapse)AuthorAgeFilesLines
* MFC r315212, r315213, r315214, r315215:pfg2017-03-206-18/+16
| | | | | | | | | mkimg(1): let calloc(3) do the multiplication. nscd(8): let calloc(3) do the multiplying. mpsutil(8): let calloc(3) do the multiplying. ypbind(8): let calloc(3) do the multiplying. MFC after: 1 week
* MFC r314830:ngie2017-03-161-4/+5
| | | | | | | | | | | | mergemaster: fix description of -p -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 r314233:ngie2017-03-121-4/+6
| | | | | | | | | | | | Parameterize out the length of struct filed->f_lasttime as `MAXDATELEN` 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)
* MFC r314896:cy2017-03-111-4/+0
| | | | | Remove extraneous arguments and options, which don't make sense for a file documented in volume 5.
* MFC r314768:cy2017-03-111-4/+0
| | | | | | Fix mismerge of r280849. Reported by: des
* MFC r314226:ngie2017-03-071-2/+2
| | | | | | Use SRCTOP instead of .CURDIR relative paths with ".." This simplifies pathing in make/displayed output
* MFC r312559:asomers2017-02-281-22/+15
| | | | | | | | | | | | | | | | | | | | | Fix misc Coverity defects in camdd(8) 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
* MFC r311572, r311895, r311928, r311985, r312395, r312417asomers2017-02-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r311572: Fix file descriptor leaks in cmp(1) Also, add a few test cases Reported by: Coverity CID: 271624 275338 Reviewed by: ngie MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9074 r311895: Fix memory leaks during "tail -r" of an irregular file * Rewrite r_buf to use standard tail queues instead of a hand-rolled circular linked list. Free dynamic allocations when done. * Remove an optimization for the case where the file is a multiple of 128KB in size and there is a scarcity of memory. * Add ATF tests for "tail -r" and its variants. Reported by: Valgrind Reviewed by: ngie MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9067 r311928: Fix build of usr.bin/tail with GCC Submitted by: pluknet Reported by: pluknet MFC after: 27 days X-MFC-with: 311895 Sponsored by: Spectra Logic Corp r311985: Fix uninitialized variable CIDs in route6d 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 r312395: Fix several Coverity CIDs in devd CID 1362055, 1362054: File descriptor leaks during shutdown CID 1362013: Potential null-termination fail with long network device names CID 1362097: Uncaught exception during memory pressure CID 1362017, 1362016: Unchecked errors, possibly resulting in weird behavior if two devd instances start at the same time. CID 1362015: Unchecked error that will probably never fail Reported by: Coverity CID: 1362055 1362054 1362013 1362097 1362017 1362016 1362015 MFC after: 4 weeks Sponsored by: Spectra Logic Corp r312417: Fix build of devd with GCC 4.2 Reported by: olivier Pointy-hat-to: asomers MFC after: 27 days X-MFC-with: 312395 Sponsored by: Spectra Logic Corp
* MFC r312644, r312650bapt2017-02-253-10/+25
| | | | | | | | | | | | | | | | | | r312644: Readd a feature lost in pw(8) refactoring pw usermod foo -m It used to be able to (re)create the home directory if it didn't exists r312650: Really restore the old behaviour for pw usermod -m It again reinstall missing skel files without overwriting changed one Add a regression test about it PR: 216224 Reported by: ae
* MFC r313563: kldxref: bump MAXSEGS to 3emaste2017-02-171-1/+1
| | | | | | | | ld.bfd generates two PT_LOAD segments, but certain linkers or linker configurations generate three PT_LOAD segments (one additional for RELRO). PR: 216975
* MFC r313562: kldxref: s/sections/segments/ in warning messageemaste2017-02-171-1/+1
| | | | | | The message refers to program header segments, not sections. PR: 216975
* MFC r311702grehan2017-02-161-1/+1
| | | | | | | | | Use correct PCI device id for virtio-rng. This prevented the device from attaching with a Windows guest (most other guests use the device type for matching) PR: 212711
* MFC r313477:garga2017-02-161-17/+15
| | | | | | | | | | | | | | | | | | | Cleanup on usr.sbin/arp/arp.c * '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
* MFC r313457:garga2017-02-151-46/+44
| | | | | | | | | | Fix style(9) Reviewed by: vangyzen, allanjude, cem Approved by: allanjude MFC after: 1 week Sponsored by: Rubicon Communications (Netgate) Differential Revision: https://reviews.freebsd.org/D9494
* MFC r313448:garga2017-02-151-3/+4
| | | | | | | | | | | | | | | bsdinstall: Make sure chroot filesystems are umounted after use * 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
* MFC r313356:ngie2017-02-141-1/+1
| | | | Fix typos in comments (returing -> returning)
* MFC r313358,r313360:ngie2017-02-141-6/+6
| | | | | | | | | | r313358: Sort sys/ #includes and zap an unnecessary trailing space nearby r313360: Sort sys/ #includes some more
* MFC r308312: vidcontrol: improve error handling in vt(4) font loadingemaste2017-02-101-18/+26
| | | | PR: 209078
* MFC r274583: Default to use 10 seconds as nap interval instead of 1.delphij2017-02-102-2/+2
|
* MFC r289172,r290254:ngie2017-02-097-16/+2
| | | | | | | | | | | | | | | | r289172: Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) and netbsd-tests.test.mk (r289151) - Eliminate explicit OBJTOP/SRCTOP setting - Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk - Remove unnecessary TESTSDIR setting - Use SRCTOP where possible for clarity r290254: Remove unused variable (SRCDIR)
* MFC r304142: ensure stripe size is non-zero multiple of 4096rpokala2017-02-081-6/+20
| | | | | | | | Ensure that the sector size is a multiple of 4096 to avoid creating unaligned partitions when the actual sector size is hidden from us. NOTE: This change was MFCed to stable/11 months ago as as r304448; I'm just MFCing it back one more stream.
* MFC r312694: Make CTL ramdisk backend a real RAM disk.mav2017-02-071-2/+17
| | | | | | | | | | | | | | | | | 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 r311471:ngie2017-02-041-3/+9
| | | | | Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of always building support into sendmail.
* MFC r311744,r312328,r312329,r312330:ngie2017-02-043-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r311744: Document bsd.snmpmod.mk from a high-level r312328: Add a make target (smilint) for running smilint tool against BMIBS Running smilint against MIB definitions is useful in finding functional problems with MIB definitions/descriptions. This is inspired by the smilint targets defined in usr.sbin/bsnmpd/modules/{snmp_hostres,snmp_mibII}/Makefile Document all of the variables that are involved in running the smilint target, as well as all of the prerequisites to running it. r312329: Remove ad hoc smilint targets made standard in bsd.snmpmod.mk in r312328 r312330: Add smilint target to subdir targets so "make smilint" here will run the smilint target in subdirs While here, convert a path that's .CURDIR relative to SRCTOP
* MFC r311469:ngie2017-02-041-3/+8
| | | | | Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of always building support into ypserv.
* MFC r311472:ngie2017-02-042-4/+10
| | | | | Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of always building support into amd(8).
* MFC r311470:ngie2017-02-041-4/+10
| | | | | Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of always building support into rpcbind.
* MFC r312105,r312162:ngie2017-02-042-2/+16
| | | | | | | | | | | | | | | | | | | | | r312105: Conditionalize libwrap support into inetd based on MK_TCP_WRAPPERS This will allow inetd to stand by itself without libwrap. Relnotes: yes r312162: Fix up r312105 - 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. Pointyhat to: ngie
* MFC r311160, r311210, r311288, r311292, r311298, r311340asomers2017-02-021-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r311160: misc minor fixes in mpr(4) sys/dev/mpr/mpr_sas.c * Fix a potential null pointer dereference (CID 1305731) * Check for overrun of the ccb_scsiio.cdb_io.cdb_bytes buffer (CID 1211934) sys/dev/mpr/mpr_sas_lsi.c * Nullify a dangling pointer in mprsas_get_sata_identify * Fix a memory leak in mprsas_SSU_to_SATA_devices (CID 1211935) Reported by: Coverity (partially) CID: 1305731 1211934 1211935 Reviewed by: slm MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D8880 r311210: Quell Coverity for diskinfo(8) * 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 r311288: Delete dead code in chat(8) It's always been dead, ever since first import in 1994. It's still dead in OpenBSD's version, too. Reported by: Coverity CID: 270586 MFC after: 4 weeks Sponsored by: Spectra Logic Corp r311292: Remove dead code in rpc_parse.c It's been dead ever since it was imported from TI-RPC in 1995. The dead code is still present in Illumos today, but was removed from NetBSD in 2006. Reported by: Coverity CID: 270097 Obtained from: NetBSD MFC after: 4 weeks Sponsored by: Spectra Logic Corp r311298: Remove dead code in dhclient(8) The offending code has been dead ever since the import from OpenBSD in r195805. OpenBSD later deleted that entire function. Reported by: Coverity CID: 500059 MFC after: 4 weeks Sponsored by: Spectra Logic Corp r311340: Misc Coverity fixes for tail(1) CID 1006402: Initialize stack variable CID 271580: Don't leak memory when ENOMEM. Reported by: Coverity CID: 271580 1006402 MFC after: 4 weeks Sponsored by: Spectra Logic Corp
* MFC r312009:ngie2017-01-161-3/+29
| | | | | | Add license preamble for r286964; credit to asomers While here, clean up trailing whitespace
* MFC r311740:ngie2017-01-162-4/+6
| | | | | | | | Improve the smilint target in the hostres and mibII modules - 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 r311758:ngie2017-01-161-1/+3
| | | | | | | Add a REVISION section to track changes for the BEGEMOT-ATM-FREEBSD-MIB MIB file There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at
* MFC r311741,r311761:ngie2017-01-162-0/+16
| | | | | | | | | | | | | | | | | r311741: Add a REVISION section to track changes for the hostres module There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at r311761: Add a REVISION section to track changes for the BEGEMOT-NETGRAPH MIB file 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 r311739:ngie2017-01-137-8/+8
| | | | | | Use SRCTOP instead of spelling out the full path with .CURDIR This helps condense the output for CFLAGS and .PATH
* MFC r310892,r310894,r310989:ngie2017-01-131-12/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r310892: Don't call snmp_pdu_free(..) until finished with the pdu and when ready to allocate a new one via snmp_pdu_create(..) This fixes bsnmpwalk, so it no longer crashes after r310729 r310894: snmp_pdu_free the right object at the right time in snmptool_walk 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 r310989: Call snmp_pdu_free on req/resp with a consistent, correct pattern - 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 r311290,r311293,r311294:ngie2017-01-131-13/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | r311290: Use strlcpy instead of strcpy when copying the bridge name to ifr.ifr_name to avoid buffer overflows CID: 1006735, 1006737, 1006738 r311293: bridge_do_pfctl: allocate mib_name dynamically using asprintf 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. CID: 1006736 r311294: style cleanup - bridge_pf_dump: use nitems instead of spelling it out longhand - bridge_do_pfctl: sort variables by alignment for type
* MFC r311709:ngie2017-01-131-6/+6
| | | | | | | Style(9) fixes - Sort sys/ #includes - Use nitems instead of hardcoding the length of `mib`
* MFC r311711,r311712,r311713:ngie2017-01-131-53/+49
| | | | | | | | | | | | | | r311711: Clean up trailing whitespace r311712: Sort #includes r311713: Use nitems(mib) instead of hardcoding mib's length
* MFC r310633: Add MAX_LUNS overflow safety checks.mav2017-01-101-0/+10
| | | | | While this MAX_LUNS limitation is too synthetic and should be removed, it is better to enforce it while it is here.
* MFC r310614: Don't assign rtjp twice.delphij2017-01-091-2/+1
|
* MFC r310611:delphij2017-01-091-3/+1
| | | | | | - pstat(8) does not accept any arguments other than getopt() args, so don't bother to adjust argc/argv after getopt() loop. - Make a string pointer constant.
* MFC r311393:ngie2017-01-091-2/+2
| | | | | OS_getSystemUptime: use nitems for calculating the number of elements in a sysctl mib instead of hardcoding the number 2
* MFC r311291:ngie2017-01-071-2/+2
| | | | bridge_get_pfval: use nitems instead of spelling it out longhand
* MFC r310497:ngie2017-01-073-42/+36
| | | | | | | | Warning message cleanup - 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 r310954,r310987,r311222:ngie2017-01-072-11/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r310954: Set value->v.octetstring.len to a correct value on malloc success/failure 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. CID: 1007590 r310987: snmp_output_err_resp, snmp_output_resp: allocate `object` using calloc, not 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 CID: 1006392 r311222: Fix logical inversion when checking result from calloc in snmp_output_err_resp(..) CID: 1368195
* MFstable/11 r311465:ngie2017-01-061-4/+3
| | | | | | | | | MFC r311175: Swap parameters around with parse_syntax_strval(..) for consistency with other parse_* APIs in bsnmp* Noted by: bz
* MFC r310356: Add support for locally assigned RFC 4122 UUID LUN identifiers.mav2017-01-051-2/+5
|
* MFC r311005cy2017-01-041-1/+1
| | | | Fix up grammar.
* MFstable/11 r311215:ngie2017-01-041-3/+8
| | | | | | | | | | MFC r310711: Don't explicitly build tcp wrappers support into bsnmpd; make it conditional on MK_TCP_WRAPPERS != "no" This likely fixes an issue seen where some of the USE_TCPWRAPPERS code didn't work as advertised
* MFstable/11 r311212:ngie2017-01-041-1/+4
| | | | | | MFC r310665: Only build/install usr.sbin/bsnmpd/modules/snmp_hast if MK_HAST != no
OpenPOWER on IntegriCloud