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

xattrs support missing from reverse mode #827

Open
crowtrobot opened this issue Feb 13, 2024 · 5 comments
Open

xattrs support missing from reverse mode #827

crowtrobot opened this issue Feb 13, 2024 · 5 comments

Comments

@crowtrobot
Copy link

I just started looking into gocryptfs as a new method to encrypt offsite backups with the reverse option, and so far I am loving it. I have noticed one strange thing, and can't find a report for it here.

If I make a normal gocryptfs filesystem, and put some files in it, I can set extended attributes on those files which get encrypted and stored as extended attributes on the encrypted files. But if I mount with -reverse a directory with files that have extended attributes, they don't show up in the encrypted form.

Tested with the latest release downloaded from github, which is gocryptfs v2.4.0 without_openssl; go-fuse v2.3.0; 2023-06-10 go1.20.3 linux/amd64

Steps to reproduce:

mkdir source_files
echo test > source_files/test
setfattr -n user.test -v "some text" source_files/test
mkdir encrypted
gocryptfs -init -reverse source_files
# put in a password
gocryptfs -reverse source_files encrypted
# type in that same password
mkdir restore
gocryptfs encrypted/ restore/
# type that password in again
getfattr -d restore/test
# expect to see user.test attribute, but see nothing
getfattr -d encrypted/*
# expected to see encrypted xattr, but see nothing

I expected to see here the encrypted xattr, like this:

# file: u2StuT-0BlmWpMSky53Z2A
user.gocryptfs.mp-jfFcJfIe-Mo97njfygw=0sQEtXBWPY7U0KU2NHB0QlbGLbLY8pQX0x2T10cCEaQ2srTo279y64Po+L6fxZ+g==

But instead see nothing.

@rfjakob
Copy link
Owner

rfjakob commented Mar 12, 2024

That is, unfortunately, correct. gocryptfs -reverse does not support xattrs, c.f.

TODO but low prio. reverse mode in gocryptfs v1 did not have xattr support

@jerry-khan
Copy link

I would love to have this feature, which is also important as my primary use of gocryptfs is to create encrypted backups via mounts using the reverse mode.

@rfjakob
Copy link
Owner

rfjakob commented Aug 11, 2024 via email

@crowtrobot
Copy link
Author

In my case we have a few directories with ACLs, but most of our xattrs come from a set of custom scripts and cron jobs that monitor some shared files.

@jerry-khan
Copy link

Just to understand the use case better: what xattrs do you have? ACLs or something custom?

On Tue, 6 Aug 2024, 16:22 jerry-khan, @.> wrote: I would love to have this feature, which is also important as my primary use of gocryptfs is to create encrypted backups via mounts using the reverse mode. — Reply to this email directly, view it on GitHub <#827 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACGA77AOBHLADYMBNXTAN3ZQDLZNAVCNFSM6AAAAABDFYXANGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZRGQZDCNRQGU . You are receiving this because you commented.Message ID: @.>

The xattr that I have and use is primarily user.xdg.tags (used by many applications). I use it to tag all files and directories in my system, as an attempt to effectively have a tagging filesystem that is application-independent and future-proof.
Support for XDG's standardized extended attributes ("user.xdg....") would be very nice if possible, but not mandatory.

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

No branches or pull requests

3 participants