Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for Cygwin XATTRs in NTFS-3g? #112

Open
philcerf opened this issue May 2, 2024 · 0 comments
Open

support for Cygwin XATTRs in NTFS-3g? #112

philcerf opened this issue May 2, 2024 · 0 comments

Comments

@philcerf
Copy link

philcerf commented May 2, 2024

Hey.

Cygwin supports user.* XATTRs by encoding them somehow in Windows EAs.

Any chance to see support for reading these via ntfs-3g?

Maybe with default mount options, they could be mapped into some special namespace (like cygwin.*) and with some special mount option like xattr-profile=cygwin they could get mapped directly into user.* ?

I found only little information on how they do it.

There's a few words in https://www.cygwin.com/cygwin-ug-net/cygwin-ug-net.pdf on PDF page 4, chapter 1.6.3 File Access.

Other than that, one would probably have to resort to https://www.cygwin.com/git.html where it seems in

  • winsup/cygwin/fhandler/disk_file.cc
  • winsup/cygwin/include/attr/xattr.h
  • winsup/cygwin/ntea.cc (which seems to contain the beef in read_ea())

ntfs-3g already has some limited support for getting the data:

$ getfattr -n system.ntfs_ea test --only-values | hd
00000000  90 00 00 00 00 04 80 00  46 4f 4f 4f 00 37 32 66  |........FOOO.72f|
00000010  32 35 64 39 30 65 66 34  63 66 65 63 64 61 38 66  |25d90ef4cfecda8f|
00000020  61 32 63 34 37 35 36 31  61 66 35 61 66 30 61 31  |a2c47561af5af0a1|
00000030  30 61 39 32 62 66 64 31  35 39 38 36 62 31 66 39  |0a92bfd15986b1f9|
00000040  31 36 33 35 38 62 66 36  61 63 38 61 33 37 38 35  |16358bf6ac8a3785|
00000050  38 61 31 34 64 32 37 33  32 39 35 30 36 61 33 37  |8a14d27329506a37|
00000060  36 36 62 61 64 30 66 33  34 64 32 65 30 34 63 61  |66bad0f34d2e04ca|
00000070  66 33 39 37 63 31 36 30  37 62 34 33 38 30 65 62  |f397c1607b4380eb|
00000080  33 33 63 39 37 64 33 37  64 66 63 33 37 00 00 00  |33c97d37dfc37...|
00000090

Here, on test the following XATTR was set from Cygwin:

$ setfattr -n user.fooo -v 72f25d90ef4cfecda8fa2c47561af5af0a10a92bfd15986b1f916358bf6ac8a37858a14d27329506a3766bad0f34d2e04caf397c1607b4380eb33c97d37dfc37 test

Not sure whether support for FAT and exFAT is needed, because it seems Cygwin itself cannot even set XATTRs on them.

Cheers,
Philippe

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

No branches or pull requests

1 participant