openbsd
3 years agonotify the user about a successful password change; ok millert@
robert [Sun, 29 Aug 2021 15:22:24 +0000 (15:22 +0000)]
notify the user about a successful password change; ok millert@

3 years agolibagentx regress relied on snmp(1) defaulting to -v2c -cpublic. Make this
martijn [Sun, 29 Aug 2021 15:15:45 +0000 (15:15 +0000)]
libagentx regress relied on snmp(1) defaulting to -v2c -cpublic. Make this
explicit.

Pointed out and OK bluhm@

3 years agoImplement --exclude/exclude-file and --include/include-file.
claudio [Sun, 29 Aug 2021 13:43:46 +0000 (13:43 +0000)]
Implement --exclude/exclude-file and --include/include-file.
Currently only simple include and excludes work, the advanced filters
introduced later in rsync are not implemented. It is unclear if the per
directory filters are something we want to implement. This requires
more modern protocols which openrsync is not able to handle right now.

This adds a special matching function to allow the ** matching which behaves
mostly like rsyncs version with the exception of how bad [] patterns are
expanded. For bad patterns openrsync follows more how fnmatch behaves and
not the somewhat strange rsync behaviour.

Not perfect but committing now so people can test and provide feedback.

3 years agoMerge sysupgrade watchdog and prompt timeout code
kn [Sun, 29 Aug 2021 13:31:52 +0000 (13:31 +0000)]
Merge sysupgrade watchdog and prompt timeout code

Provide TIMOUT_{ACTION,PERIOD_SEC} in {start,stop,reset}_timeout() to have
install.sub and dot.profile use the same mnemonic helpers.

3 years agoAdd ober_dup. Needed for upcoming SNMPv3 support for trap receiver in
martijn [Sun, 29 Aug 2021 13:27:11 +0000 (13:27 +0000)]
Add ober_dup. Needed for upcoming SNMPv3 support for trap receiver in
snmpd(8).

OK jmatthew@
OK deraadt@ for bumping libutil now.

3 years agoAdd back the echo Q thing.
tb [Sun, 29 Aug 2021 13:17:42 +0000 (13:17 +0000)]
Add back the echo Q thing.

3 years agoSync prompt timeout code with sysupgrade watchdog
kn [Sun, 29 Aug 2021 13:16:22 +0000 (13:16 +0000)]
Sync prompt timeout code with sysupgrade watchdog

Simplify code and employ the same technique in both places.
The "prompt timeout" hits when on non-interactive installations or upgrades:

Welcome to the OpenBSD/amd64 6.9 installation program.
Starting non-interactive mode in 5 seconds...
(I)nstall, (U)pgrade, (A)utoinstall or (S)hell?
Performing non-interactive upgrade...

The existing code uses a regular background job and does quirky file
descriptor fiddling just to avoid job control messages when starting the
timeout in the background.

It also does `set +m' a second time for no reason and hardodes the number of
seconds in multiple places.

Do better by using a co-process just like sysupgrade's watchdog that reboots
when the upgrade did not finish in time.

reads good to aja

3 years agoStart naccept .desc with a capital
tb [Sun, 29 Aug 2021 13:16:17 +0000 (13:16 +0000)]
Start naccept .desc with a capital

noted by inoguchi

3 years agoStop parsing unsupported dhcp-options(5)
kn [Sun, 29 Aug 2021 13:05:43 +0000 (13:05 +0000)]
Stop parsing unsupported dhcp-options(5)

dhcpleased(8) does not support everything dhclient(8) did,
so stop pretending.

OK florian

3 years agoUse s_server -naccept 1 and remove echo "Q" | openssl s_client hack.
tb [Sun, 29 Aug 2021 12:40:37 +0000 (12:40 +0000)]
Use s_server -naccept 1 and remove echo "Q" | openssl s_client hack.

3 years agoImplement -naccept in the s_server.
tb [Sun, 29 Aug 2021 12:33:15 +0000 (12:33 +0000)]
Implement -naccept in the s_server.

doc fixes/ok jmc
ok beck

3 years agomask next descriptor value and fix chunk_size calculation
dv [Sun, 29 Aug 2021 12:17:38 +0000 (12:17 +0000)]
mask next descriptor value and fix chunk_size calculation

Guest can cause out of bounds read with a malformed descriptor. In same
loop, also fix a chunk size calculation.

Reported by Ilja van Sprundel.

ok mlarkin@

3 years agoReduce the number of openings for aplns(4) to 1. This isn't correct but
kettenis [Sun, 29 Aug 2021 12:02:52 +0000 (12:02 +0000)]
Reduce the number of openings for aplns(4) to 1.  This isn't correct but
make NVMe on the Apple M1 stable.  Hopefully we can figure out the real
issue in the future.

ok jmatthew@

3 years agocheck for null vioblk info
dv [Sun, 29 Aug 2021 11:41:27 +0000 (11:41 +0000)]
check for null vioblk info

If {c,m}alloc fail, info could be NULL and result in NULL deref.

Reported by Ilja van Sprundel.

ok mlarkin@

3 years agoReduce the number of openings for aplns(4) to 1. This isn't correct but
kettenis [Sun, 29 Aug 2021 11:23:29 +0000 (11:23 +0000)]
Reduce the number of openings for aplns(4) to 1.  This isn't correct but
make NVMe on the Apple M1 stable.  Hopefully we can figure out the real
issue in the future.

ok jmatthew@

3 years agocorrect device status write size
dv [Sun, 29 Aug 2021 11:14:27 +0000 (11:14 +0000)]
correct device status write size

Reported by Ilja van Sprundel.

ok mlarkin@

3 years agoremove old descriptor dump function
dv [Sun, 29 Aug 2021 11:09:05 +0000 (11:09 +0000)]
remove old descriptor dump function

Used originally to aid dev. Unneeded.

ok mlarkin@

3 years agonew installboot will sometimes reuse the existing msdos boot partition instead
deraadt [Sun, 29 Aug 2021 09:10:57 +0000 (09:10 +0000)]
new installboot will sometimes reuse the existing msdos boot partition instead
of running newfs_msdos, so fsck_msdos gets run behind the scenes.  A few
architectures were missing this binary on their install media
jsg notices two more arch need it also, due to crazy Makefile games in installboot

3 years agonew installboot will sometimes reuse the existing msdos boot partition instead
deraadt [Sun, 29 Aug 2021 09:05:21 +0000 (09:05 +0000)]
new installboot will sometimes reuse the existing msdos boot partition instead
of running newfs_msdos, so fsck_msdos gets run behind the scenes.  A few
architectures were missing this binary on their install media
noticed by sthen

3 years ago-w default is now 3;
jmc [Sun, 29 Aug 2021 06:50:29 +0000 (06:50 +0000)]
-w default is now 3;

3 years ago/bin/ps: Implement reporting of supplemental groups
chrisz [Sat, 28 Aug 2021 20:54:54 +0000 (20:54 +0000)]
/bin/ps: Implement reporting of supplemental groups

with help from sthen@ and tim@. OK tim@

3 years agowhitespace nit
sthen [Sat, 28 Aug 2021 19:59:49 +0000 (19:59 +0000)]
whitespace nit

3 years agoAllow traceroute -w values down to 1 second, from John Carmack
sthen [Sat, 28 Aug 2021 19:59:28 +0000 (19:59 +0000)]
Allow traceroute -w values down to 1 second, from John Carmack
Change the default -w from 5 to 3 seconds, reducing the time it waits
for a response. John proposed using 1 second for this, but several
of us are familiar with networks where that would be likely to
remove hops, 3 seems reasonable and still saves 6 seconds on a
non-responding hop (there's always mtr if you need faster output).
Feedback from various, ok phessler@ kn@ florian@

3 years agoGet rid of historical code to extract the roots in the legacy case.
beck [Sat, 28 Aug 2021 15:22:42 +0000 (15:22 +0000)]
Get rid of historical code to extract the roots in the legacy case.
Due to the need to support by_dir, we use the get_issuer stuff when running
in x509_vfy compatibility mode amyway - so just use it any time we are
doing that. Removes a bunch of yukky stuff and a "Don't Look Ethel"

ok tb@ jsing@

3 years agoClean up and simplify ssl3_dispatch_alert() and ssl3_send_alert().
jsing [Sat, 28 Aug 2021 15:20:58 +0000 (15:20 +0000)]
Clean up and simplify ssl3_dispatch_alert() and ssl3_send_alert().

ok inoguchi@ tb@

3 years agoOnly remove the directories if there's an obj/ or obj@
tb [Sat, 28 Aug 2021 15:20:19 +0000 (15:20 +0000)]
Only remove the directories if there's an obj/ or obj@

3 years agoAdd a pass using the modern vfy with by_dir roots, code by me, script to
beck [Sat, 28 Aug 2021 15:13:50 +0000 (15:13 +0000)]
Add a pass using the modern vfy with by_dir roots, code by me, script to
generate certdirs by jsing, and make chicken sacrifies by tb.

ok tb@ jsing@

3 years agoAdd hex_octet() so the strtol(..,16) dance is done in just one
krw [Sat, 28 Aug 2021 11:55:17 +0000 (11:55 +0000)]
Add hex_octet() so the strtol(..,16) dance is done in just one
place.

Allows single-digit partition id's in '-b' as a side benefit.

3 years agoZap blanks before tabs.
tb [Sat, 28 Aug 2021 08:22:48 +0000 (08:22 +0000)]
Zap blanks before tabs.

3 years agoAdd RCS marker
tb [Sat, 28 Aug 2021 08:16:39 +0000 (08:16 +0000)]
Add RCS marker

3 years agoAdd case 2c to the go side. Don't tell jsing I touched go.
beck [Sat, 28 Aug 2021 07:54:57 +0000 (07:54 +0000)]
Add case 2c to the go side.  Don't tell jsing I touched go.

3 years agoRemove the "dump_chain" flag and code. This was a workaround for a problem where
beck [Sat, 28 Aug 2021 07:49:00 +0000 (07:49 +0000)]
Remove the "dump_chain" flag and code. This was a workaround for a problem where
roots were not checked correctly before intermediates that has since been fixed
and is no longer necessary. It is regress checked by case 2c in
regress/lib/libcrypto/x509/verify.c
ok jsing@ tb@

3 years agouse stderr for printing error and informational messages
robert [Sat, 28 Aug 2021 06:46:49 +0000 (06:46 +0000)]
use stderr for printing error and informational messages

this makes it easier to parse what passwd(1) is doing if
spawned from a GUI

ok millert@

3 years agoRemove bogus code that tries to unmap GTT pages in a codepath that clearly
kettenis [Sat, 28 Aug 2021 06:03:25 +0000 (06:03 +0000)]
Remove bogus code that tries to unmap GTT pages in a codepath that clearly
doesn't deal with non-GTT mappings.  What the Linux code does here isn't
possible on OpenBSD and probably unecessary.

Seems to fix a crash reported by sthen@
ok jsg@

3 years agoCheck X509_get_notAfter return value in openssl(1) ca.c
inoguchi [Sat, 28 Aug 2021 05:30:09 +0000 (05:30 +0000)]
Check X509_get_notAfter return value in openssl(1) ca.c

3 years agoUse strndup instead of malloc, memcpy and NULL termination in openssl(1) ca.c
inoguchi [Sat, 28 Aug 2021 05:14:30 +0000 (05:14 +0000)]
Use strndup instead of malloc, memcpy and NULL termination in openssl(1) ca.c

suggested from tb@ for do_updatedb(),
and applied the same for do_body() and do_revoke().

3 years agoRemove ASN1_TIME_new and use NULL for X509_gmtime_adj, free tmptm in err path
inoguchi [Sat, 28 Aug 2021 04:02:20 +0000 (04:02 +0000)]
Remove ASN1_TIME_new and use NULL for X509_gmtime_adj, free tmptm in err path

comments from tb@

3 years agoUnwrap lines in openssl(1) ca.c
inoguchi [Sat, 28 Aug 2021 02:40:17 +0000 (02:40 +0000)]
Unwrap lines in openssl(1) ca.c

suggested from tb@

3 years agoAvoid leak with X509_REVOKED variable in openssl(1) ca.c
inoguchi [Sat, 28 Aug 2021 02:24:10 +0000 (02:24 +0000)]
Avoid leak with X509_REVOKED variable in openssl(1) ca.c

pointed out by tb@

3 years agoChecking the return value in openssl(1) ca.c
inoguchi [Sat, 28 Aug 2021 02:11:18 +0000 (02:11 +0000)]
Checking the return value in openssl(1) ca.c

Some functions are used without verifying the return value in openssl(1) ca.
This diff adds checking for the function return value.
With this diff, I changed return value of the write_new_certificate from void
to int to return the condition to the caller.

ok and comments from tb@

3 years agoReplace %% in command lists (by copying them) for template arguments ,
nicm [Fri, 27 Aug 2021 17:25:55 +0000 (17:25 +0000)]
Replace %% in command lists (by copying them) for template arguments ,
this means they can be used with {} as well. Also make argument
processing from an existing vector preserve commands. GitHub issue 2858.

3 years agoAllow control mode clients to set a hard limit on the window width and
nicm [Fri, 27 Aug 2021 17:15:57 +0000 (17:15 +0000)]
Allow control mode clients to set a hard limit on the window width and
height, GitHub issue 2594.

3 years agoAdd regress test testing having the root cert in the intermediate bundle
beck [Fri, 27 Aug 2021 16:15:42 +0000 (16:15 +0000)]
Add regress test testing having the root cert in the intermediate bundle

3 years agoRemove unused #include <assert.h>.
tb [Fri, 27 Aug 2021 16:12:33 +0000 (16:12 +0000)]
Remove unused #include <assert.h>.

This is from upstream where there is an assert() that EVP_MD_size(digest)
matches the length returned by HMAC(). We avoid asserts in our libraries.

From Martin Vahlensieck

3 years agoReplace stray hand-rolled nitems() with nitems().
krw [Fri, 27 Aug 2021 11:28:22 +0000 (11:28 +0000)]
Replace stray hand-rolled nitems() with nitems().

3 years agodrm/amd/display: workaround for hard hang on HPD on native DP
jsg [Fri, 27 Aug 2021 02:47:48 +0000 (02:47 +0000)]
drm/amd/display: workaround for hard hang on HPD on native DP

From Qingqing Zhuo
2e6cc93e1b8cf3ec2966961c1e98722ee7281023 in linux 5.10.y/5.10.61
c4152b297d56d3696ad0a9003169bc5b98ad7b72 in mainline linux

3 years agodrm/amd/display: Fix Dynamic bpp issue with 8K30 with Navi 1X
jsg [Fri, 27 Aug 2021 02:43:55 +0000 (02:43 +0000)]
drm/amd/display: Fix Dynamic bpp issue with 8K30 with Navi 1X

From Bing Guo
dcc8c5fb8d8595f5061c7b000ca1d16449a5e865 in linux 5.10.y/5.10.61
06050a0f01dbac2ca33145ef19a72041206ea983 in mainline linux

3 years agodrm/amdgpu: fix the doorbell missing when in CGPG issue for renoir.
jsg [Fri, 27 Aug 2021 02:41:36 +0000 (02:41 +0000)]
drm/amdgpu: fix the doorbell missing when in CGPG issue for renoir.

From Yifan Zhang
7525f2e4de0069983497a9d3eab1ca9813ae1b4b in linux 5.10.y/5.10.61
1c0539a6fc8a4a4b77278e35d763073890de96b9 in mainline linux

3 years agoRequest wMaxInputLength bytes of data on each interrupt which should
jcs [Thu, 26 Aug 2021 21:05:01 +0000 (21:05 +0000)]
Request wMaxInputLength bytes of data on each interrupt which should
already account for the two-byte length and one-byte report id,
rather than adding them ourself and requesting wMaxInputLength + 3.

Fixes dwiic timeouts requesting data from at least one touchpad.

Tested by various

3 years agoRename ucc_intr_to_usage() to ucc_bits_to_usage(), no functional change.
anton [Thu, 26 Aug 2021 10:32:35 +0000 (10:32 +0000)]
Rename ucc_intr_to_usage() to ucc_bits_to_usage(), no functional change.

3 years agoAdd missing leading colon to error message.
anton [Thu, 26 Aug 2021 10:29:02 +0000 (10:29 +0000)]
Add missing leading colon to error message.

3 years agoThere are some races in the hardware which thus require a few more tries
kevlo [Thu, 26 Aug 2021 07:11:09 +0000 (07:11 +0000)]
There are some races in the hardware which thus require a few more tries
to get ownership.

See Linux commit 501fd9895c1d7d8161ed56698ae2fccb10ef14f5

ok stsp@

3 years agoTwo more Capt. Obvious comments go away.
krw [Wed, 25 Aug 2021 23:47:36 +0000 (23:47 +0000)]
Two more Capt. Obvious comments go away.

3 years agoDon't use log_procname before it is initialized. In particular
krw [Wed, 25 Aug 2021 21:07:47 +0000 (21:07 +0000)]
Don't use log_procname before it is initialized. In particular
set_iff_up() is called from initialize_interface() and was using
log_procname instead of ifi->name in its fatal()'s.

Diagnosed by tb@ from a recent reddit post by zielonykid1234.

3 years agoConsolidate '-e' edit command parsing into ask_cmd(), simplifying
krw [Wed, 25 Aug 2021 13:25:23 +0000 (13:25 +0000)]
Consolidate '-e' edit command parsing into ask_cmd(), simplifying
the main '-e' loop.

No functional change.

3 years agoImprove some logging.
nicm [Wed, 25 Aug 2021 10:18:01 +0000 (10:18 +0000)]
Improve some logging.

3 years agoIgnore client creating session when working out size if it is a control
nicm [Wed, 25 Aug 2021 10:15:15 +0000 (10:15 +0000)]
Ignore client creating session when working out size if it is a control
client.

3 years agobind-key needs to allow commands for any argument for the moment.
nicm [Wed, 25 Aug 2021 09:18:08 +0000 (09:18 +0000)]
bind-key needs to allow commands for any argument for the moment.

3 years agoValidate command argument types (string or command list) and give more
nicm [Wed, 25 Aug 2021 08:51:55 +0000 (08:51 +0000)]
Validate command argument types (string or command list) and give more
useful error messages.

3 years agosetupterm needs char * not const char * on some platforms.
nicm [Wed, 25 Aug 2021 07:37:20 +0000 (07:37 +0000)]
setupterm needs char * not const char * on some platforms.

3 years agoFix up some printflike attributes.
nicm [Wed, 25 Aug 2021 07:09:30 +0000 (07:09 +0000)]
Fix up some printflike attributes.

3 years agoStart inputs as NULL so not freeing random stack garbage, GitHub issue 2852.
nicm [Wed, 25 Aug 2021 06:36:05 +0000 (06:36 +0000)]
Start inputs as NULL so not freeing random stack garbage, GitHub issue 2852.

3 years agoMake all conversion routines consistent by returning a struct
anton [Wed, 25 Aug 2021 05:48:50 +0000 (05:48 +0000)]
Make all conversion routines consistent by returning a struct
ucc_keysym. No functional change.

3 years agoRemove the KB_DEFAULT flag from the wskbd keymap layout. Presence of
anton [Wed, 25 Aug 2021 05:48:02 +0000 (05:48 +0000)]
Remove the KB_DEFAULT flag from the wskbd keymap layout. Presence of
this flag will cause wskbd to discard the given keymap layout and
instead favor the layout of the associated wsmux. This is not a problem
while attaching ucc(4) during boot as the wsmux uses the default layout
at this point. However, if the layout is changed using /etc/kbdtype from
rc(8) during boot, attaching ucc(4) at this point would cause
wskbd_attach() to get stuck in an infinite loop:

wskbdX: cannot load keymap, falling back to default

... which in turn is caused by ucc(4) only providing a us layout and
using anything else in /etc/kbdtype would not work.

I missed this as I don't use /etc/kbdtype but cwen@ and Mazzurco
Riccardo <mazzurco dot riccardo at protonmail dot com> reported the same
problem.

3 years agoPrevent ucc(4) from matching report IDs with an empty input report.
anton [Wed, 25 Aug 2021 05:47:15 +0000 (05:47 +0000)]
Prevent ucc(4) from matching report IDs with an empty input report.

Fixes cwen@'s Creative BT-W3 audio device.

3 years agoIf the buffer given to the ucc interrupt handler is too long, do not
anton [Wed, 25 Aug 2021 05:46:31 +0000 (05:46 +0000)]
If the buffer given to the ucc interrupt handler is too long, do not
discard it but instead just inspect the first bytes that can make up a
usage. This is a work around as the correct solution is to only inspect
a limited number of bits as given by the report count and size
associated with the Consumer usage page.

Final piece to get florian@'s Microsoft Sculpt keyboard working.

3 years agoDetermine if a hid item is an array by solely inspecting presence of
anton [Wed, 25 Aug 2021 05:45:33 +0000 (05:45 +0000)]
Determine if a hid item is an array by solely inspecting presence of
associated min/max boundaries. Assuming that every usage array starts
with the Control usage is incorrect.

Fixes claudio@'s GMMK keyboard and partial fix for florian@'s Microsoft
Sculpt keyboard.

3 years agoFix automatic upgrade after fetching response file with dhcp.
bluhm [Tue, 24 Aug 2021 21:50:09 +0000 (21:50 +0000)]
Fix automatic upgrade after fetching response file with dhcp.

When the auto upgrader tried to fetch the sets, sometimes ftp did
not find any.  The interface was down and had no address.  As
autoconf was not cleared, the upgrade's static netstart and dhcpleased
both tried to configure the interface, which cannot work.

Disable dhcp with "ifconfig inet -autoconf" in get_responsefile()
after it is not used anymore.

OK florian@

3 years ago- guiness -> guinness
jmc [Tue, 24 Aug 2021 20:04:28 +0000 (20:04 +0000)]
- guiness -> guinness
- heros -> heroes
- kill a dup

from tom

3 years agoFix ping group offsets.
kettenis [Tue, 24 Aug 2021 16:18:50 +0000 (16:18 +0000)]
Fix ping group offsets.

ok jcs@

3 years agoAdd an #ifdef DEBUG/#endif chunk that dumps the entire GPT header when
krw [Tue, 24 Aug 2021 15:36:05 +0000 (15:36 +0000)]
Add an #ifdef DEBUG/#endif chunk that dumps the entire GPT header when
printing a GPT.

No functional change outside of DEBUG.

3 years agoFix various read buffer overflow when printing ASN.1 strings (which are
tb [Tue, 24 Aug 2021 15:23:03 +0000 (15:23 +0000)]
Fix various read buffer overflow when printing ASN.1 strings (which are
not necessarily NUL terminated). Same as schwarze's fix in t_x509a.c r1.9.

From David Benjamin and Matt Caswell (part of the fixes in OpenSSL 1.1.1l)

ok inoguchi

3 years agoWhen an interface disappears, e.g. when a usb dongle gets unplugged,
florian [Tue, 24 Aug 2021 14:56:06 +0000 (14:56 +0000)]
When an interface disappears, e.g. when a usb dongle gets unplugged,
we get a RTM_IFANNOUNCE message not a RTM_IFINFO message.
Handle this message to not accumulate "unknown" interfaces.
While here fix a bug where we would remove an interface only in the
engine process but not in the frontend when an interfaces gets
unplugged while we process a RTM_IFINFO message for it.
OK benno

3 years agoWhen an interface disappears, e.g. when a usb dongle gets unplugged,
florian [Tue, 24 Aug 2021 14:54:02 +0000 (14:54 +0000)]
When an interface disappears, e.g. when a usb dongle gets unplugged,
we get a RTM_IFANNOUNCE message not a RTM_IFINFO message.
Handle this message to not accumulate "unknown" interfaces.
OK benno

3 years agouse Pa for resolv.conf.tail, since there is no longer a man page
jmc [Tue, 24 Aug 2021 13:53:21 +0000 (13:53 +0000)]
use Pa for resolv.conf.tail, since there is no longer a man page
to Xr;

3 years agovini vidi vici -> veni vidi vici
jmc [Tue, 24 Aug 2021 13:16:07 +0000 (13:16 +0000)]
vini vidi vici -> veni vidi vici

3 years agomake SYNOPSIS match usage to indicate -l is optional in:
jmc [Tue, 24 Aug 2021 13:15:07 +0000 (13:15 +0000)]
make SYNOPSIS match usage to indicate -l is optional in:

swapctl [[-l] | -s] [-k]

from martin vahlensieck

3 years agoA couple more Capt. Obvious comments can go.
krw [Tue, 24 Aug 2021 12:55:06 +0000 (12:55 +0000)]
A couple more Capt. Obvious comments can go.

3 years agoTrim leading/trailing whitespace from -e input to make command
krw [Tue, 24 Aug 2021 12:34:04 +0000 (12:34 +0000)]
Trim leading/trailing whitespace from -e input to make command
parsing more robust (e.g. 'edit 0 ' is now accepted) and strict
(e.g. 'reinit gptx' is now rejected).

Input which may want that whitespace is not trimmed (e.g. GPT
partition names).

Use consistent definition of whitespace corresponding to that
used by isspace().

3 years agoFix compilation with debug enabled.
patrick [Tue, 24 Aug 2021 11:44:30 +0000 (11:44 +0000)]
Fix compilation with debug enabled.

ok kettenis@

3 years agoSome consumer control descriptor reports uses an array of usages instead
anton [Tue, 24 Aug 2021 10:53:43 +0000 (10:53 +0000)]
Some consumer control descriptor reports uses an array of usages instead
of enumerating all supported ones. This representation is more compact
as all supported usages are given by the array min and max boundaries.

In enumerating mode, the interrupt report has one level indirection as
it includes the bit offset of the usage requiring the driver to map bits
to usages in order to resolve the key press.
In array mode, the interrupt report includes the usage without any
indirection, removing the need map bits to usages.

ucc(4) can now operate either in enumerating or array mode depending on
the descriptor report. This should make more keyboards usable.

Thanks to Alessandro De Laurenzis <just22 at atlantide dot mooo dot com>
for testing.

3 years agofix outdated comments, from Emil Engler, thanks.
benno [Tue, 24 Aug 2021 10:07:30 +0000 (10:07 +0000)]
fix outdated comments, from Emil Engler, thanks.

3 years agoWe no longer have resolv.conf.tail.
florian [Tue, 24 Aug 2021 07:30:32 +0000 (07:30 +0000)]
We no longer have resolv.conf.tail.
From Scott Bennett, thanks!

3 years agoSay which read failed, helps debugging.
florian [Mon, 23 Aug 2021 18:22:56 +0000 (18:22 +0000)]
Say which read failed, helps debugging.

3 years agoWe don't have a config file on the ramdisks; prevents a warning.
florian [Mon, 23 Aug 2021 18:21:48 +0000 (18:21 +0000)]
We don't have a config file on the ramdisks; prevents a warning.

3 years agoSince we have a config file now we should Xr its manpage.
florian [Mon, 23 Aug 2021 18:09:05 +0000 (18:09 +0000)]
Since we have a config file now we should Xr its manpage.
From Scott Bennett, thanks!

3 years agoI missed that wskbd_rawinput() is hidden behind WSDISPLAY_COMPAT_RAWKBD
anton [Mon, 23 Aug 2021 17:50:26 +0000 (17:50 +0000)]
I missed that wskbd_rawinput() is hidden behind WSDISPLAY_COMPAT_RAWKBD
as discovered by deraadt@; should hopefully make ucc(4) work on alpha.

3 years agoargs_make_commands_now needs to take an extra reference to the returned
nicm [Mon, 23 Aug 2021 17:05:43 +0000 (17:05 +0000)]
args_make_commands_now needs to take an extra reference to the returned
command list since it will be freed already.

3 years agoMove command argument parsing common functions and don't bother to parse
nicm [Mon, 23 Aug 2021 12:33:55 +0000 (12:33 +0000)]
Move command argument parsing common functions and don't bother to parse
again if given a command rather than a string.

3 years agoKey bindings steal a reference to the command instead of adding their
nicm [Mon, 23 Aug 2021 11:48:21 +0000 (11:48 +0000)]
Key bindings steal a reference to the command instead of adding their
own, it was correct not to add a reference when parsing, but the
bind-key then needs to add one.

3 years agoRevert one of previous, for some reason it is being freed.
nicm [Mon, 23 Aug 2021 11:08:26 +0000 (11:08 +0000)]
Revert one of previous, for some reason it is being freed.

3 years agoFix a few memory leaks.
nicm [Mon, 23 Aug 2021 11:04:21 +0000 (11:04 +0000)]
Fix a few memory leaks.

3 years agoFix the initial length check in iwx_fill_probe_req() to match iwm(4).
stsp [Mon, 23 Aug 2021 08:59:31 +0000 (08:59 +0000)]
Fix the initial length check in iwx_fill_probe_req() to match iwm(4).

Patch by zxystd from OpenIntelWireless.

3 years agoLimit width and height to tty correctly, GitHub issue 2843.
nicm [Mon, 23 Aug 2021 08:17:41 +0000 (08:17 +0000)]
Limit width and height to tty correctly, GitHub issue 2843.

3 years agoFix handling of leading #s when working out width.
nicm [Sun, 22 Aug 2021 15:33:14 +0000 (15:33 +0000)]
Fix handling of leading #s when working out width.

3 years agoDo not double free expanded path in source-file, also remove some
nicm [Sun, 22 Aug 2021 13:48:29 +0000 (13:48 +0000)]
Do not double free expanded path in source-file, also remove some
unnecessary assignments.

3 years agoInsert alias in the right place, GitHub issue 2842.
nicm [Sun, 22 Aug 2021 13:00:28 +0000 (13:00 +0000)]
Insert alias in the right place, GitHub issue 2842.

3 years agoSince the raw keymap already has a capacity of holding all present keys,
anton [Sun, 22 Aug 2021 07:20:40 +0000 (07:20 +0000)]
Since the raw keymap already has a capacity of holding all present keys,
use it as a lookup table using the bit as the index. Removes the need to
linearly scan the same keymap during handling of a key press, not that
performance matters here since the length of the keymap is small but the
code gets a bit simpler and one struct becomes redundant.

While here, fix two incorrect conditionals in ucc_parse_hid() which
compared two different quantities.

3 years agoucc also fails to work here, because there is no wskbd_rawinput
deraadt [Sun, 22 Aug 2021 06:26:28 +0000 (06:26 +0000)]
ucc also fails to work here, because there is no wskbd_rawinput

3 years agoFree value properly.
nicm [Sat, 21 Aug 2021 20:57:52 +0000 (20:57 +0000)]
Free value properly.