]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
6 years agoMFC r320491:
ngie [Mon, 31 Jul 2017 03:59:07 +0000 (03:59 +0000)]
MFC r320491:

atf-sh(3): document atf_init_test_cases(3) fully

The function was missing from the NAME/SYNOPSIS sections. Add a manpage link
to complete the documentation reference.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321755 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC Note: ${FILES} documentation change omitted since r299094 will
ngie [Mon, 31 Jul 2017 03:57:45 +0000 (03:57 +0000)]
MFC Note: ${FILES} documentation change omitted since r299094 will
not be MFCed to ^/stable/10 .

MFC r320442:

share/examples/tests/{atf,plain}/Makefile: tweak example Makefile snippets

- Including bsd.own.mk isn't required since no MK_<foo> knobs are being
  manipulated.
- Update documentation to note that ${FILES} is installed via bsd.progs.mk,
  not bsd.prog.mk.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321753 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC 321406
sephe [Mon, 31 Jul 2017 03:49:08 +0000 (03:49 +0000)]
MFC 321406

    ethernet: Add ethernet interface attached event and devctl notification.

    ifnet_arrival_event may not be adequate under certain situation; e.g.
    when the LLADDR is needed.  So the ethernet ifattach event is announced
    after all necessary bits are setup.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D11617

git-svn-id: svn://svn.freebsd.org/base/stable/10@321752 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r321640:
markj [Mon, 31 Jul 2017 00:41:05 +0000 (00:41 +0000)]
MFC r321640:
Fix style bugs in ksyms.c.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321742 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r321639:
markj [Mon, 31 Jul 2017 00:39:22 +0000 (00:39 +0000)]
MFC r321639:
Restrict permissions on /dev/ksyms to 0400.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321740 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r321401:
avos [Sun, 30 Jul 2017 18:38:05 +0000 (18:38 +0000)]
MFC r321401:
net80211: do not allow to unload rate control module if it is still in use.

Keep 'nrefs' counter up-to-date, so 'kldunload wlan_amrr' with 1+ active
wlan(4) interface will not lead to kernel panic.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321725 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoRestore layout of struct vm_map_entry after r321717, same as was done
kib [Sun, 30 Jul 2017 10:49:13 +0000 (10:49 +0000)]
Restore layout of struct vm_map_entry after r321717, same as was done
in r320889 for stable/11.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@321718 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMerge MAP_GUARD.
kib [Sun, 30 Jul 2017 10:36:20 +0000 (10:36 +0000)]
Merge MAP_GUARD.

MFC r316687 (by markj), r320314, r320317, r320338, r320339, r320344, r320430,
r320560 (by alc), r320801, r320843, r321173, r321230.

Tested by: pho
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@321717 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r321371:
kib [Sat, 29 Jul 2017 08:24:51 +0000 (08:24 +0000)]
MFC r321371:
Do not allocate struct kinfo_vmobject on stack.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321677 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r321305:
dim [Fri, 28 Jul 2017 18:35:29 +0000 (18:35 +0000)]
MFC r321305:

Fix printf format warning in zfs_module.c

Clang 5.0.0 got better warnings about print format strings using %zd,
and this leads to the following -Werror warning on e.g. arm:

    sys/boot/efi/boot1/zfs_module.c:186:18: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'off_t' (aka 'long long') [-Werror,-Wformat]
                        "(%lu)\n", st.st_size, spa->spa_name, filepath, EFI_ERROR_CODE(status));
                                   ^~~~~~~~~~

Fix this by casting off_t arguments to intmax_t, and using %jd instead.

Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D11678

git-svn-id: svn://svn.freebsd.org/base/stable/10@321660 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320441:
ngie [Fri, 28 Jul 2017 03:33:09 +0000 (03:33 +0000)]
MFC r320441:

share/examples/tests/Makefile: clean up example snippets/documentation

- TESTSDIR doesn't need to be specified after r289158.
- Including bsd.own.mk isn't required since no MK_<foo> knobs are being
  manipulated.
- TESTS_SUBDIRS should be written out in an append format, one entry
  per line, to provide a better, more conflict resistant example.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321648 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320443,r320444:
ngie [Fri, 28 Jul 2017 03:30:46 +0000 (03:30 +0000)]
MFC r320443,r320444:

r320443:

Add kyua TAP test integration examples

The examples are patterned loosely after the ATF examples, similar
to the plain test examples.

r320444:

Commit the corresponding mtree file change for the TAP test examples

MFC with: r320443

git-svn-id: svn://svn.freebsd.org/base/stable/10@321646 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320446:
ngie [Fri, 28 Jul 2017 03:26:05 +0000 (03:26 +0000)]
MFC r320446:

trailing_slash is a TAP-compliant testcase; mark it as such, instead
of calling is a plain testcase.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321644 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320445:
ngie [Fri, 28 Jul 2017 03:24:57 +0000 (03:24 +0000)]
MFC r320445:

Don't hardcode path to file in /tmp; this violates the kyua sandbox

git-svn-id: svn://svn.freebsd.org/base/stable/10@321641 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC: r321314
rmacklem [Thu, 27 Jul 2017 23:15:24 +0000 (23:15 +0000)]
MFC: r321314
r320062 introduced a bug when doing NFSv4.1 mounts against some non-FreeBSD servers.

r320062 used nm_rsize, nm_wsize to set the maximum request/response sizes for
the NFSv4.1 session. If rsize,wsize are not specified as options, the
value of nm_rsize, nm_wsize is 0 at session creation, resulting in
values for request/response that are too small.
This patch fixes the problem. A workaround is to specify rsize=N,wsize=N
mount options explicitly, so they are set before session creation.
This bug only affects NFSv4.1 mounts against some non-FreeBSD servers.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321634 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC: r321248
rmacklem [Thu, 27 Jul 2017 00:04:09 +0000 (00:04 +0000)]
MFC: r321248
Update the nfsv4 man page to reflect recent changes to support
the newer RFCs (5661 and 7530). The main man changes are for the
case of "numbers in strings" for user/groups that RFC7530 allows
and avoids use of nfsuserd(8).

This is a content change.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321597 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r321218: zfs: Fix a typo in the delay_min_dirty_percent sysctl description
emaste [Wed, 26 Jul 2017 23:05:25 +0000 (23:05 +0000)]
MFC r321218: zfs: Fix a typo in the delay_min_dirty_percent sysctl description

The description is FreeBSD-specific and was added in r266497
to fix PR189865.

PR: 220825
Submitted by: Fabian Keil
Obtained from: ElectroBSD

git-svn-id: svn://svn.freebsd.org/base/stable/10@321592 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r321203:
ae [Wed, 26 Jul 2017 11:03:13 +0000 (11:03 +0000)]
MFC r321203:
  Add HPE FlexFabric 10Gb 4-port 536FLR-T device id to the bxe(4) driver.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321516 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC 321233
davidcs [Wed, 26 Jul 2017 01:28:27 +0000 (01:28 +0000)]
MFC 321233
Raise the watchdog timer interval to 2 ticks, there by guaranteeing
that it fires between 1ms and 2ms. `
Treat two consecutive occurrences of Heartbeat failures as a legitimate
Heartbeat failure

git-svn-id: svn://svn.freebsd.org/base/stable/10@321499 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC 320705
davidcs [Wed, 26 Jul 2017 01:25:51 +0000 (01:25 +0000)]
MFC 320705
Release mtx hw_lock before calling pause() in qla_stop() and
qla_error_recovery()

git-svn-id: svn://svn.freebsd.org/base/stable/10@321498 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC 320694
davidcs [Wed, 26 Jul 2017 01:23:35 +0000 (01:23 +0000)]
MFC 320694
Allow MTU changes without ifconfig down/up

git-svn-id: svn://svn.freebsd.org/base/stable/10@321497 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320077
alc [Tue, 25 Jul 2017 04:13:43 +0000 (04:13 +0000)]
MFC r320077
  Change blist_alloc()'s allocation policy from first-fit to next-fit so
  that disk writes are more likely to be sequential.  This change is
  beneficial on both the solid state and mechanical disks that I've
  tested.  (A similar change in allocation policy was made by DragonFly
  BSD in 2013 to speed up Poudriere with "stressful memory parameters".)

  Increase the width of blst_meta_alloc()'s parameter "skip" and the local
  variables whose values are derived from it to 64 bits.  (This matches the
  width of the field "skip" that is stored in the structure "blist" and
  passed to blst_meta_alloc().)

  Eliminate a pointless check for a NULL blist_t.

  Simplify blst_meta_alloc()'s handling of the ALL-FREE case.

  Address nearby style errors.

MFC r320417
  Address the remaining integer overflow issues with the "skip" parameters
  and "next_skip" variables.  The "skip" value in struct blist has long been
  a 64-bit quantity but various functions have implicitly truncated this
  value to 32 bits.  Now, all arithmetic involving the "skip" value is 64
  bits wide.  (This should allow us to relax the size limit on a swap device
  in the swap pager.)

  Maintain the ability to test this allocator as a user-space application by
  including <stdbool.h>.

  Remove an unused variable from blst_radix_print().

MFC r320527
  Change blst_leaf_alloc() to handle a cursor argument, and to improve
  performance.

  To find in the leaf bitmap all ranges of sufficient length, use a doubling
  strategy with shift-and-and until each bit still set represents a bit
  sequence of length 'count', or until the bitmask is zero.  In the latter
  case, update the hint based on the first bit sequence length not found to
  be available.  For example, seeking an interval of length 12, the set bits
  of the bitmap would represent intervals of length 1, then 2, then 3, then
  6, then 12.  If no bits are set at the point when each bit represents an
  interval of length 6, then the hint can be updated to 5 and the search
  terminated.

  If long-enough intervals are found, discard those before the cursor.  If
  any remain, use binary search to find the position of the first of them,
  and allocate that interval.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321459 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r290605,r290606:
ngie [Mon, 24 Jul 2017 16:45:38 +0000 (16:45 +0000)]
MFC r290605,r290606:

r290605:

Document powl(3)

PR: 191751

r290606:

Bump .Dd

git-svn-id: svn://svn.freebsd.org/base/stable/10@321421 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r321207:
ken [Mon, 24 Jul 2017 14:42:45 +0000 (14:42 +0000)]
MFC r321207:
  ------------------------------------------------------------------------
  r321207 | ken | 2017-07-19 09:39:01 -0600 (Wed, 19 Jul 2017) | 14 lines

  Fix spurious timeouts on commands sent to mps(4) and mpr(4) controllers.

  mps_wait_command() and mpr_wait_command() were using getmicrotime() to
  determine elapsed time when checking for a timeout in polled mode.
  getmicrotime() isn't guaranteed to monotonically increase, and that
  caused spurious timeouts occasionally.

  Switch to using getmicrouptime(), which does increase monotonically.
  This fixes the spurious timeouts in my test case.

  ------------------------------------------------------------------------
Reviewed by: slm, scottl
Sponsored by: Spectra Logic

git-svn-id: svn://svn.freebsd.org/base/stable/10@321416 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC 321286
sephe [Mon, 24 Jul 2017 02:13:46 +0000 (02:13 +0000)]
MFC 321286

    hyperv/storvsc: Force SPC3 for CDROM attached.

    This unbreaks the CDROM attaching on GEN2 VMs.  On GEN1 VMs, CDROM is
    attached to emulated ATA controller.

    PR:             220790
    Submitted by:   Hongjiang Zhang <honzhan microsoft com>
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D11634

git-svn-id: svn://svn.freebsd.org/base/stable/10@321405 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r321240:
ngie [Sun, 23 Jul 2017 18:00:11 +0000 (18:00 +0000)]
MFC r321240:

cron(8) manpage updates

- Document /etc/cron.d and /usr/local/etc/cron.d under FILES.
- Reword documentation for -n: add appropriate soft-stop and remove
  contraction to appease igor.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321389 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319905
alc [Sat, 22 Jul 2017 17:49:18 +0000 (17:49 +0000)]
MFC r319905

Reduce the frequency of hint updates on allocation without incurring
additional allocation overhead.  Previously, blst_meta_alloc() updated the
hint after every successful allocation.  However, these "eager" hint
updates are of no actual benefit if, instead, the "lazy" hint update at
the start of blst_meta_alloc() is generalized to handle all cases where
the number of available blocks is less than the requested allocation.
Previously, the lazy hint update at the start of blst_meta_alloc() only
handled the ALL-FULL case.  (I would also note that this change provides
consistency between blist_alloc() and blist_fill() in that their hint
maintenance is now entirely lazy.)

Eliminate unnecessary checks for terminators in blst_meta_alloc() and
blst_meta_fill() when handling ALL-FREE meta nodes.

Eliminate the field "bl_free" from struct blist.  It is redundant.  Unless
the entire radix tree is a single leaf, the count of free blocks is stored
in the root node.  Instead, provide a function blist_avail() for obtaining
the number of free blocks.

In blst_meta_alloc(), perform a sanity check on the allocation once rather
than repeating it in a loop over the meta node's children.

In blst_leaf_fill(), use the optimized bitcount*() function instead of a
loop to count the blocks being allocated.

Add or improve several comments.

Address some nearby style errors.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321375 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319756
alc [Sat, 22 Jul 2017 07:28:44 +0000 (07:28 +0000)]
MFC r319756
  Style and comment fixes

git-svn-id: svn://svn.freebsd.org/base/stable/10@321365 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320546
alc [Sat, 22 Jul 2017 06:40:57 +0000 (06:40 +0000)]
MFC r320546
  When "force" is specified to pmap_invalidate_cache_range(), the given
  start address is not required to be page aligned.  However, the loop
  within pmap_invalidate_cache_range() that performs the actual cache
  line invalidations requires that the starting address be truncated to
  a multiple of the cache line size.  This change corrects an error in
  that truncation.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321363 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r315621
alc [Sat, 22 Jul 2017 05:58:10 +0000 (05:58 +0000)]
MFC r315621
  Use IDX_TO_OFF(), not ptoa(), when converting the difference between two
  vm_pindex_t's into a vm_ooffset_t.

  The length given to shm_dotruncate() must never be negative.  Assert this.

  Tidy up a comment.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321361 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320498
alc [Sat, 22 Jul 2017 04:57:51 +0000 (04:57 +0000)]
MFC r320498
  Clear the MAP_WIREFUTURE flag on the vm map in exec_new_vmspace() when it
  recycles the current vm space.  Otherwise, an mlockall(MCL_FUTURE) could
  still be in effect on the process after an execve(2), which violates the
  specification for mlockall(2).

  It's pointless for vm_map_stack() to check the MEMLOCK limit.  It will
  never be asked to wire the stack.  Moreover, it doesn't even implement
  wiring of the stack.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321359 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320273:
bdrewery [Fri, 21 Jul 2017 17:58:06 +0000 (17:58 +0000)]
MFC r320273:

  Allow ALWAYS_BOOTSTRAP_MAKE to force bmake bootstrapping.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321341 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320927,320931,320932:
mm [Thu, 20 Jul 2017 20:16:18 +0000 (20:16 +0000)]
MFC r320927,320931,320932:
Bump libarchive to 3.3.2

Vendor changes:
  PR #901: don't depend on stdin in a testcase

Relnotes: yes

git-svn-id: svn://svn.freebsd.org/base/stable/10@321304 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320729: Add GEOM::descr attribute for symmetry with GEOM::ident.
mav [Thu, 20 Jul 2017 11:37:02 +0000 (11:37 +0000)]
MFC r320729: Add GEOM::descr attribute for symmetry with GEOM::ident.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321291 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r290570:
ngie [Thu, 20 Jul 2017 01:19:05 +0000 (01:19 +0000)]
MFC r290570:

Reduce the Makefile snippet complexity a bit

- Set BINDIR to TESTSDIR globally (and subsequently, remove all
  `${FILESGROUP}DIR` setting because BINDIR is set to `TESTSDIR`)
- Set MAN to "" globally, instead of per-PROG

git-svn-id: svn://svn.freebsd.org/base/stable/10@321281 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r278329:
ngie [Thu, 20 Jul 2017 01:12:31 +0000 (01:12 +0000)]
MFC r278329:

Document WITNESS_COUNT and WITNESS_NO_VNODE

git-svn-id: svn://svn.freebsd.org/base/stable/10@321279 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r314475:
ngie [Thu, 20 Jul 2017 01:07:02 +0000 (01:07 +0000)]
MFC r314475:

Simplify idioms in usr.sbin/lpr Makefiles

Use :H instead of .CURDIR-relative pathing to simplify make output, etc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321275 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r314454,r314455:
ngie [Thu, 20 Jul 2017 01:03:50 +0000 (01:03 +0000)]
MFC r314454,r314455:

r314454:

Use .ALLSRC instead of RPCSRC

This is a trivial simplification in the Makefile, meant to serve as
a good example for what to do with rules like this.

r314455:

Use .ALLSRC instead of RPCSRC

This is a trivial simplification in the Makefile, meant to serve as
a good example for what to do with rules like this.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321274 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r314479:
ngie [Thu, 20 Jul 2017 01:02:37 +0000 (01:02 +0000)]
MFC r314479:

Use :H to manipulate .CURDIR-relative paths instead of ../

This simplifies make output

git-svn-id: svn://svn.freebsd.org/base/stable/10@321272 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r314654:
ngie [Thu, 20 Jul 2017 01:01:16 +0000 (01:01 +0000)]
MFC r314654:

cddl: normalize paths using SRCTOP-relative paths or :H when possible

This simplifies make logic/output

While here, remove bogus CFLAGS which look for headers in cddl/lib/libumem.
There aren't any source files there (just Makefiles)

git-svn-id: svn://svn.freebsd.org/base/stable/10@321270 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r314653:
ngie [Thu, 20 Jul 2017 00:52:11 +0000 (00:52 +0000)]
MFC r314653:

libexec: normalize paths using SRCTOP-relative paths or :H when possible

This simplifies make logic/output

git-svn-id: svn://svn.freebsd.org/base/stable/10@321267 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r316102:
ngie [Thu, 20 Jul 2017 00:48:04 +0000 (00:48 +0000)]
MFC r316102:

Wrap bootcamp DEBUG statement with curly braces

This fixes a -Wempty-body warning with gcc 6.3.0 when PART_DEBUG is undefined.

Tested with: amd64-gcc-6.3.0 (devel/amd64-xtoolchain-gcc)

git-svn-id: svn://svn.freebsd.org/base/stable/10@321265 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318960,r319545,r319546,r319548,r321261:
ngie [Thu, 20 Jul 2017 00:44:01 +0000 (00:44 +0000)]
MFC r318960,r319545,r319546,r319548,r321261:

r318960 (by dab):

Add newsyslog capability to write RFC5424 compliant rotation message.

This modification adds the capability to newsyslog to write the
rotation message in a format that is compliant with RFC5424. This
capability is enabled on a per-log file basis through a new value
("T") in the flags field in newsyslog.conf. This is useful on systems
that use the RFC5424 format for log files so that the rotation message
format matches that of the other log messages. There has been recent
mention of adding an RFC5424 compliant mode to syslogd and at least
one alternative system log daemon (rsyslogd) that already has the
capability to use that format.

Relnotes: yes

r319545:

Don't execute the TODO cases in a subshell

This messes up the testcase counter, as seen in bug 219756.

PR: 212160, 219756

r319546:

Fix the testplan after ^/head@r318960

The number of executed testcases is 128, not 126.

MFC with: r318960

r319548:

Remove TODO for sub testcases added for bug 212160

On closer inspection, the past failures no longer occur on ^/head.

PR: 212160

r321261:

Clean up leading whitespace (convert single column spaces to hard tabs)

git-svn-id: svn://svn.freebsd.org/base/stable/10@321263 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320135:
ngie [Thu, 20 Jul 2017 00:33:12 +0000 (00:33 +0000)]
MFC r320135:

periodic(8): delete trailing whitespace

git-svn-id: svn://svn.freebsd.org/base/stable/10@321260 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoRecord-only merge for ^/head@r312419
ngie [Wed, 19 Jul 2017 21:19:28 +0000 (21:19 +0000)]
Record-only merge for ^/head@r312419

git-svn-id: svn://svn.freebsd.org/base/stable/10@321255 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC note: only the newsyslog.conf.d change has been backported to unbreak
ngie [Wed, 19 Jul 2017 21:06:05 +0000 (21:06 +0000)]
MFC note: only the newsyslog.conf.d change has been backported to unbreak
"make distribution" with etc/newsyslog.conf.d/opensm.conf
installation. The cron.d and syslog.d changes were omitted by
request to avoid churn on ^/stable/{10,11}.
Requested by: jhb, peter

MFC r318545:

Install {cron.d,newsyslog.conf.d,syslog.d} via `make distribution`, not `make install`

I incorrectly started this pattern in r277541 with the opensm newsyslog.conf.d file,
and continued using it in r318441 and r318443.

This will fix the files being handled improperly via installworld, preventing tools like
etcupdate, mergemaster, etc from functioning properly when comparing the installed
contents on a system vs the contents in a source tree when doing merges.

PR: 219404
MFC with: r277541, r318441, r318443

git-svn-id: svn://svn.freebsd.org/base/stable/10@321251 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC note: content changes of r317315 were reversed. .Dd is being updated
ngie [Wed, 19 Jul 2017 20:58:16 +0000 (20:58 +0000)]
MFC note: content changes of r317315 were reversed. .Dd is being updated
for diff reduction purposes.

MFC r317315,r317437:

r317315:

Note that getpagesize(3) can return -1 on failure

r317437 (by kib):

getpagesize(3) cannot fail.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321249 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r269550:
ngie [Wed, 19 Jul 2017 20:44:50 +0000 (20:44 +0000)]
MFC r269550:
r269550 (by peter):

Check gethostname(2) return code - but even if it succeeds it may not
null terminate.

Temporarily use "From: $user@$hostname" rather than "From: $user".
The latter exposes incompatible behavior if using dma(8).  sendmail(8)
(and other alternatives) canonify either form on submission (even
if masquerading), but dma will leak a non-compliant address to
the internet.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321245 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r269550:
ngie [Wed, 19 Jul 2017 20:29:07 +0000 (20:29 +0000)]
MFC r269550:
r269550 (by peter):

Check gethostname(2) return code - but even if it succeeds it may not
null terminate.

Temporarily use "From: $user@$hostname" rather than "From: $user".
The latter exposes incompatible behavior if using dma(8).  sendmail(8)
(and other alternatives) canonify either form on submission (even
if masquerading), but dma will leak a non-compliant address to
the internet.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321244 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r310329:
ngie [Wed, 19 Jul 2017 20:26:35 +0000 (20:26 +0000)]
MFC r310329:
r310329 (by cem):

Add a 'force' option for non-interactive crontab removal

Add a '-f' option to force crontab '-r' to be non-interactive.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321243 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r308139,r308157,r308158:
ngie [Wed, 19 Jul 2017 20:24:38 +0000 (20:24 +0000)]
MFC r308139,r308157,r308158:

r308139 (by bapt):

cron(8): add support for /etc/cron.d and /usr/local/etc/cron.d

For automation tools it is way easier to maintain files in directories rather
than modifying /etc/crontab.

The files in those directories are in the same format as /etc/crontab

Relnotes: yes

r308157 (by bapt):

Fix typo in cron(8) date

r308158 (by bapt):

Allow symlinks to be followed in cron.d directories and fix detection of
regular files on NFS

git-svn-id: svn://svn.freebsd.org/base/stable/10@321242 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r304570,r321235:
ngie [Wed, 19 Jul 2017 19:41:13 +0000 (19:41 +0000)]
MFC r304570,r321235:

r304570 (by trasz):

Add the "-n" flag to cron(8), to prevent it from daemonizing.
This makes it possible to use it with external supervisors.
The "-n" flag name is compatible with Linux, NetBSD, and OpenBSD.

r321235:

Fix trivial whitespace bug introduced in usage message changes for -n
support (r304570).

git-svn-id: svn://svn.freebsd.org/base/stable/10@321237 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r308160,r309194,r309216:
ngie [Wed, 19 Jul 2017 19:30:13 +0000 (19:30 +0000)]
MFC r308160,r309194,r309216:

r308160 (by bapt):

syslogd(8): add an 'include' keyword

All the '.conf' files not beginning with a '.' contained int he directory
following the keyword will be included.

This keyword can only be used in the first level configuration files.

Modify the default syslogd.conf to 'include' /etc/syslog.d and
/usr/local/etc/syslog.d

It simplify a lot handling of syslog from automation tools.

Relnotes: yes

r309194 (by bapt):

initialize *nextp which could be left uninitialized in case the configuration
file cannot be open/read

CID: 1365665

r309216 (by bapt):

Properly initialize nextp

git-svn-id: svn://svn.freebsd.org/base/stable/10@321234 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r316601:
ngie [Wed, 19 Jul 2017 18:23:49 +0000 (18:23 +0000)]
MFC r316601:

pmc.atomsilvermont(3): fix manlint warnings

Start new sentences on new lines.

Sentences affected by the change are wrapped at <80 columns. Other
potentially offending lines have been left alone to reduce churn.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321225 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r316600:
ngie [Wed, 19 Jul 2017 18:22:55 +0000 (18:22 +0000)]
MFC r316600:

pmc(3): add additional references for libpmc functions in the SEE ALSO section

These functions are already referenced throughout the manpage -- this makes their
presence more apparent.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321223 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoPull in r229281 from upstream libc++ (by Larisse Voufo):
dim [Wed, 19 Jul 2017 18:22:32 +0000 (18:22 +0000)]
Pull in r229281 from upstream libc++ (by Larisse Voufo):

  Implement C++14's sized deallocation functions, since there are no
  longer implicitly defined by clang, as of r229241.

This allows ports which use C++14's sized deallocation functions, such
as cad/openvsp, to build on stable/10.  Bump __FreeBSD_version to allow
detection from ports.

Direct commit, since stable/11 and head already have newer versions of
libc++ which include this change.

PR: 219484

git-svn-id: svn://svn.freebsd.org/base/stable/10@321222 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r316602:
ngie [Wed, 19 Jul 2017 18:19:11 +0000 (18:19 +0000)]
MFC r316602:

pmc_read(3): fix manlint error

Remove spurious trailing comma from last .Nm entry in NAME section.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321220 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoRecord merges for r319659 and r319660.
ngie [Wed, 19 Jul 2017 16:54:34 +0000 (16:54 +0000)]
Record merges for r319659 and r319660.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321216 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoRelnotes: yes (subtle output/behavior change)
ngie [Wed, 19 Jul 2017 16:38:55 +0000 (16:38 +0000)]
Relnotes:       yes (subtle output/behavior change)

MFC r316938,r316953:

r316938:

savecore: fix space calculation with respect to `minfree` in check_space(..)

- Use strtoll(3) instead of atoi(3), because atoi(3) limits the
  representable data to INT_MAX. Check the values received from
  strtoll(3), trimming trailing whitespace off the end to maintain
  POLA.
- Use `KiB` instead of `kB` when describing free space, total space,
  etc. I am now fully aware of `KiB` being the IEC standard for 1024
  bytes and `kB` being the IEC standard for 1000 bytes.
- Store available number of KiB in `available` so it can be more
  easily queried and compared to ensure that there are enough KiB to
  store the dump image on disk.
- Print out the reserved space on disk, per `minfree`, so end-users
  can troubleshoot why check_space(..) is reporting that there isn't
  enough free space.

Tested with: positive/negative cases (see review); make tinderbox

r316953:

Switch back to non-IEC units for 1024 bytes

I was swayed a little too quickly when I saw the wiki page discussing
kB vs KiB. Switch back as none of the code in base openly uses
IEC units via humanize_number(3) (which was my next step), and there's
a large degree of dislike with IEC vs more SI-like units.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321212 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r312521,r313397:
ngie [Wed, 19 Jul 2017 15:59:51 +0000 (15:59 +0000)]
MFC r312521,r313397:

r312521:

Add testcases for -i with hardlinks and symlinks

The symlink testcase is expected to fail, post-r312519 (the revert of
r312404); mark it so.

r313397:

Don't expect :inplace_symlink_src to fail anymore (post-r313277)

The S_ISREG check was restored, such that the code will again fail with
in-place replacements on symlinks

git-svn-id: svn://svn.freebsd.org/base/stable/10@321209 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r302145: bsdinstall: increase EFI partition size to 200MB
emaste [Wed, 19 Jul 2017 14:15:49 +0000 (14:15 +0000)]
MFC r302145: bsdinstall: increase EFI partition size to 200MB

A larger EFI file system size will facilitate multi-boot configurations
and the installation other EFI applications like firmware update tools.
200MB matches OS X.

Note that this changes only the partition size, not the file system that
bsdinstall places there. We need to do both, but as the partition size
is difficult to adjust later make this change for now so that at least
systems installed with FreeBSD 11.0 have a partition layout with room
to grow.

Also merge part of r320007:

- use EFI_BOOTPART_SIZE and EFI_BOOTPART_PATH macros on x86
- increase ZFS EFI partition to 200M

PR: 201898
Relnotes: Yes
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@321202 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r313547, r313777: fix mouse selection when vt(4) scrolls
emaste [Wed, 19 Jul 2017 13:32:08 +0000 (13:32 +0000)]
MFC r313547, r313777: fix mouse selection when vt(4) scrolls

r313547 (ray, submitted by hselasky):

o Reset mouse selection when new lines reach selection lines.
o Fix how selection handled on display.

r313777 (rpokala):

Un-break vt(4) for {powerpc,powerpc64,sparc64} LINT kernel builds

The {powerpc,powerpc64,sparc64} LINT kernel builds fail with this error:

    sys/dev/vt/vt_buf.c:198: warning: 'vtbuf_htw' defined but not used

Move vtbuf_htw() inside the '#if SC_NO_CUTPASTE' block where it belongs, and
put it in the proper order.

This fixes the immedate issue w/ vt(4), but all three then fail on different
issues.

PR: 211922
Relnotes: Yes

git-svn-id: svn://svn.freebsd.org/base/stable/10@321200 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r303043: Increase vt(4) framebuffer maximum size
emaste [Wed, 19 Jul 2017 13:11:35 +0000 (13:11 +0000)]
MFC r303043: Increase vt(4) framebuffer maximum size

PR: 210382
Relnotes: Yes

git-svn-id: svn://svn.freebsd.org/base/stable/10@321198 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318723:
ngie [Wed, 19 Jul 2017 02:50:06 +0000 (02:50 +0000)]
MFC r318723:

bsdinstall(8): fix manpage issues

- Start new sentences on new lines.
- Separate e.g. (more of an igor thing) with commas, and rewrite some examples
  not to be enclosed in parentheses.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321181 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC: r320659
rmacklem [Tue, 18 Jul 2017 20:46:29 +0000 (20:46 +0000)]
MFC: r320659
Add a Bugs section that indicates that the nfsuserd doesn't work
when jails are being used on the system.
It is hoped that the patches in PR#205193 will someday get tested/debugged
so that they can be MFC'd to fix this.

This is a content change.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321175 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318722:
ngie [Tue, 18 Jul 2017 18:56:06 +0000 (18:56 +0000)]
MFC r318722:

sade(8): start new sentence on new line

git-svn-id: svn://svn.freebsd.org/base/stable/10@321169 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318693,r318694:
ngie [Tue, 18 Jul 2017 18:54:47 +0000 (18:54 +0000)]
MFC r318693,r318694:

r318693:

Some minor style(9) fixes

- Wrap at <80 columns.
- Sort by type

r318694:

style(9): sort headers

MFC with: r318693

git-svn-id: svn://svn.freebsd.org/base/stable/10@321166 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319026:
ngie [Tue, 18 Jul 2017 18:48:25 +0000 (18:48 +0000)]
MFC r319026:

pw: add some basic testcases for groupshow and usershow

- groupshow: test out -a/-g/-n .
- usershow: test out -a/-n/-u .

git-svn-id: svn://svn.freebsd.org/base/stable/10@321163 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318702:
ngie [Tue, 18 Jul 2017 18:39:51 +0000 (18:39 +0000)]
MFC r318702:

vis(3): delete spurious .Pp macro

git-svn-id: svn://svn.freebsd.org/base/stable/10@321161 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318706:
ngie [Tue, 18 Jul 2017 18:37:56 +0000 (18:37 +0000)]
MFC r318706:

localeconv(3): start sentences on new lines

git-svn-id: svn://svn.freebsd.org/base/stable/10@321160 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318712:
ngie [Tue, 18 Jul 2017 18:36:40 +0000 (18:36 +0000)]
MFC r318712:

xdr(3): add missing comma after xdr_sizeof(3) in SYNOPSIS

This unbreaks the .Nm declaration

git-svn-id: svn://svn.freebsd.org/base/stable/10@321157 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318703:
ngie [Tue, 18 Jul 2017 18:35:41 +0000 (18:35 +0000)]
MFC r318703:

__iconv_get_list: separate .Nm entries with commas

git-svn-id: svn://svn.freebsd.org/base/stable/10@321155 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318707:
ngie [Tue, 18 Jul 2017 18:34:16 +0000 (18:34 +0000)]
MFC r318707:

sctp_send(3): start sentences on new lines

git-svn-id: svn://svn.freebsd.org/base/stable/10@321154 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318280:
ngie [Tue, 18 Jul 2017 18:33:05 +0000 (18:33 +0000)]
MFC r318280:

getconf: use nitems(..) to compute NWORDS instead of hardcoding
the equivalent macro

git-svn-id: svn://svn.freebsd.org/base/stable/10@321151 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318704,r318708,r318709:
ngie [Tue, 18 Jul 2017 18:23:54 +0000 (18:23 +0000)]
MFC r318704,r318708,r318709:

r318704:

posix1e(3): reference using the section (3) when referencing libbsm with .Xr

r318708:

acl_create_entry(3): separate .Nm entries with commas in SYNOPSIS

r318709:

acl_to_text(3): start sentences on new lines

git-svn-id: svn://svn.freebsd.org/base/stable/10@321149 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318710:
ngie [Tue, 18 Jul 2017 18:21:00 +0000 (18:21 +0000)]
MFC r318710:

quick_exit(3): delete trailing whitespace in licensing tort

git-svn-id: svn://svn.freebsd.org/base/stable/10@321148 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318718,r318719,r318720,r318721:
ngie [Tue, 18 Jul 2017 18:15:45 +0000 (18:15 +0000)]
MFC r318718,r318719,r318720,r318721:

r318718:

rctl_add_rule(2): fix manlint warnings

- Fix commas (either missing or misused) after .Nm entries in SYNOPSIS

r318719:

open(2): fix manlint warnings

- Sort SEE ALSO .Xr entries.
- Sort sections (HISTORY comes after STANDARDS).

r318720:

ptrace(2): clean up trailing whitespace

r318721:

kill(2): add missing section for sysctl(9)

git-svn-id: svn://svn.freebsd.org/base/stable/10@321146 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319048,r319049,r319051,r319054:
ngie [Tue, 18 Jul 2017 18:09:26 +0000 (18:09 +0000)]
MFC r319048,r319049,r319051,r319054:

r319048:

Push `snapshot_file` copying down into run_tests function, and mark snapshot_file
const char *.

This fixes a bogus set of errors from gcc about strdup not being allowed a NULL
argument.

r319049:

Bump WARNS from 1 to 3 after recent commits to fix warnings in the
directory.

Tested with: clang 4.0, gcc 4.2.1, gcc 6.3.0

r319051:

hostent_test_getnameinfo_eq(..): initialize found_a_host to false

CID: 1368943

r319054:

hostent_test_getaddrinfo_eq(..): call freeaddrinfo on `ai` when done

This plugs a leak of memory allocated via getaddrinfo.

CID: 1346866

git-svn-id: svn://svn.freebsd.org/base/stable/10@321144 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r316552,r319662:
ngie [Tue, 18 Jul 2017 17:51:33 +0000 (17:51 +0000)]
MFC r316552,r319662:

r316552:

atf-c: fix documentation description for atf_utils_wait(3)

atf_utils_wait(3) should be used in combination with atf_utils_fork(3),
not itself (atf_utils_wait(3)).

r319662:

Add MLINKS for atf-sh(3) to each of the functions it implements

This hopefully will make atf-sh(3) easier to understand for newcomers,
without having to go through the atf-sh(3) level of indirection.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321141 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r302500,r319339,r319543,r319544,r319551,r321138:
ngie [Tue, 18 Jul 2017 17:36:25 +0000 (17:36 +0000)]
MFC r302500,r319339,r319543,r319544,r319551,r321138:

r302500 (by cem):

dd(1): Enable access to SIZE_T_MAX character devices

On machines where SIZE_T_MAX exceeds OFF_MAX (signed 64-bit), permit seeking
character devices to negative off_t values.  This enables dd(1) to interact
with kernel KVA in /dev/kmem on amd64, for example.

r319339 (by asomers):

Fix integer overflow detection in dd

dd(1) tried to detect whether the seek offset would overflow, but it failed
to account for the case where the provided argument was negative and the
file was a regular file (negative seeks are allowed for character devices).
I fixed it, and added a regression test.

CID: 1368659

r319543:

Stylistic tweaks

Move opening braces of functions from the last column to column 0.

MFC with: r319339

r319544:

Mark :seek_overflow as an expected failure

MFC with: r319339
PR: 219757

r319551 (by asomers):

Fix bin/dd/dd2_tests:seek_overflow on UFS and TMPFS

Split the postive and negative parts into separate test cases.  The positive
test case can only run on ZFS, because only ZFS supports files that large.

PR: 219757

r321138:

Remove unnecessary make logic added in r319339

This makes the change cleaner and easier to backport to ^/stable/10.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321140 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319800,r319806:
ngie [Tue, 18 Jul 2017 17:16:58 +0000 (17:16 +0000)]
MFC r319800,r319806:

r319800:

Don't explicitly get the class to PART in gctl_test_helper.c

This will allow the tool to be used with arbitrary geom(4) classes, like GEOM.

Specify class=PART explicitly in the tester to keep existing behavior.

r319806:

Improve handling with system state

- Always unlink $cmd after exit via END block.
- The tests don't function well if kern.geom.debugflags != 0. Save debugflags,
  then restore them at the end of the test.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321137 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318255:
ngie [Tue, 18 Jul 2017 16:58:52 +0000 (16:58 +0000)]
MFC r318255:

Add missing braces around MCAST_EXCLUDE check when KTR support is
compiled into the kernel

This ensures that .iss_asm (the number of ASM listeners) isn't incorrectly
decremented for MLD-layer source datagrams when inspecting im*s_st[1]
(the second state in the structure).

PR: 217509 [1]

git-svn-id: svn://svn.freebsd.org/base/stable/10@321134 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319850:
ngie [Tue, 18 Jul 2017 16:49:24 +0000 (16:49 +0000)]
MFC r319850:

Add some initial basic tests for du(1)

Tests that exercise the following flags are added in this commit:
- -A
- -H
- -I
- -g
- -h
- -k
- -m

Additional tests will be added soon.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321133 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r268030,r268793,r303212,r319642,r319830:
ngie [Tue, 18 Jul 2017 16:27:10 +0000 (16:27 +0000)]
MFC r268030,r268793,r303212,r319642,r319830:

r268030 (by eadler):

chown: add a test

Add a test for the chown utility. This sets up chown(8) to be capable of being
tested.  As such, only add one test for now as an example.

r268793 (by eadler):

chown: Fix chown test number

r303212 (by bdrewery):

Move chown tests to proper path

r319642:

Add some basic tests for chmod(1)

r319830:

Add more simple positive tests for chown(1)

The tests are largely symmetric with the tests for chmod(1)--added in r319642.

Remove chown-f_test (added in r268030) since the test coverage is now being
provided by `chown_test`.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321130 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319842:
ngie [Tue, 18 Jul 2017 08:54:35 +0000 (08:54 +0000)]
MFC r319842:

getbsize(3): clarify that underflow/overflow warnings in regard to $BLOCKSIZE
gets output via warnx(3)

This helps set expectations for how one might deal with those messages, i.e.,
mute output from /dev/stderr today, since that's where vwarn(3) outputs messages
to today.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321127 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318695:
ngie [Tue, 18 Jul 2017 08:50:36 +0000 (08:50 +0000)]
MFC r318695:

err(3): use `NULL`, aka `(void*)0` per POSIX instead of `(FILE *)0`

This is being done to aid humans and static analysis checkers.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321124 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319844,r319845:
ngie [Tue, 18 Jul 2017 08:44:38 +0000 (08:44 +0000)]
MFC r319844,r319845:

r319844:

Add positive and negative testcases for cam_get_device(3)

r319845:

Remove stdlib.h #include added in r319844

A previous iteration of the tests I added in r319844 involved free(3), but
that attempt didn't pan out, so I switched to stack allocated buffers instead
of heap allocated ones, making the #include unnecessary.

MFC with: r319844

git-svn-id: svn://svn.freebsd.org/base/stable/10@321122 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318705:
ngie [Tue, 18 Jul 2017 08:33:29 +0000 (08:33 +0000)]
MFC r318705:

fopen(3): make manlint fixes

- Break on new lines.
- Use .Dv with NULL.
- Rewrap lines as necessary/when possible.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321120 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r316558:
ngie [Tue, 18 Jul 2017 08:30:58 +0000 (08:30 +0000)]
MFC r316558:

Use __FBSDID instead of the license agreement to embed the $FreeBSD$ RCS keyword

Reminded by a comment made by markj w.r.t. using __FBSDID in .c files ala a
past Phabricator review.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321118 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r316549,r316550,r316551,r316554:
ngie [Tue, 18 Jul 2017 08:28:14 +0000 (08:28 +0000)]
MFC r316549,r316550,r316551,r316554:

r316549:

Add sys/types.h #include to EXAMPLE to provide a complete functional
standalone example program

r316550:

sbuf(9): convert SYNOPSIS section from .Fn entries to .Fo/.Fa/.Fc entries

This shortens the column count on many lines considerably.

While here, add "(void)" to sbuf_new_auto(3) for consistency with style(9)
recommendations.

r316551:

sbuf(9): clarify kernel-only APIs

- move sbuf_bcopyin(9) and sbuf_copyin(9) near sbuf_new_for_sysctl(9), as
  all three functions are kernel-only APIs.
- add #ifdef _KERNEL around sbuf_*copyin and sbuf_new_for_sysctl(9) to
  make it visually clear that they are kernel-only APIs.

r316554:

sbuf(9): add MLINKS for sbuf_{clear,get,set}_flags(9)

These functions were added in r279992.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321115 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r316557:
ngie [Tue, 18 Jul 2017 08:23:21 +0000 (08:23 +0000)]
MFC r316557:

sbuf(3): add some basic functional tests for the library

Areas not covered still [positive functionality wise] are:
- sbuf_{clear,get,set}_flags
- sbuf_new (in particular, with fixed buffers, etc).

Some basic negative testing has been added, but more will be added in the
future.

This work was in part to validate work done by cem in r288223, and ian
before that.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321113 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r279992,r280149,r280193,r288223,r288484,r321109:
ngie [Tue, 18 Jul 2017 08:15:02 +0000 (08:15 +0000)]
MFC r279992,r280149,r280193,r288223,r288484,r321109:

r279992 (by ian):

Add a new flag, SBUF_INCLUDENUL, and new get/set/clear functions for flags.

The SBUF_INCLUDENUL flag causes the nulterm byte at the end of the string
to be counted in the length of the data.  If copying the data using the
sbuf_data() and sbuf_len() functions, or if writing it automatically with
a drain function, the net effect is that the nulterm byte is copied along
with the rest of the data.

r280149 (by ian):

Update an sbuf assertion to allow for the new SBUF_INCLUDENUL flag.  If
INCLUDENUL is set and sbuf_finish() has been called, the length has been
incremented to count the nulterm byte, and in that case current length is
allowed to be equal to buffer size, otherwise it must be less than.

Add a predicate macro to test for SBUF_INCLUDENUL, and use it in tests, to
be consistant with the style in the rest of this file.

r280193 (by ian):

The minimum sbuf buffer size is 2 bytes (a byte plus a nulterm), assert that.

Values smaller than two lead to strange asserts that have nothing to do
with the actual problem (in the case of size=0), or to writing beyond the
end of the allocated buffer in sbuf_finish() (in the case of size=1).

r288223 (by cem):

sbuf: Process more than one char at a time

Revamp sbuf_put_byte() to sbuf_put_bytes() in the obvious fashion and
fixup callers.

Add a thin shim around sbuf_put_bytes() with the old ABI to avoid ugly
changes to some callers.

Obtained from: Dan Sledz

r288484 (by phk):

Fail the sbuf if vsnprintf(3) fails.

r321109:

Fix whitespace regression accidentally checked in via ^/head@r280149

git-svn-id: svn://svn.freebsd.org/base/stable/10@321112 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r307873,r314397,r314399,r314419,r314420,r314533,r316553:
ngie [Tue, 18 Jul 2017 06:45:41 +0000 (06:45 +0000)]
MFC r307873,r314397,r314399,r314419,r314420,r314533,r316553:

r307873 (by marcel):

Include <stdarg.h> instead of <machine/stdarg.h> when compiled as
part of libsbuf. The former is the standard header, and allows us
to compile libsbuf on macOS/linux.

r314397 (by scottl):

Implement sbuf_prf(), which takes an sbuf and outputs it
to stdout in the non-kernel case and to the console+log
in the kernel case.  For the kernel case it hooks the
putbuf() machinery underneath printf(9) so that the buffer
is written completely atomically and without a copy into
another temporary buffer.  This is useful for fixing
compound console/log messages that become broken and
interleaved when multiple threads are competing for the
console.

r314399 (by scottl):

Add prototype for sbuf_putbuf()

r314419 (by jkim):

Include stdio.h to fix libsbuf build.

r314420 (by scottl):

Provide a comment on why stdio.h needs to be included.

r314533 (by scottl):

Expose the sbuf_putbuf() symbol to libsbuf.  There are a few other symbols
that are present but not exposed, like get/set/clear flags, not sure if they
need to be exposed at this point.

r316553:

sbuf(3): expose sbuf_{clear,get,set}_flags(3) via libsbuf

These functions were added to sbuf(9) in r279992, but never
exposed to userspace. Expose them now so they can be used/tested.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321108 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319836:
ngie [Mon, 17 Jul 2017 21:19:29 +0000 (21:19 +0000)]
MFC r319836:

stat(1): sort flags in the DESCRIPTION section

-x's description should come after -t's description.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321098 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319846:
ngie [Mon, 17 Jul 2017 21:18:44 +0000 (21:18 +0000)]
MFC r319846:

du(1): trivial whitespace cleanup

git-svn-id: svn://svn.freebsd.org/base/stable/10@321097 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319856,r320172,r320173:
ngie [Mon, 17 Jul 2017 21:13:43 +0000 (21:13 +0000)]
MFC r319856,r320172,r320173:

r319856:

Add a testcase for `ln -sF`

The testcase fails today, so mark it with atf_expect_fail: in
particular, the target (B) isn't being unlinked and the documentation
doesn't suggest special handling for directories. Thus, there's either
a doc or an implementation bug in ln(1) that needs to be resolved.

MFC with: r319714, r319854, r319855
PR: 219943

r320172:

ln(1): fix -F behavior

When '-F' option is used, the target directory needs to be unlinked.
Currently, the modified target ("target/source") is being unlinked, and
since it doesn't yet exist, the original target isn't removed.
This is fixed by skipping the block where target is modified to
"target/source" when '-F' option is set.
Hence, a symbolic link (with the same name as of the original target) to
the source_file is produced.

Update the test for ln(1) to reflect fix for option '-F'

PR: 219943

r320173:

Don't expect :sF_flag to fail anymore

While here, also add a check to verify that the link target
is updated in the testcase

MFC with: r320172
PR: 219943

git-svn-id: svn://svn.freebsd.org/base/stable/10@321094 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319857:
ngie [Mon, 17 Jul 2017 21:12:02 +0000 (21:12 +0000)]
MFC r319857:

ln(1): wordsmith -F option description

git-svn-id: svn://svn.freebsd.org/base/stable/10@321093 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319857:
ngie [Mon, 17 Jul 2017 21:10:08 +0000 (21:10 +0000)]
MFC r319857:

ln(1): wordsmith -F option description

git-svn-id: svn://svn.freebsd.org/base/stable/10@321091 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319928:
ngie [Mon, 17 Jul 2017 21:09:35 +0000 (21:09 +0000)]
MFC r319928:

Use nitems(..) when computing `max` instead of the longhand version of
the same logic

git-svn-id: svn://svn.freebsd.org/base/stable/10@321090 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319834,r319841,r320723,r320724:
ngie [Mon, 17 Jul 2017 21:01:07 +0000 (21:01 +0000)]
MFC r319834,r319841,r320723,r320724:

r319834:

Write up some basic tests for readlink(1)

The tests exercise -f (f_flag), -n (n_flag), and no arguments (basic).

r319841:

Add initial tests for stat(1)

Testcases for -H, -L, and -f haven't been implemented yet, in part due
to additional complexity needed to validate the features:
* -H and -f will require an external "helper" program to display/modify
  the state/permissions for a given path.
* -L is being covered partially via the -n testcase today.

r320723:

Use %e instead of %d with x_output_date(..)

stat -x doesn't 0-fill days so %d is inappropriate. %e is correct.

MFC with: r319841

r320724:

:l_flag:: be more aggressive when normalizing whitespace

Save output from ls -ldT and stat -l, then normalize all repeating whitespace using
sed to single column spaces.

This makes the test flexible with single-digit days, etc, similar to r320723. This
approach is just a bit more of a hammer approach because of how the columns are
ordered/spaced in both ls and stat.

MFC with: r319841

git-svn-id: svn://svn.freebsd.org/base/stable/10@321085 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f