WSL icon indicating copy to clipboard operation
WSL copied to clipboard

rsync: rsync_xal_set: lsetxattr(...,"security.selinux") failed: Operation not supported (95)

Open JackieKu opened this issue 9 years ago • 10 comments

  • Your Windows build number: (Type ver at a Windows Command Prompt)

17025 With clean installation of Ubuntu from the Store.

  • What you're doing and what's happening: (Copy&paste specific commands and their output, or include screen shots)

Use rsync to fetch files that contains "security.selinux" xattr (SELinux). rsync rsync://nexus9/r/sdcard/Download/ ./ -aX -sxzPF --inplace --numeric-ids

On the WSL side rsync failed to set "security.selinux" xattr with the following error messages.

rsync: rsync_xal_set: lsetxattr(...,"security.selinux") failed: Operation not supported (95)

  • What's wrong / what should be happening instead:

It should work without errors, the xattrs should be copied and preserved. The release notes of Build 16226 says this should have been supported. Note I don't expect SELinux to be functional in WSL, but it should allow the data to be stored without problems.

  • Strace of the failing command, if applicable: (If <cmd> is failing, then run strace -o strace.txt -ff <cmd>, and post the strace.txt output here)

rsync-strace.txt

JackieKu avatar Nov 16 '17 03:11 JackieKu

@SvenGroot, is this expected?

jstarks avatar Nov 16 '17 22:11 jstarks

@jstarks - yes. Only a few attributes in the security namespace are implemented and this is not one of them.

benhillis avatar Nov 16 '17 22:11 benhillis

@benhillis It would be really helpful to have a list of implemented attributes with the Windows build numbers they were introduced in. At the moment https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64-root.tar.xz needs to be repacked removing system.posix_acl_* attributes to let install.tar.gz register successfully.

rbalint avatar Sep 05 '18 10:09 rbalint

@rbalint - Build 16237 added some initial xattr support, no other support has been added since then. However, none of the attributes in the system namespace are currently supported (only security.capability is fully supported).

benhillis avatar Sep 05 '18 17:09 benhillis

to be repacked removing system.posix_acl_* attributes to let install.tar.gz register successfully

Balint when you say "repacked" do you mean you un-tar it with --no-xattrs and then tar it back up without --xattrs (say piped), or is the repackaging more elaborate and involve other steps to work-around the missing attributes? This is a different way of asking, if lsetxattr(2) no-opped on unknown attributes (read: ignored fails) would that be equivalent to your repackaging process. I have a glibc shim in the can that works around various missing WSL surface to make stuff run, but my bsdtar is static.

therealkenc avatar Sep 05 '18 17:09 therealkenc

@therealkenc - I believe his issue is that the base tar.gz contains system namespace attributes, and when the distro is installed our bsdtar attempts to write the attributes, which fails and makes bsdtar return a non-zero exit code.

benhillis avatar Sep 05 '18 17:09 benhillis

Yes exactly, I know (all too well). I am asking Balint if [ed, clarify] me ~stubbing out the fail~ shimming away the xattr is sufficient, or necessary but insufficient. [Subtext being my trees are installed with a static tar so it needs to be worked-around there separately from the dynamic glibc shim].

therealkenc avatar Sep 05 '18 18:09 therealkenc

@benhillis thanks! @therealkenc We untar, then tar with --no-xattrs to keep it simple and install.tar.gz free of xattrs. If lsetxattr was a no-op for not supported attributes when extracting install.tar.gz on installation, that would help, but AFAIK that would only help going forward and not with older Windows builds.

rbalint avatar Sep 05 '18 21:09 rbalint

We ... keep it simple

Thanks for the details, appreciated.

AFAIK that would only help going forward and not with older Windows builds

Good point. Depends on whether one continues to use MSFT's internal bsdtar on those older builds, or do it another way, 'spose [inside voice]. But yeah, understand. I think (?) you run into the same kind of problem even if you were armed with a helpfully documented table of supported xattrs versus build number though. Assuming you want to want to continue supporting (say) pre-16237. Conversely, if (hypothetically) you decided to start bumping the minimum target version supported, it wouldn't matter.

therealkenc avatar Sep 05 '18 22:09 therealkenc

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!