summaryrefslogtreecommitdiff
path: root/usr.bin/find
AgeCommit message (Collapse)Author
2023-08-11Replace use of the old BSD st_*timespec members in struct stat withPhilip Guenther
the POSIX-standard st_*tim members. ok millert@
2023-04-01horrible whitespace, mostly on non-code lines. no object changeTheo Buehler
2023-03-08Delete obsolete /* ARGSUSED */ lint comments.Philip Guenther
ok miod@ millert@
2023-03-07Delete obsolete /* ARGSUSED1 */ lint comments.Philip Guenther
ok claudio@ cheloha@ krw@ deraadt@ miod@ millert@
2022-12-26spelling fixes from paul tagliamonte;Jason McIntyre
part of a larger diff: i'm committing this separately as i changed statuses to status;
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-03-31man pages: add missing commas between subordinate and main clausesChristian Weisgerber
jmc@ dislikes a comma before "then" in a conditional, so leave those untouched. ok jmc@
2021-10-24For open/openat, if the flags parameter does not contain O_CREAT, theTheo de Raadt
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
2021-03-07v1/v2 find is different to pwb/v5 findJonathan Gray
2020-11-23The -exec primary is terminated by either ';' or '+', but the latterAlexander Hall
only if immediately following a '{}' placeholder. Slightly modify the error message to indicate so. Brought up by and discussed with Paul de Weerd, thanks! ok millert@
2020-09-30Now that dprintf(3) uses format string annotation checking, a sizeof()Theo de Raadt
requires (int) for a '*' modifier ok millert
2020-08-14'!' does not need to be escaped;Jason McIntyre
confirmed by naddy and deraadt
2020-04-09Account for environment when computing maximum space used for argsJeremie Courreges-Anglas
Already done by xargs(1). Pointed out by espie@, ok millert@
2020-04-09find -exec +: use sysconf to find the kernel's idea of ARG_MAXJeremie Courreges-Anglas
Using ARG_MAX directly doesn't fly when ARG_MAX gets bumped and the kernel and userland are not in sync, effectively breaking find -exec +. Use sysconf(3) as already done in xargs(1). Spotted by sthen@, ok deraadt@ millert@ sthen@
2019-09-02More correction of section 3 layout. directory->opendir, fts->fts_open,Theo de Raadt
getcap->cgetent. pwcache->user_from_uid. And then repair references. ok jmc
2019-08-23Use -delete in EXAMPLESkn
-delete is part of POSIX since 2001 and tedu added support for it in 2012, -print0 however never made it into any standard, so replace this less portable idiom with its more concise built-in counterpart. Both -print0 as well as xargs(1) -0 explain and reference each other and CAVEATS goes into detail with problematic file names, so no information is lost by replacing this particular example. While here, make the -exec example rm(1) multiple files at once. Feedback from claudio tb Input and OK millert
2019-06-28When system calls indicate an error they return -1, not some arbitraryTheo de Raadt
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.
2019-02-05dev_t is signed to permit passing -1 as an invalid condition, but theTheo de Raadt
decomposition into major and minor is unsigned, so we should print them with %u instead of %d. ok guenther
2018-12-06add -not as a sh friendly alias for !.Ted Unangst
ok millert
2018-09-16Use uid_from_user(3) and gid_from_group(3) in utilities thatTodd C. Miller
do repeated lookups. OK tb@
2018-08-01document when -exec evaluates to true; from kris katterjohnJason McIntyre
ok tb while here, knock out a useless Tn;
2018-08-01Update a comment to include -delete, -execdir, -ls and -print0 amongTheo Buehler
the primaries that do not imply -print. From Kris Katterjohn, thanks! ok jmc
2018-08-01Document that -delete and -execdir prevent -print from being assumed.Theo Buehler
From Kris Katterjohn, thanks. ok jmc
2017-12-08Convert snprintf+write into dprintf. It is simply easier to read, andTheo de Raadt
provides retry on short-write file descriptors. ok florian, previous versions seen by millert
2017-01-04If find(1) may end up calling execve(2), it needs "proc exec" in additionTheo Buehler
to its other promises. Previously, find ran unpledged if the -exec{,dir} or -ok primaries were specified: the tame(2) calls for find(1) were added a few days before the "exec" promise was implemented and these code paths were never revisited. ok millert
2017-01-03tweak previous;Jason McIntyre
2017-01-03add -delete option which can simplify the common case of wanting to deleteTed Unangst
lots of files without the arcane -exec or error prone xargs. code from freebsd. ok millert
2015-10-10normalize a few more tame request orderings, to help reviewTheo de Raadt
2015-10-09Change all tame callers to namechange to pledge(2).Theo de Raadt
2015-10-05If expression omits -exec/execdir/-ok primaries, then find will neverTheo de Raadt
enter the fork+execve codepath. That allows use of "stdio getpw rpath"! Use of -exec methods have been discouraged for years anyways, with -print0/xargs -0 now considered safer practice. ok guenther millert
2015-09-11delete bogus escaping from ellipsis to forestall cargo cult effectsIngo Schwarze
2015-07-14Don't dereference a freed pointer when updating the value of p.Todd C. Miller
Noted by tedu@
2015-07-14Convert the last remaining realloc() in find to reallocarray().Todd C. Miller
2015-07-14In brace_subst() if we realloc() the store, update p so that itTodd C. Miller
points into the new store, not the old one. From Gregor Best.
2015-04-18Convert many atoi() calls to strtonum(), adding range checks and failureTheo de Raadt
handling along the way. Reviews by Brendan MacDonell, Jeremy Devenport, florian, doug, millert
2015-03-15tzfile.h is an internal header that should never have been installed.Todd C. Miller
What's worse, the tzfile.h that gets installed is over 20 years old and doesn't match the real tzfile.h in libc/time. This makes the tree safe for /usr/include/tzfile.h removal. The TM_YEAR_BASE define has been moved to time.h temporarily until its usage is replaced by 1900 in the tree. Actual removal of tzfile.h is pending a ports build. Based on a diff from deraadt@
2015-02-28Reduce usage of predefined strings in manpages.Anthony J. Bentley
Predefined strings are not very portable across troff implementations, and they make the source much harder to read. Usually the intended character can be written directly. No output changes, except for two instances where the incorrect escape was used in the first place. tweaks + ok schwarze@
2015-01-19Make some $OpenBSD$ lines prettier/standardier by eliminatingKenneth R Westerback
superflous '*' after '/*' and adding blank after terminating '$'. Also eases parsing of the lines by simple awk scripts. Aesthetic approval from tedu@.
2015-01-16Replace <sys/param.h> with <limits.h> and other less dirty headers whereTheo de Raadt
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)
2014-12-03document -o and -a; requested by yonJason McIntyre
i had to tweak their descriptions a little to make the text read nicely while here, fix some minor issues: - kill some unneeded Xo/Xc - kill some unneeded Tn - replace "\*Gt" with ">"
2014-12-01Use warnc() to use the correct errno value for FTS_DNR, FTS_NS andTodd C. Miller
FTS_ERR. From Piotr Durlej.
2014-05-18use reallocarrayMarc Espie
okay chl@, tedu@
2014-03-20- use more portable -o in examples, requested by millert and sobradoJason McIntyre
- tweak STANDARDS to make the note about -and and -or a little clearer - remove some gnu clutter ok millert sobrado
2014-01-20Obvious .Xr fixes, found while testing mandocdb(8).Ingo Schwarze
2014-01-10Copy changes from ls -l to find -ls: print future times with year and usePhilip Guenther
strftime() instead of parsing ctime()'s output. ok millert@
2013-11-15Include unistd.h as it is the standard location for getopt().Todd C. Miller
2013-04-23handle large ino_t; ok millertTheo de Raadt
2013-04-20adjust commentTheo de Raadt
2013-04-19handle large numbers. this fixes time_t beyond 2038, constrains theTheo de Raadt
range of i_num correctly, and now handles files > 4GB in size on 32-bit machines. ok otto millert
2013-03-14-follow is the same as -L, not -HAlexander Hall
second occurance pointed out by Jeremie Courreges-Anglas, thanks! ok guenther@ on the first occurance