gopass cp
has a different behaviour depending on whether the recursive directory already exist
#2912
Labels
Milestone
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
gopass cp --force full-store/some/secret/directory/ empty-store/some/secret/directory/
empty-store/some/secret/directory/
, e.g. withgopass ls empty-store
gopass cp --force full-store/some/secret/directory/ empty-store/some/secret/directory/
againempty-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
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 1.15.13 go1.22.2 darwin arm64
brew
Additional context
The text was updated successfully, but these errors were encountered: