Age | Commit message (Collapse) | Author |
|
No need for KSH_VERSION and its PS1 esacape sequences in installer shells.
Save some bits and clean up what(1) output on ramdisk kernels.
OK deraadt
|
|
|
|
exposed in a new field returned by sysctl(KERN_PROC). Update
pthread_{get,set}_name_np(3) to use the syscalls. Show them, when
set, in ps -H and top -H output.
libc and libpthread minor bumps
ok mpi@, mvs@, deraadt@
|
|
From nabijaczleweli, OK deraadt@
|
|
With input from and OK jmc@
|
|
space (specifically in the "alias", "readonly" and "typeset"
commands);
from josiah frentsos
|
|
A few programs used the plural in their synopsis which doesn't read as
clear as the obvious triple-dot notation.
mdoc(7) .Ar defaults to "file ..." if no arguments are given and consistent
use of 'arg ...' matches that behaviour.
Cleanup a few markups of the same argument so the text keeps reading
naturally; omit unhelpful parts like 'if optional arguments are given,
they are passed along' for tools like time(1) and timeout(1) that obviously
execute commands with whatever arguments where given -- just like doas(1)
which doesn't mention arguments in its DESCRIPTION in the first place.
For expr(1) the difference between 'expressions' and 'expression ...' is
crucial, as arguments must be passed as individual words.
Feedback millert jmc schwarze deraadt
OK jmc
|
|
Reported with diff from Ross L Richardson
Agreed kn, OK jmc
|
|
getopt(3) returns '?' when it encounters a flag not present in the in
the optstring or if a flag is missing its option argument. We can
handle this case with the "default" failure case with no loss of
legibility. Hence, remove all the redundant "case '?':" lines.
Prompted by dlg@. With help from dlg@ and millert@.
Link: https://marc.info/?l=openbsd-tech&m=167011979726449&w=2
ok naddy@ millert@ dlg@
|
|
This matches both historical behavior and the POSIX specification.
From Soeren Tempel.
|
|
|
|
ok miod@
|
|
|
|
The following three cases behave identical in bash(1), but our ksh
(ksh93 also) fails to run the trap in the last case:
(non-zero exit code is trigger, no redirection)
$ ksh -c 'trap "echo ERR" ERR ; false'
ERR
(failed redirection is trigger, 'echo' was not executed)
$ ksh -c 'trap "echo ERR" ERR ; echo >/'
ksh: cannot create /: Is a directory
ERR
(failed redirection, no execution, trap was NOT triggered)
$ ksh -c 'trap "echo ERR" ERR ; exec >/'
ksh: cannot create /: Is a directory
bash(1) prints "ERR" in all three cases, as expected.
ksh93 behaves like our ksh(1).
In ksh `exec' is a builtin (CSHELL), but also special (SPEC_BI):
$ type alias
alias is a shell builtin
$ type exec
exec is a special shell builtin
Without command and redirection alone, `exec' permanently redirects I/O for
the shell itself, not executing anything; it is the only (special) builtin
with such a special use-case, implemented as c_sh.c:c_exec().
This corner-case is overlooked in exec.c:execute() which handles iosetup()
failure for all commands, incl. builtins.
Exclude c_exec() from the rest of special builtins to ensure it runs the
ERR trap as expected:
$ ./obj/ksh -c 'trap "echo ERR" ERR ; exec >/'
ksh: cannot create /: Is a directory
ERR
Also add three new regress cases covering this; rest keep passing.
OK millert
|
|
and can depend on the /usr/share/zoneinfo bypass.
OK mestre, millert, deraadt
|
|
Reported by Christian Weisgerber
OK kn@
|
|
this using unveil(2), but ignore errors if /var/log doesn't exist. We
want to be able to set the time if the system is damanged or /var is
not mounted yet.
We also need to unveil everything for reading since we still allow
arbitrary locations of zone info files. Hopefully that will go away
soon.
OK deraadt
|
|
OK millert
|
|
- while here, wrap a long line
|
|
In -f mode group & display parent/child process relationships using ASCII art.
Borrows heavily from Brian Somers' work on FreeBSD ps(1).
With input from deraadt@ and tb@
OK benno@ claudio@
|
|
nudge from luka krmpotic
|
|
"rm -rfv nonexistent". problem spotted by Alfred Morgan
ok millert
|
|
ok schwarze@
|
|
ok cheloha@
|
|
Description
- "for a minimum of" is better said "for at least".
- The seconds argument can be zero, so say "non-negative".
- Specify that the number (the whole thing) is decimal to exclude
e.g. hex numbers. It then follows that the optional fraction
must also be decimal.
- No need to inspire the reader to use sleep(1) in any particular way.
It is probably sufficient to demonstrate these patterns in the Examples
section later.
Asynchronous Events
- Note that SIGALRM wakes sleep(1) up "early".
Examples
- Simplify the first example. Parenthetically pointing the reader to
at(1) muddies what is otherwise a trivial example. We can still point
the reader to at(1) in the See Also section later.
- Shorten the interval in the first example. A half hour is not
interactive.
- Get rid of the entire csh(1) example. It's extremely complex and
the bulk of the text is spent explaining things that aren't about
sleep(1) at all.
- Tweak the third example to show the reader that you can sleep
for a fraction of a second, as mentioned in the Description.
Standards
- Prefer active voice.
"The handling of fractional arguments" is better said
"Support for fractional seconds".
Shorten "is provided as" to "is".
History
- Not merely "appeared": "first appeared".
- Note that sleep(1) was reimplemented for 4.4BSD.
Thread: https://marc.info/?l=openbsd-tech&m=165888826603953&w=2
Lots of nice tweaks from jmc@. Typo spotted by Crystal Kolipe.
ok jmc@
|
|
Also remove unneeded seltrue() and selfalse().
OK mpi@ jsg@
|
|
|
|
jmc@ dislikes a comma before "then" in a conditional, so leave those
untouched.
ok jmc@
|
|
These are becoming quite common in distributed software (including
tars produced by Python and Go) and often standard timestamps are
not set, resulting in extracted files dated as the epoch.
Lots of help from tb@, ok tb@ millert@
|
|
Pointers from and discussions with millert and deraadt.
Ok millert@, deraadt@, bluhm@
|
|
This way we keep the size of the strings in the private struct in
sync with what the kernel gives us. OK deraadt@
|
|
from sysctl.h. This isn't a perfect transition, still thinking about
other ways to do it.
ok millert
|
|
|
|
Ok deraat@
|
|
Ok deraadt
|
|
If we're only working with the standard input we don't need "rpath".
Tweaked by mestre@.
Thread: https://marc.info/?l=openbsd-tech&m=163941848104274&w=2
No objections on tech@ after several weeks.
|
|
- Combine the open/close portions of cook_args()/raw_args() into a single
function, cat_file().
- Push the flag-checking conditional in main() down into cat_file().
- Pull the argv loop in cat_file() up into main().
These changes -- especially pulling the argv look up into main() --
will allow us to drop the "rpath" promise in a single spot in a
subsequent patch.
Tweaked by mestre@. Descriptor leak in earlier version spotted by
Matthew Martin.
Thread: https://marc.info/?l=openbsd-tech&m=163941848104274&w=2
No objections on tech@ after several weeks.
|
|
Feedback and tweaks from deraadt@ guenther@
Ok bluhm@ deraadt@
|
|
|
|
Ok millert@ deraadt@
|
|
apostrophe.
|
|
Otherwise, if ed's output is not line buffered (e.g. if it is
redirected to a file or pipe) the shell command output may be
displayed before data buffered by ed itself is written.
From Soeren Tempel. OK deraadt@
|
|
On BSD, fpos_t is typedef'd to off_t but some systems use a struct.
This means fpos_t is not a portable function argument or return value.
Both FreeBSD and the Linux libbsd funopen() have switched to off_t
for this--we should too. From Joe Nelson. OK deraadt@
|
|
ok jsg@ deraadt@
|
|
not print the shell script line number where this occured. Doing so is
pointless, or an information leak.
This change does not affect any other error reporting.
ok millert
|
|
is not unneccesary. Different buffer sizes are actually dangerous, though
major problems are strangely rare.
ok millert
|
|
|
|
ton of namespace intrusion). Create local sizes, and refactor some code
along the way.
ok millert
|
|
3rd (variadic) mode_t parameter is irrelevant. Many developers in the past
have passed mode_t (0, 044, 0644, or such), which might lead future people
to copy this broken idiom, and perhaps even believe this parameter has some
meaning or implication or application. Delete them all.
This comes out of a conversation where tb@ noticed that a strange (but
intentional) pledge behaviour is to always knock-out high-bits from
mode_t on a number of system calls as a safety factor, and his bewilderment
that this appeared to be happening against valid modes (at least visually),
but no sorry, they are all irrelevant junk. They could all be 0xdeafbeef.
ok millert
|
|
be opened is on stty -f `file', so call unveil(2) afterwards to restrict all fs
access.
OK deraadt@
|