summaryrefslogtreecommitdiffstats
path: root/usr.sbin
Commit message (Collapse)AuthorAgeFilesLines
* ffs_bswap: Copy one UFS dinode member at a timecem2016-05-111-2/+5
| | | | | | | | No functional change. Reported by: Coverity CIDs: 974635, 974636, 977396, 977397, 977398, 977399 Sponsored by: EMC / Isilon Storage Division
* bsdinstall/zfsboot: Do not mirror swap when swapsize is 0allanjude2016-05-101-1/+1
| | | | | | PR: 209415 Submitted by: Ganael LAPLANCHE <ganael.laplanche@corp.ovh.com> MFC after: 2 weeks
* Directly set the NONBLOCK flags when creating the socketbapt2016-05-101-8/+1
| | | | No functional changes
* Rename getline with get_line to avoid collision with getline(3)bapt2016-05-105-10/+10
| | | | | When getline(3) in 2009 was added a _WITH_GETLINE guard has also been added. This rename is made in preparation for the removal of this guard
* Rename getline with get_line to avoid collision with getline(3)bapt2016-05-102-9/+9
| | | | | When getline(3) in 2009 was added a _WITH_GETLINE guard has also been added. This rename is made in preparation for the removal of this guard
* Replace fparseln(3) with getline(3) to remove dependency on libutilbapt2016-05-092-7/+11
|
* Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedngie2016-05-0411-86/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after r298107 Summary of changes: - Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed - Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc - Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously. - Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk - Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk. - Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo - Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup) Document the proposed changes in share/examples/tests/tests/... via examples so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of replacing FILES. share/mk/bsd.README didn't seem like the appropriate method of communicating that info. MFC after: never probably X-MFC with: r298107 PR: 209114 Relnotes: yes Tested with: buildworld, installworld, checkworld; buildworld, packageworld Sponsored by: EMC / Isilon Storage Division
* Improve performance and functionality of the bitstring(3) apiasomers2016-05-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Two new functions are provided, bit_ffs_at() and bit_ffc_at(), which allow for efficient searching of set or cleared bits starting from any bit offset within the bit string. Performance is improved by operating on longs instead of bytes and using ffsl() for searches within a long. ffsl() is a compiler builtin in both clang and gcc for most architectures, converting what was a brute force while loop search into a couple of instructions. All of the bitstring(3) API continues to be contained in the header file. Some of the functions are large enough that perhaps they should be uninlined and moved to a library, but that is beyond the scope of this commit. sys/sys/bitstring.h: Convert the majority of the existing bit string implementation from macros to inline functions. Properly protect the implementation from inadvertant macro expansion when included in a user's program by prefixing all private macros/functions and local variables with '_'. Add bit_ffs_at() and bit_ffc_at(). Implement bit_ffs() and bit_ffc() in terms of their "at" counterparts. Provide a kernel implementation of bit_alloc(), making the full API usable in the kernel. Improve code documenation. share/man/man3/bitstring.3: Add pre-exisiting API bit_ffc() to the synopsis. Document new APIs. Document the initialization state of the bit strings allocated/declared by bit_alloc() and bit_decl(). Correct documentation for bitstr_size(). The original code comments indicate the size is in bytes, not "elements of bitstr_t". The new implementation follows this lead. Only hastd assumed "elements" rather than bytes and it has been corrected. etc/mtree/BSD.tests.dist: tests/sys/Makefile: tests/sys/sys/Makefile: tests/sys/sys/bitstring.c: Add tests for all existing and new functionality. include/bitstring.h Include all headers needed by sys/bitstring.h lib/libbluetooth/bluetooth.h: usr.sbin/bluetooth/hccontrol/le.c: Include bitstring.h instead of sys/bitstring.h. sbin/hastd/activemap.c: Correct usage of bitstr_size(). sys/dev/xen/blkback/blkback.c Use new bit_alloc. sys/kern/subr_unit.c: Remove hard-coded assumption that sizeof(bitstr_t) is 1. Get rid of unrb.busy, which caches the number of bits set in unrb.map. When INVARIANTS are disabled, nothing needs to know that information. callapse_unr can be adapted to use bit_ffs and bit_ffc instead. Eliminating unrb.busy saves memory, simplifies the code, and provides a slight speedup when INVARIANTS are disabled. sys/net/flowtable.c: Use the new kernel implementation of bit-alloc, instead of hacking the old libc-dependent macro. sys/sys/param.h Update __FreeBSD_version to indicate availability of new API Submitted by: gibbs, asomers Reviewed by: gibbs, ngie MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6004
* Fix "getextattr -x" with non-ascii attribute valuesasomers2016-05-042-4/+18
| | | | | | | | | | | | | extattr/rmextattr.c When printing hex output, treat all attribute values as unsigned char arrays instead of sign extending them to 32 bit values. extattr/tests/extattr_test.sh Add a regression test PR: 209039 MFC after: 4 weeks Sponsored by: Spectra Logic Corp
* Allow setextattr(8) to take attribute values from stdinasomers2016-05-044-34/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the -i option to setextattr. This option allow extended attribute data to be provided via stdin. Add a -qq option to getextattr, which omits the trailing newline. Together these options can be used to work with extended attributes whose values are large and/or binary. usr.sbin/extattr/Makefile: Link against libsbuf which is used for processing stdin data. usr.sbin/extattr/rmextattr.8: Document setextattr's -i option, getextattr's -qq option, and remove the BUG about setextattr only being useful for strings. usr.sbin/extattr/rmextattr.c: For setextattr operations, buffer attribute data in an sbuf. If -i is specified, pull the data from stdin, otherwise from the appropriate argurment. Update usage text and argument validation code for setextattr's -i option. usr.sbin/extattr/tests/extattr_test.sh Add tests for -q and -i. Reviewed by: wblock (manpage) MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6090
* pmcstudy.8: minor "efficiency" fix.pfg2016-05-031-1/+1
| | | | No functional change.
* bsdinstall: fix static address assignment for protected wireless networks.avos2016-05-021-1/+1
| | | | | | | Filter out IFCONFIG_PREFIX variable (which may contain WPA keyword) from ifconfig parameters. PR: 169199
* rpcbind: use our roundup() macro when available through <sys/param.h>.pfg2016-05-021-1/+1
| | | | No functional change.
* quot: make use of our rounddown() macro when <sys/param.h> is available.pfg2016-05-021-2/+2
| | | | No functional change.
* Use MIN macro from sys/param.h.araujo2016-05-021-1/+1
| | | | MFC after: 2 weeks.
* Use MIN/MAX macros from sys/param.h.araujo2016-05-021-3/+2
| | | | MFC after: 2 weeks.
* Use MIN macro from sys/param.h.araujo2016-05-021-1/+1
| | | | MFC after: 2 weeks.
* Use MAX macro from sys/param.h.araujo2016-05-021-1/+1
| | | | MFC after: 2 weeks.
* typojamie2016-05-011-1/+1
| | | | Submitted by: Jimmy Olgeni
* usr.sbin: minor spelling fixes on comments.pfg2016-05-0110-12/+12
| | | | No functional change.
* pmcstat: minor spelling fixes.pfg2016-05-012-2/+2
| | | | | | Mostly comments bur also a user-visible string. MFC after: 2 weeks
* usr.sbin/bsdconfig: minor spelling fixes on comments.pfg2016-05-019-22/+22
| | | | No functional change.
* bluetooth: minor spelling fixes.pfg2016-05-012-2/+2
| | | | | | User-visible strings. MFC after: 2 weeks
* Clarify when happens when there is a "depend" parameter in jail.conf,jamie2016-04-301-4/+5
| | | | and how this affects the "jail_list" option in rc.conf.
* Fix including Kyuafile in packaged base system.gjb2016-04-291-1/+2
| | | | | | | | | | | | Fix a related typo while here. Note, this change results in the Kyuafile inclusion in the runtime package, which needs to be fixed, however addresses the PR as far as I can tell in my tests. PR: 209114 Submitted by: ngie Sponsored by: The FreeBSD Foundation
* Use a better idiom for finding UTC prefixed timezonesngie2016-04-281-3/+4
| | | | | | | | | | Instead of copy-pasting the string literal for "UTC" 3 times and using strlen, use a static char[3] buffer and sizeof(..). MFC after: 3 days X-MFC with: r298507 Submitted by: kib Sponsored by: EMC / Isilon Storage Division
* Add PACKAGE fields to usr.sbin/extattr/tests/Makefileasomers2016-04-281-0/+4
| | | | | | | | | | | usr.sbin/extattr/tests/Makefile Add boiler plate required by 298107 but omitted by 298483. These two changes passed through CR in parallel. I think this should get the full test suite running in Jenkins again. MFC after: 22 days X-MFC-with: 298483 Sponsored by: Spectra Logic Corp
* Merge ACPICA 20160422.jkim2016-04-273-45/+54
|
* Add 'devctl delete' that calls device_delete_child().jhb2016-04-272-2/+54
| | | | | | | | | | | | | 'devctl delete' can be used to delete a device that is no longer present. As an anti-foot-shooting measure, 'delete' will not delete a device unless it's parent bus says it is no longer present. This can be overridden by passing the force ('-f') flag. Note that this command should be used with care. If a device is deleted that is actually present it can't be resurrected unless the parent bus device's driver supports rescans. Differential Revision: https://reviews.freebsd.org/D6019
* Add a new rescan method to the bus interface.jhb2016-04-272-1/+19
| | | | | | | | The BUS_RESCAN() method rescans a single bus device checking for devices that have been added or removed from the bus. A new 'rescan' command is added to devctl(8) to trigger a rescan. Differential Revision: https://reviews.freebsd.org/D6016
* MFV r298691:delphij2016-04-2710-48/+130
| | | | | | | | | | ntp 4.2.8p7. Security: CVE-2016-1547, CVE-2016-1548, CVE-2016-1549, CVE-2016-1550 Security: CVE-2016-1551, CVE-2016-2516, CVE-2016-2517, CVE-2016-2518 Security: CVE-2016-2519 Security: FreeBSD-SA-16:16.ntp With hat: so
* For pointers use NULL instead of 0.araujo2016-04-272-24/+24
| | | | | | Reviewed by: rpaulo MFC after: 2 weeks. Differential Revision: https://reviews.freebsd.org/D5946
* Remove redundant word.bhd2016-04-261-1/+1
| | | | | Reviewed by: bjk, bcr Differential Revision: https://reviews.freebsd.org/D6064
* Remove unportable calls to basename().ed2016-04-261-10/+11
| | | | | | | | | | | The POSIX version of basename() doesn't use a 'const char *' argument; the function may overwrite its input buffer. Instead of copying the input string, let's just simplify this code by using our getprogname() function that already returns the name of the application in the right format. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D6094
* Remove a variable and three lines of code which I should have removed asgad2016-04-251-5/+1
| | | | | | | part of revision 98776 back on June 24/2002. Noticed by pfg@ trying coccinelle for checking code. MFC after: 3 weeks
* Encapsulate SYSV IPC objects in jails. Define per-module parametersjamie2016-04-251-4/+27
| | | | | | | | | | | | | | | | | | | | sysvmsg, sysvsem, and sysvshm, with the following bahavior: inherit: allow full access to the IPC primitives. This is the same as the current setup with allow.sysvipc is on. Jails and the base system can see (and moduly) each other's objects, which is generally considered a bad thing (though may be useful in some circumstances). disable: all no access, same as the current setup with allow.sysvipc off. new: A jail may see use the IPC objects that it has created. It also gets its own IPC key namespace, so different jails may have their own objects using the same key value. The parent jail (or base system) can see the jail's IPC objects, but not its keys. PR: 48471 Submitted by: based on work by kikuchan98@gmail.com MFC after: 5 days
* Note the existence of module-specific jail paramters, starting with thejamie2016-04-251-1/+27
| | | | | | linux.* parameters when linux emulation is loaded. MFC after: 5 days
* Make jail(8) interpret escape codes in fstab the same as getfsent(3).jamie2016-04-251-1/+8
| | | | | PR: 208663 MFC after: 3 days
* Add a single example of adding a user that roughly corresponds with thewblock2016-04-231-1/+13
| | | | | | adduser example in the Handbook. MFC after: 1 week
* Define which of the username options (-u/-U) to jexec(8) is the default.bcr2016-04-231-1/+2
| | | | | | | | | Bump Dd. PR: 207587 Submitted by: dewayne@heuristicsystems.com.au MFC after: 3 days Sponsored by: Essen Hackathon 2016
* Fix looking for "UTC" at start of ptr by using strnmp instead of improperlyngie2016-04-231-2/+2
| | | | | | | | | unrolled equivalent CID: 1347118 MFC after: 1 week Reported by: Coverity Sponsored by: EMC / Isilon Storage Division
* Add ATF tests for usr.sbin/extattrasomers2016-04-223-0/+301
| | | | | | | | | | Add ATF tests for the existing behavior of setextattr, rmextattr, lsextattr, and getextattr. Reviewed by: ngie MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D5889
* Use MIN()/MAX() macros from sys/param.h.araujo2016-04-222-3/+3
| | | | | Reviewed by: grehan Differential Revision: https://reviews.freebsd.org/D6054
* Don't try to free `string` (stack allocated char[])ngie2016-04-221-2/+1
| | | | | | | | | Fix minor style with warnx call while in the neighborhood MFC after: 1 week CID: 1009683 Reported by: Coverity, gcc 5.x Sponsored by: EMC / Isilon Storage Division
* Don't use `entry` after free in the "already in lists" casengie2016-04-221-0/+1
| | | | | | | | | | | Return with 0 as it isn't an error. MFC after: 1 week CID: 1006085 Reported by: Coverity Obtained from: Isilon OneFS (part of r493633) Submitted by: Thor Steingrimsson <thor.steingrimsson@isilon.com> Sponsored by: EMC / Isilon Storage Division
* Use macro MAX() from sys/param.h.araujo2016-04-221-1/+1
| | | | MFC after: 2 weeks.
* Use macro MAX() from sys/param.h.araujo2016-04-221-1/+1
| | | | MFC after: 2 weeks.
* Plug memory leakbapt2016-04-201-0/+2
| | | | | Reported by: coverity CID: 1331664, 1331665
* Plug various resources leakbapt2016-04-201-1/+13
| | | | | | | | While here fix a test logic Reported by: coverity CID: 1332096, 1332097, 1332098, 1332099, 1332100, 1332101, 1332102 MFC after: 1 week
* Plug leaksbapt2016-04-201-0/+8
| | | | | | Reported by: Coverity CID: 1340155 and 1340156 MFC after: 1 week
OpenPOWER on IntegriCloud