Skip to content

Conversation

drinkcat
Copy link
Collaborator

Fixes #8402, misc/selinux will pass with this -- I just added test for 2 non-SELinux set of attributes in fifo and symlinks, it's really verbose to test everything.


cp: Also copy attributes in copy_symlink

Most attributes can actually be applied to symlinks (mode and
xattr are exceptions), so try to copy them, if possible.

Fort those 2 exceptions, we don't need any special handling as:

  • Mode errors would be ignored anyway.
  • The source symlink cannot have any xattr anyway, so no
    attribute is attempted to be set on the destination.

cp: File logic error when preserving attributes for fifos

There was a mismatch between the test, the comment, and the code.

The intention was to preserve attributes if the source of a
fifo/pipe still exists. Perhaps the clearest way is to modify
the test (as that avoids code duplication).

Also add a basic test for that, if permissions are preserved, the
rest should also be preserved correctly.

Fixes the first part of #8402.

drinkcat added 2 commits July 30, 2025 17:37
There was a mismatch between the test, the comment, and the code.

The intention was to _preserve_ attributes if the source of a
fifo/pipe still exists. Perhaps the clearest way is to modify
the test (as that avoids code duplication).

Also add a basic test for that, if permissions are preserved, the
rest should also be preserved correctly.

Fixes the first part of uutils#8402.
Most attributes can actually be applied to symlinks (mode and
xattr are exceptions), so try to copy them, if possible.

Fort those 2 exceptions, we don't need any special handling as:
 - Mode errors would be ignored anyway.
 - The source symlink cannot have any xattr anyway, so no
   attribute is attempted to be set on the destination.
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/misc/selinux is no longer failing!

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/misc/selinux is no longer failing!

@sylvestre
Copy link
Contributor

Congrats! The gnu test tests/misc/selinux is no longer failing!

sweet!

@RenjiSann RenjiSann merged commit d90f3a4 into uutils:main Jul 31, 2025
118 of 119 checks passed
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.

cp: Fails to preserve fifo permissions, and symlink/fifo SELinux context
3 participants