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

Cannot write to a file if the owner doesn't have the read permission #125

Closed
declan94 opened this issue Jul 9, 2017 · 6 comments
Closed

Comments

@declan94
Copy link

declan94 commented Jul 9, 2017

The owner cannot write to a file if he doesn't have the read permission, even if he has the write permission.

For example, if the file's mode is --w-rw-rw-, the owner cannot write to the file

@rfjakob
Copy link
Owner

rfjakob commented Jul 10, 2017

That is correct, gocryptfs always needs read permissions due to read-modify-write. I'll see if can work around this by chmod'ing the file for an instant.

rfjakob added a commit that referenced this issue Jul 11, 2017
Due to RMW, we always need read permissions on the backing file. This is a
problem if the file permissions do not allow reading (i.e. 0200 permissions).
This patch works around that problem by chmod'ing the file, obtaining a fd,
and chmod'ing it back.

Test included.

Issue reported at: #125
@rfjakob
Copy link
Owner

rfjakob commented Jul 11, 2017

Should be fixed by 3062de6 - does it work for you?

@declan94
Copy link
Author

I'm sorry, but it seems not work.

@rfjakob
Copy link
Owner

rfjakob commented Jul 13, 2017

What is you gocryptfs -version output? You should get v1.4-24-g3062de6 and with that version it seems to work here, see below:

$ gocryptfs -version
gocryptfs v1.4-24-g3062de6; go-fuse v20170619; 2017-07-13 go1.8.3
$ echo xxx > foo
$ chmod 0200 foo
$ ls -l
total 4
--w-------. 1 jakob jakob 4 13. Jul 22:47 foo
$ echo xxx >> foo
$ echo xxx > foo

@declan94
Copy link
Author

Oh, I'm sorry my version is: gocryptfs v1.4-21-gb6bda01; go-fuse v20170619; 2017-07-12 go1.8.3
After update to the latest version, it works! Thank you.

@rfjakob
Copy link
Owner

rfjakob commented Jul 14, 2017

Thanks for testing!

@rfjakob rfjakob closed this as completed Jul 14, 2017
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

2 participants