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

Store is undeletable if store name is accidentally ended with / #2669

Closed
p4perf4ce opened this issue Sep 14, 2023 · 1 comment · Fixed by #2698
Closed

Store is undeletable if store name is accidentally ended with / #2669

p4perf4ce opened this issue Sep 14, 2023 · 1 comment · Fixed by #2698
Assignees
Labels
bug Defects
Milestone

Comments

@p4perf4ce
Copy link

p4perf4ce commented Sep 14, 2023

Summary

Accidentally created a new store with --store name/ instead of --store name making it undiscoverable by gopass. This will require the user to manually delete the mount point in the config file.

Steps To Reproduce

  1. Initialize the password-store with [a-zA-Z]+\/
  2. gopass ls will show the mount as STORE_NAME without / but you can't do anything with it. Note that the actual path / is replaced with -. E.g., /home/username/.local/share/gopass/STORE_NAME-

Expected behavior

If the name is illegal, it shouldn't be created.

Environment

  • OS: Darwin 22.6.0: Wed Jul 5 22:17:35 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T8112 arm64
  • OS: Linux 5.15.90.1-microsoft-standard-WSL2 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
  • gopass Version: gopass 1.15.8 go1.21.1 darwin arm64
  • Installation method: brew (MacOS & Ubuntu 22.04 WSL)

Additional context

Remove the things in .config/gopass/config can workaround this issue.

@dominikschulz
Copy link
Member

Good point. Indeed. This is clearly missing some input validation. We'll add that.

@dominikschulz dominikschulz self-assigned this Sep 24, 2023
@dominikschulz dominikschulz added this to the 1.15.9 milestone Sep 24, 2023
@dominikschulz dominikschulz added the bug Defects label Sep 24, 2023
dominikschulz added a commit to dominikschulz/gopass that referenced this issue Nov 18, 2023
Fixes gopasspw#2669

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
dominikschulz added a commit that referenced this issue Nov 18, 2023
* [bugfix] Remove leading and trailing slashes from mounts

Fixes #2669

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Add tests for leading slashes

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Reorder mount alias checks

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

---------

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
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

Successfully merging a pull request may close this issue.

2 participants