| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
The POSIX spec [1] lists some characters that may need to be escaped.
Unfortunately, the document uses ˜ (U+02DC SMALL TILDE) instead of ~
(U+007E TILDE), and I copy-pasted from it.
[1]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02
|
| |
|
| |
|
|
|
|
| |
__ORDER_NATIVE_ENDIAN__ is not a thing.
|
|
|
|
|
| |
wcwidth() returns -1 for non-printable characters, but terminals
typically don't print anything for them, so treat them as 0.
|
|
|
|
| |
Closes: https://github.com/tavianator/bfs/issues/133
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
POSIX specifies[1] that
If a thread accesses tzname, daylight, or timezone directly while
another thread is in a call to tzset(), or to any function that is
required or allowed to set timezone information as if by calling
tzset(), the behavior is undefined.
So calling it lazily from arbitrary threads is risky.
[1]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/tzset.html
|
|
|
|
|
|
|
| |
Otherwise, if the test files are created just before midnight, and the
test runs just after midnight, -daystart will consider them one day old.
Fixes #132
|
| |
|
|
|
|
|
| |
We now report failures and continue, rather than aborting after the
first failure.
|
| |
|
|
|
|
| |
And add some more test cases.
|
| |
|
|
|
|
| |
Fixes: https://github.com/tavianator/bfs/issues/131
|
|
|
|
| |
Otherwise bfs will think it's interactive.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Rather than attempting to close any unexpected FDs, just count them and
adjust our ulimit -n calls to account for them.
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we hardcoded file descriptors 3 and 4 for duplicating
stdandard output/error respectively. In preparation for keeping
inherited FDs open, switch to using bash's variable redirection feature
to dynamically assign FDs.
This feature is only available from bash 4.1 onwards, so this marks the
end of our support for bash 3. macOS users will need to install a
modern bash version to run our tests.
|
|
|
|
|
|
| |
Otherwise, bftw_ids() or bftw_eds() might keep going!
Fixes: 5f16169 ("bftw: Share the bftw_state between iterations of ids/eds")
|
|
|
|
|
|
| |
Using -path 'deep/*/*/.../*' to simulate -mindepth 18 falls off a
performance cliff on systems that use backtracking for fnmatch(). This
was observed on macOS 12.4. Instead, just use -type f.
|
| |
|
|
|
|
|
|
|
| |
We used to have is_nonexistence_error() to consistently treat ENOENT and
ENOTDIR the same. Recently, we started considering EFAULT the same as
ENAMETOOLONG on DragonFly BSD to work around a kernel bug. Unify both
of these behind a more generic interface.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
POSIX says
> When using the symbolic mode form on a regular file, it is
> implementation-defined whether or not:
>
> - Requests to set the set-user-ID-on-execution or set-group-ID-on-
> execution bit when all execute bits are currently clear and none
> are being set are ignored.
And indeed, illumos ignores them with a warning:
chmod: WARNING: /tmp/bfs.XXXX7KaGWb/rainbow/suid: Execute permission
required for set-ID on execution
Link: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/chmod.html
|
| |
|
|
|
|
|
|
|
|
|
| |
DragonFly's x86_64 assembly implementation of copyinstr() checks the
wrong pointer when deciding whether to return EFAULT or ENAMETOOLONG,
causing it to always return EFAULT for overlong paths. Work around it
by treating EFAULT the same as ENAMETOOLONG on DragonFly.
Link: https://twitter.com/tavianator/status/1742991411203485713
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The POSIX spec for readdir() [1] says:
> If a file is removed from or added to the directory after the most
> recent call to opendir() or rewinddir(), whether a subsequent call
> to readdir() returns an entry for that file is unspecified.
which implies that a loop of readdir()/unlink()/creat() may continue to
return new files unendingly. This was even observed on a Linux 6.6
tmpfs mount [2].
It's not clear whether find(1) is also permitted to loop endlessly in
this case, but in case it is, let's avoid the whole problem by limiting
the -exec to happen at most once.
[1]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/readdir.html
[2]: https://lore.kernel.org/linux-fsdevel/20231113180616.2831430-1-tavianator@tavianator.com/
|
| |
|
|
|
|
|
|
| |
Doesn't work for the highest bit due to overflow.
This reverts commit 208376ef99da243545efcd6fb02d3469b4c068ed.
|