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

Problems with creating secret with mount name #2979

Open
rayshoo opened this issue Oct 27, 2024 · 2 comments
Open

Problems with creating secret with mount name #2979

rayshoo opened this issue Oct 27, 2024 · 2 comments
Assignees
Labels
bug Defects

Comments

@rayshoo
Copy link

rayshoo commented Oct 27, 2024

Summary

When creating a secret with a mount name, unexpected behaviors occur.

Steps To Reproduce

$ gp mounts add test C:\Users\raysh\AppData\Local\gopass\stores\test
$ gp mounts list
gopass (C:\Users\raysh\AppData\Local\gopass\stores\root)
└── test (C:\Users\raysh\AppData\Local\gopass\stores\test)
$ gp insert test

Expected behavior

# It seems like the shadowed secret should be deleted, but an error occurred.
$ gp remove test
☠ Are you sure you would like to delete ["test"]? [y/N/q]: y
Error: Can not delete "test": can not delete a mount point. Use `gopass mounts remove test`

Environment

  • OS: windows10
  • gopass Version: gopass 1.15.7 go1.20.6 windows amd64
  • Installation method: chocolatey

Creating a secret with the mount name creates a .gpg file in the repository with no file name. This works differently than creating shadowed files in subfolders. Is this behavior as intended? I am currently developing a GUI tool that works with gopass, but this method has led to unexpected situations, and gopass cli also has this problem with secret remove.

@dominikschulz dominikschulz self-assigned this Oct 27, 2024
@dominikschulz dominikschulz added the bug Defects label Oct 27, 2024
@dominikschulz
Copy link
Member

@rayshoo Thanks for reporting this issue. This might be an unhandled corner case. I'll have a look.

@rayshoo
Copy link
Author

rayshoo commented Oct 28, 2024

While modifying the code of the tool I was developing to respond to this method of gopass, I recognized the following problem. As in the example above, if the password is inserted as a sub mount rather than a root mount, viewing functions such as show are possible, but deletion is not possible.

However, I realized that even if someone changed the delete function to work, access would become impossible if this store was mounted as root rather than as a submount.

# unmount and mount on root
[mounts]
path = C:\Users\chan\AppData\Local\gopass\stores\test # This store has a .gpg file on its root path
# cannot access the .gpg file of the test store root path mounted as root.
$ gp show . # This command looks for `..gpg` files and does not find `.gpg`.
$ gp show # wrong command

Therefore, it appears that this is not the intended situation. I am of the opinion that it would be better to not be able to access the mount name at all rather than allowing it to be deleted. I'm not good at English conversation, so I apologize for any inconvenience caused by communicating through a translator. thank you

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

No branches or pull requests

2 participants