-
-
Notifications
You must be signed in to change notification settings - Fork 521
Open
Labels
HacktoberfestbugDefectsDefectsgood-first-issueGood for beginners starting to contributeGood for beginners starting to contribute
Milestone
Description
Summary
The copy command has a different behaviour when recursively copying secret directories from one store to another.
Even if the --force
flag is given, it will recursively copy the directory structure even tho a trailing slash is given.
gopass cp --help
states, that the contents will be flattened, if a trailing slash is found.
However, the contents are not flattened, if the directory already exists in the target store.
I've also tried every combination of trailing slashes, all with the same outcome:
gopass cp --force full-store/some/secret/directory empty-store/some/secret/directory
gopass cp --force full-store/some/secret/directory/ empty-store/some/secret/directory
gopass cp --force full-store/some/secret/directory empty-store/some/secret/directory/
gopass cp --force full-store/some/secret/directory/ empty-store/some/secret/directory/
I could not spot any difference in behavior with/without the --force
flag at all.
Steps To Reproduce
- Two stores; one contains a directory of secrets, one is empty
- Copy the directory to the empty store
gopass cp --force full-store/some/secret/directory/ empty-store/some/secret/directory/
- Verify the entire directory was copied to
empty-store/some/secret/directory/
, e.g. withgopass ls empty-store
- Now run
gopass cp --force full-store/some/secret/directory/ empty-store/some/secret/directory/
again - The secrets were now copied to
empty-store/some/secret/directory/full-store/some/secret/directory
Expected behavior
The second gopass cp
command should overwrite the secrets in the existing directory and not copy the directory structure as well.
Environment
- OS: macOS Sonoma 14.5
- OS version:
Darwin FE-C-014F3 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64
- gopass Version:
gopass 1.15.13 go1.22.2 darwin arm64
- Installation method:
brew
Additional context
Metadata
Metadata
Assignees
Labels
HacktoberfestbugDefectsDefectsgood-first-issueGood for beginners starting to contributeGood for beginners starting to contribute