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 list --flat doesn't show secrets with the same names as folders #2338

Closed
duxovni opened this issue Sep 11, 2022 · 5 comments · Fixed by #2341 or #2376
Closed

gopass list --flat doesn't show secrets with the same names as folders #2338

duxovni opened this issue Sep 11, 2022 · 5 comments · Fixed by #2341 or #2376
Assignees
Labels
bug Defects
Milestone

Comments

@duxovni
Copy link
Contributor

duxovni commented Sep 11, 2022

Summary

If a secret has the same name as a folder, it won't be listed by gopass list --flat.

Steps To Reproduce

gopass add foo/bar
gopass add foo/bar/baz
gopass list --flat

Expected behavior

Should return:

foo/bar
foo/bar/baz

Environment

  • OS: NixOS
  • OS version: 22.11
  • gopass Version: 1.14.5
  • Installation method: Nixpkgs

Additional context

@dominikschulz dominikschulz self-assigned this Sep 13, 2022
@dominikschulz
Copy link
Member

Small but tricky little issue. I think I found it, but I'll need to make sure all the tests pass and nothing breaks.

@dominikschulz dominikschulz added this to the 1.14.7 milestone Sep 13, 2022
@dominikschulz dominikschulz added the bug Defects label Sep 13, 2022
dominikschulz added a commit to dominikschulz/gopass that referenced this issue Sep 13, 2022
Fixes gopasspw#2338

RELEASE_NOTES=[BUGFIX] Do not shadow entries behind folders.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
@AnomalRoil
Copy link
Member

I won't say it's by design, but note we might want to change the text around shadowing here if we change the behaviour:
https://github.com/gopasspw/gopass/blob/master/docs/commands/list.md#shadowing

@dominikschulz
Copy link
Member

You are right. Thank you. I'll look at that once I get to fix the failing tests.

dominikschulz added a commit that referenced this issue Sep 16, 2022
* Do not omit shadowed entries in ls output

Fixes #2338

RELEASE_NOTES=[BUGFIX] Do not shadow entries behind folders.

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

* Add shadow marker

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

* Adjust tests to match the new shadow behaviour

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

* Update list docs wrt. shadowing

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

* Do not mark mounts as shadowed. That's already implicit.

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

* Add more comments and some other cleanup

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

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
@duxovni
Copy link
Contributor Author

duxovni commented Oct 3, 2022

This doesn't seem to have been fixed in 1.14.9? I'm seeing that gopass list now adds (shadowed) after shadowed entries, but shadowed entries are still missing from gopass list --flat.

@dominikschulz
Copy link
Member

I'm confused. This should have been fixed before. #2341 did fix some cases but your PR looks legit.
I'll need a bit to think a about these edge cases.

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