summaryrefslogtreecommitdiff
path: root/bin
AgeCommit message (Collapse)Author
2024-01-16print flag 'l' for base program or ld.so being under pinsyscalls enforcement,Theo de Raadt
and 'L' for libc.so. This flag printing may be deleted once we are entirely confident this is working correctly. ok kettenis
2023-12-27'pax' format support for mtime and atimeJeremie Courreges-Anglas
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@
2023-12-22Zap useless newline added in previousJeremie Courreges-Anglas
2023-12-22'pax' format support for files over 8GBJeremie Courreges-Anglas
ok millert@
2023-12-21Print the proper file name in case we fail to allocate a "path" extended headerJeremie Courreges-Anglas
Use name, not ln_name. Pasto introduced in previous.
2023-12-09Add basic write support for 'pax' format archivesJeremie Courreges-Anglas
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@
2023-11-26mark functions as static when they're unused elsewhere, makes theMarc Espie
code slightly easier to understand. okay and tweak kn@
2023-11-10accept numerical user IDsKlemens Nanni
Turn [-U username] into [-U user] to match top(1)/pgrep(1)/fstat(1) -U/-u taking both "root" and "0". Feedback OK millert
2023-11-09Tighten pledge in List and Append mode:Klemens Nanni
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
2023-10-31cksum: better describe the -c (checklist) optionTodd C. Miller
The -c option can handle entries in normal (BSD) and reverse (GNU) format. Both hex and base64 entries are supported. OK jmc@
2023-10-31cksum -c: support checking base64 digests in reverse mode too.Todd C. Miller
In reverse mode, the entry does not include the digest algorithm so the specified algorithm (or the default) is used when checking. OK deraadt@
2023-10-20Improve markup in some cases where .Li was abused.Ingo Schwarze
Triggered by a smaller diff from jan@. OK jmc@ jan@
2023-10-15Pledge once with or without "proc exec", not twiceKlemens Nanni
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
2023-10-07Simplify the display() function by getting rid of a useless bufferIngo Schwarze
on the stack. No functional change, +8 -15 LOC. Suggested by and OK millert@.
2023-10-07Improve horizontal alignment in long format when printing minorIngo Schwarze
device numbers greater than 999 by measuring the two widths needed for device numbers just like it is already done for other numbers. In the output, this only changes whitespace, but not the text. Ugly formatting reported by Crystal Kolipe <kolipe dot c at exoticsilicon dot com>. OK millert. Also tested by Crystal Kolipe.
2023-09-14sh(1), ksh(1): reimplement p_tv() with p_ts()Scott Soule Cheloha
p_tv() is identical to p_ts(). Better to not have two copies: in p_tv(), convert the timeval to a timespec and pass it to p_ts(). With input from tb@ and millert@. Thread: https://marc.info/?l=openbsd-tech&m=169448818503541&w=2 ok tb@ millert@
2023-09-04Zap #ifndef SMALL around pax format read supportJeremie Courreges-Anglas
-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@
2023-08-19Copy entire st_*tim structs at once, rather than copyingPhilip Guenther
the st_*time and (obsolete) st_*timensec members separately. ok millert@
2023-08-18use imperative tense consistently; OK jmcKlemens Nanni
2023-08-08Replace use of the old BSD st_*timensec members in struct stat withPhilip Guenther
the POSIX-standard st_*tim.tv_nsec members. ok millert@
2023-08-03add extract example and reorder flags on other examplesaisha
comments sthen@ and Peter J. Philipp <pjp AT delphinusdns DOT org> ok jmc@
2023-07-23avoid MAIL* environment variables to save a few bytes in install mediaKlemens Nanni
ksh(1) MAIL, MAILCHECK, MAILPATH mbox handling is useless in the installer. OK miod deraadt
2023-07-10Don't open files that will be skippedJeremy Evans
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@
2023-07-06Document PS_CHROOT, and upcoming PS_NOBTCFI flagsTheo de Raadt
2023-07-05It isn't portable to use stderr (or std{in,out}) in file-scopePhilip Guenther
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@
2023-06-26pax: truncate times to MAX_TIME_T, not INT_MAXTodd C. Miller
If the mtime in the file header is larger than MAX_TIME_T, trucate it to MAX_TIME_T, not INT_MAX. OK otto@
2023-06-26pax: use safe_print() to display messages which may include file names.Todd C. Miller
Reported by David Leadbeater. OK op@
2023-06-26fix grammar of the comment describing pat_chk(); ok millert@Omar Polo
2023-06-21ksh: escape control chars when displaying file name completions.Todd C. Miller
If there are multiple matches when using autocomplete, the list of matching file names was output as-is. However, for a single match, control characters are escaped before the file name is displayed. This makes the behavior more consistent by escaping control chars in the list of matches too. Discussed with deraadt@, OK op@
2023-06-10ksh: remove broken special handling of test -tOmar Polo
Drop the vestiges of the pre-POSIX support of `test -t' defaulting to fd 1. It doesn't work and it always succeed since "-t" is treated as a string by default when no argument (fd) is specified. diff by Lucas (lucas [at] sexy [dot] is) with minor change by me. ok millert@
2023-06-10test: fix description of -t: it has no defaultOmar Polo
-t always requires the fd number as argument, there's no default. With only one argument -t is equivalent to `test -n -t' and so banally always true. diff from Lucas (lucas [at] sexy [dot] is) ok millert@
2023-05-24ksh: make $(< filename) error output include the errno string.Todd C. Miller
This is more consistent with how bash, zsh and ksh93 behave and makes $(< filename) more of a drop-in replacment for $(cat filename). OK kn@ florian@
2023-05-13add /usr/local/sbin to PATH;Jason McIntyre
confirmed/ok kn
2023-03-30escape "An" in a %T call, so groff does not flag it as an error;Jason McIntyre
2023-03-30adjust markup of one of the builtin kill usageOmar Polo
The Op on its own line becomes part of the item body instead of the list item itself. OK millert@
2023-03-08Fix alignment of command column. print_comm_name() returns an updatedTobias Heider
length value, not the length difference. ok deraadt@ millert@ guenther@
2023-03-08Delete obsolete /* ARGSUSED */ lint comments.Philip Guenther
ok miod@ millert@
2023-02-08Omit version in SMALL ksh buildsKlemens Nanni
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
2023-01-17pax: Switch a function definition from K&R to ANSI.Theo Buehler
2023-01-07Add {get,set}thrname(2) for putting thread names in the kernel andPhilip Guenther
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@
2023-01-01Round up fractional percentages, as per POSIX.Todd C. Miller
From nabijaczleweli, OK deraadt@
2022-12-31Document that -P disables BLOCKSIZE support.Todd C. Miller
With input from and OK jmc@
2022-12-26reformat some multiline markup, which had been causing an unwantedJason McIntyre
space (specifically in the "alias", "readonly" and "typeset" commands); from josiah frentsos
2022-12-22Denote multiple arguments with 'arg ...' not 'args'Klemens Nanni
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
2022-12-19Remove array reference from sh(1) because sh doesn't have arrays.Stefan Hagen
Reported with diff from Ross L Richardson Agreed kn, OK jmc
2022-12-04userspace: remove vestigial '?' cases from top-level getopt(3) loopsScott Soule Cheloha
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@
2022-11-18Write number of bytes read/written and "?" prompt to stdout, not stderr.Todd C. Miller
This matches both historical behavior and the POSIX specification. From Soeren Tempel.
2022-10-13controm terminql -> controlling terminal;Jason McIntyre
2022-10-11correct t_lex_type() return typeJonathan Gray
ok miod@
2022-10-11remove unused varJonathan Gray