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

Gopass doesn't work with symlinks #40

Closed
hobbeswalsh opened this issue Feb 6, 2017 · 3 comments
Closed

Gopass doesn't work with symlinks #40

hobbeswalsh opened this issue Feb 6, 2017 · 3 comments

Comments

@hobbeswalsh
Copy link
Contributor

How to reproduce:

## The password store is a link to a dropbox folder
➤ ls -lad ~/.password-store/
drwx------@ 155 hobbeswalsh  staff  5270 Feb  3 20:23 /Users/hobbeswalsh/.password-store/

## hiding names of passwords, but asserting that there are some
hobbeswalsh@mac:~
➤ pass | wc -l  
     208

## Gopass does not read the passwords
hobbeswalsh@mac:~
➤ gopass
gopass

hobbeswalsh@mac:~
➤ gopass fsck
Wrong permissions for file /Users/hobbeswalsh/.password-store: drwx------
Fixing permissions from -rwx------ to -rw-------
Store (/Users/hobbeswalsh/.password-store) OK
hobbeswalsh@mac:~
➤ gopass
failed to check dir /Users/hobbeswalsh/.password-store/.gpg-id: lstat /Users/hobbeswalsh/.password-store/.gpg-id: permission denied
failed to check dir /Users/hobbeswalsh/.password-store/.gpg-id: lstat /Users/hobbeswalsh/.password-store/.gpg-id: permission denied

Error: password-store is not initialized. Try 'gopass init'

## Uh, thanks for messing up all my permissions, gopass!
## Now `pass` doesn't work either.
➤ pass
Password Store

How to work around the problem:

## Let's remove the symlink and make ~/.password-store a real directory
➤ rm .password-store
hobbeswalsh@mac:~

➤ mkdir .password-store
hobbeswalsh@mac:~

➤ cp -pR ~/Dropbox/password-store/* .password-store/
hobbeswalsh@mac:~
➤ gopass

Error: password-store is not initialized. Try 'gopass init'
hobbeswalsh@mac:~
➤ gopass init
Please select a private Key for encryption:
[0] 0xFDD6CAAFE5114586 - Robin Walsh <rob.walsh@gmail.com>
Please enter the number of a key (0-0) [0]:
Password store initialized for: 0xFDD6CAAFE5114586 - Robin Walsh <rob.walsh@gmail.com>

Please select a key for signing Git Commits
[0] 0xFDD6CAAFE5114586 - Robin Walsh <rob.walsh@gmail.com>
Please enter the number of a key (0-0) [0]:
Initialized empty Git repository in /Users/rwwalsh/.password-store/.git/
... lots of output...

## Now it works.
hobbeswalsh@mac:~
➤ gopass | wc -l ; pass | wc -l
     209
     208

Obviously it would be nice it we supported symlinks.

hobbeswalsh pushed a commit to hobbeswalsh/gopass that referenced this issue Feb 6, 2017
@dominikschulz
Copy link
Member

Thanks for the bug report.

Changing permissions on a symlink is definitely a bug.

We'll rethink/discuss the symlink limitation soon.

@hobbeswalsh
Copy link
Contributor Author

My PR "fixes" the bug, but it's actually more of a workaround. Let me know if you'd like to see me approach the change differently, or if you're just going to scrap the proposed change and come up with a better-thought-out solution. Thanks!

@metalmatze
Copy link
Contributor

metalmatze commented Feb 12, 2017

I will close this issue now, because it's a duplicate of #12

dominikschulz pushed a commit that referenced this issue May 17, 2017
* Fixes #40

* Going at this a different way...

I should be doing symlink checking in fsutil.CleanPath, so I've moved it
there. We now pass unit and integration tests.
samuelnilsson pushed a commit to samuelnilsson/gopass that referenced this issue Sep 7, 2023
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

3 participants