dragonfly.git
3 years ago<efivar-dp.h>: Include <sys/types.h> to be self sufficient.
Sascha Wildner [Sat, 27 Jun 2020 19:06:54 +0000 (21:06 +0200)]
<efivar-dp.h>: Include <sys/types.h> to be self sufficient.

3 years agomake_autoclone_dev.9: Several minor improvements
Aaron LI [Sat, 27 Jun 2020 13:30:28 +0000 (21:30 +0800)]
make_autoclone_dev.9: Several minor improvements

* Remove the mention of private function 'devfs_clone_bitmap_fff()'.
* Adjust the wording about the clone handler.
* Add 'SEE ALSO' section to mention 'make_dev()', 'make_only_dev()',
  etc.

3 years agomake_autoclone_dev.9: Better describe devfs_clone_bitmap_get()
Aaron LI [Sat, 27 Jun 2020 13:28:22 +0000 (21:28 +0800)]
make_autoclone_dev.9: Better describe devfs_clone_bitmap_get()

* Describe the 'limit' argument.
* Describe the return value.
* Adjust the description order of this function to align with 'SYNOPSIS'
  section.

3 years agomake_dev.9: Describe a bit more about make_only_dev()
Aaron LI [Sat, 27 Jun 2020 13:23:33 +0000 (21:23 +0800)]
make_dev.9: Describe a bit more about make_only_dev()

* Describe a bit more about the usage of make_only_dev(), mentioning
  make_autoclone_dev(),  also improve a sensence about this function.
* Fix a missing function markup to 'make_dev()'.
* Add 'SEE ALSO' section to mention devfs(5) and make_autoclone_dev(9).

3 years agoif_tap: Remove a debug message
Aaron LI [Sat, 27 Jun 2020 13:21:53 +0000 (21:21 +0800)]
if_tap: Remove a debug message

3 years agotun/tap: Use if_clone framework to clone from autoclone device
Aaron LI [Sat, 27 Jun 2020 13:11:50 +0000 (21:11 +0800)]
tun/tap: Use if_clone framework to clone from autoclone device

Before this change, the clone methods from autoclone device and if_clone
is quite different, so the allocated device unit numbers are not synced
between them, and the default interface group is not added for the
interfaces created via the autoclone device.

For example: tinc/openvpn will open '/dev/tun' to clone a device
'/dev/tun0' and an interface 'tun0', but the 'tun0' interface doesn't
own the 'tun' default group.  And then, 'ifconfig tun create' will fail
with 'SIOCIFCREATE2: File exists'.

Fix the above conflicts/inconsistencies by using the same if_clone logic
for device cloning from the autoclone device.  Now the two clone methods
are consistent and can be mix used.

Bug: https://bugs.dragonflybsd.org/issues/3230

3 years agotun/tap: Return EEXIST in clone creation if softc found
Aaron LI [Sat, 27 Jun 2020 12:05:33 +0000 (20:05 +0800)]
tun/tap: Return EEXIST in clone creation if softc found

With the old logic, an existing softc (e.g., created by cloning via
autoclone device) may be used and then be modified later, which should
be better avoided.

3 years agoif_clone: Fix a missing allocated unit free upon error
Aaron LI [Sat, 27 Jun 2020 11:36:11 +0000 (19:36 +0800)]
if_clone: Fix a missing allocated unit free upon error

3 years agotun/tap: Fix errno NODEV to NOENT in clone creation
Aaron LI [Sat, 27 Jun 2020 11:23:00 +0000 (19:23 +0800)]
tun/tap: Fix errno NODEV to NOENT in clone creation

I was thinking 'NODEV' means 'no such device' but it actually means
'operation not supported by device'...  So change this errno to 'NOENT'.

While there, adjust the code a bit in if_tap.c to align with if_tun.c.

3 years agotun/tap: Do not flag cloned interface as manually made
Aaron LI [Sat, 27 Jun 2020 03:43:00 +0000 (11:43 +0800)]
tun/tap: Do not flag cloned interface as manually made

Similar to the devices cloned via the autocloner device (i.e., /dev/tun,
/dev/tap), don't flag devices cloned via interface cloning as manually
made.  Only explicitly opened devices are flagged as manually made.

3 years agovknetd(8): Minor style improvements
Aaron LI [Thu, 30 Aug 2018 13:08:13 +0000 (21:08 +0800)]
vknetd(8): Minor style improvements

3 years agolibthread_xu: Fix building with -fno-common.
Sascha Wildner [Sat, 27 Jun 2020 13:30:42 +0000 (15:30 +0200)]
libthread_xu: Fix building with -fno-common.

-fno-common will be default in future compilers (GCC 10, for example).

3 years agocamcontrol(8): Fix building with -fno-common.
Sascha Wildner [Sat, 27 Jun 2020 13:29:23 +0000 (15:29 +0200)]
camcontrol(8): Fix building with -fno-common.

-fno-common will be default in future compilers (GCC 10, for example).

3 years agortld(1): Fix building with -fno-common.
Sascha Wildner [Sat, 27 Jun 2020 13:29:05 +0000 (15:29 +0200)]
rtld(1): Fix building with -fno-common.

-fno-common will be default in future compilers (GCC 10, for example).

3 years agolibtelnet/telnetd(8): Fix building with -fno-common.
Sascha Wildner [Sat, 27 Jun 2020 13:27:50 +0000 (15:27 +0200)]
libtelnet/telnetd(8): Fix building with -fno-common.

-fno-common will be default in future compilers (GCC 10, for example).

3 years agocsh(1): Fix building with -fno-common.
Sascha Wildner [Sat, 27 Jun 2020 13:27:17 +0000 (15:27 +0200)]
csh(1): Fix building with -fno-common.

-fno-common will be default in future compilers (GCC 10, for example).

3 years agosh(1): Fix building with -fno-common.
Sascha Wildner [Sat, 27 Jun 2020 13:26:56 +0000 (15:26 +0200)]
sh(1): Fix building with -fno-common.

-fno-common will be default in future compilers (GCC 10, for example).

3 years agopax(1): Fix building with -fno-common.
Sascha Wildner [Sat, 27 Jun 2020 13:26:43 +0000 (15:26 +0200)]
pax(1): Fix building with -fno-common.

-fno-common will be default in future compilers (GCC 10, for example).

3 years agolibc: Fix building with -fno-common.
Sascha Wildner [Sat, 27 Jun 2020 13:25:08 +0000 (15:25 +0200)]
libc: Fix building with -fno-common.

-fno-common will be default in future compilers (GCC 10, for example).

3 years agoconfig(8): Fix building with -fno-common.
Sascha Wildner [Sat, 27 Jun 2020 13:20:18 +0000 (15:20 +0200)]
config(8): Fix building with -fno-common.

-fno-common will be default in future compilers (GCC 10, for example).

3 years agomake(1): Fix building with -fno-common.
Sascha Wildner [Sat, 27 Jun 2020 13:19:19 +0000 (15:19 +0200)]
make(1): Fix building with -fno-common.

-fno-common will be default in future compilers (GCC 10, for example).

3 years agoSync various games with NetBSD, in order to fix building with -fno-common.
Sascha Wildner [Sat, 27 Jun 2020 11:57:03 +0000 (13:57 +0200)]
Sync various games with NetBSD, in order to fix building with -fno-common.

Namely, adventure(6), backgammon(6), battlestar(6), hack(6) and trek(6).

-fno-common will be default in future compilers (GCC 10, for example).

3 years agoshare/doc: Remove documents that we haven't been installing for ages.
Sascha Wildner [Sat, 27 Jun 2020 10:53:05 +0000 (12:53 +0200)]
share/doc: Remove documents that we haven't been installing for ages.

While all of those are old and some of them are quite outdated, some
others are actually still useful and have information that is not
contained in any manual page (such as information on the internals
of config(8), for example). But since we haven't been installing them
since 15 years now (see ce233c472eb2cc66b348daa45965ffeb85ad7fe1) and
they are archived elsewhere and easily findable on the web, remove
them from our tree.

Also, they would need groff in base to build, which is no longer the
case in DragonFly since 1419a4e1759b9901ee3a1d147d0f7bee0394d6f3.

See for example https://docs.freebsd.org/44doc/ for FreeBSD's
archive.

3 years agoUpgrade libarchive, bsdcat(1), bsdcpio(1) and bsdtar(1). 2/2
Daniel Fojt [Sat, 27 Jun 2020 10:21:08 +0000 (12:21 +0200)]
Upgrade libarchive, bsdcat(1), bsdcpio(1) and bsdtar(1). 2/2

- update README.DRAGONFLY
- extend Symbol.map and Versions.def
- adapt Makefile
- regenerate config.h

3 years agoUpgrade libarchive, bsdcat(1), bsdcpio(1) and bsdtar(1). 1/2
Daniel Fojt [Sat, 27 Jun 2020 10:19:57 +0000 (12:19 +0200)]
Upgrade libarchive, bsdcat(1), bsdcpio(1) and bsdtar(1). 1/2

Merge branch vendor/LIBARCHIVE into master.

3 years agovendor/libarchive: upgrade from 3.3.3 to 3.4.3
Daniel Fojt [Sat, 27 Jun 2020 10:18:46 +0000 (12:18 +0200)]
vendor/libarchive: upgrade from 3.3.3 to 3.4.3

Fixes CVE-2019-18408.

New features:
- support for pzstd compressed files
- support for RHT.security.selinux tar extended attribute
- atomic file extraction support (bsdtar -x --safe-writes)
- unicode filename support for reading lha/lzh archives
- new pax write option "xattrhdr"
- read support for RAR 5.0 archives
- read support for ZIPX archives with xz, lzma, ppmd8 and bzip2
  compression
- support for non-recursive list and extract
- new tar option: --exclude-vcs
- 64-bit ar format support

Bugfixes:
- use-after-free in a certain ARCHIVE_FAILED situation
- various zstd fixes and improvements
- child process handling fixes
- compression buffer fix in XAR writer
- fix for uname and gname longer than 32 characters in PAX writer
- fix segfault when archiving hard links in ISO9660 and XAR writers
- fix support for extracting 7z archive entries with Delta filter
- security fixes and optimizations to write filter logic
- security fix related to use of readlink(2)
- sparse file handling fixes
- fix reading Android APK archives
- fix problems related to unreadable directories
- patches from OpenBSD to libarchive_fe/passphrase.c
- support extracting ACLs with in-entry comments
- support extracting extattrs as non-root on non-user-writable files
- various resource leak, use-after-free and crash fixes

For details, see release notes or commit history on github:
https://github.com/libarchive/libarchive/wiki/ReleaseNotes

3 years agoFix various typos: a -> an
Sascha Wildner [Sat, 27 Jun 2020 09:40:58 +0000 (11:40 +0200)]
Fix various typos: a -> an

3 years agoshare/mk/bsd.README: Add some info about bsd.host{libs,prog}.mk.
Sascha Wildner [Sat, 27 Jun 2020 09:11:33 +0000 (11:11 +0200)]
share/mk/bsd.README: Add some info about bsd.host{libs,prog}.mk.

3 years agoshare/mk/bsd.README: Remove reference to pmake documentation.
Sascha Wildner [Sat, 27 Jun 2020 09:06:05 +0000 (11:06 +0200)]
share/mk/bsd.README: Remove reference to pmake documentation.

We've since switched to bmake.

3 years agotraceroute.8: Mention ping6(8) and traceroute6(8)
Aaron LI [Fri, 26 Jun 2020 14:45:21 +0000 (22:45 +0800)]
traceroute.8: Mention ping6(8) and traceroute6(8)

3 years agoping.8: Mention ping6(8) and traceroute6(8)
Aaron LI [Fri, 26 Jun 2020 14:43:28 +0000 (22:43 +0800)]
ping.8: Mention ping6(8) and traceroute6(8)

3 years agoipfw3: Fix several comments and error messages
Aaron LI [Thu, 14 Feb 2019 07:28:02 +0000 (15:28 +0800)]
ipfw3: Fix several comments and error messages

3 years agoifconfig(8): Support to filter output by interface groups
Aaron LI [Fri, 26 Jun 2020 14:34:43 +0000 (22:34 +0800)]
ifconfig(8): Support to filter output by interface groups

Add options '-g <match_group>' and '-G <no_group>' to select and
unselect interfaces by groups in the output of 'ifconfig -a', just
like the existing '-d' and '-u' options to select only interfaces
that are down or up, respectively.  Note that '-g' and '-G' options
can be used at the same time to apply both conditions and their
arguments may contain shell patterns.

Examples:
* To exclude loopback from the list:
      ifconfig -a -G lo
* To list interfaces whose group names begin with 't':
      ifconfig -a -g 't*'

Obtained from FreeBSD (revision 361790; review D25029)

3 years agoifconfig.8: Update to show '-d' and '-u' is mutually exclusive
Aaron LI [Fri, 26 Jun 2020 14:21:56 +0000 (22:21 +0800)]
ifconfig.8: Update to show '-d' and '-u' is mutually exclusive

3 years agoifconfig(8): Speed up non-status operations to a single interface
Aaron LI [Fri, 26 Jun 2020 13:38:11 +0000 (21:38 +0800)]
ifconfig(8): Speed up non-status operations to a single interface

When performing a non-status operation on a single interface (e.g., set
address or flags), it is not necessary for ifconfig(8) to build a list
of all addresses in the system, sort them, and then iterate through them
to look for the single interface of interest.

Obtained from FreeBSD (revision 343535; review D18919)

3 years agoifconfig(8): Group addresses of each interface by family
Aaron LI [Fri, 26 Jun 2020 12:56:17 +0000 (20:56 +0800)]
ifconfig(8): Group addresses of each interface by family

Group the list of addresses associated with an interface by the address
family.  A stable sorting algorithm is employed here to preserve the
order of addresses inside a single group of each interface.

Obtained from FreeBSD (revisions 278080 and 278107).

3 years agoifconfig(8): Use getifaddrs(3) from libc
Aaron LI [Fri, 26 Jun 2020 09:59:53 +0000 (17:59 +0800)]
ifconfig(8): Use getifaddrs(3) from libc

Use libc's getifaddrs(3) instead of implementing its own version.

Obtained from FreeBSD (revisions 166956 and 199770); with minor
adjustments.

While there, also adjust some styles.

3 years agoifconfig(8): Use correct interface name when setting flags
Aaron LI [Fri, 26 Jun 2020 07:53:07 +0000 (15:53 +0800)]
ifconfig(8): Use correct interface name when setting flags

Obtained from FreeBSD (revision 187253).

With this change, the comment to setifflags() is now obsolete, so remove
it.  While there, improve styles a bit.

3 years agoifconfig(8): Add '-f' option to print in more formats
Aaron LI [Fri, 26 Jun 2020 06:02:58 +0000 (14:02 +0800)]
ifconfig(8): Add '-f' option to print in more formats

* Add the '-f' option to control the output formats of addresses,
  inet (IPv4) subnet masks, inet6 (IPv6) prefix length, Ethernet (MAC)
  address.  The following output formats are supported:

  - address: numeric (default), host, FQDN
  - inet (IPv4) subnet masks: CIDR, dotted-quad, and traditional hex
    output (default)
  - inet6 (IPv6) prefix length: CIDR, traditional integer format
    (default)
  - ether (MAC address): colon-separated (default), dash-separated

* The 'IFCONFIG_FORMAT' environment variable has the same usage as the
  '-f' option and can be overrided by the latter.

* Some minor cleanups.

Obtained from FreeBSD (revisions 301059 and 301185; review D2856), but
with my own minor modifications.

3 years agoifconfig(8): Print more WPS attributes in verbose "list scan" output
Aaron LI [Tue, 5 May 2020 02:58:20 +0000 (10:58 +0800)]
ifconfig(8): Print more WPS attributes in verbose "list scan" output

* Move WPS-related defines to a dedicated file
  <netproto/802_11/ieee80211_wps.h>
* Add handlers for more WPS attributes

Obtained-from: FreeBSD (revision 343204)

3 years agoifconfig(8): Eliminate trailing whitespace on inet6 and group lines
Aaron LI [Sun, 12 Apr 2020 13:53:32 +0000 (21:53 +0800)]
ifconfig(8): Eliminate trailing whitespace on inet6 and group lines

Obtained from FreeBSD:
https://github.com/freebsd/freebsd/commit/edcbc8f7441a32ec27fb2e57542bf291cb01029e
https://reviews.freebsd.org/D19004

3 years agoifconfig(8): Drop two unused macros from ifieee80211.c
Aaron LI [Sun, 12 Apr 2020 13:36:22 +0000 (21:36 +0800)]
ifconfig(8): Drop two unused macros from ifieee80211.c

Obtained from FreeBSD:
https://github.com/freebsd/freebsd/commit/1ce3befafefa7226bcff3621562943176fe87ff3

3 years agoifconfig(8): Make lagg creation more fault-tolerant
Aaron LI [Sun, 12 Apr 2020 13:29:32 +0000 (21:29 +0800)]
ifconfig(8): Make lagg creation more fault-tolerant

* Warn, don't exit, when SIOCSLAGGPORT returns an error.

  When we exit with an error during lagg creation, a single failed NIC
  (which no longer attaches) can prevent lagg creation and other
  configuration, such as adding an IPv4 address, and thus leave a
  machine unreachable.

* Preserve non-EEXISTS errors for exit status from SIOCSLAGGPORT, in
  case scripts are looking for it. Hopefully this can be extended if
  other parts of ifconfig can allow a "soft" failure.

* Improve the warning message to mention what lagg and what member are
  problematic.

Obtained from FreeBSD:
https://github.com/freebsd/freebsd/commit/dde41c97866152e8c7eb1f52f07e3e5ac43b2652
https://reviews.freebsd.org/D15046

3 years agoifconfig(8): Render non-ASCII SSID names with UTF-8 locales
Aaron LI [Sun, 12 Apr 2020 12:56:39 +0000 (20:56 +0800)]
ifconfig(8): Render non-ASCII SSID names with UTF-8 locales

Currently ifconfig(8) only prints the hex representation of ssid names
with non-ASCII characters.  Many modern terminals are able to properly
render non-ASCII characters.  This change checks if the terminal charmap
is UTF-8, and if so, will render the characters, rather than the hex
value.

This behavior is circumvented by running ifconfig(8) in a non-UTF8
locale; e.g. C or POSIX.

Obtained from FreeBSD:
https://github.com/freebsd/freebsd/commit/137a4801848fde80544a987fb168ff56face2ffd
https://reviews.freebsd.org/D15922

3 years agoUpgrade awk(1). 2/2
Daniel Fojt [Thu, 25 Jun 2020 04:16:24 +0000 (06:16 +0200)]
Upgrade awk(1). 2/2

Adapt Makefile and update README.{DELETED,DRAGONFLY}.

3 years agoUpgrade awk(1). 1/2
Daniel Fojt [Thu, 25 Jun 2020 04:15:47 +0000 (06:15 +0200)]
Upgrade awk(1). 1/2

Merge branch vendor/AWK into master.

3 years agovendor/awk: upgrade from 20121220 to 20200612
Daniel Fojt [Wed, 24 Jun 2020 05:45:41 +0000 (07:45 +0200)]
vendor/awk: upgrade from 20121220 to 20200612

Summary of notable changes:

- fixed buffer overflow in error reporting
- OFS value used to rebuild the record was incorrect
- add POSIX standard %a and %A to supported formats
- decrementing NF did not change $0
- unary plus on a string constant returned the string
- avoid undefined behaviour when using ctype(3) functions in relex()
- make getline handle numeric strings
- added support for POSIX-standard interval expressions in regexps
- use of random(3) as the random number generator
- support POSIX-specified C-style escape sequences "\a" and "\v" in
  command line arguments and regular expressions
- fix various array / memory overruns
- import code from NetBSD awk that implements RS as a regular expression
- add an optimization for string concatenation
- fix a bug whereby a{0,3} could match four a's
- input/output errors on closing files are now fatal instead of mere
  warnings
- if POSIXLY_CORRECT is set in the environment, then sub and gsub use
  POSIX rules for multiple backslashes
- it's no longer necessary to use the -y flag to bison
- backslash continuation inside strings removes the newline
- avoid any spurious errors left over from previous calls

For details, see FIXES, or commit history at
https://github.com/onetrueawk/awk/commits/master

3 years agodrm: Add headers, stubs and constants required by Linux 4.10 code
François Tigeot [Wed, 24 Jun 2020 15:45:07 +0000 (17:45 +0200)]
drm: Add headers, stubs and constants required by Linux 4.10 code

3 years agodrm: Move acpi_is_video_device() to linux/acpi.h
François Tigeot [Wed, 24 Jun 2020 14:58:54 +0000 (16:58 +0200)]
drm: Move acpi_is_video_device() to linux/acpi.h

3 years agobsd-family-tree: Sync with FreeBSD (fix 1BSD release date).
Sascha Wildner [Tue, 23 Jun 2020 19:48:04 +0000 (21:48 +0200)]
bsd-family-tree: Sync with FreeBSD (fix 1BSD release date).

3 years agoddb.4: document hardware watchpoints and dwatch
Krzysztof Piecuch [Sun, 21 Jun 2020 18:48:48 +0000 (18:48 +0000)]
ddb.4: document hardware watchpoints and dwatch

Document dwatch, hwatch, dhwatch commands.
While there, mention possible command aliases.

3 years agotmpfs - Try to avoid a tmpfs node deadlock in rename
Matthew Dillon [Sat, 20 Jun 2020 18:26:05 +0000 (11:26 -0700)]
tmpfs - Try to avoid a tmpfs node deadlock in rename

* Simultaneous renames of A -> DIR/B  and DIR/C -> D can
  deadlock tmpfs due to an incorrect assumption.  The directory
  vnodes are only referenced, not locked, so the namecache locks
  are insufficient.

* Solve by ordering the rename directories deterministically.  This
  is probably not a perfect solution but it should be good enough.
  Use a simple pointer inequality and a direct directory-subdirectory
  test.

3 years agomountd - Turn on SO_REUSEADDR (2)
Matthew Dillon [Sat, 20 Jun 2020 18:24:22 +0000 (11:24 -0700)]
mountd - Turn on SO_REUSEADDR (2)

* After several years it turns out that just turning SO_REUSEADDR
  on can cause a duplicate port to be assigned when an anonymous
  port is requested.  This is really a bug in the kernel which also
  needs to be fixed, but for now only set this option when a specific
  port is selected.

* Enhance bind error reporting.

3 years agotail(1): Implement tac(1) as the reverse version of cat(1)
Aaron LI [Sat, 20 Jun 2020 07:10:41 +0000 (15:10 +0800)]
tail(1): Implement tac(1) as the reverse version of cat(1)

The tac(1) is the reverse version of cat(1) and is implemented with
'tail -rq'.

Update cat.1, rev.1 and tail.1 man pages to mention the new tac(1).

The tac.1 man page is obtained from NetBSD.  The implementation is also
inspired by NetBSD but is different.

3 years agotail(1): Add -v flag to always print a header
Aaron LI [Sat, 20 Jun 2020 03:52:32 +0000 (11:52 +0800)]
tail(1): Add -v flag to always print a header

* Add the '-v' flag to always print a header for each file, even if only
  a single file is specified.  Obtained from NetBSD.
* Add '__dead2' attribute to the non-return function 'usage()'.
* Improve several markups in the man page.

3 years agohead(1): Support '-q' and '-v' flags and improve man page
Aaron LI [Fri, 19 Jun 2020 05:17:29 +0000 (13:17 +0800)]
head(1): Support '-q' and '-v' flags and improve man page

* Support the '-q' flag to never print headers of each filename, and the
  '-v' flag to always print the headers, which are the GNU extensions to
  this tool.
* Improve the man page to include the 'COMPATIBILITY' and 'STANDARDS'
  sections.

Obtained-from: NetBSD

3 years agohead(1): Minor cleanups
Aaron LI [Fri, 19 Jun 2020 05:13:39 +0000 (13:13 +0800)]
head(1): Minor cleanups

* Add '__dead2' attribute to non-return function 'usage()'.
* Move the 'first' out from the initializer part of the 'for' loop and
  change it to a boolean, making the code a bit cleaner.
* Remove one duplicate copyright notice.

3 years agoefibootmgr.8: Add commas before long options for better readability.
Sascha Wildner [Fri, 19 Jun 2020 06:32:14 +0000 (08:32 +0200)]
efibootmgr.8: Add commas before long options for better readability.

While here, upper-case .Sh Examples -> EXAMPLES.

3 years agoefi{dp,var}.8: Add commas before long options for better readability.
Sascha Wildner [Fri, 19 Jun 2020 06:21:32 +0000 (08:21 +0200)]
efi{dp,var}.8: Add commas before long options for better readability.

3 years agoetc/network.subr: enhance wlan initialization
Daniel Fojt [Thu, 18 Jun 2020 06:16:04 +0000 (08:16 +0200)]
etc/network.subr: enhance wlan initialization

Teach wlan_up() and wlan_down() to process just a single interface
passed as optional argument. If no argument is given, process all
"net.wlan.devices" just like before.

Reviewed by: Aaron LI

3 years agotail(1): improve style consistency of previous change
Daniel Fojt [Thu, 18 Jun 2020 04:28:36 +0000 (06:28 +0200)]
tail(1): improve style consistency of previous change

Suggested by: Sascha Wildner

3 years agotail(1): fix misbehaviour on pseudo filesystems
Daniel Fojt [Wed, 17 Jun 2020 06:56:17 +0000 (08:56 +0200)]
tail(1): fix misbehaviour on pseudo filesystems

When processing regular zero-sized files, use display_lines() instead of
rlines(). This fixes tail(1) behaviour with files on pseudo filesystems
(like procfs) which are often reported to have zero size while having
a content.

Issue: https://bugs.dragonflybsd.org/issues/3034

3 years agoetc/periodic: fix off-by-one error in 220.snapshot-hammer2
Daniel Fojt [Tue, 16 Jun 2020 17:05:40 +0000 (19:05 +0200)]
etc/periodic: fix off-by-one error in 220.snapshot-hammer2

Increase $_keep before passing it to tail(1) as the output from
tail -n+N starts at N-th line of its input which is the last
snapshot to be kept actually.

3 years agokernel: improve open(2) error handling
Daniel Fojt [Tue, 16 Jun 2020 05:23:19 +0000 (07:23 +0200)]
kernel: improve open(2) error handling

When trying to open a file with O_CREAT and O_EXCL flags while the file
exists, disregard the file permissions and always return EEXIST as
described in manpage and required by the standard.

Issue: https://bugs.dragonflybsd.org/issues/2953

3 years agodhcpcd: Update README.DRAGONFLY
Roy Marples [Tue, 16 Jun 2020 08:50:55 +0000 (08:50 +0000)]
dhcpcd: Update README.DRAGONFLY

3 years agodhcpcd: Fix build for 9.1.2
Roy Marples [Tue, 16 Jun 2020 08:47:49 +0000 (08:47 +0000)]
dhcpcd: Fix build for 9.1.2

3 years agoMerge branch 'vendor/DHCPCD'
Roy Marples [Tue, 16 Jun 2020 08:46:44 +0000 (08:46 +0000)]
Merge branch 'vendor/DHCPCD'

3 years agoUpdate to dhcpcd-9.1.2 with the following changes:
Roy Marples [Tue, 16 Jun 2020 08:43:31 +0000 (08:43 +0000)]
Update to dhcpcd-9.1.2 with the following changes:

 * BSD: Only mark static routes from dhcpcd.conf as static
 * DHCP6: Ensure requested addresses are requested
 * DHCP6: Fix prefix length calculation when no prefix specified

 * privsep: Implement a resource limited sandbox

You will see a control proxy process now.
This is for the resource limited sandbox so that we can isolate
requests over the control socket.
For NetBSD, FreeBSD and derivatives such as DragonFlyBSD this is a massive win
as these OS now enjoy a similar level of protection as Capsicum or Pledge,
but without the syscall filtering.

3 years agodrm/i915: enable i915_gem_phys_ops
François Tigeot [Tue, 16 Jun 2020 08:05:25 +0000 (10:05 +0200)]
drm/i915: enable i915_gem_phys_ops

3 years agosed(1): sync with FreeBSD
Daniel Fojt [Mon, 15 Jun 2020 17:15:41 +0000 (19:15 +0200)]
sed(1): sync with FreeBSD

Summary of notable changes:

- fix sed functions 'i' and 'a' from discarding leading white space
- rewrite the main loop of the "sed s/..." command
- fix -i option behavior with 'q' command
- process \r, \n, and \t
- attempt to learn about hex escapes (e.g. \x27)
- read commands from stdin when -f - is passed

Reviewed by: Sascha Wildner

3 years ago<protocols/dumprestore.h>: Fix include guard comment.
Sascha Wildner [Mon, 15 Jun 2020 18:25:18 +0000 (20:25 +0200)]
<protocols/dumprestore.h>: Fix include guard comment.

3 years agodrm/i915: Use kmem_cache functions
François Tigeot [Mon, 15 Jun 2020 10:16:39 +0000 (12:16 +0200)]
drm/i915: Use kmem_cache functions

3 years agodrm/linux: Add kmem_cache functions and related constants
François Tigeot [Mon, 15 Jun 2020 09:51:21 +0000 (11:51 +0200)]
drm/linux: Add kmem_cache functions and related constants

3 years agoUpdate the pciconf(8) database.
Sascha Wildner [Mon, 15 Jun 2020 09:13:32 +0000 (11:13 +0200)]
Update the pciconf(8) database.

May 29, 2020 snapshot from https://pci-ids.ucw.cz

3 years agoBring in efibootmgr(8) from FreeBSD.
Sascha Wildner [Sat, 13 Jun 2020 06:52:58 +0000 (08:52 +0200)]
Bring in efibootmgr(8) from FreeBSD.

Taken-from: FreeBSD

3 years agoinitrd/mkinitrd.sh: Use 'du -t' to simplify size calculation
Aaron LI [Fri, 12 Jun 2020 15:57:01 +0000 (23:57 +0800)]
initrd/mkinitrd.sh: Use 'du -t' to simplify size calculation

The du(1)'s '-t' option calculates the apparent size, which is what we
want here for determining the required size of the initrd image.  This
saves us a shell function to do the same work.

3 years agoetc/periodic: Use 'LINKS' to create links for 220.snapshot-hammer2
Aaron LI [Fri, 12 Jun 2020 14:58:42 +0000 (22:58 +0800)]
etc/periodic: Use 'LINKS' to create links for 220.snapshot-hammer2

Avoid the ad-hoc 'ln' command.  In addition, the original linked-to
files are absolute paths but missing the '${DESTDIR}', so they can be on
two different installations.  Use 'LINKS' that creates hard-links to
fix this issue.

Reviewed-by: swildner, deef
3 years agomk/bsd.README: Document 'SYMLINKS' and update 'LINKS' and 'MLINKS'
Aaron LI [Fri, 12 Jun 2020 14:54:53 +0000 (22:54 +0800)]
mk/bsd.README: Document 'SYMLINKS' and update 'LINKS' and 'MLINKS'

* Add description of 'SYMLINKS' that creates symbolic links.
* 'MLINKS' creates hard links rather than soft links.
* Update description of 'LINKS' and the example.  '${DESTDIR}' will be
  auto prepended so it should not be used.

Reviewed-by: swildner
3 years agoUpgrade less(1). 2/2
Daniel Fojt [Fri, 12 Jun 2020 11:34:05 +0000 (13:34 +0200)]
Upgrade less(1). 2/2

- update README.{DELETED,DRAGONFLY}
- import regenerated defines.h
- fix -Werror=unused-variable in screen.c

3 years agoUpgrade less(1). 1/2
Daniel Fojt [Fri, 12 Jun 2020 11:33:18 +0000 (13:33 +0200)]
Upgrade less(1). 1/2

Merge branch vendor/LESS into master.

3 years agovendor/less: upgrade from 481 to 551
Daniel Fojt [Fri, 12 Jun 2020 11:32:09 +0000 (13:32 +0200)]
vendor/less: upgrade from 481 to 551

- unicode tables updated
- new commands added
- new cmdline options introduced
- bugs and memory leaks fixed

For details see:

http://www.greenwoodsoftware.com/less/news.487.html
http://www.greenwoodsoftware.com/less/news.530.html
http://www.greenwoodsoftware.com/less/news.551.html

3 years agokernel - Refactor sysclock_t from 32 to 64 bits (2)
Matthew Dillon [Thu, 11 Jun 2020 22:57:04 +0000 (15:57 -0700)]
kernel - Refactor sysclock_t from 32 to 64 bits (2)

* Cputimer reload values can be negative, check condition and
  set a small positive reload value instead.

* Also avoids muldivu64() overflow warnings on the console.

Reported-by: kworr
3 years agoshare/example/Makefile: Sort better.
Sascha Wildner [Thu, 11 Jun 2020 20:37:18 +0000 (22:37 +0200)]
share/example/Makefile: Sort better.

3 years agoProperly ignore "trim" failures in swapon(8).
Daniel Fojt [Thu, 11 Jun 2020 18:11:55 +0000 (20:11 +0200)]
Properly ignore "trim" failures in swapon(8).

When trying to "trim" a swap device that doesn't support this, just ignore
particular ioctl() failure and continue activating the swap. This actually
matches the behaviour described in swapon(8) manpage.

Issue: https://bugs.dragonflybsd.org/issues/3207

3 years agoUpgrade diffutils. 2/2
Daniel Fojt [Wed, 10 Jun 2020 09:32:29 +0000 (11:32 +0200)]
Upgrade diffutils. 2/2

- update README.{DELETED,DRAGONFLY}
- regenerate header files
- adapt Makefile to vendor update

3 years agoUpgrade diffutils. 1/2
Daniel Fojt [Thu, 11 Jun 2020 12:33:51 +0000 (14:33 +0200)]
Upgrade diffutils. 1/2

Merge branch vendor/DIFFUTILS into master.

3 years agovendor/diffutils: upgrade from 3.3 to 3.7 vendor/DIFFUTILS
Daniel Fojt [Wed, 10 Jun 2020 09:05:53 +0000 (11:05 +0200)]
vendor/diffutils: upgrade from 3.3 to 3.7

Summary of notable changes:

- new options --color and --palette to generate and configure colored
  output, compatible with less -R
- when binary files differ, diff now exits with status 1 as POSIX requires
- unless the --ignore-file-name-case option is used, diff now
  considers file names to be equal only if they are byte-for-byte
  equivalent
- diff -B no longer generates incorrect output if the two inputs each end
  with a one-byte incomplete line
- diff --brief no longer reports a difference for unusual identical files
- diff3 no longer malfunctions due to use-after-free
- using an invalid regular expression with --ignore-matching-lines=RE (-I)
  no longer causes stack overflow
- possible uninitialized memory read with --strip-trailing-cr fixed
- default algorithm has been adjusted to output higher-quality results,
  and further tweaked to deal better with larger files

For a complete history of changes see:

http://git.savannah.gnu.org/cgit/diffutils.git/log/

3 years agokernel: fix misleading error from allocating file descriptors
Daniel Fojt [Thu, 11 Jun 2020 09:25:27 +0000 (11:25 +0200)]
kernel: fix misleading error from allocating file descriptors

Return EINVAL instead of EMFILE when requested new file descriptor number
exceeds the limit.

Discussed with: Sascha Wildner

3 years agoDeduplicate login environment setup.
Daniel Fojt [Tue, 9 Jun 2020 11:28:45 +0000 (13:28 +0200)]
Deduplicate login environment setup.

Revise default environment assignments in login.conf(5).

Update share/skel/dot.profile to match share/skel/dot.cshrc, ie. comment
assignments done via login.conf (PATH, BLOCKSIZE, umask).

Drop etc/root and update "distribution" target in Makefile to use
share/skel/* instead.

Discussed with and reviewed by: Sascha Wildner
Issue: https://bugs.dragonflybsd.org/issues/3220

3 years agoworld - Change serial port default from 9600 to 115200
Matthew Dillon [Wed, 10 Jun 2020 21:00:28 +0000 (14:00 -0700)]
world - Change serial port default from 9600 to 115200

* Long overdue change, all serial port defaults are now set to
  115200.

* NOTE: legacy BIOS boot0/boot1 use int 0x14 to set the serial
  console baud rate.  This BIOS call only supports up to 9600.
  But once you get into the boot loader it should be able to set
  the correct baud rate.

3 years agoboot.8: Markup a kernel configuration option better.
Sascha Wildner [Wed, 10 Jun 2020 20:06:46 +0000 (22:06 +0200)]
boot.8: Markup a kernel configuration option better.

3 years agouefi.8: Add a reference to efidp(8).
Sascha Wildner [Wed, 10 Jun 2020 19:27:54 +0000 (21:27 +0200)]
uefi.8: Add a reference to efidp(8).

3 years agohammer2.8: Sort SEE ALSO.
Sascha Wildner [Wed, 10 Jun 2020 14:14:19 +0000 (16:14 +0200)]
hammer2.8: Sort SEE ALSO.

3 years agoSync shutdown(8) and reboot(8) with FreeBSD
Krzysztof Piecuch [Sat, 6 Jun 2020 21:55:06 +0000 (21:55 +0000)]
Sync shutdown(8) and reboot(8) with FreeBSD

shutdown now understands offsets in seconds, minutes and hours.
reboot is harder to kill ignoring SIGPIPE, SIGINT, SIGQUIT and SIGSTP.

Taken-from: FreeBSD

3 years agoStop overwriting /etc/gettytab on every 'make upgrade'.
Sascha Wildner [Tue, 9 Jun 2020 19:05:42 +0000 (21:05 +0200)]
Stop overwriting /etc/gettytab on every 'make upgrade'.

There isn't really any important movement in it from our side, but there
are some scenarios (autologin for example) where a user may have changed
it.

3 years agokernel - Refactor sysclock_t from 32 to 64 bits
Matthew Dillon [Tue, 9 Jun 2020 16:08:16 +0000 (09:08 -0700)]
kernel - Refactor sysclock_t from 32 to 64 bits

* Refactor the core cpu timer API, changing sysclock_t from 32
  to 64 bits.  Provide a full 64-bit count from all sources.

* Implement muldivu64() using gcc's 128-bit integer type.  This
  functions takes three 64-bit valus, performs (a * b) / d
  using a 128-bit intermediate calculation, and returns a 64-bit
  result.

  Change all timer scaling functions to use this function which
  effectively gives systimers the capability of handling any
  timeout that fits 64 bits for the timer's resolution.

* Remove TSC frequency scaling, it is no longer needed.  The
  TSC timer is now used at its full resolution.

* Use atomic_fcmpset_long() instead of a clock spinlock when
  updating the msb bits for hardware timer sources less than
  64 bits wide.

* Properly recalculate existing systimers when the clock source
  is changed.  Existing systimers were not being recalculated,
  leading to the system failing to boot when time sources had
  radically different clock frequencies.

3 years agodrm/linux: Add work_pending()
François Tigeot [Tue, 9 Jun 2020 07:32:37 +0000 (09:32 +0200)]
drm/linux: Add work_pending()

3 years agodrm/linux: Add raw_read_seqcount()
François Tigeot [Tue, 9 Jun 2020 07:31:49 +0000 (09:31 +0200)]
drm/linux: Add raw_read_seqcount()

3 years agodrm/linux: Add swiotlb_max_segment()
François Tigeot [Tue, 9 Jun 2020 07:30:24 +0000 (09:30 +0200)]
drm/linux: Add swiotlb_max_segment()

3 years agosbin/newfs_hammer2: Remove extra line break after printf outputs
Tomohiro Kusumi [Mon, 8 Jun 2020 17:50:04 +0000 (02:50 +0900)]
sbin/newfs_hammer2: Remove extra line break after printf outputs

This probably came from newfs_hammer.c, but HAMMER2 doesn't have
a note after this.