5 days agoevdev - Change default mask to fix duplicate mouse movement events in X master
Matthew Dillon [Mon, 28 Nov 2022 22:10:22 +0000 (14:10 -0800)]
evdev - Change default mask to fix duplicate mouse movement events in X

* Change the default mask from sysmouse + kbdmux to hw_mouse + hw_kbd,
  which makes it the same as FreeBSD.

* Allows X to now autoconfigure evdev and not receive duplicate mouse
  movement events (really all events but X filters out the duplicate
  button and keyboard events already).

5 days agoopenssh: Adjustments after import
Antonio Huete Jimenez [Mon, 28 Nov 2022 18:30:10 +0000 (19:30 +0100)]
openssh: Adjustments after import

 - Update openbsd-compat
 - Regen config.h , adjusting several defines manually because the
   configure script seems to not detect everything correctly.
 - Add some required source files to SRCS in various programs.

Basic testing done:
 - sshd runs and works, i.e. accepts incoming connections, allows different
   auth methods (interactive, key).
 - X-Forwarding works.
 - Can ssh to other OSes.

5 days agoMerge branch 'vendor/OPENSSH'
Antonio Huete Jimenez [Mon, 28 Nov 2022 18:35:48 +0000 (19:35 +0100)]
Merge branch 'vendor/OPENSSH'

6 days agovendor/OPENSSH: upgrade from 8.8p1 top 9.1p1 vendor/OPENSSH
Antonio Huete Jimenez [Sun, 27 Nov 2022 17:51:33 +0000 (18:51 +0100)]
vendor/OPENSSH: upgrade from 8.8p1 top 9.1p1

Summary of notable changes:

 * sshd(8): fix an integer overflow in the user authentication path
 * ssh(1), sshd(8), ssh-add(1), ssh-agent(1): add a system for
   restricting forwarding and use of keys added to ssh-agent(1)
 * ssh(1): unbreak hostbased auth using RSA keys.
 * sshd(8): fix truncation in rhosts/shosts path construction.
 * ssh(1), sshd(8): use the hybrid Streamlined NTRU Prime + x25519 key
   exchange method by default ("sntrup761x25519-sha512@openssh.com").
   The NTRU algorithm is believed to resist attacks enabled by future
   quantum computers.
 * sftp(1): add a "cp" command to allow the sftp client to perform
   server-side file copies.
 * scp(1): fix a memory leak in argument processing.
 * ssh-keygen(1): double free() in error path of file hashing step in
   signing/verify code;
 * ssh-keyscan(1): fix a one-byte overflow in SSH- banner processing.
   Reported by Qualys
 * sftp-server(8): add a "users-groups-by-id@openssh.com" extension
   request that allows the client to obtain user/group names that
   correspond to a set of uids/gids.
 * sshd(8): improve logging of errors when opening authorized_keys

For a detailed list of changes, please check:

6 days agoAdd the old libssl/libcrypto to TO_REMOVE_LATE
Antonio Huete Jimenez [Sun, 27 Nov 2022 16:46:23 +0000 (17:46 +0100)]
Add the old libssl/libcrypto to TO_REMOVE_LATE

6 days agolibressl: Local modifications after the upgrade (refs #3333)
Antonio Huete Jimenez [Sun, 27 Nov 2022 16:27:36 +0000 (17:27 +0100)]
libressl: Local modifications after the upgrade (refs #3333)

  - Adjust Makefiles to include a number of source files that have been
    either added or moved around.
  - Bump shlib.
  - Forcibly compile in engines by removing OPENSSL_NO_ENGINE which no longer
    seems to be valid to have a full build. We wanted to avoid doing hacks to
    bypass the OPENSSL_NO_ENGINE requirement. As far as we know the engine
    code is disabled anyways.
  - Adjust Makefiles to include a number of source files that have been
    either added or moved around.
  - Bump shlib.
  - Remove HAVE_EVP_DSS1 from config.h to avoid using removed LibreSSL API
   - Adjustments to use the new API.
   - Adjustments to use the new API.
  - Add more source files to the Makefile from libtls, which are now required.

Testing-and-fixes: @dillon, @tuxillo, @aly

6 days agoMerge branch 'vendor/LIBRESSL'
Antonio Huete Jimenez [Sun, 27 Nov 2022 16:29:50 +0000 (17:29 +0100)]
Merge branch 'vendor/LIBRESSL'


8 days agovendor/LIBRESSL: Import LibreSSL 3.6.1 vendor/LIBRESSL
Antonio Huete Jimenez [Sat, 26 Nov 2022 01:38:53 +0000 (02:38 +0100)]
vendor/LIBRESSL: Import LibreSSL 3.6.1

For a full list of changes:


13 days agondp(8): Add gmt2local() as static.
Antonio Huete Jimenez [Sun, 20 Nov 2022 23:52:18 +0000 (00:52 +0100)]
ndp(8): Add gmt2local() as static.

Taken-from: FreeBSD (sbin/setkey)

13 days agotcpdump(8): Raise WARNS to 5
Antonio Huete Jimenez [Sun, 20 Nov 2022 23:48:46 +0000 (00:48 +0100)]
tcpdump(8): Raise WARNS to 5

13 days agotcpdump: Adjustments after the import
Antonio Huete Jimenez [Sun, 20 Nov 2022 23:31:05 +0000 (00:31 +0100)]
tcpdump: Adjustments after the import

 - Add source files to the Makefile
 - Regen config.h

13 days agoMerge branch 'vendor/TCPDUMP'
Antonio Huete Jimenez [Sun, 20 Nov 2022 23:41:57 +0000 (00:41 +0100)]
Merge branch 'vendor/TCPDUMP'


13 days agovendor/TCPDUMP: Import libpcap 4.99.1 vendor/TCPDUMP
Antonio Huete Jimenez [Sun, 20 Nov 2022 01:32:01 +0000 (02:32 +0100)]
vendor/TCPDUMP: Import libpcap 4.99.1

Most significant changes:

 - CVE-2018-16301: For the -F option handle large input files safely.
 - Improve the contents, wording and formatting of the man page.
 - Print unsupported link-layer protocol packets in hex.
 - Add support for new network protocols and DLTs
 - BGP: Fix overwrites of global 'astostr' temporary buffer
 - ARP: fix overwrites of static buffer in q922_string().

See full change log in: https://git.tcpdump.org/tcpdump/blob/HEAD:/CHANGES

2 weeks agolibpcap: Adjustments after the import
Antonio Huete Jimenez [Sat, 19 Nov 2022 21:00:01 +0000 (22:00 +0100)]
libpcap: Adjustments after the import

 - Add HAVE_NET_PF_PFVAR_H define to config.h which allows including
   pfvar.h and if_pflog.h from the system headers. This should be perhaps
 - Leave the PCAP_DONT_INCLUDE_PCAP_BPF_H define in so that we can make
   use of it. Include the system's bpf.h header when defined.
 - tzoff field has been removed from struct pcap

2 weeks agoMerge branch 'vendor/LIBPCAP'
Antonio Huete Jimenez [Sat, 19 Nov 2022 13:38:45 +0000 (14:38 +0100)]
Merge branch 'vendor/LIBPCAP'

2 weeks agovendor/LIBPCAP: Import libpcap 1.10.1 vendor/LIBPCAP
Antonio Huete Jimenez [Sat, 19 Nov 2022 13:11:00 +0000 (14:11 +0100)]
vendor/LIBPCAP: Import libpcap 1.10.1

Most significant changes:

 - Treat ENXIO as meaning "the interface was removed"
 - Add support for capturing on DPDK devices
 - Fix some memory leaks, including in pcap_compile()
 - Fix some thread safety issues

See full change log in: https://git.tcpdump.org/libpcap/blob/HEAD:/CHANGES

2 weeks agocontrib/libpcap: Revert local modifications before import
Antonio Huete Jimenez [Sat, 19 Nov 2022 13:19:31 +0000 (14:19 +0100)]
contrib/libpcap: Revert local modifications before import

2 weeks agolibedit: Adjustments after the import
Antonio Huete Jimenez [Sat, 19 Nov 2022 12:55:13 +0000 (13:55 +0100)]
libedit: Adjustments after the import

2 weeks agoMerge branch 'vendor/LIBEDIT'
Antonio Huete Jimenez [Thu, 17 Nov 2022 23:52:24 +0000 (00:52 +0100)]
Merge branch 'vendor/LIBEDIT'

2 weeks agoPRIV: Missed a removal
Antonio Huete Jimenez [Thu, 17 Nov 2022 23:15:38 +0000 (00:15 +0100)]
PRIV: Missed a removal

2 weeks agoKERN_PROC - Change behavior and bump version to 600302
Matthew Dillon [Thu, 17 Nov 2022 22:31:05 +0000 (14:31 -0800)]
KERN_PROC - Change behavior and bump version to 600302

* Change default behavior to not include pure LWPs.  That is, to not
  include pure kernel threads without a process (pid returned as -1).

* Add a flag KERN_PROC_FLAG_LWKT to re-include the LWPs for programs
  that don't get confused by them.

* Adjust /bin/ps and /usr/bin/top to use the flag.  Also conditionalized
  on the existance of the flag so buildworld on older systems doesn't

* Clean-up the sysctl kernel interface for KERN_PROC a bit, since adding
  the flag creates a lot more combinations that need to be handled as
  discrete sysctls.

2 weeks agovendor/libedit: upgrade from 2019-12-31 to 2022-10-30 vendor/LIBEDIT
Antonio Huete Jimenez [Thu, 17 Nov 2022 22:17:38 +0000 (23:17 +0100)]
vendor/libedit: upgrade from 2019-12-31 to 2022-10-30

Most significant changes:

 - Fix filename autocompletion for strings like a\)b
 - Correct declaration of hook functions.
 - Add support for rl_delete_text and rl_set_key
 - Improve readline compatibility by adding rl_readline_state support.
 - fix memory issues found by fuzzing (double frees and buffer overflows)

See full change log in: https://www.thrysoee.dk/editline/

2 weeks agolibarchive: Adjustments after the 3.6.1 import
Antonio Huete Jimenez [Thu, 17 Nov 2022 21:12:38 +0000 (22:12 +0100)]
libarchive: Adjustments after the 3.6.1 import

2 weeks agoMerge branch 'vendor/LIBARCHIVE'
Antonio Huete Jimenez [Thu, 17 Nov 2022 16:58:19 +0000 (17:58 +0100)]
Merge branch 'vendor/LIBARCHIVE'

2 weeks agoPRIV: Handle libpanel and libzstd in case it is needed
Antonio Huete Jimenez [Sun, 13 Nov 2022 23:47:03 +0000 (00:47 +0100)]
PRIV: Handle libpanel and libzstd in case it is needed

2 weeks agovendor/libarchive: upgrade from 3.4.3 to 3.6.1 vendor/LIBARCHIVE
Antonio Huete Jimenez [Sun, 13 Nov 2022 22:25:21 +0000 (23:25 +0100)]
vendor/libarchive: upgrade from 3.4.3 to 3.6.1

Notable changes:

 - 7zip reader: fix PPMD read beyond boundary (#1671)
 - ZIP reader: fix possible out of bounds read (OSS-Fuzz 38766 #1672)
 - ISO reader: fix possible heap buffer overflow in read_children()
 - tar: new option "--no-read-sparse" (#1614)
 - ZIP reader: zstd decompression support (#1518)
 - extended fix for following symlinks when processing the fixup
   list (#1566, #1617, CVE-2021-31566)
 - fix invalid memory access and out of bounds read in RAR5 reader
   (#1491, #1492, #1493, CVE-2021-36976)
 - ZIP reader: Support of deflate algorithm in symbolic link
   decompression (#1509)
 - do not follow symlinks when processing the fixup list (#1566)
 - fixed extraction of archives with hard links pointing to itself (#1381)
 - fixed memory leaks in error case of archive_write_open() functions (#1456)

For details, see release notes or commit history on github:

2 weeks agoless: Local changes after the merge
Antonio Huete Jimenez [Sun, 13 Nov 2022 19:15:04 +0000 (20:15 +0100)]
less: Local changes after the merge

 - Adjust READMEs
 - Add more SRCS to the Makefile
 - Regen defines.h

2 weeks agoMerge branch 'vendor/LESS'
Antonio Huete Jimenez [Sun, 13 Nov 2022 18:03:51 +0000 (19:03 +0100)]
Merge branch 'vendor/LESS'


2 weeks agovendor/less: upgrade from 551 to 608 vendor/LESS
Antonio Huete Jimenez [Sun, 13 Nov 2022 17:46:01 +0000 (18:46 +0100)]
vendor/less: upgrade from 551 to 608

 - Update Unicode tables.
 - Fix memory corruption when built with libtermcap.
 - Support libtinfow.
 - Fix crash on some systems due to realpath incompatibility.
 - Add the --incsearch option.
 - Add the --line-num-width option.
 - Add the --status-col-width option.
 - Add the --use-color and --color options.
 - Add the --lesskey-src option.
 - Add the --file-size option.
 - Add the --header option.
 - Add the --no-number-headers option.
 - Add the --status-line option.
 - Add the --redraw-on-quit option.
 - Add the --search-options option.
 - Add the --exit-follow-on-close option.
 - Fix bug which caused failure to respond to window resize.

For details see:

2 weeks agoldns: Adjust makefiles for ldns-1.8.3 update.
Antonio Huete Jimenez [Sun, 13 Nov 2022 01:12:24 +0000 (02:12 +0100)]
ldns: Adjust makefiles for ldns-1.8.3 update.

 - Bump soname for api changes, 1.8.3 has major as 3.
 - Update ldns/ headers and remove them from the vendor branch.
 - Adjust lib/libssh Makefile to include the headers from ldns.
 - Update READMES.

Currently only user of the libprivate_ldns is drill(1).
OpenSSH will be adjusted to use this lib next.

2 weeks agoMerge branch 'vendor/LDNS'
Antonio Huete Jimenez [Sun, 13 Nov 2022 12:26:25 +0000 (13:26 +0100)]
Merge branch 'vendor/LDNS'

2 weeks agovendor/ldns: upgrade from 1.7.1 to 1.8.3
Antonio Huete Jimenez [Sat, 12 Nov 2022 18:43:26 +0000 (19:43 +0100)]
vendor/ldns: upgrade from 1.7.1 to 1.8.3

Notable changes:

 * bugfix #50: heap Out-of-bound Read vulnerability in rr_frm_str_internal
   reported by pokerfacett.
 * bugfix #51: Heap Out-of-bound Read vulnerability in ldns_nsec3_salt_data
   reported by pokerfacett.
 * Fix memory leak in examples/ldns-testns handle_tcp routine.
 * Detect fixed time memory compare for openssl 0.9.8.
 * Fix -U flag with ldns-signzone. Thanks Ulrich and Jonathan
 * bugfix #166: Grow buffer when writing chars and fixed size
   strings when converting to presentation format, preventing
   potential assersion errors.
 * bugfix #183: Assertion failure with OPT record without rdata.
   This caused packet creation with only a DO bit (for DNSSEC OK)
   to crash. Thanks Anand Buddhdev and others for reporting this
   so quickly.

For details see commit history or changelog on github:


3 weeks agofile: Local changes after the merge.
Antonio Huete Jimenez [Sat, 12 Nov 2022 17:47:11 +0000 (18:47 +0100)]
file: Local changes after the merge.

3 weeks agoMerge branch 'vendor/FILE'
Antonio Huete Jimenez [Sat, 12 Nov 2022 17:40:03 +0000 (18:40 +0100)]
Merge branch 'vendor/FILE'


3 weeks agovendor/file: upgrade from 5.41 to 5.43 vendor/FILE
Antonio Huete Jimenez [Sat, 12 Nov 2022 17:38:06 +0000 (18:38 +0100)]
vendor/file: upgrade from 5.41 to 5.43

For details, see ChangeLog.

3 weeks agolibexpat: Local changes after the merge.
Antonio Huete Jimenez [Sat, 12 Nov 2022 17:27:24 +0000 (18:27 +0100)]
libexpat: Local changes after the merge.

3 weeks agoMerge branch 'vendor/EXPAT'
Antonio Huete Jimenez [Sat, 12 Nov 2022 16:11:49 +0000 (17:11 +0100)]
Merge branch 'vendor/EXPAT'

3 weeks agovendor/expat: upgrade from 2.1.0 to 2.5.0 vendor/EXPAT
Antonio Huete Jimenez [Sat, 12 Nov 2022 15:38:24 +0000 (16:38 +0100)]
vendor/expat: upgrade from 2.1.0 to 2.5.0

Summary of notable changes:

 - Detect overflow from len=INT_MAX call to XML_Parse
 - Fix a dangling pointer issue related to realloc
 - Fix copying of partial characters for UTF-8 input
 - Avoid doing arithmetic with NULL pointers in XML_GetBuffer
 - Fix reading uninitialized variable during parsing
 - CVE-2015-1283 - Multiple integer overflows in XML_GetBuffer
 - Fix potential null pointer dereference
 - Following CVEs were handled (not a complete list)
   CVE-2016-0718, CVE-2016-4472, CVE-2016-5300, CVE-2012-0876
   CVE-2012-6702, CVE-2017-9233, CVE-2016-9063, CVE-2018-20843
   CVE-2019-15903,CVE-2013-0340/CWE-776, CVE-2021-45960
   CVE-2021-46143, CVE-2022-22822 to CVE-2022-22827
   CVE-2022-23852, CVE-2022-23990, CVE-2022-43680

For detailed list of all changes, bugfixes and improvements, see Changes.

3 weeks agoxargs(1): Sync with FreeBSD
Antonio Huete Jimenez [Sat, 12 Nov 2022 12:01:40 +0000 (13:01 +0100)]
xargs(1): Sync with FreeBSD

 - fix exit code when using -P
 - fix description of strnsubst return value
 - terminate if line replacement cannot be constructed
 - compile yesexpr as ERE
 - add some long options for GNU compatibility
 - Add EXAMPLES to man page

3 weeks agousr.sbin/makefs: Sync with sys/vfs/hammer2
Tomohiro Kusumi [Fri, 11 Nov 2022 08:10:27 +0000 (00:10 -0800)]
usr.sbin/makefs: Sync with sys/vfs/hammer2

Sync with following sys/vfs/hammer2 commits.

$ git log --pretty="%h %s" 185ae703d726eb41fe0f44e432a9575d06b2ba45.. -- sys/vfs/hammer2/
ae4718daaa sys/vfs/hammer2: Remove redundant "spmp->iroot = NULL;"
ee92f60939 sys/vfs/hammer2: Fix many comments
be41253d2a sys/vfs/hammer2: Rename HAMMER2_BREF_FLAG_ZERO -> HAMMER2_BREF_FLAG_UNUSED
64eadfb368 sys/vfs/hammer2: Fix incorrect reservedXXX names in ondisk structure
6feb58ab26 sys/vfs/hammer2: Minor cleanups for hammer2_disk.h
4b2ec0813c sys/vfs/hammer2: Move HAMMER2_{CHECK,COMP}_STRINGS to sbin/hammer2
cca587dd52 sys/vfs/hammer2: Move HAMMER2_METH_DEFAULT from hammer2_disk.h to hammer2.h
d21704d78e sys/vfs/hammer2: Fix a typo in a source code comment
fac0c41fdd sys/vfs/hammer2: Fix "already initialized" multi-volumes error message
6763396fd5 sys/vfs/hammer2: Remove redundant error check in hammer2_vfs_mount()
12757b74e2 sys/vfs/hammer2: Make fchain/vchain dump on last drop consistent
a011271d2d sys/vfs/hammer2: Remove comments on removed stuff
e6a1580946 sys/vfs/hammer2: Remove obsolete comment on HAMMER2_RESOLVE_RDONLY
e8e30c7644 sys/vfs/hammer2: Remove obsolete comment in hammer2_vop_readdir()
25b8f48546 sys/vfs/hammer2: #if0 hammer2_chain_lock_unhold()/hammer2_chain_unlock_hold()
b5513ad07d sys/vfs/hammer2: Use correct XOP struct in hammer2_xop_{lookup,delete}
5b691df11e sys/vfs/hammer2: hammer2_dump_chain() should belong to hammer2_chain.c
92931eab21 sys/vfs/hammer2: Use HAMMER2_PFSTYPE_NONE rather than 0
16f0b63d7f sys/vfs/hammer2: Make sure PFS exists after chain lookup on mount
4b0205e630 sys/vfs/hammer2: hammer2_ioctl_inode_{get,set} never returns error
634b6e30ca sys/vfs/hammer2: Add include guard for hammer2_xxhash.h
bc7ea12e61 sbin/hammer2: Remove HAMMER1 comment from dirhash()
47f63aa5d3 sys/vfs/hammer2: Rename hammer2_chain_core_init() -> hammer2_chain_init()
507074cda8 sys/vfs/hammer2: Change readonly purpose sysctls to CTLFLAG_RD
39b691836e sys/vfs/hammer2: Use __debugvar for RB_INSERT() result only used in KKASSERT
a4959f8900 sys/vfs/hammer2: Use __debugvar rather than trying to use it outside KASSERT
9944926ceb sys/vfs/hammer2: Avoid unused warning when !INVARIANTS

3 weeks agotzsetup(8): Do not use dlg_calloc() which is now internal to libdialog
Antonio Huete Jimenez [Wed, 9 Nov 2022 23:39:56 +0000 (00:39 +0100)]
tzsetup(8): Do not use dlg_calloc() which is now internal to libdialog

3 weeks agodialog(1): Adjustments after upgrade merge.
Antonio Huete Jimenez [Wed, 9 Nov 2022 23:15:48 +0000 (00:15 +0100)]
dialog(1): Adjustments after upgrade merge.

- adapt libdialog/Makefile
- regenerate dlg_config.h

3 weeks agoMerge branch 'vendor/DIALOG'
Antonio Huete Jimenez [Thu, 10 Nov 2022 17:49:35 +0000 (18:49 +0100)]
Merge branch 'vendor/DIALOG'

3 weeks agosys/vfs/hammer2: Remove redundant "spmp->iroot = NULL;"
Tomohiro Kusumi [Thu, 10 Nov 2022 09:41:46 +0000 (01:41 -0800)]
sys/vfs/hammer2: Remove redundant "spmp->iroot = NULL;"

3 weeks agovendor/dialog: upgrade from 1.3-20200327 to 1.3-20220728 vendor/DIALOG
Antonio Huete Jimenez [Wed, 9 Nov 2022 23:01:09 +0000 (00:01 +0100)]
vendor/dialog: upgrade from 1.3-20200327 to 1.3-20220728

Summary of notable changes:

 + initialize color-settings before --create-rc option is processed.
 + adjust fallback bindings for backspace/delete to match the curses
   library's sense of backspace (Arch #74379).
 + improve logic for updating form-height after screen-resizing.
 + correct off-by-one limit for month when validating parameters of the
   calendar widget (patch by "viverna", Debian #1000720).
 + use mktemp utility rather than tempfile for temporary filename in
   the sample scripts (patch by Ville Skytt√§).
 + directly include stddef.h for systems which need it for offsetof().
 + fix a few cppcheck warnings
 + update configure macros, for quoting/escaping fixes per shellcheck
 + add option "--cursor-off-label"
 + add option "--erase-on-exit"
 + add dlg_getenv_num() and dlg_getenv_str().

For detailed list of all changes, bugfixes and improvements, see CHANGES.

3 weeks agobyacc: Update README.DRAGONFLY and config.h
Antonio Huete Jimenez [Wed, 9 Nov 2022 20:41:39 +0000 (21:41 +0100)]
byacc: Update README.DRAGONFLY and config.h

3 weeks agoMerge branch 'vendor/BYACC'
Antonio Huete Jimenez [Wed, 9 Nov 2022 20:38:16 +0000 (21:38 +0100)]
Merge branch 'vendor/BYACC'

3 weeks agovendor/byacc: upgrade from 20200910 to 20221106 vendor/BYACC
Antonio Huete Jimenez [Wed, 9 Nov 2022 19:57:12 +0000 (20:57 +0100)]
vendor/byacc: upgrade from 20200910 to 20221106

Summary of notable changes:

 o yacc.1: minor fixes with check-manpage
 o mkpar.c: change printf format to allow for long-YYINT
 o output.c:
   - add a state-machine to output_semantic_actions() to detect and replace
 o main.c:
   - account for a memory-leak
   - add "-h" option
 o reader.c, output.c:
   - improve loop which skips backward through a (possibly nested) sequence
     of square-brackets.
   - change a few malloc's to calloc's so clang analyzer can
     see initialized data.
   - fix memory-leak when replacing $$'s in destructor code
     (report/testcase by Boris Kolpackov).

For a detailed change list see CHANGES.

3 weeks agomake(1): Adjustments after the upgrade.
Antonio Huete Jimenez [Wed, 9 Nov 2022 13:22:22 +0000 (14:22 +0100)]
make(1): Adjustments after the upgrade.

3 weeks agoMerge branch 'vendor/BMAKE'
Antonio Huete Jimenez [Wed, 9 Nov 2022 13:52:46 +0000 (14:52 +0100)]
Merge branch 'vendor/BMAKE'


3 weeks agovendor/bmake: upgrade from 20210314 to 20220928 vendor/BMAKE
Antonio Huete Jimenez [Wed, 9 Nov 2022 11:50:16 +0000 (12:50 +0100)]
vendor/bmake: upgrade from 20210314 to 20220928

Summary of notable changes:

 o Fix bug in .break reset of conditional depth.
 o Man page updates.
 o Allow .break to terminate a .for loop early.
 o Fix exit status for '-q' (since 1994)
 o fix memory leak for filenames in .for loops
 o job.c: fix handling of null bytes in output.
 o cond.c:
   - add more details to error message for numeric comparison.
   - fix mem leak in CondParser_Leaf
 o var.c:
   - fix out-of-bounds errors when parsing.
   -fix memory leak in error case of the ':?' modifier
 o lst.c: fix mem leak in Lst_Remove
 o parse.c:
   - fix out-of-bounds read when parsing an invalid line.
   - fix memory leak in wildcard targets and sources
   - fix off-by-one error in buffer for .WAIT nodes

For detailed list see ChangeLog.

3 weeks agocontrib/awk: Fix typo in README.DRAGONFLY
Antonio Huete Jimenez [Wed, 9 Nov 2022 11:17:13 +0000 (12:17 +0100)]
contrib/awk: Fix typo in README.DRAGONFLY

3 weeks agoawk(1): Adjustments after the import
Antonio Huete Jimenez [Wed, 9 Nov 2022 10:58:59 +0000 (11:58 +0100)]
awk(1): Adjustments after the import

 - ytab.h has now become awkgram.tab.h

3 weeks agoMerge branch 'vendor/AWK'
Antonio Huete Jimenez [Wed, 9 Nov 2022 11:15:27 +0000 (12:15 +0100)]
Merge branch 'vendor/AWK'

3 weeks agovendor/awk: upgrade from 20200702 to 20220912 vendor/AWK
Antonio Huete Jimenez [Wed, 9 Nov 2022 08:42:35 +0000 (09:42 +0100)]
vendor/awk: upgrade from 20200702 to 20220912

Bugfixes and maintenance:

- Clean up xfree, remove redundant NULL check.
- Stop leaking tempcells from extra arguments in format.
- Fix leak of qstring result in setclvar.
- Fix leak of regex string representations.
- Fix memory leak in string assignment to built-ins.
- Eliminate file management memory leak.
- When closing, don't flush input streams
- Heap buffer overflow from PR #83 fixed in #121.

For details, see FIXES, or commit history at

3 weeks agojail.8 : update the manpage date
Pierre-Alain TORET [Tue, 8 Nov 2022 08:18:56 +0000 (09:18 +0100)]
jail.8 : update the manpage date

3 weeks agojail.8 : syscall net_raw_sockets has been renamed allow_raw_sockets
Pierre-Alain TORET [Mon, 7 Nov 2022 21:07:36 +0000 (22:07 +0100)]
jail.8 : syscall net_raw_sockets has been renamed allow_raw_sockets

4 weeks agosbin/hammer2: Fix build error on i386
Tomohiro Kusumi [Sun, 6 Nov 2022 02:04:46 +0000 (19:04 -0700)]
sbin/hammer2: Fix build error on i386

error: format specifies type 'long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]

4 weeks agosbin/hammer2: Apply fac0c41fdd to user space ondisk.c
Tomohiro Kusumi [Sat, 5 Nov 2022 06:47:14 +0000 (23:47 -0700)]
sbin/hammer2: Apply fac0c41fdd to user space ondisk.c

4 weeks agosys/vfs/hammer2: Fix many comments
Tomohiro Kusumi [Sat, 5 Nov 2022 05:30:18 +0000 (22:30 -0700)]
sys/vfs/hammer2: Fix many comments

* "lru_spin; /* inumber lookup */" -> lru_spin isn't for inode.

* "If an error occurred we eat the lock" -> "eat the lock" was
  removed in c603b86b77206805493fc181d3576ecd1786e056 in 2015.
  The rest of the comment (not removed) seems obsolete too.

* "removed from the parent's btree" -> Typo for rbtree.

* "pointing it to an embedded data structure and copying the data from the buffer"
  -> No longer implemented like this since
  01eabad4d93a8dc8f0f01a6209b384b1e010bb8c in 2012.

* "Called to clean up cached DIOs on umount" -> This isn't specific to
  unmount, called regularly if iofree_count > dio_limit.

* "voldata is not yet loaded" -> It's already loaded.

* "so do not pass cluster", etc -> "cluster" no longer appears
  here since b7add6753e221920947c96fab3314c39a2f67fe4 in 2015.

* "multiple hammer2_inode structures can be aliased to the same chain
  element, for example for hardlinks" -> This comment from 2013
  seems to only apply to hardlink mechanism back then, which was
  something completely different.

4 weeks agobin/ls: Fix mismatched parentheses.
Antonio Huete Jimenez [Sat, 5 Nov 2022 13:09:44 +0000 (14:09 +0100)]
bin/ls: Fix mismatched parentheses.

Submitted-by: piecuch (closes #3322)
4 weeks agodsynth - Implement a new 'add' directive
Matthew Dillon [Fri, 4 Nov 2022 23:52:57 +0000 (16:52 -0700)]
dsynth - Implement a new 'add' directive

* This directive allows adding additional port(s) to the build list
  of a running dsynth.  It can be useful when the user does not wish
  to interrupt the running dsynth but wishes to add more ports and then
  leave the dsynth unintended.  For example because it might be half
  way through building a huge package and interrupting it would be bad.

* dsynth will complete the current build as-per normal, including
  rebuilding the repository if it would normally do so (without asking
  interactively), and will then re-exec itself with the same options
  and directive for the additional ports that were added in the interim.

4 weeks agodsynth - Add Check_plist config file option
Matthew Dillon [Fri, 4 Nov 2022 21:54:05 +0000 (14:54 -0700)]
dsynth - Add Check_plist config file option

* dsynth -P turns on plist checking for builds.  Note that this
  feature is already automatically turned on when the 'everything'
  and 'test' directives are used.

* Add a Check_plist configuration file option that does the same thing
  so -P does not have to be specified if the developer wants to always do
  plist checking.

Requested-by: daftaupe
5 weeks agosys/vfs/hammer2: Rename HAMMER2_BREF_FLAG_ZERO -> HAMMER2_BREF_FLAG_UNUSED
Tomohiro Kusumi [Sat, 29 Oct 2022 11:15:40 +0000 (04:15 -0700)]

Unused since 58898c0eb3f3dcaecea7216c70e96b4be4a3ff7f in 2020.
Rename it to UNUSED rather than "NO LONGER USED" comment.

5 weeks agosys/vfs/hammer2: Fix incorrect reservedXXX names in ondisk structure
Tomohiro Kusumi [Sat, 29 Oct 2022 10:59:25 +0000 (03:59 -0700)]
sys/vfs/hammer2: Fix incorrect reservedXXX names in ondisk structure

These names don't match comments right next to them.
Also fix typo UNMUSED -> UNUSED.

These aren't used by anyone in kernel or user space.

5 weeks agosys/vfs/hammer2: Minor cleanups for hammer2_disk.h
Tomohiro Kusumi [Sat, 29 Oct 2022 06:20:18 +0000 (23:20 -0700)]
sys/vfs/hammer2: Minor cleanups for hammer2_disk.h

5 weeks agosys/vfs/hammer2: Move HAMMER2_{CHECK,COMP}_STRINGS to sbin/hammer2
Tomohiro Kusumi [Sat, 29 Oct 2022 06:16:12 +0000 (23:16 -0700)]
sys/vfs/hammer2: Move HAMMER2_{CHECK,COMP}_STRINGS to sbin/hammer2

These are just arrays of names used by sbin/hammer2 directives,
so nothing directly to do with ondisk structure.

HAMMER2_CHECK_STRINGS also only reflects names used by sbin/hammer2 directives.

5 weeks agosys/vfs/hammer2: Move HAMMER2_METH_DEFAULT from hammer2_disk.h to hammer2.h
Tomohiro Kusumi [Sat, 29 Oct 2022 06:12:05 +0000 (23:12 -0700)]
sys/vfs/hammer2: Move HAMMER2_METH_DEFAULT from hammer2_disk.h to hammer2.h

As the comment explains, this is just a flag for HAMMER2 function,
so nothing directly to do with ondisk structure.

makefs(8) also needs this change as it depends on hammer2_disk.h.

5 weeks agosys/vfs/hammer2: Fix a typo in a source code comment
Tomohiro Kusumi [Fri, 28 Oct 2022 06:40:06 +0000 (23:40 -0700)]
sys/vfs/hammer2: Fix a typo in a source code comment

- s/Miscellanious/Miscellaneous/

taken-from FreeBSD c254580cc2616ca7049a9afb06382025d4d21300

5 weeks agosys/vfs/hammer2: Fix "already initialized" multi-volumes error message
Tomohiro Kusumi [Thu, 27 Oct 2022 06:46:30 +0000 (23:46 -0700)]
sys/vfs/hammer2: Fix "already initialized" multi-volumes error message

It's not "path" that's already initialized,
but rather same "volume id" (likely from a different device path)
that's already initialized and registered to the volumes list.

5 weeks agosys/vfs/hammer2: Remove redundant error check in hammer2_vfs_mount()
Tomohiro Kusumi [Mon, 24 Oct 2022 07:24:37 +0000 (00:24 -0700)]
sys/vfs/hammer2: Remove redundant error check in hammer2_vfs_mount()

The error is always 0 at this point, and devvps must always be opened.
While here zero initialize error on update mount.

7 weeks agosys/vfs/hammer2: Make fchain/vchain dump on last drop consistent
Tomohiro Kusumi [Thu, 13 Oct 2022 08:10:05 +0000 (01:10 -0700)]
sys/vfs/hammer2: Make fchain/vchain dump on last drop consistent

fchain/vchain are both non kmalloc'd chains, but hammer2_dump_chain()
should be called either before or after last drop for both.

It currently results in showing inconsistent refs (0 and 1).

7 weeks agosys/vfs/hammer2: Remove comments on removed stuff
Tomohiro Kusumi [Tue, 11 Oct 2022 07:30:16 +0000 (00:30 -0700)]
sys/vfs/hammer2: Remove comments on removed stuff

HAMMER2_XOP_SYNCHRONIZER appeared only in this comment in
c847e8387ad749d611d395742d337213aefef3b9 in 2015, and never actually existed.

ECHECK appeared only in this comment in
f3bfcc3fda3d70dd80cbb0440b5b8649ca2d07de in 2022, and never actually existed.

"layerq" was removed in 8138a154be31c3db1d8bd046ca7b003a6c79c01c in 2014.

io_complete() was removed in 85b1f267a5c33386e0761edb93a486fce13e8e88 in 2017.

8 weeks agosys/vfs/hammer2: Remove obsolete comment on HAMMER2_RESOLVE_RDONLY
Tomohiro Kusumi [Wed, 5 Oct 2022 04:30:40 +0000 (21:30 -0700)]
sys/vfs/hammer2: Remove obsolete comment on HAMMER2_RESOLVE_RDONLY

d2a410239c107d0aeceaf0a17417e92b75be24ed in 2018.

8 weeks agosys/vfs/hammer2: Remove obsolete comment in hammer2_vop_readdir()
Tomohiro Kusumi [Tue, 4 Oct 2022 06:12:05 +0000 (23:12 -0700)]
sys/vfs/hammer2: Remove obsolete comment in hammer2_vop_readdir()

This comment from around 2014 no longer matches the code.
e.g. There is no "parent" in hammer2_vop_readdir().

8 weeks agosys/vfs/hammer2: #if0 hammer2_chain_lock_unhold()/hammer2_chain_unlock_hold()
Tomohiro Kusumi [Mon, 3 Oct 2022 06:47:04 +0000 (23:47 -0700)]
sys/vfs/hammer2: #if0 hammer2_chain_lock_unhold()/hammer2_chain_unlock_hold()

for clarity.
These two functions were never used since first appeared in
6d51e13ade73a84bc976316303593a37f14a3753 in 2016.

8 weeks agosys/vfs/hammer2: Use correct XOP struct in hammer2_xop_{lookup,delete}
Tomohiro Kusumi [Mon, 3 Oct 2022 06:27:44 +0000 (23:27 -0700)]
sys/vfs/hammer2: Use correct XOP struct in hammer2_xop_{lookup,delete}

Callers of these XOP use hammer2_xop_lookup_t,
but the XOP implementation takes it as hammer2_xop_scanlhc_t.
It was working as the definition of these structs are the same.

Apparently hammer2_xop_lookup() should be using hammer2_xop_lookup_t.
hammer2_xop_delete() should be using hammer2_xop_lookup_t too given
similarity in its implementation (i.e. caller side is correct).

2 months agosys/vfs/hammer2: hammer2_dump_chain() should belong to hammer2_chain.c
Tomohiro Kusumi [Mon, 3 Oct 2022 06:12:38 +0000 (23:12 -0700)]
sys/vfs/hammer2: hammer2_dump_chain() should belong to hammer2_chain.c

2 months agosys/vfs/hammer2: Use HAMMER2_PFSTYPE_NONE rather than 0
Tomohiro Kusumi [Thu, 29 Sep 2022 04:01:19 +0000 (21:01 -0700)]
sys/vfs/hammer2: Use HAMMER2_PFSTYPE_NONE rather than 0

2 months agosys/vfs/hammer2: Make sure PFS exists after chain lookup on mount
Tomohiro Kusumi [Tue, 27 Sep 2022 08:02:52 +0000 (01:02 -0700)]
sys/vfs/hammer2: Make sure PFS exists after chain lookup on mount

If pmp is NULL at this point, it panics, so return EINVAL.

What makes the existing code complicated is pmp could have already
been found via @label matching about 300 lines above, regardless of
chain lookup result right before this diff.

So return EINVAL on `pmp == NULL` rather than `chain->error != 0`.
In any case, something is wrong if chain lookup failed despite pmp.

2 months agosys/vfs/hammer2: hammer2_ioctl_inode_{get,set} never returns error
Tomohiro Kusumi [Tue, 27 Sep 2022 04:13:40 +0000 (21:13 -0700)]
sys/vfs/hammer2: hammer2_ioctl_inode_{get,set} never returns error

No need to do hammer2_error_to_errno(error).

2 months agosys/vfs/hammer2: Add include guard for hammer2_xxhash.h
Tomohiro Kusumi [Tue, 27 Sep 2022 04:10:24 +0000 (21:10 -0700)]
sys/vfs/hammer2: Add include guard for hammer2_xxhash.h

2 months agosbin/hammer2: Remove HAMMER1 comment from dirhash()
Tomohiro Kusumi [Sun, 25 Sep 2022 09:20:05 +0000 (02:20 -0700)]
sbin/hammer2: Remove HAMMER1 comment from dirhash()

and sync with hammer2_dirhash() which doesn't have this comment.
The latter half of the comment doesn't apply.

2 months agosys/vfs/hammer2: Rename hammer2_chain_core_init() -> hammer2_chain_init()
Tomohiro Kusumi [Sat, 24 Sep 2022 08:11:08 +0000 (01:11 -0700)]
sys/vfs/hammer2: Rename hammer2_chain_core_init() -> hammer2_chain_init()

Currently this function is just a common function to initialize chains.
What it initializes are no longer limited to chain->core as opposed to
when it first appeared in 0dea3156dc9c037aae4fd9fb00c631a401f62e5a in 2013.

Remove "core" for clarity and remove irrelevant comment.

2 months agosys/vfs/hammer2: Change readonly purpose sysctls to CTLFLAG_RD
Tomohiro Kusumi [Sat, 24 Sep 2022 06:12:10 +0000 (23:12 -0700)]
sys/vfs/hammer2: Change readonly purpose sysctls to CTLFLAG_RD

read/write/allocation/process counters shouldn't be writable.

2 months agosys/vfs/hammer2: Use __debugvar for RB_INSERT() result only used in KKASSERT
Tomohiro Kusumi [Fri, 23 Sep 2022 07:10:12 +0000 (00:10 -0700)]
sys/vfs/hammer2: Use __debugvar for RB_INSERT() result only used in KKASSERT

2 months agosys/vfs/hammer2: Use __debugvar rather than trying to use it outside KASSERT
Tomohiro Kusumi [Wed, 21 Sep 2022 03:05:13 +0000 (20:05 -0700)]
sys/vfs/hammer2: Use __debugvar rather than trying to use it outside KASSERT

Redo 9944926ceb4c39de216e512f60f1841d25e267f1.

suggested-by: swildner

2 months agosys/vfs/hammer2: Avoid unused warning when !INVARIANTS
Tomohiro Kusumi [Sun, 18 Sep 2022 10:15:12 +0000 (03:15 -0700)]
sys/vfs/hammer2: Avoid unused warning when !INVARIANTS

Use xchain local variable.
error: variable 'xchain' set but not used [-Werror,-Wunused-but-set-variable]

2 months agousr.sbin/makefs: Sync with sys/vfs/hammer2
Tomohiro Kusumi [Sun, 18 Sep 2022 01:11:28 +0000 (18:11 -0700)]
usr.sbin/makefs: Sync with sys/vfs/hammer2

Sync with following sys/vfs/hammer2 commits.

 $ git log --pretty="%h %s" 8a656edff0678e34ac00175186cb6850eadc9441.. -- sys/vfs/hammer2/
 b18a596227 Revert "sys/vfs/hammer2: Properly set rdonly flag for PFS"
 617766ee20 sys/vfs/hammer2: Fix typo in error message
 b108516224 sys/vfs/hammer2: Fail mount if root volume was not specified
 e9ecf1728d sys/vfs/hammer2: Remove unused local variable bigread
 de2601344f sys/vfs/hammer2: Remove unused modify_tid argument in hammer2_pfsalloc()
 5f5122fa24 sys/vfs/hammer2: Properly set rdonly flag for PFS
 a5e418c0eb sys/vfs/hammer2: Fix incorrect hammer2_dump_chain() argument

2 months agonrelease - Copy `/etc/ssl/cert.pem` into ISOROOT
Michael Neumann [Sat, 17 Sep 2022 16:28:41 +0000 (18:28 +0200)]
nrelease - Copy `/etc/ssl/cert.pem` into ISOROOT

Otherwise it fails when using target `binpkg`:

9984868:error:14FFF086:SSL routines:(UNKNOWN)SSL_internal:certificate verify failed:/usr/src/lib/libressl/../../crypto/libressl/ssl/tls13_client.c:617:
pkg-static: https://mirror-master.dragonflybsd.org/dports/dragonfly:6.4:x86:64/LATEST/packagesite.txz: Authentication error
Unable to update repository Avalon
Error updating repositories!

2 months agousr.sbin/makefs: Allow FIFO hardlink for HAMMER2
Tomohiro Kusumi [Sat, 17 Sep 2022 07:24:01 +0000 (00:24 -0700)]
usr.sbin/makefs: Allow FIFO hardlink for HAMMER2

since this is possible on actual HAMMER2 as well.

2 months agousr.sbin/makefs: Support hardlink (vop_nlink) for HAMMER2
Tomohiro Kusumi [Fri, 16 Sep 2022 08:04:36 +0000 (01:04 -0700)]
usr.sbin/makefs: Support hardlink (vop_nlink) for HAMMER2

Currently only regular file is allowed for hardlink.

2 months agousr.sbin/makefs: Support FIFO (vop_nmknod) for HAMMER2
Tomohiro Kusumi [Fri, 16 Sep 2022 03:30:30 +0000 (20:30 -0700)]
usr.sbin/makefs: Support FIFO (vop_nmknod) for HAMMER2

2 months agourtwn - Add support for Edimax EW-7811Un V2 (N150)
Michael Neumann [Wed, 14 Sep 2022 15:40:30 +0000 (17:40 +0200)]
urtwn - Add support for Edimax EW-7811Un V2 (N150)

2 months agoRevert "sys/vfs/hammer2: Properly set rdonly flag for PFS"
Tomohiro Kusumi [Tue, 13 Sep 2022 08:35:07 +0000 (01:35 -0700)]
Revert "sys/vfs/hammer2: Properly set rdonly flag for PFS"

This reverts commit 5f5122fa2471887600e87e29917d577f65d73a05.

pmp->ronly should be set properly, but hammer2_remount() implementation
is missing pmp handling.

2 months agosys/vfs/hammer2: Fix typo in error message
Tomohiro Kusumi [Tue, 13 Sep 2022 07:25:40 +0000 (00:25 -0700)]
sys/vfs/hammer2: Fix typo in error message

2 months agosys/vfs/hammer2: Fail mount if root volume was not specified
Tomohiro Kusumi [Mon, 12 Sep 2022 07:12:04 +0000 (00:12 -0700)]
sys/vfs/hammer2: Fail mount if root volume was not specified

If !rootvoldata->version, root volume was never specified which is invalid.
This prevents panic (in hammer2_verify_volumes_1() via vol->dev->path dereference)
on attempt to mount only non-root volumes.

2 months agosbin/newfs_hammer2: Fix -V option being required for multi-volumes
Tomohiro Kusumi [Sun, 11 Sep 2022 08:30:52 +0000 (01:30 -0700)]
sbin/newfs_hammer2: Fix -V option being required for multi-volumes

Since 2d60b848f2 ("usr.sbin/makefs: Add HAMMER2 support") creating multi-volumes
required explicit '-V 2' option, which wasn't the case before.

2 months agosbin/hammer2: Rename CountBlocks() -> count_blocks()
Tomohiro Kusumi [Sun, 11 Sep 2022 01:30:13 +0000 (18:30 -0700)]
sbin/hammer2: Rename CountBlocks() -> count_blocks()

This (and only this) static function has been camel case.

2 months agousr.sbin/makefs: Correct a typo in a source code comment
Tomohiro Kusumi [Sat, 10 Sep 2022 09:32:04 +0000 (02:32 -0700)]
usr.sbin/makefs: Correct a typo in a source code comment

taken-from FreeBSD 5f285d5537219932c12ce4e6149d1a4f26aa3457