dragonfly.git
6 months agoMerge branch 'vendor/DHCPCD'
Roy Marples [Mon, 5 Oct 2020 16:24:54 +0000 (17:24 +0100)]
Merge branch 'vendor/DHCPCD'

6 months agoUpdate to dhcpcd-9.3.0 with the following changes:
Roy Marples [Mon, 5 Oct 2020 16:22:25 +0000 (17:22 +0100)]
Update to dhcpcd-9.3.0 with the following changes:
 * dhcpcd: Backticks have been removed from quoting filenames
 * dhcpcd: Only manipulate stdin, stdout and stderr if they are valid
 * duid: Adjust option so the type can be specified
 * logerr: Don't leak logfile fd to scripts
 * privsep: Run the launcher process in the sandbox
 * privsep: getifaddrs now carries ifa_data for BSD
 * BSD: Use `ifi_link_state` as the single source of truth about carrier
 * BSD: Ignore vether(4) devices by default

7 months agosoreadable() should consider so_rerror
Roy Marples [Mon, 5 Oct 2020 08:59:35 +0000 (09:59 +0100)]
soreadable() should consider so_rerror

7 months agosbin/hammer2: Change hammer2_uuid_to_str() to take const pointer
Tomohiro Kusumi [Sun, 4 Oct 2020 21:01:12 +0000 (06:01 +0900)]
sbin/hammer2: Change hammer2_uuid_to_str() to take const pointer

7 months agosbin/hammer2: Add hammer2_pfssubtype_to_str()
Tomohiro Kusumi [Sun, 4 Oct 2020 17:04:48 +0000 (02:04 +0900)]
sbin/hammer2: Add hammer2_pfssubtype_to_str()

7 months agosbin/hammer2: Sort "pfs-list" by PFS label
Tomohiro Kusumi [Sun, 4 Oct 2020 15:42:06 +0000 (00:42 +0900)]
sbin/hammer2: Sort "pfs-list" by PFS label

7 months agosys/vfs/hammer2: Fix wrong comment in hammer2_recovery_scan()
Tomohiro Kusumi [Sat, 3 Oct 2020 19:52:20 +0000 (04:52 +0900)]
sys/vfs/hammer2: Fix wrong comment in hammer2_recovery_scan()

It no longer cares about PFS boundary since
e513e77e7d72a7b81fe5a8e60f5d9511e10af682 in 2015.

7 months agogcc: Allow our C++ headers to survive -Wsystem-headers (2).
Sascha Wildner [Sat, 3 Oct 2020 17:56:19 +0000 (19:56 +0200)]
gcc: Allow our C++ headers to survive -Wsystem-headers (2).

The previous commit (894c19b2d84fd28593ce799678d7d9f7d33936ef) wasn't
actually working because __LONG_LONG_SUPPORTED wasn't yet known.

Include <sys/cdefs.h> for it.

Reported-by: tuxillo
7 months agosbin/hammer2: Adjust "stat" output format
Tomohiro Kusumi [Sat, 3 Oct 2020 15:48:09 +0000 (00:48 +0900)]
sbin/hammer2: Adjust "stat" output format

7 months agosys/vfs/hammer2: Don't expose inode's kva via ioctl
Tomohiro Kusumi [Sat, 3 Oct 2020 16:05:06 +0000 (01:05 +0900)]
sys/vfs/hammer2: Don't expose inode's kva via ioctl

This was just for debugging, and apparently no longer used.

7 months agosys/vfs/hammer2: Adjust some kprintfs in vfsops
Tomohiro Kusumi [Sat, 3 Oct 2020 15:30:09 +0000 (00:30 +0900)]
sys/vfs/hammer2: Adjust some kprintfs in vfsops

7 months agosbin/hammer2: Sync "pfs-create" message format with "pfs-delete"
Tomohiro Kusumi [Fri, 2 Oct 2020 15:19:08 +0000 (00:19 +0900)]
sbin/hammer2: Sync "pfs-create" message format with "pfs-delete"

7 months agosbin/hammer2: Make "pfs-delete" error message handle ENOENT case
Tomohiro Kusumi [Thu, 1 Oct 2020 17:07:25 +0000 (02:07 +0900)]
sbin/hammer2: Make "pfs-delete" error message handle ENOENT case

If all attempts failed before ioctl(HAMMER2IOC_PFS_DELETE) without
valid used_fd, print not-found message rather than just FAILED.

7 months agosys/vfs/hammer2: Make ioctl(HAMMER2IOC_PFS_DELETE) return EBUSY if mounted
Tomohiro Kusumi [Thu, 1 Oct 2020 16:32:07 +0000 (01:32 +0900)]
sys/vfs/hammer2: Make ioctl(HAMMER2IOC_PFS_DELETE) return EBUSY if mounted

Don't let hammer2(8) "pfs-delete" delete a currently mounted PFS...

7 months agoFix typos in libfetch and ext2fs.
Sascha Wildner [Fri, 2 Oct 2020 05:37:20 +0000 (07:37 +0200)]
Fix typos in libfetch and ext2fs.

7 months agosbin/hammer2: Add missing PFS types for "pfs-list"
Tomohiro Kusumi [Wed, 30 Sep 2020 16:47:55 +0000 (01:47 +0900)]
sbin/hammer2: Add missing PFS types for "pfs-list"

Added missing ones, but these two shouldn't match.

7 months agosbin/fsck_hammer2: Fix whitespace in usage output
Tomohiro Kusumi [Wed, 30 Sep 2020 16:44:24 +0000 (01:44 +0900)]
sbin/fsck_hammer2: Fix whitespace in usage output

7 months agosbin/fsck_hammer2: Add -P option to print PFS information
Tomohiro Kusumi [Wed, 30 Sep 2020 16:34:08 +0000 (01:34 +0900)]
sbin/fsck_hammer2: Add -P option to print PFS information

This prints PFS info, in the same format as "pfs-list" in hammer2(8).

The problem with "pfs-list" is it requires HAMMER2 inode, but in order
to mount HAMMER2, PFS label is required. This option provides "pfs-list"
equivalent via block device.

7 months agosys/vfs/hammer2: Make corrupted volume header messages verbose
Tomohiro Kusumi [Tue, 29 Sep 2020 15:11:29 +0000 (00:11 +0900)]
sys/vfs/hammer2: Make corrupted volume header messages verbose

HAMMER2 can be mounted if at least 1 volume header is alive,
but make error messages verbose to indicate corrupted ones on mount.

7 months agorc: Add handler for allow_listen_override.
Antonio Huete Jimenez [Mon, 28 Sep 2020 22:57:39 +0000 (00:57 +0200)]
rc: Add handler for allow_listen_override.

  - This is a follow-up of commit 2ea2781e4d73ee6.
  - Allow setting allow_listen_override globally for all jails,
    by default it is disabled:

          jail_default_allow_listen_override    (default: disabled)

  - Adjust rc.conf(5) manpage too.

7 months agogcc: Allow our C++ headers to survive -Wsystem-headers.
Sascha Wildner [Mon, 28 Sep 2020 20:25:59 +0000 (22:25 +0200)]
gcc: Allow our C++ headers to survive -Wsystem-headers.

It was breaking on defining a macro that resolves to a defined()
directive, which is apparently an issue in C++ land. As a workaround,
define a C++ specific macro that is either 0 or 1 for long long
support and can be used without issues.

Stop filtering out -Wsystem-headers in CXXFLAGS. The remaining -W...
options that are filtered out are all C specific.

7 months agosys/vfs/hammer2: Return ENOENT if PFS label not found on mount
Tomohiro Kusumi [Mon, 28 Sep 2020 15:24:30 +0000 (00:24 +0900)]
sys/vfs/hammer2: Return ENOENT if PFS label not found on mount

and make sbin/mount_hammer2 handle ENOENT with an error message.

This can easily happen if newfs_hammer2'd with explcit label
specification (i.e. no default label created), and the reason isn't
obvious with just EINVAL.

7 months agosbin/fsck_msdosfs: Use %ju and cast to (uintmax_t) to avoid using PRI* macros
Tomohiro Kusumi [Mon, 28 Sep 2020 18:42:04 +0000 (03:42 +0900)]
sbin/fsck_msdosfs: Use %ju and cast to (uintmax_t) to avoid using PRI* macros

from freebsd/freebsd@51dd232dae465eb3cbe00596ba0583964e0c259f

7 months agosbin/mount_hammer2: Use MOPT_UPDATE
Tomohiro Kusumi [Sun, 27 Sep 2020 16:31:46 +0000 (01:31 +0900)]
sbin/mount_hammer2: Use MOPT_UPDATE

7 months agosbin/hammer2: Fix default value of vfs.hammer2.cluster_write
Tomohiro Kusumi [Sun, 27 Sep 2020 15:05:09 +0000 (00:05 +0900)]
sbin/hammer2: Fix default value of vfs.hammer2.cluster_write

7 months agoworld: Staticize various variables and also remove a couple of unused ones.
Sascha Wildner [Sun, 27 Sep 2020 10:46:47 +0000 (12:46 +0200)]
world: Staticize various variables and also remove a couple of unused ones.

7 months agosh(1): bring sh from freebsd
Krzysztof Piecuch [Fri, 11 Sep 2020 17:24:23 +0000 (17:24 +0000)]
sh(1): bring sh from freebsd

I used freebsd@19bed3ae2eb256a2c68dabbcb77eff2835d569de.

* Write absolute path in command -vV and type
* Keep ignored SIGINT/SIGQUIT after set in a background job
* print a newline when ^D quits sh
* Do not ignore INTOFF during a trap
* Fix description of the "\$" sequence for PS1
* Allow more scripts without #!
* Fix double INTON with vfork
* Assert INTOFF rather than applying it in ck*
* Remove remnants to compile out fc completely
* Fix a "may be unused" warning on mips-gcc
* remove duplicate el definition
* fix read builtin on 32-bit systems
* Improve performance of "read" built-in command when using a seekable
* Fix rare memory leak with SIGINT
* Do not use our custom completion function, it is not needed anymore
* Add set -o pipefail
* Send normal output from bind builtin to stdout
* Restore $((x)) error checking after fix for $((-9223372036854775808))
* Make sh(1) support \u in PS1.  This removes one fork/exec on
  interactive
* Send libedit "ferr" output to fd 2
* Fix an edge case when parsing large numbers which resulted in
  inconsistent
* Do not place exported but unset variables into the environment
* Make sh(1) collapse $HOME into "~" in PS1.
* Remove -c string from set builtin documentation
* Fix ${param?} default error message
* Use 126 and 127 exit status for failures opening a script
* Unify EXERROR and EXEXEC
* Use exitstatus instead of exerrno to pass EXEXEC status
* Fix formal overflow in pointer arithmetic
* Describe how to prevent *.core files from being created using ulimit.
* Don't treat % specially in CDPATH
* Don't use padvance() for MAIL/MAILPATH
* Split CNL syntax category to avoid a check on state[level].syntax
* Allow unquoted newlines in word in ${param+word} etc.
* Don't have [ match any [[:class:]]
* Allow overriding VTABSIZE at compile-time.
* Refactor job status printing, preparing for -o pipefail and similar
* Move various structs from jobs.h to jobs.c
* Fix a few speelling errors
* Don't leak wait* implementation details from jobs.c
* Markup and spelling fixes
* Fix mandoc -Tlint warnings in bin/
* General further adoption of SPDX licensing ID tags.
* Remove broken #ifdef NOHACK code (related to sh -c).
* Ignore error when cd writes the directory actually switched to.
* Enable interrupts before executing EXIT trap and doing final flush.
* Call fc -e editor with interrupts enabled.
* Make sure to process SIGINT if SETINTON re-enables processing.
* Allow defining nofork builtins from builtins.def and move always-safe
  ones there.
* Fix INTOFF leak when a redirection on a compound command fails.
* Keep output buffer across builtins.
* Ensure memout.bufsize matches allocated buffer, if it exists.
* Simplify output buffering.
* Fix '-' from quoted arithmetic in case/glob pattern range.
* Fix INTOFF leak after a builtin with different locale settings.
* Update TOUR and comments for some code changes, some of them old.
* Simplify handling of newlines in command substitution.
* Simplify setinteractive().
* Fix use after free when resetting an in-use alias.
* Fix unalias -a while an alias is currently in use.
* Reduce size of limits table.
* Remove an XXX comment: it is normal for builtins to use argptr.
* Remove global state from collate_range_cmp().
* Don't scan word twice in ${param=word}.
* Don't scan word twice in ${param#%##%%word}.
* Don't scan word twice in ${param+-word}.
* Remove unused function declaration for arith_lex_reset().
* Remove unused return value of subevalvar_misc().
* Get rid of global variable argbackq.
* Fix executing wrong command with ${unsetvar#$(cmdsubst)}$(cmdsubst).
* Fix crash if a -T trap is taken during command substitution.
* bin: normalize paths using SRCTOP-relative paths or :H when possible
* Remove empty Li
* Do not import IFS's value from the environment.
* Fix a clang warning.
* Path generation was not according to collate
* Back out non-collating [a-z] ranges.
* After removing collation for [a-z] ranges in r302512, do it here too.
* Improve descriptions in 'ulimit -a' output.
* Clarify the explanations for the hostname and FQDN entries.
* Match the descriptions of the \H and \h prompt string sequences to reality.
* Hopefully fix Coverity CID 1008328 (Out-of-bounds write) in /bin/sh.
* Handle empty hostname and $PWD when building prompt
* Write LINENO value to stack string directly.
* Merge the projects/release-pkg branch to head.
* Simplify code by removing variable bracketed_name.
* replace 0 with NULL for pointers.
* Fix use-after-free if a trap replaces itself.
* Fix copying uninitialized field 'special'.
* Fix handling of umtxp resource limit in sh(1)/ulimit(1), limits(1), add
* Avoid out-of-bounds access in setoptionbyindex() for 'set -o nolog'.
* Fix some dead stores.
* Remove a redundant STPUTC check.
* Don't trust that signal descriptions fit within 49 bytes.
* Fix set -v and multiline history after r295825.
* Don't hash alias name when there are no aliases.
* Optimize setprompt(0).
* Remove unnecessary flushouts while reading script.
* Rework code to remove '\0' from shell input.
* Don't allocate a redirtab if there are no redirections.
* Document 'cd -'.
* Constify internal representation in expand.c.
* Remove a global variable from cd.c.
* Use OLDPWD shell variable for 'cd -'.
* Clean a readonly local, even if the variable does not exist outside.
* Simplify some code related to positional parameters.
* Update associated state when restoring locals while leaving a function.
* Reduce size of options table.
* Ensure OPTIND=1 in subshell without forking does not affect outer env.
* Reduce size of builtins table.
* Remove redundant CTLQUOTEMARK checks.
* Reindent expandmeta().
* Perform pathname generation during the first expansion phases.
* Perform IFS splitting during the first expansion phases.
* Split subevalvar() in #/##/%/%% and =/? parts.
* sh/mknodes: Close files and check for errors when writing.
* Fix use-after-free when attempting to modify a read-only variable.
* Remove global state from nodes.c.
* Fix ""$@, which should not use the special case for "$@".
* Avoid copying argv for simple commands.
* Make struct arglist an array instead of a linked list.
* Allow empty << EOF markers.
* Fix read with escaped IFS characters at the end.
* Add set -o nolog.
* Fix out of bounds read when there is no ] after a [:class:].
* Don't create bad parse result when postponing a bad substitution error.
* Avoid negative character values from $'\Uffffffff' etc.
* Backslash-newline should not affect field splitting in read builtin.
* When setting option via long name, don't go via letter.
* libedit has supported multibyte encodings for a while.
* Fix some arithmetic undefined behaviour.

Taken-from: FreeBSD

7 months agogpt(8): device_path does not need to be global.
Sascha Wildner [Wed, 23 Sep 2020 13:49:20 +0000 (15:49 +0200)]
gpt(8): device_path does not need to be global.

7 months agosbin/hammer2: Fix calloc element size in get_hammer2_mounts()
Tomohiro Kusumi [Sat, 26 Sep 2020 15:04:10 +0000 (00:04 +0900)]
sbin/hammer2: Fix calloc element size in get_hammer2_mounts()

7 months agosys/vfs/hammer2: Fix non inode chain handling in hammer2_update_pmps()
Tomohiro Kusumi [Fri, 25 Sep 2020 16:27:48 +0000 (01:27 +0900)]
sys/vfs/hammer2: Fix non inode chain handling in hammer2_update_pmps()

This should only be seeing inode chains,
but if not it still needs to continue chain iteration.

7 months agolibc: Hide some internal symbols.
Sascha Wildner [Sat, 26 Sep 2020 09:49:03 +0000 (11:49 +0200)]
libc: Hide some internal symbols.

Taken-from: FreeBSD

7 months agotest(1): sync with FreeBSD
Krzysztof Piecuch [Fri, 11 Sep 2020 19:38:53 +0000 (19:38 +0000)]
test(1): sync with FreeBSD

* optimize operator lookup
* simplify the code by unifying op_num and op_type
* use NULL instead of 0
* update manpage

Taken-from: FreeBSD

7 months agoprintf(1): sync with FreeBSD
Krzysztof Piecuch [Fri, 11 Sep 2020 19:42:31 +0000 (19:42 +0000)]
printf(1): sync with FreeBSD

* improve manpage
* output formatted data directly, instead of via asprintf
* fixes printf(1) ignoring width and precision in %b format.

Taken-from: FreeBSD

7 months agokill(1): Don't kill pid -1 on overflow from strtol(3).
Krzysztof Piecuch [Fri, 11 Sep 2020 17:53:10 +0000 (17:53 +0000)]
kill(1): Don't kill pid -1 on overflow from strtol(3).

Port freebsd/freebsd@908622a5632a1a9aa5dda2a1fc7ce9f0102f6327
Store the result in a proper long and then compare to the proper pid_t
for overflow so that no MD assumptions are made.

Taken-from: FreeBSD

7 months agosbin/mount_hammer2: Mention @label mount when >1 mounts exist
Tomohiro Kusumi [Fri, 25 Sep 2020 14:45:08 +0000 (23:45 +0900)]
sbin/mount_hammer2: Mention @label mount when >1 mounts exist

The first one matched from pmp list is selected, and pmps are
tail-inserted to pmp list when hmp is allocated by scanning inodes
under sroot.

7 months agosys/vfs/hammer2: Prevent write against mounted device
Tomohiro Kusumi [Wed, 23 Sep 2020 17:30:56 +0000 (02:30 +0900)]
sys/vfs/hammer2: Prevent write against mounted device

Use a most recently mounted mp for devvp->v_rdev->si_mountpoint.
All fs do this except that in HAMMER2 devvp and mp aren't 1:1.

7 months agosbin/fsck_msdosfs: Fix an integer overflow on 32-bit platforms
Tomohiro Kusumi [Wed, 23 Sep 2020 13:35:29 +0000 (22:35 +0900)]
sbin/fsck_msdosfs: Fix an integer overflow on 32-bit platforms

Likely unrelated to DragonFly, but sync with FreeBSD anyway.

from freebsd/freebsd@4b0089abdf36a27fda364b25e95706a0abfe6c3a
from freebsd/freebsd@667eef4ac6396ffe2d705b401a2a09f60ab38fe7

7 months agopw(8): Use __unused instead of self-assignments.
Sascha Wildner [Tue, 22 Sep 2020 20:00:53 +0000 (22:00 +0200)]
pw(8): Use __unused instead of self-assignments.

7 months agolibdmsg: Init a pointer that was used uninitialized in early error paths.
Sascha Wildner [Tue, 22 Sep 2020 19:58:59 +0000 (21:58 +0200)]
libdmsg: Init a pointer that was used uninitialized in early error paths.

7 months agoftpd(8): Fix wrong buffer used in an snprintf()'s sizeof().
Sascha Wildner [Tue, 22 Sep 2020 19:56:14 +0000 (21:56 +0200)]
ftpd(8): Fix wrong buffer used in an snprintf()'s sizeof().

7 months agorwhod(8): Fix a for() loop that was incrementing twice.
Sascha Wildner [Tue, 22 Sep 2020 19:53:46 +0000 (21:53 +0200)]
rwhod(8): Fix a for() loop that was incrementing twice.

7 months agokernel: Provide __udivti3() for intermediate 128-bit calculations.
Sascha Wildner [Mon, 21 Sep 2020 12:58:31 +0000 (14:58 +0200)]
kernel: Provide __udivti3() for intermediate 128-bit calculations.

The recent refactoring of sysclock_t from 32 to 64 bits added -lgcc
to the kernel for this purpose but this approach has a number of
issues:

* It prevents the kernel from linking with clang that does these
  things differently.

* We don't generally want to link the kernel against any userspace
  libraries. Even less if these are GPL licensed libraries.

So the best solution is to provide __udivti3() in the kernel, too.
The code of the __udivmodti4() function (of which __udivti3() is a
special case) was taken from an older LLVM/clang C runtime library
and is MIT licensed. I've added the (dual-)license and list of
contributors.

The commit also adds kernel specific _uint128_t and _int128_t
types. The choice of names is deliberate, in order to avoid
conflicting with internal types provided by compilers.

In-discussion-with: zrj

7 months agosbin/newfs_hammer2: Fix wrong comments on blockrefs in sroot inode
Tomohiro Kusumi [Sat, 19 Sep 2020 20:48:51 +0000 (05:48 +0900)]
sbin/newfs_hammer2: Fix wrong comments on blockrefs in sroot inode

newfs_hammer2 initially only used 1 blockref within sroot inode when
these were written in b33a7e92438b9c9fc915e7c432666385051369db in 2012.

7 months agosys/vfs/hammer2: Fix hammer2_get_vtype() for unsupported objtype
Tomohiro Kusumi [Sat, 19 Sep 2020 14:03:06 +0000 (23:03 +0900)]
sys/vfs/hammer2: Fix hammer2_get_vtype() for unsupported objtype

Also remove obsolete comments.

7 months agobyacc: Update README.DRAGONFLY and config.h.
Sascha Wildner [Sat, 19 Sep 2020 09:32:24 +0000 (11:32 +0200)]
byacc: Update README.DRAGONFLY and config.h.

7 months agoMerge branch 'vendor/BYACC'
Sascha Wildner [Sat, 19 Sep 2020 09:31:31 +0000 (11:31 +0200)]
Merge branch 'vendor/BYACC'

7 months agoImport byacc-20200910 vendor/BYACC
Sascha Wildner [Sat, 19 Sep 2020 09:31:12 +0000 (11:31 +0200)]
Import byacc-20200910

7 months agoFix some more programs for newer byaccs.
Sascha Wildner [Sat, 19 Sep 2020 09:29:41 +0000 (11:29 +0200)]
Fix some more programs for newer byaccs.

7 months agoinet6 - Fix panic after route purge
Matthew Dillon [Fri, 18 Sep 2020 19:55:57 +0000 (12:55 -0700)]
inet6 - Fix panic after route purge

* When the codepath in nd6_timer_dispatch() purges an ia6, it
  then continues on and tests content in the now dead structure,
  resulting in a panic.

* Once an ia6 has been purged we continue the loop at the next
  ia6 instead of falling through and doing more tests.

Reported-by: phma
7 months agoPrepare a few programs for future byacc upgrades.
Sascha Wildner [Fri, 18 Sep 2020 17:49:33 +0000 (19:49 +0200)]
Prepare a few programs for future byacc upgrades.

Conditionalize yylex() prototypes on byacc's patchlevel.

Never byacc provides a prototype for yylex() by default since some time
and this prevents any fallout related to that.

7 months agosys/vfs/hammer2: Remove obsolete hammer2_devblk{radix,size}()
Tomohiro Kusumi [Wed, 16 Sep 2020 16:33:36 +0000 (01:33 +0900)]
sys/vfs/hammer2: Remove obsolete hammer2_devblk{radix,size}()

Remove these functions from 2013 as the comment implies.

Since physical blk size is always 64KiB, radix bits itself
in freemap class variable is redundant, but this commit just
removes two functions without functional changes.

7 months agohier.7: Mention /etc/calendar.
Sascha Wildner [Thu, 17 Sep 2020 08:43:24 +0000 (10:43 +0200)]
hier.7: Mention /etc/calendar.

7 months agoftpd(8): Exit during authentication if an error occurs after chroot().
Antonio Huete Jimenez [Wed, 16 Sep 2020 00:04:57 +0000 (02:04 +0200)]
ftpd(8): Exit during authentication if an error occurs after chroot().

Taken-from: FreeBSD
Security:       CVE-2020-7468

7 months agohack(6): Remove an unused header file.
Sascha Wildner [Wed, 16 Sep 2020 00:05:04 +0000 (02:05 +0200)]
hack(6): Remove an unused header file.

7 months agousr.bin/xargs: Do not report SIGPIPE from children.
Antonio Huete Jimenez [Tue, 15 Sep 2020 23:38:32 +0000 (01:38 +0200)]
usr.bin/xargs: Do not report SIGPIPE from children.

  - Additionally, print the signal name if it's known,
    otherwise just print the signal number. Before only
    the signal number was being reported.

Reported-by: swildner@
Taken-from: OpenBSD

7 months agobinutils227: Backport binutils commit 033bfb739b52
Antonio Huete Jimenez [Sun, 13 Sep 2020 14:54:04 +0000 (14:54 +0000)]
binutils227: Backport binutils commit 033bfb739b52

 - In DPorts, lang/ghc 'configure' phase was failing with this message:

      checking for ld.gold object merging bug (binutils 22266)... Abort trap
      (core dumped) affected
      configure: error: Linker is affected by binutils 22266 but couldn't find
      another unaffected linker. Please set the SettingsMergeObjectsCommand
      variable to a functional linker.
      ===>  Script "configure" failed unexpectedly.
 - https://lists.gnu.org/archive/html/bug-binutils/2017-11/msg00042.html
 - https://gitlab.haskell.org/ghc/ghc/-/issues/14328

Tested-with: buildworld+buildkernel+full dsynth run.

--------
The fix for PR 19291 broke some other cases where -r is used with scripts,
as reported in PR 22266. The original fix for PR 22266 ended up breaking
many cases for REL targets, where the addends are stored in the section data,
and are not being adjusted properly.

The problem was basically that in a relocatable output file (ET_REL),
symbol values are supposed to be relative to the start address of their
section. Usually in a relocatable file, all sections start at 0, so the
failure to get this right is often irrelevant, but with a linker script,
we occasionally see an output section whose starting address is not 0,
and gold would occasionally write a symbol with its relocated value instead
of its section-relative value.

This patch reverts the recent fix for PR 22266 as well as my original fix
for PR 19291. The original fix moved the symbol value adjustment to
write_local_symbols, but neglected to undo a few places where the adjustment
was also being applied, resulting in an occasional double adjustment. The
more recent fix removed those other adjustments, but then failed to
re-account for the adjustment when rewriting the relocations on REL targets.

With the old attempts reverted, we now apply the symbol value adjustment to
the one case that had been missed (non-section symbols in merge sections).
But now we also need to account for the adjustment when rewriting the addends
for RELA relocations.

gold/
PR gold/19291
PR gold/22266
* object.cc (Sized_relobj_file::compute_final_local_value_internal):
Revert changes from 2017-11-08 patch.  Adjust symbol value in
relocatable links for non-section symbols.
(Sized_relobj_file::compute_final_local_value): Revert changes from
2017-11-08 patch.
(Sized_relobj_file::do_finalize_local_symbols): Likewise.
(Sized_relobj_file::write_local_symbols): Revert changes from
2015-11-25 patch.
* object.h (Sized_relobj_file::compute_final_local_value_internal):
Revert changes from 2017-11-08 patch.
* powerpc.cc (Target_powerpc::relocate_relocs): Adjust addend for
relocatable links.
* target-reloc.h (relocate_relocs): Adjust addend for relocatable links.
* testsuite/pr22266_a.c (hello): New function.
* testsuite/pr22266_main.c (main): Add test for merge sections.
* testsuite/pr22266_script.t: Add rule for .rodata.
--------

7 months agobinutils227: Backport binutils commit 333d0055f6f16
Antonio Huete Jimenez [Sun, 13 Sep 2020 14:49:45 +0000 (14:49 +0000)]
binutils227: Backport binutils commit 333d0055f6f16

-------
Fix problems with -r.

The fix committed for PR gold/19291 ended up breaking other cases. The
commit added adjustment code to write_local_symbols, but in many cases
compute_final_local_value_internal had already subtracted the output
section's address. To fix this, all other adjustments are now removed, so
only the one in write_local_symbols is left.

gold/
PR gold/22266
* object.cc (Sized_relobj_file::compute_final_local_value_internal):
Drop relocatable parameter and stop adjusting output value based on
it.
(Sized_relobj_file::compute_final_local_value): Stop passing
relocatable to compute_final_local_value_internal.
(Sized_relobj_file::do_finalize_local_symbols): Ditto.
* object.h (Sized_relobj_file::compute_final_local_value_internal):
Drop relocatable parameter.
-------

7 months agosbin/hammer2: Set error code if "grow" failed
Tomohiro Kusumi [Tue, 15 Sep 2020 16:00:22 +0000 (01:00 +0900)]
sbin/hammer2: Set error code if "grow" failed

7 months agoUpdate the pciconf(8) database.
Sascha Wildner [Tue, 15 Sep 2020 11:15:01 +0000 (13:15 +0200)]
Update the pciconf(8) database.

August 19, 2020 snapshot from https://pci-ids.ucw.cz

7 months agoecclesiastical.c: Fix comment error to easter()
Aaron LI [Mon, 14 Sep 2020 13:53:33 +0000 (21:53 +0800)]
ecclesiastical.c: Fix comment error to easter()

Well, the comment of easter() was copied from orthodox_easter() but
forgot to update it.

Reported-by: Sascha Wildner
7 months agocalendar.1: Fix a grammar mistake and avoid Pinyin symbols
Aaron LI [Mon, 14 Sep 2020 13:52:02 +0000 (21:52 +0800)]
calendar.1: Fix a grammar mistake and avoid Pinyin symbols

7 months agomkcsmapper(1): Move yylex() declaration to the .y file.
Sascha Wildner [Sun, 13 Sep 2020 17:38:13 +0000 (19:38 +0200)]
mkcsmapper(1): Move yylex() declaration to the .y file.

7 months agomille(6): Remove local erasechar()/killchar() definitions.
Sascha Wildner [Sat, 12 Sep 2020 23:56:41 +0000 (01:56 +0200)]
mille(6): Remove local erasechar()/killchar() definitions.

This also reverts f2a508fe031425cd16ce86e24837668eeffbc6f7 which is
no longer needed after this commit.

7 months agosbin/newfs_hammer2: Remove -f in SYNOPSIS
Tomohiro Kusumi [Sat, 12 Sep 2020 16:12:19 +0000 (01:12 +0900)]
sbin/newfs_hammer2: Remove -f in SYNOPSIS

7b2944d3f07cfec26f629f9ed161157b42a0af32 missed removal of -f in SYNOPSIS.

7 months agoedk2: Sync our TianoCore EDK II headers with the edk2-stable202008 tag.
Sascha Wildner [Sat, 12 Sep 2020 09:10:36 +0000 (11:10 +0200)]
edk2: Sync our TianoCore EDK II headers with the edk2-stable202008 tag.

7 months agoUpgrade libressl. 2/2
Daniel Fojt [Sat, 12 Sep 2020 07:43:41 +0000 (09:43 +0200)]
Upgrade libressl. 2/2

Update README.DRAGONFLY.

7 months agoUpgrade libressl. 1/2
Daniel Fojt [Sat, 12 Sep 2020 07:40:26 +0000 (09:40 +0200)]
Upgrade libressl. 1/2

Merge branch 'vendor/LIBRESSL' into master.

7 months agovendor/libressl: upgrade from 3.1.3 to 3.1.4
Daniel Fojt [Fri, 11 Sep 2020 14:58:25 +0000 (16:58 +0200)]
vendor/libressl: upgrade from 3.1.3 to 3.1.4

Interoperability and bug fixes for the TLSv1.3 client:

 * Improve client certificate selection to allow EC certificates
   instead of only RSA certificates.

 * Do not error out if a TLSv1.3 server requests an OCSP response as
   part of a certificate request.

 * Fix SSL_shutdown behavior to match the legacy stack.  The previous
   behaviour could cause a hang.

 * Fix a memory leak and add a missing error check in the handling of
   the key update message.

 * Fix a memory leak in tls13_record_layer_set_traffic_key.

 * Avoid calling freezero with a negative size if a server sends a
   malformed plaintext of all zeroes.

 * Ensure that only PSS may be used with RSA in TLSv1.3 in order
   to avoid using PKCS1-based signatures.

 * Add the P-521 curve to the list of curves supported by default
   in the client.

7 months ago<sys/cdefs.h>: Restore to original behavior for __{BEGIN,END}_DECLS.
Sascha Wildner [Fri, 11 Sep 2020 18:48:33 +0000 (20:48 +0200)]
<sys/cdefs.h>: Restore to original behavior for __{BEGIN,END}_DECLS.

Specifically, to how it was after a1671b4d6c66bceb629394590c46c15be034d14e
until 07a9133651472164d0ff4a0b6ffd6ecec4f46b30. I messed it up a little in
the latter commit.

Add __{BEGIN,END}_PUBLIC_DECLS too.

7 months agosys/vfs/hammer2: Remove unused hammer2_iod_invals sysctl
Tomohiro Kusumi [Fri, 11 Sep 2020 18:40:46 +0000 (03:40 +0900)]
sys/vfs/hammer2: Remove unused hammer2_iod_invals sysctl

No longer used since 85b1f267a5c33386e0761edb93a486fce13e8e88 in 2017.

7 months agosys/vfs/hammer2: Remove unused hammer2_chain_frees sysctl
Tomohiro Kusumi [Fri, 11 Sep 2020 18:37:29 +0000 (03:37 +0900)]
sys/vfs/hammer2: Remove unused hammer2_chain_frees sysctl

Appeared in 7d565a4f16015b664e90560061ad7574c3e68737 in 2016,
but never used.

7 months agosys/vfs/hammer2: Remove unused hammer2_inval_enable sysctl
Tomohiro Kusumi [Fri, 11 Sep 2020 18:34:59 +0000 (03:34 +0900)]
sys/vfs/hammer2: Remove unused hammer2_inval_enable sysctl

No longer used since 85b1f267a5c33386e0761edb93a486fce13e8e88 in 2017.

7 months agodrm/linux: Fix __test_and_set_bit()
François Tigeot [Fri, 11 Sep 2020 17:19:16 +0000 (19:19 +0200)]
drm/linux: Fix __test_and_set_bit()

Its arguments were inverted.

7 months agodrm/linux: Add pagevec_space()
François Tigeot [Fri, 11 Sep 2020 17:12:37 +0000 (19:12 +0200)]
drm/linux: Add pagevec_space()

Obtained-from: OpenBSD

7 months agoterminfo: drop repeat-character capability from 'xterm-new' (2)
Matthew Dillon [Fri, 11 Sep 2020 16:31:18 +0000 (09:31 -0700)]
terminfo: drop repeat-character capability from 'xterm-new' (2)

* Drop all use cases, output is mis-generated in some situations
  (LANG and LC_CTYPE envs both unset, vi (nvi) a file with 0x0000000
  sequences in it).

  Frankly, its beyond stupid to even implement ansi sequences that were
  designed for an era of 1200 baud modems.

* Add comment describing why ansi+rep was removed.

7 months agosbin/newfs_hammer2: Remove/fix obsolete stuff from HAMMER1
Tomohiro Kusumi [Fri, 11 Sep 2020 15:18:20 +0000 (00:18 +0900)]
sbin/newfs_hammer2: Remove/fix obsolete stuff from HAMMER1

Remove unused -f option. HAMMER1 had this to force creation when
devices were smaller than expected, but HAMMER2 has no such limitation.
The man page also had incorrect description.

Fix incorrect code/description for -r option originally from HAMMER1.

7 months agocalendar.1: Fix minor formatting issues
Aaron LI [Fri, 11 Sep 2020 15:02:26 +0000 (23:02 +0800)]
calendar.1: Fix minor formatting issues

* Fix markup of the '-s' flag
* Use 'Cm' to itemize the values of the '-s' flag
* Use 'Rs' and 'Re' macros to format the reference book
* Update the usage text against the man page

7 months agoterminfo: drop repeat-character capability from 'xterm-new'
Daniel Fojt [Fri, 11 Sep 2020 14:12:44 +0000 (16:12 +0200)]
terminfo: drop repeat-character capability from 'xterm-new'

Remove ANSI capability 'rep' from xterm-new entry as it's causing
misbehaviour (at least) in nvi2 editor from base.

Reported by: Matthew Dillon

7 months agoterminfo: avoid alternate buffer in 'xterm-basic'
Daniel Fojt [Thu, 10 Sep 2020 18:01:31 +0000 (20:01 +0200)]
terminfo: avoid alternate buffer in 'xterm-basic'

Remove smcup and rmcup capabilities from xterm-basic entry to avoid screen
content restoration upon leaving viewers and editors (like less, vi, etc).

Reported by: Peeter Must, Matthew Dillon

7 months agocalendar(1): Define some days in Austria in relation to 'Advent' as well.
Sascha Wildner [Fri, 11 Sep 2020 10:27:34 +0000 (12:27 +0200)]
calendar(1): Define some days in Austria in relation to 'Advent' as well.

7 months agocalendar(1): Define various German entries relative to "Advent".
Sascha Wildner [Fri, 11 Sep 2020 06:15:00 +0000 (08:15 +0200)]
calendar(1): Define various German entries relative to "Advent".

Now that we have the special "Advent" day defined, we can make this
much better readable and unambiguous.

7 months agoflex - Fix buildworld issue when compiling on older releases
Matthew Dillon [Fri, 11 Sep 2020 04:11:15 +0000 (21:11 -0700)]
flex - Fix buildworld issue when compiling on older releases

* Conditionalize use of reallocarray() so flex can bootstrap during
  a buildworld on an older release.

7 months agosbin/newfs_hammer2: Fix comments/assert on 4MB segments
Tomohiro Kusumi [Thu, 10 Sep 2020 16:30:18 +0000 (01:30 +0900)]
sbin/newfs_hammer2: Fix comments/assert on 4MB segments

The 4MB segments exist at every 1GB (every level1 freemap),
not every 2GB "zone".

7 months agosys/vfs/hammer2: Remove obsolete comments on volume headers
Tomohiro Kusumi [Thu, 10 Sep 2020 15:36:24 +0000 (00:36 +0900)]
sys/vfs/hammer2: Remove obsolete comments on volume headers

Some comments here from 2012 seem obsolete.

7 months agosys/vfs/hammer2: Remove obsolete comments on hardlink
Tomohiro Kusumi [Thu, 10 Sep 2020 15:25:07 +0000 (00:25 +0900)]
sys/vfs/hammer2: Remove obsolete comments on hardlink

Hardlink in HAMMER2 is dirents which refer to the same inode#.
It was initially designed differently.

7 months agocalendar(1): Remove Volkstrauertag. It's already in calendar.kirche.
Sascha Wildner [Thu, 10 Sep 2020 17:18:39 +0000 (19:18 +0200)]
calendar(1): Remove Volkstrauertag. It's already in calendar.kirche.

7 months agocalendar(1): Add three more commemoration days to the german calendar.
Sascha Wildner [Thu, 10 Sep 2020 14:58:35 +0000 (16:58 +0200)]
calendar(1): Add three more commemoration days to the german calendar.

7 months agoSync tpm(4) with FreeBSD.
Sascha Wildner [Thu, 10 Sep 2020 04:02:11 +0000 (06:02 +0200)]
Sync tpm(4) with FreeBSD.

Adds TPM 2.0 support, mainly.

7 months agosbin/newfs_hammer2: Assert inodes/volhdrs don't cross 64KB boundary
Tomohiro Kusumi [Wed, 9 Sep 2020 16:01:19 +0000 (01:01 +0900)]
sbin/newfs_hammer2: Assert inodes/volhdrs don't cross 64KB boundary

Assert they fit within a pbuf in addition to existing asserts.

7 months agoUpgrade vi(1). 2/2
Daniel Fojt [Tue, 8 Sep 2020 08:49:35 +0000 (10:49 +0200)]
Upgrade vi(1). 2/2

- update README.{DRAGONFLY,DELETED}
- adjust Makefile
- regenerate header files

7 months agoUpgrade vi(1). 1/2
Daniel Fojt [Wed, 9 Sep 2020 06:36:13 +0000 (08:36 +0200)]
Upgrade vi(1). 1/2

Merge branch 'vendor/NVI2' into master.

7 months agovendor/nvi2: upgrade from 2.1.3 to 2.2.0 vendor/NVI2
Daniel Fojt [Mon, 7 Sep 2020 17:33:17 +0000 (19:33 +0200)]
vendor/nvi2: upgrade from 2.1.3 to 2.2.0

Digest of notable changes from git commit messages:

- fix incompatible behaviour of T
- remove a needless NULL-checks before free()
- fix backward sentence deletion
- fix a few memory leaks and a double free
- prevent erroneous COLUMNS/LINES settings
- add Vim-style expandtab option
- align unprintable chars correctly

For complete "git log" see:

https://github.com/lichray/nvi2/commits/master

7 months agosys/vfs/hammer2: Add () around HAMMER2_XOPMASK_* macros
Tomohiro Kusumi [Tue, 8 Sep 2020 16:04:51 +0000 (01:04 +0900)]
sys/vfs/hammer2: Add () around HAMMER2_XOPMASK_* macros

7 months agosys/vfs/hammer2: Change hammer2_bref_type_str() to take btype
Tomohiro Kusumi [Tue, 8 Sep 2020 15:44:04 +0000 (00:44 +0900)]
sys/vfs/hammer2: Change hammer2_bref_type_str() to take btype

struct hammer2_blockref isn't the only data structure with blockref type.

7 months agosys/vfs/hammer2: Add hammer2_adjwritecounter()
Tomohiro Kusumi [Tue, 8 Sep 2020 15:27:57 +0000 (00:27 +0900)]
sys/vfs/hammer2: Add hammer2_adjwritecounter()

Separate counters adjustment from HAMMER2 I/O code.

7 months agosys/vfs/hammer2: Ignore HAMMER2_BREF_TYPE_EMPTY in dio_write_stats_update()
Tomohiro Kusumi [Tue, 8 Sep 2020 15:23:53 +0000 (00:23 +0900)]
sys/vfs/hammer2: Ignore HAMMER2_BREF_TYPE_EMPTY in dio_write_stats_update()

Same as 1de4fc15b2011a762e9001a3ad50d1a0e84e544f except this one
already ignored 0 (HAMMER2_BREF_TYPE_EMPTY).

7 months agosys/vfs/hammer2: Make hammer2_iod_inode_* static
Tomohiro Kusumi [Tue, 8 Sep 2020 15:12:05 +0000 (00:12 +0900)]
sys/vfs/hammer2: Make hammer2_iod_inode_* static

7 months agonrelease: Follow-up commit 10d767c30ac91
Antonio Huete Jimenez [Mon, 7 Sep 2020 23:30:44 +0000 (01:30 +0200)]
nrelease: Follow-up commit 10d767c30ac91

  - In our release disk image, create /firstboot so that any
    rc.d script using the KEYWORD firstboot can be run
    exactly once at boot. Since the firstboot code assumes
    a read-write root filesystem, do not add this file to
    our ISO image.

7 months agosys/vfs/hammer2: Implement missing errors in hammer2_err*_to_err*()
Tomohiro Kusumi [Mon, 7 Sep 2020 16:30:11 +0000 (01:30 +0900)]
sys/vfs/hammer2: Implement missing errors in hammer2_err*_to_err*()

Add missing HAMMER2_ERROR_* compatible with errnos.
The existing conversions stay the same.

7 months agoUpdate to dhcpcd-9.2.0 with the following changes:
Roy Marples [Sun, 6 Sep 2020 16:15:23 +0000 (17:15 +0100)]
Update to dhcpcd-9.2.0 with the following changes:

 * route: ensure IPv4LL routes come last in priority
 * DHCP: fix many issues with extending the last lease
 * privsep: don't read control group from config in privsep
 * privsep: only the master process responds to signals
 * privsep: use a socketpair for stderr/stdin rather than dupping /dev/null
 * privsep: right limit stdin/stderr/stdout
 * privsep: dumping a lease is now run in a sandbox
 * options: check if kernel supports INET or INET6 before enabling default
 * options: let clientid override a prior duid
 * options: allow -1 to represent infinity for requested lease time
 * dhcpcd: fix a crash initing a new interface after route overflow