Age | Commit message (Collapse) | Author |
|
As specified, don't include the subsecond part if zero and drop trailing
zeros in the subsecond part. ok millert@
|
|
Access time can't be represented by ustar, so always include it when
using the pax format. Also include an extended header record for mtime
if the file modification time can't be fully represented by ustar (eg
subsecond resolution).
Input & ok millert@
|
|
|
|
ok millert@
|
|
Use name, not ln_name. Pasto introduced in previous.
|
|
Keep writing archives in ustar format by default. People can test the
posix 'pax' format using pax(1) -w -x pax ... or cpio -o -H pax ...;
tar(1) can't exercise this code yet. Only long names file and link
names are supported for now.
With input and tests from caspar@, ok millert@
|
|
code slightly easier to understand.
okay and tweak kn@
|
|
Drop "wpath cpath fattr dpath" in read-only:
- cpio -i -t < test.tar
- pax < test.tar
- tar -t -f test.tar
Drop "cpath fattr dpath" in read-write:
- echo foo | cpio -o -A -H ustar -O test.tar
- tar -r -f test.tar foo
- pax -w -a -f test.tar foo
Other modes remain unchanged and thus can create or modify files.
Feedback OK millert
|
|
Spotted while comparing ktraces between 'tar -z' and 'gzcat | tar -f-'.
Only the former runs, e.g. gzip(1), but the latter also pledges theses promises
just to pledge again immediately afterwards without them.
Make the calls mutually exclusive so 'tar -f-' et al. skip the first pledge
and thus never have "proc exec" to begin wth.
"looks good to me" mbuhl
OK millert
|
|
-DSMALL has never been used to build the ramdisks, thus the support for
reading pax format archives has always been there. This is misleading,
so just zap the ifdef since we want to keep read support.
Went through a make release Just In Case(tm).
Spotted by caspar@, ok millert@ sthen@ caspar@
|
|
the st_*time and (obsolete) st_*timensec members separately.
ok millert@
|
|
comments sthen@ and Peter J. Philipp <pjp AT delphinusdns DOT org>
ok jmc@
|
|
Previously, when creating an archive file with pax(1), pax will attempt
to open a file even if the file will be skipped due to an -s replacement
with the empty string. With this change, pax will not attempt to open
files that it knows will be skipped.
When doing direct copies to a directory (-rw), pax already skips
the file before attempting to open it. So this makes the behavior
more consistent.
This can measurably speed up pax when skipping a large number of files.
OK tb@
|
|
initializers as they are not required to be compile-time constants.
So, intialize these global variables at the top of main().
ok miod@ deraadt@ yasuoka@ millert@
|
|
If the mtime in the file header is larger than MAX_TIME_T, trucate
it to MAX_TIME_T, not INT_MAX. OK otto@
|
|
Reported by David Leadbeater. OK op@
|
|
|
|
|
|
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@
|
|
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@
|
|
apostrophe.
|
|
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
|
|
headers (hd->size) using a 32-bit operation.
from Samanta Navarro
ok guenther
|
|
to make it read better;
reported by roderick
ok millert
|
|
show a less confusing track
okay millert@ (with a small tweak to the error message by millert@)
|
|
Change several instances, most of them to the usual -width Ds.
|
|
if not already set. This makes "cpio -Hustar -o" behave the same as
"cpio -o -Hustar". ok guenther@
|
|
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.
|
|
|
|
not arbitrary values < 0.
|
|
the pax-specific functions in cache.c. OK guenther@
|
|
the C API in section 3.
OK millert jmc nicm, "the right idea" deraadt
|
|
provides retry on short-write file descriptors.
ok florian, previous versions seen by millert
|
|
specify it more than once. Adapted from a diff by and OK schwarze@
|
|
|
|
on any sensible posix system (in which time_t must be an integer type)
ok deraadt@ millert@
|
|
ok millert@
|
|
with hint from millert@; ok millert@ guenther@
|
|
conversion is involved. Cast the sizeof to int to get a signed compare;
ok deraadt@ bluhm@
|
|
ok guenther
|
|
ok kettenis
|
|
of "tape" for a week or so.
|
|
upon "inet". Adjust the 4 programs that care about this.
|
|
"warning:" rectification.
|
|
so gcc doesn't complain about defining but not using them.
typo correction & ok jca@
|
|
prompt. From NetBSD.
ok millert@, deraadt@
|
|
noted by tb@
|
|
value that merits a warning in the manpage and using 2 billion will get
you practically the same effect, so delete the -E none support
|
|
reduce and sort #includes
|