summaryrefslogtreecommitdiff
path: root/usr.bin
AgeCommit message (Collapse)Author
2022-05-05kstat(1): implement wait with setitimer(2) instead of nanosleep(2)Scott Soule Cheloha
kstat(1)'s wait period drifts because nanosleep(2) uses a relative timeout. If we use setitimer(2)/sigsuspend(2) the period does not drift. While here, bump the upper bound for wait up to UINT_MAX and switch to the normal strtonum(3) error message format. With input from kn@. Tweaked by bluhm@ to block SIGALRM with sigprocmask(2) while we're outside of sigsuspend(2). Thread: https://marc.info/?l=openbsd-tech&m=160038548111187&w=2 Earlier version ok millert@. ok bluhm@
2022-05-05Fix line wrapping in wall(1).Alexander Bluhm
from Anton Borowka; OK mbuhl@
2022-05-05sshkey_unshield_private() contains a exact duplicate of the code inDamien Miller
private2_check_padding(). Pull private2_check_padding() up so the code can be reused. From Martin Vahlensieck, ok deraadt@
2022-05-05channel_new no longer frees remote_name. So update the commentDamien Miller
accordingly. As remote_name is not modified, it can be const as well. From Martin Vahlensieck
2022-05-05mux.c: mark argument as const; from Martin VahlensieckDamien Miller
2022-05-04make sure stdout is non-blocking; ok djm@Markus Friedl
2022-05-03Add FIDO AUTHENTICATOR section and explain a bit how FIDO works. TheFlorian Obser
wording came mostly from the 8.2 OpenSSH release notes, addapted to fit the man page. Then move the -O bits into the new section as is already done for CERTIFICATES and MODULI GENERATION. Finally we can explain the trade-offs of resident keys. While here, consistently refer to the FIDO thingies as "FIDO authenticators", not "FIDO tokens". input & OK jmc, naddy
2022-05-02remove an obsolete rsa1 format example from an example;Jason McIntyre
from megan batty ok djm
2022-05-01fix some integer overflows in sieve_large() that show up when tryingDamien Miller
to generate modp groups > 16k bits. Reported via GHPR#306 by Bertram Felgenhauer, but fixed in a different way. feedback/ok tb@
2022-05-01Split a new function roff_parse_comment() out of roff_expand() because thisIngo Schwarze
functionality is not needed when called from roff_getarg(). This makes the long and complicated function roff_expand() significantly shorter, and also simpler in so far as it no longer needs to return ROFF_APPEND. No functional change intended.
2022-04-30Provide a new function roff_req_or_macro() to parse and handle a requestIngo Schwarze
or macro, including context-dependent error handling inside tbl(7) code and inside .ce/.rj blocks. Use it both in the top level roff(7) parser and inside conditional blocks. This fixes an assertion failure triggered by ".if 1 .ce" inside tbl(7) code, found by tb@ using afl(1). As a side benefit for readability, only one place remains in the code that calls the main handler functions for the various roff(7) requests. This patch also improves column numbers in some error messages and various comments.
2022-04-30Add comments to some of the enum roff_tok values;Ingo Schwarze
particularly useful for values that have non-obvious semantics like ROFF_MAX, ROFF_cblock, ROFF_RENAMED, and TOKEN_NONE; no code change.
2022-04-30Refactor the handler function roff_block_sub() for clarity and simplicity.Ingo Schwarze
1. Do not needlessly access the function pointer table roffs[]. Instead, simply call the block closing function directly. 2. Sort code: handle both cases of block closing at the beginning of the function rather than one at the beginning and one at the end. 3. Trim excessive, partially repetitive and obvious comments, also making the comments considerably more precise. No functional change.
2022-04-29Wait until the buffer is drained before closing the deviceAlexandre Ratchov
Fixes last few samples not being played when very large buffers are used.
2022-04-29Add sio_flush(3) function to stop playback immediatelyAlexandre Ratchov
The new sio_flush(3) functions works the same way as sio_stop(3), except that it doesn't wait for play buffer to be drained. Instead, it discards its contents and returns immediately.
2022-04-29be stricter in which characters will be accepted in specifying a maskDamien Miller
length; allow only 0-9. From khaleesicodes via GHPR#278; ok dtucker@
2022-04-29mention that the helpers are used by ssh(1), ssh-agent(1) andDamien Miller
ssh-keygen(1). Previously only ssh(1) was mentioned. From Pedro Martelletto
2022-04-29Don't leak SK device. Patch from Pedro Martelletto via github PR#316.Darren Tucker
ok djm@
2022-04-29fix memleak on session-bind path; from Pedro Martelletto, ok dtucker@Damien Miller
2022-04-28The syntax of the roff(7) .mc request is quite specialIngo Schwarze
and the roff_onearg() parsing function is too generic, so provide a dedicated parsing function instead. This fixes an assertion failure when an \o escape sequence is passed as the argument; the bug was found by tb@ using afl(1). It also makes mandoc output more similar to groff in various cases.
2022-04-28Fix comparison in openssl(1) pkcs12Kinichiro Inoguchi
comment from tb@
2022-04-28Compare pointer value with NULL in openssl(1) pkcs12Kinichiro Inoguchi
ok tb@
2022-04-28Element next-line scopes may nest, so man_breakscope() may have toIngo Schwarze
break multiple element next-line scopes at the same time, similar to what man_descope() already does for unconditional rewinding. This fixes an assertion failure that tb@ found with afl(1), caused by .SH .I .I .BI and similar sequences of macros without arguments.
2022-04-28avoid printing hash algorithm twice; from lucas AT sexy.isDamien Miller
2022-04-27The .AT, .DT, and .UC macros are allowed inside next-line scopeIngo Schwarze
and never produce output at the place of their invocation. Minibugs found while investigating unrelated afl(1) reports from tb@.
2022-04-27Fix three bugs regarding the interaction of \z and \h:Ingo Schwarze
1. The combination \z\h is a no-op whatever the argument may be. In the past, the \z only affected the first space character generated by the \h, which was wrong. 2. For the conbination \zX\h with a positive argument, the first space resulting from the \h is not printed but consumed by the \z. 3. For the combination \zX\h with a negative argument, application of the \z needs to be completed before the \h can be started. In the past, if this combination occurred at the beginning of an output line, the \h backed up to the beginning of the line and after that, the \z attempted to back up even further, triggering an assertion. Bugs found during an audit of assignments to termp->col that i started after the bugfix tbl_term.c rev. 1.65. The assertion triggered by bug 3 was *not* yet found by afl(1).
2022-04-27Add authfd path to debug output. ok markus@Darren Tucker
2022-04-26At the end of every tbl(7) cell, clear the \z state.Ingo Schwarze
This is needed because the TERMP_MULTICOL mode is designed such that term_tbl() buffers all the cells of the table row before the normal reset logic near the end of term_flushln() can be reached. This fixes an assertion failure triggered by \z near the end of a table cell, found by tb@ using afl(1).
2022-04-26If a node is tagged explicitly, skip implicit tagging for that node.Ingo Schwarze
Apart from making sense in the first place, this fixes an assertion failure that happened when the calculated implicit tag did not match the string value of the first child of the node, Bug found by tb@ using afl(1).
2022-04-26Check sshauthopt_new() for NULL. bz#3425, from tessgauthier atDarren Tucker
microsoft.com. ok djm@
2022-04-24When we open a new .while loop, let's not attempt to close outIngo Schwarze
another enclosing .while loop at the same time. Instead, postpone the closing until the next iteration of ROFF_RERUN. This prevents one-line constructions like ".while 0 .while 0 something" and ".while rx .while rx .rr x" (which admittedly aren't particularly useful) from dying of abort(3), which was a bug tb@ found with afl(1).
2022-04-24If a .shift request has a negative argument, do not use a negative arrayIngo Schwarze
index but use 0 instead of the argument, just like groff. Warn about the invalid argument. While here, fix the column number in another warning message. Segfault reported by tb@, found with afl(1).
2022-04-23If the last data row of a tbl(7) contains nothing but a horizontal line,Ingo Schwarze
do not skip closing the table and cleaning up memory at the end of the table in the HTML output module. This bug resulted in skipping the tblcalc() function and reusing the existing roffcol array for the next tbl(7) processed. If the next table had more columns than the one ending with a horizontal line in the last data row, uninitialized memory was read, potentially resulting in near-infinite output. The bug was introduced in rev. 1.24 (2018/11/26) but only fully exposed by rev. 1.33 (2021/09/09). Until rev. 1.32, it could only cause misformatting and invalid HTML output syntax but not huge output because up to that point, the function did not use the roffcol array. Nasty bug found the hard way by Michael Stapelberg on the production server manpages.debian.org. Michael also supplied example files and excellent instructions how to reproduce the bug, which was very difficult because no real-world manual page is known that triggers the bug by itself, so to reproduce the bug, mandoc(1) had to be invoked with at least two file name arguments.
2022-04-22escape the word "An" in an Rs/Re block, since it can beJason McIntyre
interpreted as a macro;
2022-04-22Check tkp->output != NULL before taking strlen for both command mappingsTheo Buehler
and input mappings. This adds a missing check for command mappings and simplifies the input mappings. ok millert
2022-04-22vi: apply expandtab to the output of a ! commandTodd C. Miller
This is consistent with vim's expandtab behavior. From nvi2 (Craig Leres). OK tb@
2022-04-22handle 16 bit kstat_kv typesDavid Gwynne
2022-04-21v_event_get: check qp->output for NULL before passing to e_memcmp().Todd C. Miller
Other users of qp->output already include a NULL check. Avoids a crash when cursor key support is disabled in cl/cl_term.c. From Jeremy Mates. OK tb@
2022-04-20Remove unnecessary includes: openssl/hmac.h and openssl/evp.h.Todd C. Miller
From Martin Vahlensieck.
2022-04-20Add missing includes of stdlib.h and stdint.h.Todd C. Miller
We need stdlib.h for malloc(3) and stdint.h for SIZE_MAX. Unlike the other xmss files, ssh-xmss.c does not include xmss_commons.h so ssh-xmss.c must include those headers itself. From Martin Vahlensieck
2022-04-20Avoid an unnecessary xstrdup in rm_env() when matching patterns.Todd C. Miller
Since match_pattern() doesn't modify its arguments (they are const), there is no need to make an extra copy of the strings in options->send_env. From Martin Vahlensieck
2022-04-20Try to continue running local I/O for channels in state OPEN duringDamien Miller
SSH transport rekeying. The most visible benefit is that it should make ~-escapes work in the client (e.g. to exit) if the connection happened to have stalled during a rekey event. Based work by and ok dtucker@
2022-04-20Import regenerated moduliDarren Tucker
2022-04-19enable kstat(4) and kstat(1).David Gwynne
kstat allows the kernel to expose arbitrary data for userland to consume. currently this is used by some network card drivers to expose hardware counters they provide, and a bit by the network stack to show things like ifq counters. ok bluhm@ deraadt@
2022-04-16list the correct version number when usage of the sftp protocol became defaultT.J. Townsend
and fix a typo from ed maste
2022-04-14Fix clearphist alias, from Jacqueline Jolicoeur via jmc@.Nicholas Marriott
2022-04-13To prevent infinite recursion while expanding eqn(7) definitions,Ingo Schwarze
we must not reset the recursion counter when moving beyond the end of the *previous* expansion, but we may only do so when moving beyond the rightmost position reached by *any* expansion in the current equation. This matters because definitions can nest; consider: .EQ define inner "content" define outer "inner outer" outer .EN This endless loop was found by tb@ using afl(1). Incidentally, GNU eqn(1) also performs an infinite loop in this situation and then crashes when memory runs out, but that's not an excuse for nasty behaviour of mandoc(1). While here, consistently print the expanded content even when the expansion is finally truncated. While that is not likely to help end-users, it may help authors of eqn(7) code to understand what's going on. Besides, it sends a very clear signal that something is amiss, which was easy to miss in the past unless people enabled -W error or used -T lint.
2022-04-13Do not die on an assertion if an input file contains no sectionIngo Schwarze
whatsoever and ends with a broken next-line scope. Obviously, this cannot happen in a real manual page, but mandoc(1) should not die even when fed absurd input. This bug was independently reported by both jsg@ and tb@ who both found it with afl(1).
2022-04-13Surprisingly, groff supports multiple copy mode escapes at theIngo Schwarze
beginning of an escape sequence: \, \E, \EE, \EEE, and so on all do the same outside copy mode, so let them do the same in mandoc(1), too. This fixes an assertion failure triggered by \EE*X that tb@ found with afl(1). The first E was consumed by roff_expand(), but that function failed to recognize the escape sequence as the expansion of a user-defined string and handed it over to mandoc_escape(), which consumed the second E and then died on an assertion because it is not prepared to handle user-defined strings. Fix this by letting *both* functions handly arbitrary numbers of 'E's correctly.
2022-04-12Do not convert the int value twice from little to host endian.Claudio Jeker
io_read_int() already does the conversion so don't double up in io_read_ulong(). Fixes openrsync on sparc64. OK miod@ deraadt@