Check the destination entry without following its symlink target so missing
or inaccessible referents do not fall through to a raw rename error.
Extend the regression to cover existing and dangling symlinks.
Closes#15358
On macOS the ACL isn't stored as a listed xattr, and most files carry some
xattr (e.g. com.apple.provenance), so ls -l hard-coded is_acl_set = false.
Check for an extended ACL with acl_get_file / acl_get_link_np instead and
enable the check on macOS.
Fixes#15273
Temporary files were created, reopened and deleted by path, and cleanup
emptied the temporary directory by path. Once the directory's path led to
another directory, sort read the files there as its own and deleted them.
The directory and each file are identified by device and inode when
created. Files are created and deleted through a descriptor of the
directory that is checked first, and reopened only if they are still the
file sort created. Cleanup deletes only the names sort created. Redox and
non-Unix systems keep the path-based code.
The directory descriptor is closed after each use, so with merges creating
their output before opening their inputs, sort needs no more file
descriptors than before.
When a merge has more inputs than it can open at once, each batch is
merged into a temporary file. That file was created after the batch's
inputs had been opened. Create it first, so that creating it doesn't
compete with them for file descriptors, and take each batch straight
from the input iterator instead of collecting it first.
Use `quote()`, as nohup does, instead of converting the command name
lossily. Invalid UTF-8 bytes are now escaped rather than replaced with
U+FFFD, and valid names use the quoted form printed by GNU in the C
locale.
Extend the test to check stderr for the escaped name.
nohup parsed COMMAND and its arguments as String, so clap rejected the
whole invocation when any value was not valid UTF-8. It exited 125
without running the command.
Read COMMAND and its arguments as OsString and pass them through
unchanged. The existing "failed to run command" diagnostic already
quotes an OsString correctly.
nice parsed COMMAND and its arguments as String, so clap rejected the
whole invocation when any value was not valid UTF-8. The command never
ran and nice exited 125.
Read COMMAND and the remaining arguments as OsString and pass them to
exec unchanged. Convert the command name lossily only when it is needed
for the diagnostic after exec fails.
The adjustment remains a String. GNU rejects a non-UTF-8 adjustment too;
only the diagnostic differs.