-
Notifications
You must be signed in to change notification settings - Fork 457
encrypt.go: check keyFile permissions #1347
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
Conversation
c1c5fe4 to
69f8ed1
Compare
pkg/blobserver/encrypt/encrypt.go
Outdated
| // TODO: check that keyFile's unix permissions aren't too permissive. | ||
| if fileInfo, err := os.Stat(keyFile); err != nil { | ||
| return nil, fmt.Errorf("Checking for key file permissions %v: %v", keyFile, err) | ||
| } else if fileInfo.Mode().Perm() != 0600 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might be too specific for Windows. You probably want Perm() & 0077 != 0 instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, done!
| } | ||
|
|
||
| // Using key file | ||
| tmpKeyFile, _ := ioutil.TempFile(os.TempDir(), "camlitest") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use t.TempDir() instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, done!
69f8ed1 to
64692cc
Compare
|
ping @bradfitz I still can't merge anything. Looks like I can manage issues but not push to protected branches. This is probably setup in repository permissions. Can you also add me to the org? Thanks |
Ah, indeed, we all the permissions set up all fancy here. I'd forgotten about that. All fixed. Try again? |
|
Works, thanks :) |
64692cc to
97e1bd5
Compare
picked-up a small todo in the code.