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

File permissions are not preserved in macOS #300

Open
mig8447 opened this issue Feb 23, 2020 · 3 comments
Open

File permissions are not preserved in macOS #300

mig8447 opened this issue Feb 23, 2020 · 3 comments

Comments

@mig8447
Copy link

mig8447 commented Feb 23, 2020

Tested with homebrew blackbox version 1.20181219 (macOS 10.14.4, GPG 2.1) for a file that has 400 permissions. When decrypting, it stores the file as 644.

Even changing the permissions to the .gpg file didn't help, decryption is still giving 644

Related to issue #100

@TomOnTime
Copy link
Collaborator

This is due to how gpg works, not how blackbox works.

You can control this, somewhat by setting the umask:

export DECRYPT_UMASK=0277

Does that help?

@tlimoncelli
Copy link
Contributor

tlimoncelli commented Apr 27, 2021

tbh, I think the stuff we did around permissions was a design mistake. Adjusting permissions is a layering violation.
Permissions should be handled at a different layer.

Cloning the permissions of .gpg doesn't make as much sense as when we originally thought. Git doesn't maintain permissions very well (intentionally). Plus, this could get you into a bad situation: What if you want permissions on the unencrypted file that wouldn't make sense on the encrypted file?

I haven't made any decisions but I'm considering deprecating all permission-related code. Instead, people should run a script afterwords that fixes permissions.

@a2f0
Copy link

a2f0 commented Apr 27, 2021

Based on my testing this morning the unencryption process honors the umask setting in the shell, this is sufficient for my use case.

EDIT: allow me to backpedal on this. I think I I reported bad information. The unencrypted files appear to take the permission of the encrypted file. I had to set the umask before I cloned the repo.

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

4 participants