Age | Commit message (Collapse) | Author |
|
This makes signal handler safe on OpenBSD.
To avoid overflows the accuracy is scaled. Above 10 minutes run time
we only care about second accuracy. Between 1 seconds and 10 minutes
we use millisecond accuracy.
Below one second we use nanoseconds, but those numbers are probably
meaningless.
Signal handler problem pointed out by deraadt
OK deraadt, millert, tb
|
|
the signal handler was calling a big function which is shared between
multiple contexts -- that hides the rule that this big function has
signal safe requirements (which it fails). now, the signal handler
contains all the code, and everyone else calls the signal handler function
as a regular function, from their (normal) contexts.
the signal handler context is the most strict, so this pattern is better.
ok florian
|
|
|
|
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
|
|
input/ok deraadt jca
|
|
but additionally have a bootblock in the first 8K (since UFS does not use that
space). There are some UEFI direct-from-internet bootloaders that require
the name *.img. So this makes things more convenient for those, while keeping
it consistant in all architectures.
ok kettenis beck kn
|
|
|
|
and make some wordings more concise.
Parts of a patch from Jan Stary <hans at stare dot cz>, tweaked by me.
Feedback and OK jmc@.
|
|
value < 0. errno is only updated in this case. Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.
|
|
|
|
final write to output. GNU dd also has this. It is useful for
write performance measurement or guaranteed writes to reliable
storage.
OK kn@ tedu@ deraadt@
|
|
We strdup operands before destructively parsing them to keep w(1) output
looking nice and neat, but after parsing we ought to free them.
We do need to keep copies for file paths, though, so add additional strdups
for operands if and of.
While here, use the preferred err(1, NULL) for an allocation failure. Also
while here, don't assign `oper' to a copy of itself because it looks strange.
"sure." deraadt
|
|
Large buffer sizes on 64-bit platforms cause the sum to wrap, leading
read(2) to fail later.
We check prior to this point that all buffer sizes are <= SSIZE_MAX.
SSIZE_MAX * 2 < SIZE_MAX on all platforms, so the addition here will
not overflow and cause a similar issue.
Discovered by tobias@ a while back.
ok deraadt millert tobias
|
|
Much simpler.
Dropping writev makes the output from summary() non-atomic, so
output lines triggered by SIGINFO can intermingle with output
lines triggered by SIGINT or atexit(3).
This behavior is difficult to trigger, even deliberately.
The buffer in dprintf is large enough so that lines produced by
summary() are not garbled if this occurs, though, so this is unlikely
to break any scripts.
Discussed at length with deraadt@, who helpfully noted that
"not all problems have perfect solutions."
ok millert@
|
|
from erroring out with "dd: skip: Undefined error: 0", mostly for
consistency and to avoid the unidiomatic, wrong looking code.
Patch from Bulat Musin <mbulatka at yandex dot ru>.
OK guenther@ millert@
|
|
exit with a non-zero EXIT STATUS, as required by POSIX,
consistent with what other operating systems do, consistent
with how other OpenBSD programs behave, and making wait(2)
consistent with what happens when dd(1) dies from other signals.
Patch from <ScottCheloha at gmail dot com>.
OK florian@ tb@.
|
|
from Scott Cheloha
|
|
|
|
Information found on: http://www.tuhs.org/cgi-bin/utree.pl
Checked by Sevan Janiyan <venture37 at geeklan dot co dot uk>.
|
|
|
|
|
|
|
|
|
|
can tame "stdio" it.
ok semarie
|
|
possible. Annotate <sys/param.h> lines with their current reasons. Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution. These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)
|
|
|
|
bug report from Martin Wolters
|
|
overlapping swab behavior. vaguely ok kettenis
|
|
Do not error out when the maximum permissible value is given,
but only when it is exceeded.
Patch from William Orr <will at worrbase dot com> using feedback from tedu@.
ok millert@
|
|
ok jca@ krw@
|
|
underspecified. The man page offers little guidance as to their use.
Remove them and spare people the (likely poor) decision to use them.
ok deraadt jmc millert
|
|
ok deraadt jmc
|
|
|
|
|
|
to stderr after transfer. Use the GNU syntax status=noxfer and
status=none to make dd quiet. The output is annoying in some
situations, so people redirect stderr to /dev/null. This approach
also suppresses the error messages and bugs in shell scripts remain
undetected. The new feature status=none is the better alternative.
OK mpf@
|
|
|
|
|
|
ok halex
|
|
|
|
|
|
|
|
an fd is a socket, pipe or named pipe. OK deraadt@ matthew@
|
|
ok millert jmc
|
|
|
|
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms
|
|
The size multipliers m and w are BSD extensions, not POSIX.
While here, sort the conversions alphabetically.
help and OK jmc@, sobrado@; and sthen@ on an earlier version
|
|
updates to follow;
|
|
ok jmc@
|
|
ok millert@
|
|
|