summaryrefslogtreecommitdiffstats
path: root/sbin
Commit message (Collapse)AuthorAgeFilesLines
* MFC r313745:garga2017-02-212-42/+44
| | | | | | | | | | | | | * Add missing parameters to usage() * Add missing parameters to manpage synopsis * Add missing description of -d flag * Sort flags descriptions Reviewed by: allanjude, kib Approved by: allanjude MFC after: 1 week Sponsored by: Rubicon Communications (Netgate) Differential Revision: https://reviews.freebsd.org/D9152
* MFC r312992:pfg2017-02-201-4/+0
| | | | | | | | MFV r312970, 313160: openresolv: update to version 3.9.0. It is now possible to drop the _WITH_ARG vars thanks to a change to the pdns_recursor upstreamed by Guy Yur.
* MFC r313273:ngie2017-02-121-36/+23
| | | | | | | | style(9) cleanup - Delete trailing whitespace - Fix alignment/variable sorting - Delete single-line enclosing braces
* MFC r311160, r311210, r311288, r311292, r311298, r311340asomers2017-02-021-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 r312228: Make `camcontrol cmd ... -i ...` return only valid bytes.mav2017-01-291-5/+9
| | | | | Previously code ignored resid field and returned extra zeroes in case of data underflow. Now it returns only real bytes received from target.
* MFC r312560:avos2017-01-251-1/+1
| | | | ifconfig(8): fix '-stbc' parameter name.
* MFC r311897: Add checks for received mode page length.mav2017-01-211-3/+6
| | | | | | | | If our buffer is too small, we may receive part of the page, and should not try read/write past the end of the buffer. Reported by: Coverity CID: 1368374, 1368375
* MFC r311636: Make 'camcontrol modepage' support subpages.mav2017-01-214-139/+187
|
* MFC r311623: Make do_buff_decode() not read past the end of the buffer.mav2017-01-211-1/+8
| | | | Abort format processing as soon as we have no enough data.
* MFC r311522:kib2017-01-131-22/+32
| | | | Use type-independent formats for printing nlink_t and ino_t.
* MFC r310707:loos2017-01-131-1/+1
| | | | | | | | | | | Fix the parsing of NPt binat rules. In this specific case the src address can be set to any, which was not accepted prior to this commit. pfSense bug report: https://redmine.pfsense.org/issues/6985 Reviewed by: kp Obtained from: pfSense Sponsored by: Rubicon Communications, LLC (Netgate)
* MFC r311530:dim2017-01-111-2/+5
| | | | | | | | | | | | | | | | Fix clang 4.0.0 warnings about taking the address of a packed member of struct ip in ping(8): sbin/ping/ping.c:1684:53: error: taking address of packed member 'ip_src' of class or structure 'ip' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member] (void)printf(" %s ", inet_ntoa(*(struct in_addr *)&ip->ip_src.s_addr)); ^~~~~~~~~~~~~~~~~ sbin/ping/ping.c:1685:53: error: taking address of packed member 'ip_dst' of class or structure 'ip' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member] (void)printf(" %s ", inet_ntoa(*(struct in_addr *)&ip->ip_dst.s_addr)); ^~~~~~~~~~~~~~~~~
* MFC r310961:avos2017-01-081-1/+1
| | | | sysctl(8): fix typename for uint32_t
* MFC r310092:brooks2016-12-212-0/+15
| | | | | | | | | | | Add a free_iovec() function to reset iovec's. The primary purpose is to call nmount() in a loop with new iovec's so free_iovec takes arguments by reference and resets their values. Reviewed by: cem Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D8513
* MFC r310089:avos2016-12-181-1/+1
| | | | | | | | | ifconfig: do not truncate SSID in verbose mode. Fix 32-character SSID abbreviation for 'ifconfig -v wlan0 scan' command. PR: 215301 Submitted by: <ms-freebsd-bugzilla@stoffnet.at>
* MFC r309374, r309513, r309839, r309840:ken2016-12-165-3/+589
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------ r309374 | ken | 2016-12-01 15:20:27 -0700 (Thu, 01 Dec 2016) | 41 lines Add SCSI REPORT TIMESTAMP and SET TIMESTAMP support. This adds support to camcontrol(8) and libcam(3) for getting and setting the time on SCSI protocol drives. This is more commonly found on tape drives, but is a SPC (SCSI Primary Commands) command, and may be found on any device that speaks SCSI. The new camcontrol timestamp subcommand allows getting the current device time or setting the time to the current system time or any arbitrary time. sbin/camcontrol/Makefile: Add timestamp.c. sbin/camcontrol/camcontrol.8: Document the new timestamp subcommand. sbin/camcontrol/camcontrol.c: Add the timestamp subcommand to camcontrol. sbin/camcontrol/camcontrol.h: Add the timestamp() function prototype. sbin/camcontrol/timestamp.c: Timestamp setting and reporting functionality. sys/cam/scsi/scsi_all.c: Add two new CCB building functions, scsi_set_timestamp() and scsi_report_timestamp(). Also, add a new helper function, scsi_create_timestamp(). sys/cam/scsi/scsi_all.h: Add CDB and parameter data for the the set and report timestamp commands. Add function declarations for the new CCB building and helper functions. Submitted by: Sam Klopsch Sponsored by: Spectra Logic ------------------------------------------------------------------------ r309513 | adrian | 2016-12-03 13:35:39 -0700 (Sat, 03 Dec 2016) | 7 lines [camcontrol] init ts=0 to quieten gcc. It "looks" like ts is set to something on success, and not modified on error. Checked on IRC with: cem ------------------------------------------------------------------------ r309839 | ngie | 2016-12-10 16:26:34 -0700 (Sat, 10 Dec 2016) | 6 lines free/NULL out variables prior to calling strdup to avoid leaking memory if arguments are specified more than once with "camcontrol timestamp". CID: 1366829, 1366831 ------------------------------------------------------------------------ r309840 | ngie | 2016-12-10 16:58:14 -0700 (Sat, 10 Dec 2016) | 8 lines Cut to the chase and just call free instead of free(x) + x = NULL NULLing out x wasn't required as the memory was immediately scribbled over with strdup in the following call. Submitted by: imp ------------------------------------------------------------------------
* MFC r309625vangyzen2016-12-131-0/+52
| | | | | | | | | | | This is imported from NetBSD. The author--Joerg Sonnenberger--agreed to apply a two-clause BSD license, just so the license was clear. This source tree location matches NetBSD, and is the first place someone might look for such a tool. Obtained from: Joerg Sonnenberger via NetBSD Sponsored by: Dell EMC
* MFC r307684, r307747ken2016-12-121-53/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------ r307684 | ken | 2016-10-20 13:42:26 -0600 (Thu, 20 Oct 2016) | 13 lines For CCBs allocated on the stack, we need to clear the entire CCB, not just the header. Otherwise stack garbage can lead to random flags getting set. This showed up as 'camcontrol rescan all' failing with EINVAL because the address type wasn't CAM_DATA_VADDR. sbin/camcontrol/camcontrol.c: In rescan_or_reset_bus(), bzero the stack-allocated CCBs before use instead of clearing the body. Sponsored by: Spectra Logic ------------------------------------------------------------------------ r307747 | ken | 2016-10-21 12:54:56 -0600 (Fri, 21 Oct 2016) | 27 lines Fix a problem in camcontrol(8) that cropped up with r307684. In r307684, I changed rescan_or_reset_bus() to bzero stack-allocated CCBs before sending them to the kernel because there was stack garbage in there that wound up meaning that bogus CCB flags were set. While this fixed the 'camcontrol rescan all' case (XPT_DEV_MATCH CCBs were failing previously), it broke the 'camcontrol rescan 0' (or any other number) case when INVARIANTS are turned on. Rescanning a single bus reliably produced an assert in cam_periph_runccb(): panic: cam_periph_runccb: ccb=0xfffff80044ffe000, func_code=0x708, flags=0xffffdde0 The flags values don't make sense from the code. Changing the CCBs in rescan_or_reset_bus() from stack to heap allocated avoids the problem. It would be better to understand why userland stack allocated CCBs don't work properly, since there may be other code that breaks if stack allocated CCBs don't work. sbin/camcontrol/camcontrol.c: In rescan_or_reset_bus(), allocate the CCBs using malloc(3) instead of on the stack to avoid an assertion in cam_periph_runccb(). Sponsored by: Spectra Logic ------------------------------------------------------------------------ Sponsored by: Spectra Logic
* MFC r309281:oleg2016-12-081-1/+1
| | | | | Fix 'ipfw delete set N': do not emit meaningless 'rule 0 not found' warning if set was already empty.
* MFC: r308871rmacklem2016-12-031-2/+22
| | | | | | Modify umount so that it does not do an Unmount RPC for NFSv4 mounts and uses TCP for the Unmount RPC if the mount is over TCP. Without this patch, umount does an Unmount RPC over UDP for all NFS mounts.
* MFC r309027:brooks2016-11-301-2/+2
| | | | | | | | | | | | | | | | | Allocate a struct ifreq rather than using a (wrong) computed size for the BIOCSETIF ioctl. The kernel always copies an entire struct ifreq and IPv4 addresses will always fit in an ifreq. On systems with pointers larger than 64-bits, the computed size will be less than the size of struct ifreq, potentially resulting in the kernel attempting to copyin memory from outside the allocation. Reviewed by: jhb Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D8445
* MFC r308673:ae2016-11-223-25/+20
| | | | | | Add missing support of named lookup tables to the IPv6 code. PR: 214419
* MFC r308089: zfsbootcfg: a simple tool to set next boot (one time)avg2016-11-214-0/+238
| | | | options for zfsboot
* Zero etherswitch_vlangroup structure before doing partial assignments.loos2016-11-201-2/+4
| | | | Sponsored by: Rubicon Communications, LLC (Netgate)
* MFC r307755: swapoff: Remove only late devices with -aL.jilles2016-11-192-1/+11
| | | | | | | | | | | | | | | Currently, '/etc/rc.d/swaplate stop' removes all swap devices. This can be very slow and may not even be possible if there is a lot of swap space in use. However, removing swap devices is only needed for late swap devices that may depend on daemons that subsequent shutdown steps stop. Normal swap devices such as hard disk partitions will remain available throughout the shutdown process and need not be removed. In swapoff, interpret -aL to remove late swap devices only, and use this in etc/rc.d/swaplate. The meaning of -aL in swapon remains unchanged (add all swap devices, both normal and late). PR: 187081
* MFC r306585: swapon(8): Update to reality: swapoff ignores -L and the latejilles2016-11-191-9/+1
| | | | option in fstab.
* MFC r306808:kib2016-10-281-2/+7
| | | | Add verbosity around failed reboot(2) call.
* MFC r306807:kib2016-10-281-1/+9
| | | | | | When making a pause after detecting hard kill of the single-user shell, ensure that we do sleep for at least the specified time, in presence of signals.
* MFC r306276, but don't remove findwin95asomers2016-10-211-8/+1
| | | | | | | Mount msdosfs with longnames support by default. The old behavior depended on the FAT version and on what files were in the root directory. "mount_msdosfs -o shortnames" is still supported.
* MFC r303541, r303542, r303543, r303545, r303546, r303547, r304225, r304226, ↵araujo2016-10-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r304605, r304676, r305212, r305863: r303541: Use nitems() from sys/param.h. Sponsored by: gandi.net (BSD Day Taiwan) MFC after: 2 weeks. r303542: Use nitems() from sys/param.h. MFC after: 2 weeks. Sponsored by: gandi.net (BSD Day Taiwan) r303543: Use nitems() from sys/param.h. MFC after: 2 weeks. Sponsored by: gandi.net (BSD Day Taiwan) r303545: Use nitems() from sys/param.h. MFC after: 2 weeks. Sponsored by: gandi.net (BSD Day Taiwan) r303546: Use nitems() from sys/param.h. MFC after: 2 weeks. Sponsored by: gandi.net (BSD Day Taiwan) r303547: Use nitems() from sys/param.h. MFC after: 2 weeks. Sponsored by: gandi.net (BSD Day Taiwan) r304225: Use nitems() from sys/param.h. MFC after: 2 weeks. r304226: Use nitems() from sys/param.h. MFC after: 2 weeks. r304605: Fix calloc(3) argument order. Reviewed by: trasz MFC after: 4 weeks. Differential Revision: https://reviews.freebsd.org/D7532 r304676: Fix calloc(3) argument order. MFC after: 4 weeks. r305212: - Invert calloc(3) argument order. MFC after: 4 weeks r305863: Invert calloc(3) argument order. Reviewed by: ed. MFC after: 4 weeks. Differential Revision: https://reviews.freebsd.org/D7902
* MFC 304438:mckusick2016-10-174-13/+15
| | | | | Fsck_ufs was using an int rather than a ufs2_daddr_t to store the alternate superblock location when given in the -b option.
* MFC r306840:sevan2016-10-161-3/+3
| | | | | | | | | Sort SEE ALSO section sequentially. Highlighted by mandoc -Tlint PR: 212440 Approved by: imp Differential Revision: https://reviews.freebsd.org/D8192
* MFC r306736:sevan2016-10-161-1/+6
| | | | | | | | Add history section to nos-tun(8) PR: 212545 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8104
* MFC r306735:sevan2016-10-161-2/+7
| | | | | | | | | Add history section to natd(8) Fix back sentence raised by igor. PR: 212544 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8104
* MFC r306734:sevan2016-10-161-4/+15
| | | | | | | | | Add history section to fsck_ffs(8) Move sentence to a new line as advised by igor. PR: 212474 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8104
* MFC r306733:sevan2016-10-161-1/+13
| | | | | | | | Add history section to fsck(8) PR: 212472 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8104
* MFC r306732:sevan2016-10-161-1/+16
| | | | | | | | | | | | | | | Document the history of fdisk based on the original post to comp.unix.bsd by Julian Elischer [1] and the Mach 2.5 Installation notes [2]. I was unable to pin point the exact version of Mach the fdisk utility appeared as I could not find documentation older than version 2.5 & no source code or repo history. fdisk utility appears as a separate utility[3] in v2.5. Due to this, I have avoided stating the exact version fdisk first appeared in Mach. Add authors section. [1] https://groups.google.com/d/topic/comp.unix.bsd/Hhi45vAHxDg/discussion [2] ftp://ftp.mcs.vuw.ac.nz/doc/misc/mach-i386-doc/i386_install.ps [3] ftp://ftp.mcs.vuw.ac.nz/doc/misc/mach-i386-doc/i386_manpages.ps PR: 212470 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8104
* MFC r306731:sevan2016-10-161-4/+19
| | | | | | | | | | | | | | | | | Document the history of fdisk based on the original post to comp.unix.bsd by Julian Elischer [1] and the Mach 2. 5 Installation notes [2]. I was unable to pin point the exact version of Mach the fdisk utility appeared as I could not find documentation older than version 2.5 & no source code or repo history. fdisk utility appears as a separate utility[3] in v2.5. Due to this, I have avoided stating the exact version fd isk first appeared in Mach. Add authors section. Make correction pointed by igor [1] https://groups.google.com/d/topic/comp.unix.bsd/Hhi45vAHxDg/discussion [2] ftp://ftp.mcs.vuw.ac.nz/doc/misc/mach-i386-doc/i386_install.ps [3] ftp://ftp.mcs.vuw.ac.nz/doc/misc/mach-i386-doc/i386_manpages.ps PR: 212469 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8104
* MFC r306728:sevan2016-10-161-2/+8
| | | | | | | | | Add history section for devfs(8) Move sentence to a new line as advised by igor. PR: 212441 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8104
* MFC r306727:sevan2016-10-161-2/+8
| | | | | | | | | Add history section for devd(8) Move sentence to a new line as advised by igor PR: 212439 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8104
* MFC r306725:sevan2016-10-161-1/+6
| | | | | | | | | Add history section for clri(8) http://minnie.tuhs.org/cgi-bin/utree.pl?file=V6/usr/man/man8/clri.8 PR: 212438 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8104
* MFC r306724:sevan2016-10-161-2/+7
| | | | | | | | | | Add history section for bsdlabel(8) http://minnie.tuhs.org/cgi-bin/utree.pl?file=4.3BSD-Tahoe/usr/man/cat8/disklabel.0 Remove tab after space, highlighted by igor PR: 212436 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8104
* MFC r306723:sevan2016-10-161-2/+7
| | | | | | | | Add history section for atmconfig(8) PR: 212415 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8104
* MFC r306617:sevan2016-10-161-4/+6
| | | | | | | | | | shutdown appeared as a standalone utility in 4.1BSD. http://mail-index.netbsd.org/source-changes-d/2016/09/13/msg008686.html http://mail-index.netbsd.org/source-changes-d/2016/09/14/msg008691.html PR: 212552 Approved by: bcr (mentor) Obtained from: NetBSD Differential Revision: https://reviews.freebsd.org/D8105
* MFC r306616:sevan2016-10-161-1/+3
| | | | | | | | setkey appeared in FreeBSD 4.0 PR: 212551 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8105
* MFC r306615:sevan2016-10-161-2/+8
| | | | | | | | sconfig appeared in FreeBSD 5.2. PR: 212550 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8105
* MFC r306614:sevan2016-10-161-6/+10
| | | | | | | | | Note the version PF first appeared in FreeBSD & from which version it was ported from. Address the contractions raised by igor. PR: 212574 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8105
* MFC r306613:sevan2016-10-161-2/+6
| | | | | | | | Note the change of name in FreeBSD 5.0. PR: 212542 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8105
* MFC r306612:sevan2016-10-161-2/+6
| | | | | | | | Note the name change from mount_null to mount_nullfs in FreeBSD 5.0. PR: 212541 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8105
* MFC r306611:sevan2016-10-101-13/+24
| | | | | | | | | | | | | | Amend history to mention predecessor originated from 386BSD[1] & current implementation from NetBSD[2]. Reword history since the utility was renamed once more in FreeBSD 5.0. Separate out author & historical information regarding character code conversion. Add AUTHORS section. [1] https://groups.google.com/forum/#!search/mount_pcfs.c/comp.unix.bsd/9qhH0v1tZm0/inlPnXZj_2sJ [2] http://cvsweb.netbsd.org/bsdweb.cgi/src/sbin/mount_msdos/mount_msdos.c?rev=1.6&content-type=text/x-cvsweb-markup PR: 212536 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8105
OpenPOWER on IntegriCloud