IABSD.fr/src/bin

Branch :


Log

Author Commit Date CI Message
93da23da 2024-11-30 06:59:12 use a more readable explanation of directory creation; from evan silberman, tweaked by millert ok sthen (pre-tweak)
85ce0bb8 2024-10-15 13:49:49 Add PS_STOPPED to the flags
118f3e42 2024-10-14 08:26:48 remove duplicate includes and license; feedback and ok miod@
1ca96170 2024-10-12 07:58:40 remove duplicate unistd.h include
c59e78d3 2024-10-10 10:24:14 Print the session id (PID of the session leader) instead of a pointer. Pointers are only visible when run as superuser. Also in most cases you want to know which process is the session leader and which process groups belong together. So it is better to print the session id. OK deraadt@ (long time ago)
e9d1bb1d 2024-09-25 06:13:01 remove some unneeded Xo/Xc calls; from evan silberman the original diff had a couple of errors, which i've fixed
e6679286 2024-09-23 21:18:33 If during parsing lines in the script, ksh finds a NUL byte on the line, it should abort ("syntax error: NUL byte unexpected"). There appears to be one piece of software which is misinterpreting guidance of this, and trying to depend upon embedded NUL. During research, every shell we tested has one or more cases where a NUL byte in the input or inside variable contents will create divergent behaviour from other shells. (ie. gets converted to a space, is silently skipped, or aborts script parsing or later execution). All the shells are written in C, and majority of them use C strings for everything, which means they cannot embed a NUL, so this is not surprising. It is quite unbelievable there are people trying to rewrite history on a lark, and expecting the world to follow alone. If there is ONE THING the Unix world needs, it is for bash/ksh/sh to stop diverging further by permitting STUPID INPUT that cannot plausibly work in all other shells. We are in a post-Postel world. It remains possible to put arbitrary bytes *AFTER* the parts of the shell script that get parsed & executed (like some Solaris patch files do). But you can't put arbirary bytes in the middle, ahead of shell script parsed lines, because shells can't jump to arbitrary offsets inside the input file, they go THROUGH all the 'valid shell script text lines' to get there. This was in snapshots for more than 2 months, and only spotted one other program depending on the behaviour (and that test program did not observe that it was therefore depending in incorrect behaviour!!) ok ingo. Softer ok's from various others.
8c6999ca 2024-08-27 19:27:19 inline `start' and simplify; from/ok millert@
edf882c3 2024-08-27 18:45:58 ksh: use strtonum() in findhistrel() ok millert@, deraadt@
79df796a 2024-08-25 09:32:08 Since netstart r1.208 (2020), it no longer applies /etc/myname Change Xr from netstart to rc. From Christian Schulte, ok florian
c7735c59 2024-08-21 03:07:45 We do not need the PS_LIBCPIN and PS_PIN flag fields anymore, which were used during devlopment (for visibility). There is speculation claudio will immediately use these bits for something else.
b0522082 2024-08-20 23:40:39 Now that we have dup2(), csh can use it instead of close()+dup(). Also, as used here, dup/dup2 will clear the close-on-exec flag, so delete the superfluous fcntl(F_SETFD,0) calls ok deraadt@
421bf2dd 2024-08-19 01:43:23 move ed/tests files to regress/bin/ed, where they are used
18d62080 2024-08-15 06:27:24 unifdef for S_I{FLNK,FIFO,FSOCK}. For the operations where we use access() (-r, -w, -x, -e) do them without requiring stat() to succeed first. ok tb@ deraadt@
b27f9b39 2024-08-15 00:47:44 'newercnt' no longer does anything that 'refcnt' doesn't; eliminate the former in favor of the latter. ok millert@
33f846a6 2024-08-01 14:44:34 bump posix spec from 2008 -> 2024; no documented changes.
4cef13ba 2024-08-01 14:30:17 bump posix spec 2008 -> 2024; no change noted from 2008 spec, but i've added -h to the list of extensions. that was an omission from our 2008 notes, rather than a change in the spec.
20b6c1a1 2024-08-01 14:08:38 bump posix spec 2008 -> 2024;
ca1e11fc 2024-08-01 14:08:07 bump posix spec 2008 -> 2024;
b7fe6922 2024-07-29 09:50:30 Sync with sys/proc.h after P_CONTINUED -> PS_CONTINUED change. OK mpi@
324a3c8c 2024-07-28 15:31:22 block SIGHUP in the same places where SIGCHLD is blocked to protect the process lists, because the SIGHUP handler looks at them (and it is very difficult to rewrite the that handler a different way) ok millert
fc20a59e 2024-07-22 09:44:37 Sync with proc.h: s/PS_STOPPED/PS_STOPPING/ OK kettenis@
2bde29b3 2024-07-16 05:01:10 Fix the SIGHUP signal race. ed's "event loop" operates a getchar(); check the hup flag before and after that call, when the buffer structures are stable for write_file() to work. Remove the hup handling from the SPL0() macro, because this is run in at least one place during structure instability. The SIGINT handler, which uses siglongjmp(), is also trusting the SPL1/SPL0 dance more than it should. ok millert
c7d97141 2024-07-14 14:32:02 Zap trailing whitespace Dummy commit to trigger the git exporter.
ba080721 2024-07-12 19:11:25 Rewrite bytes/sec calculation using fixed point math. 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
f901c358 2024-07-12 14:30:27 refactor the signal handlers for clarity, inverting the situation: 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
9606c166 2024-07-12 07:22:44 annotate broken signal handler
1245b84d 2024-06-18 16:41:39 Stop trying to deprecate "test -L" in favour of "test -h" (or vice versa). It's hopeless because POSIX requires both since Issue 6 (2001). Both always worked on OpenBSD, no matter which base system shell was used. According to research done by jsg@, it seems likely that actually, "test -L" has precedence over "test -h" by about one year: v8 (Feb 1985) had -L, SunOS 3.0 (Feb 1986) had -h; but SVR4 (1989) already had both, so we are talking about 35 years of petrification. More details: https://marc.info/?l=openbsd-bugs&m=171867441927989 Resolving a question raised by Tim dot theCHASEs dot com on bugs@. OK deraadt@ millert@ jsg@ jmc@ and also works for Tim Chase.
ce7279d8 2024-05-21 05:00:47 remove prototypes with no matching function and externs with no var partly checked by millert@
375f1517 2024-05-18 13:08:09 prefixing flags to ps(1) by a hyphen is optional; while here, make synopsis fit in a 80-column display. ok jmc@
bb7daa6d 2024-05-18 05:21:38 When comparing mtimes for the -u and -Z options and the target is 'too old', use pathconfat(_PC_TIMESTAMP_RESOLUTION, AT_SYMLINK_NOFOLLOW) to get the timestamp resolution to which the _source_ timestamp should be truncated for a stable comparison. Problem reported by Walter Alejandro Iglesias (wai(at)roquesor.com) ok millert@
8758bb59 2024-05-10 20:28:31 pax: make list file handle line-buffered unless it is stderr. This fixes a problem where the file list output was fully-buffered when used as part of a pipeline. With this change, files are listed as they are extracted in verbose mode. OK deraadt@ guenther@
55449a4b 2024-04-28 16:43:15 gmtime(3) / locatime(3) can fail when timestamps are way off. Add missing error checks to all calls under bin/ Input & OK millert
9a584187 2024-04-27 19:49:42 Use propper knf. Spotted by kettenis.
a782b597 2024-04-27 14:57:02 localtime(3) can fail if time_t is very far in the future or past. found using afl++ OK millert
e6c7c102 2024-04-23 13:34:50 correct indentation; no functional change ok tb@
8df76133 2024-04-17 18:12:12 Provide a pax format specific option handler The existing tar_opt() implements support for -o write_opt=nodir for the old tar and ustar formats. We don't really want to support it for the pax format, and we want to be able to implement pax format specific options (even if there are none right now). ok millert@
3e7fedf4 2024-04-17 15:48:44 Fold long line
4ce91cbe 2024-04-17 10:19:17 Fixup comment Spotted by caspar@ earlier
e313d3eb 2024-04-16 23:09:35 Switch tar(1) write default format to 'pax' Lets us store longer file names, link names, finer grained timestamps, larger archive member files, etc; at the expense of larger uncompressed archives and less widespread support across the ecosystem. If you're unhappy with the new defaults, you can use -F ustar. Or you can help fix bugs / find a better middle ground. Prodding from various including job@ and deraadt@ ok sthen@ caspar@ millert@
fe4b30a0 2024-04-16 22:58:10 Fix reading large pax extended records 512 bytes isn't enough if you want to store rather large but still useful long file names or symbolic links destinations. The best way to size the buffer to read those records is based upon the largest paths pax(1) can handle, and that is PAXPATHLEN. Reported by caspar@, input and ok millert@
cf0ae65b 2024-04-16 20:51:11 Fix pasto: broken storage of symbolic link long destinations in pax format
489289b7 2024-04-16 19:09:06 Revert wip patch, not intended for commit
f30fa552 2024-04-16 19:04:11 Add tar(1) -F option to select write format We want to move towards 'pax' as the default format for writing, this option lets users downgrade to -F ustar where the 'pax' format isn't convenient/usable (same as -x <format> in pax(1)). -F <format> is more generic than -o/-O. -H (GNU tar) was already used and we don't want long options so --format (NetBSD/FreeBSD) is excluded too. ok sthen@ caspar@ millert@
ce1e26fb 2024-04-16 18:52:43 Correctly detect 'pax' format archives in append mode We expect that existing pax archives start with a global or extended header. If they don't, append operations will be done using ustar format. Fixes append mode on pax archives where pax(1) would bail out when appending to pax archives, falsely detecting a mismatch. Reading was unaffected. Reported by caspar@, ok caspar@ millert@
85d4a8a2 2024-04-15 22:07:08 Amend previous: improve comment
9dcb0c6d 2024-04-15 17:33:10 Switch pax(1) to write archives using the 'pax' format by default ramdisk versions will keep using ustar for writing. ok millert@
ba906cc6 2024-03-27 14:44:52 printtime: use the Unix epoch if the file's timestamp is invalid Fixes a crash in "ls -l" for files with bogus timestamp values. OK miod@ denis@
6be3c107 2024-03-06 06:26:22 add missing Ev macro; from mail at lukasneukom ch
81fb472f 2024-02-03 18:51:57 Remove Softdep. Softdep has been a no-op for some time now, this removes it to get it out of the way. Flensing mostly done in Talinn, with some help from krw@ ok deraadt@
58457bb1 2024-01-28 19:05:33 Remove the 'l' and 'L' flag printing in 'STAT' column. These were added to provide visibility of the internal behaviour of pinsyscalls(2) during introduction. These flags remain (less) visible in the "-o procflags" option, as 0x08000000 (PS_PIN) and 0x10000000 (PS_LIBCPIN). That's good enough.
b54e1577 2024-01-20 17:34:50 Better formatting for pax extended header times As specified, don't include the subsecond part if zero and drop trailing zeros in the subsecond part. ok millert@
3b5541ba 2024-01-16 19:08:37 print flag 'l' for base program or ld.so being under pinsyscalls enforcement, and 'L' for libc.so. This flag printing may be deleted once we are entirely confident this is working correctly. ok kettenis
554c9a8f 2023-12-27 08:29:41 'pax' format support for mtime and atime 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@
cd67bb40 2023-12-22 20:32:29 Zap useless newline added in previous
eafddf6e 2023-12-22 20:29:27 'pax' format support for files over 8GB ok millert@
ba5cb451 2023-12-21 01:20:54 Print the proper file name in case we fail to allocate a "path" extended header Use name, not ln_name. Pasto introduced in previous.
013e174a 2023-12-09 23:00:11 Add basic write support for 'pax' format archives 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@
c01bd743 2023-11-26 16:04:17 mark functions as static when they're unused elsewhere, makes the code slightly easier to understand. okay and tweak kn@
52e706ca 2023-11-10 09:17:02 accept numerical user IDs Turn [-U username] into [-U user] to match top(1)/pgrep(1)/fstat(1) -U/-u taking both "root" and "0". Feedback OK millert
067bf70e 2023-11-09 18:54:15 Tighten pledge in List and Append mode: 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
80461f24 2023-10-31 20:42:14 cksum: better describe the -c (checklist) option The -c option can handle entries in normal (BSD) and reverse (GNU) format. Both hex and base64 entries are supported. OK jmc@
6f4f14eb 2023-10-31 19:37:17 cksum -c: support checking base64 digests in reverse mode too. In reverse mode, the entry does not include the digest algorithm so the specified algorithm (or the default) is used when checking. OK deraadt@
1e99d303 2023-10-20 18:51:09 Improve markup in some cases where .Li was abused. Triggered by a smaller diff from jan@. OK jmc@ jan@
942b9b29 2023-10-15 09:49:57 Pledge once with or without "proc exec", not twice 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
772e31c1 2023-10-07 13:29:08 Simplify the display() function by getting rid of a useless buffer on the stack. No functional change, +8 -15 LOC. Suggested by and OK millert@.
09b34e9c 2023-10-07 11:51:08 Improve horizontal alignment in long format when printing minor 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.
9ab2d3bb 2023-09-14 18:32:03 sh(1), ksh(1): reimplement p_tv() with p_ts() 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@
9c4549c6 2023-09-04 17:05:34 Zap #ifndef SMALL around pax format read support -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@
e425abdc 2023-08-19 04:21:05 Copy entire st_*tim structs at once, rather than copying the st_*time and (obsolete) st_*timensec members separately. ok millert@
7ac65e42 2023-08-18 14:10:33 use imperative tense consistently; OK jmc
6fa343ac 2023-08-08 04:45:44 Replace use of the old BSD st_*timensec members in struct stat with the POSIX-standard st_*tim.tv_nsec members. ok millert@
81f808e1 2023-08-03 18:17:54 add extract example and reorder flags on other examples comments sthen@ and Peter J. Philipp <pjp AT delphinusdns DOT org> ok jmc@
08cf2055 2023-07-23 23:42:03 avoid MAIL* environment variables to save a few bytes in install media ksh(1) MAIL, MAILCHECK, MAILPATH mbox handling is useless in the installer. OK miod deraadt
07ca5729 2023-07-10 16:28:33 Don't open files that will be skipped 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@
b8bce0ff 2023-07-06 10:07:09 Document PS_CHROOT, and upcoming PS_NOBTCFI flags
c0c90351 2023-07-05 18:45:14 It isn't portable to use stderr (or std{in,out}) in file-scope 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@
2f186dea 2023-06-26 18:00:59 pax: truncate times to MAX_TIME_T, not INT_MAX If the mtime in the file header is larger than MAX_TIME_T, trucate it to MAX_TIME_T, not INT_MAX. OK otto@
375ccafb 2023-06-26 16:58:50 pax: use safe_print() to display messages which may include file names. Reported by David Leadbeater. OK op@
3921d3a3 2023-06-26 07:10:17 fix grammar of the comment describing pat_chk(); ok millert@
abe76290 2023-06-21 22:22:08 ksh: escape control chars when displaying file name completions. 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@
990e11ad 2023-06-10 07:24:21 ksh: remove broken special handling of test -t 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@
ef9fc2e5 2023-06-10 07:19:39 test: fix description of -t: it has no default -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@
4fae8b77 2023-05-24 14:20:33 ksh: make $(< filename) error output include the errno string. 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@
318b6d18 2023-05-13 18:34:49 add /usr/local/sbin to PATH; confirmed/ok kn
ed451670 2023-03-30 16:16:32 escape "An" in a %T call, so groff does not flag it as an error;
c1c1c9e2 2023-03-30 16:00:47 adjust markup of one of the builtin kill usage The Op on its own line becomes part of the item body instead of the list item itself. OK millert@
66cbf9ab 2023-03-08 14:47:02 Fix alignment of command column. print_comm_name() returns an updated length value, not the length difference. ok deraadt@ millert@ guenther@
5b133f3f 2023-03-08 04:43:04 Delete obsolete /* ARGSUSED */ lint comments. ok miod@ millert@
7fada9fd 2023-02-08 17:22:10 Omit version in SMALL ksh builds 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
366a2d32 2023-01-17 16:20:28 pax: Switch a function definition from K&R to ANSI.
cef5a146 2023-01-07 05:24:58 Add {get,set}thrname(2) for putting thread names in the kernel and 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@
dca39b43 2023-01-01 16:31:20 Round up fractional percentages, as per POSIX. From nabijaczleweli, OK deraadt@
d9f757ce 2022-12-31 21:47:53 Document that -P disables BLOCKSIZE support. With input from and OK jmc@
c82ed43e 2022-12-26 17:45:27 reformat some multiline markup, which had been causing an unwanted space (specifically in the "alias", "readonly" and "typeset" commands); from josiah frentsos
881f6c5f 2022-12-22 19:53:22 Denote multiple arguments with 'arg ...' not 'args' 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
4068fef5 2022-12-19 08:19:50 Remove array reference from sh(1) because sh doesn't have arrays. Reported with diff from Ross L Richardson Agreed kn, OK jmc
d7259957 2022-12-04 23:50:45 userspace: remove vestigial '?' cases from top-level getopt(3) loops 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@
a565d659 2022-11-18 14:52:03 Write number of bytes read/written and "?" prompt to stdout, not stderr. This matches both historical behavior and the POSIX specification. From Soeren Tempel.
a398fd9a 2022-10-13 21:37:05 controm terminql -> controlling terminal;