Skip to content

Including .gpg extension causes unintended results when calling fscopy #2768

@tjex

Description

@tjex

Summary

It could also be worth looking at #2767 along with this issue, as they seem to be related.

the command gopass fscopy file.ext.gpg ~/dir/file.ext results in file.ext.gpg being copied (still encrypted) to a newly created folder $PASSWORD_STORE_DIR/dir.

This results in $PASSWORD_STORE_DIR/file.ext.gpg and $PASSWORD_STORE_DIR/dir/file.ext.gpg.

Steps To Reproduce

cd $PASSWORD_STORE_DIR
touch ~/test-file.txt
gopass fscopy ~/test-file.txt ./test-file.txt
gopass fscopy ./test-file.txt.gpg ~/test-dir/test-file-dencrypted.txt
ls $PASSWORD_STORE_DIR

Notice how (on mac) there is a new Users/<user>/test-dir directory with test-file-decrypted.txt.gpg inside.

Expected behavior

An error message stating the requirement of fscopy to be provided filenames without .gpg extension, as well as a friendly notice that the user may be wanting to use gopass cp instead.

Environment

  • macos 13.5
  • OS Version: Darwin tjex-lappy 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul 5 22:22:05 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T6000 arm64
  • gopass Version: gopass 1.15.11 go1.21.4 darwin arm64
  • Installation method: brew

Additional context

Metadata

Metadata

Assignees

Labels

bugDefects

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions