Skip to content

Conversation

@sgmarz
Copy link

@sgmarz sgmarz commented Jan 2, 2026

Fixes #9934

This PR will update the failed-to-remove error message to better align with GNU coreutils. Furthermore, it adds "cannot stat" for when looking for a file to see if it exists fails. This can fail for myriad of reasons, including permission denied.

Test: original issue request

$ uu-install /dev/null /dev/full
install: failed to remove existing file '/dev/full': Permission denied (os error 13)
$ gnu-install /dev/null /dev/full
install: cannot remove '/dev/full': Permission denied

The original issue was due to the way Rust's standard library calculates is_file. It only checks for regular files to be file, but on a UNIX configuration, the files could include block and character devices as well as a FIFO device. This patch now checks the metadata to check specifically for block, character, and FIFO devices on UNIX configurations. If the configuration is not UNIX, it reverts to the original behavior.

Test: cannot stat due to permission error

$ uu-install /dev/null /root/file
install: cannot stat '/root/file': Permission denied (os error 13)
$ gnu-install /dev/null /root/file
install: cannot stat '/root/file': Permission denied

The issue here was due to the way the main branch does remove_file. Since no checks are done before this function call, we get too granular of an error: was it due to not found or not? In this patch, there is an additional check using Rust's standard try_exists. This will tell us if the actual calculation of a file existing failed.

@sylvestre
Copy link
Contributor

lot of jobs failing

@github-actions
Copy link

github-actions bot commented Jan 3, 2026

GNU testsuite comparison:

Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@github-actions
Copy link

github-actions bot commented Jan 4, 2026

GNU testsuite comparison:

Congrats! The gnu test tests/printf/printf-surprise is now passing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

install /dev/null /dev/full has wrong error message

2 participants