Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a7986df1f7 |
@@ -1025,16 +1025,19 @@ func (cli *Instance) sameDirectory(dir, other string) (bool, error) {
|
|||||||
|
|
||||||
// moveSecretCrossVault handles moving between two different vaults. Its
|
// moveSecretCrossVault handles moving between two different vaults. Its
|
||||||
// caller, MoveSecret, has already checked both secret names and that both
|
// caller, MoveSecret, has already checked both secret names and that both
|
||||||
// vaults exist. Copying needs the long-term keys of both vaults, and getting
|
// vaults exist. The copy needs the source vault's long-term key; the
|
||||||
// one can ask for a passphrase, so it gets them before it takes the state
|
// destination vault is unlocked only to check that it can be. Either can ask
|
||||||
// directory lock, and no other command waits while the user answers.
|
// for a passphrase, so both happen before it takes the state directory lock,
|
||||||
|
// and no other command waits while the user answers.
|
||||||
func (cli *Instance) moveSecretCrossVault(
|
func (cli *Instance) moveSecretCrossVault(
|
||||||
cmd *cobra.Command,
|
cmd *cobra.Command,
|
||||||
srcVault *vault.Vault, srcSecretName string,
|
srcVault *vault.Vault, srcSecretName string,
|
||||||
destVault *vault.Vault, destSecretName string,
|
destVault *vault.Vault, destSecretName string,
|
||||||
force bool,
|
force bool,
|
||||||
) error {
|
) error {
|
||||||
// Refuse a move that cannot be made before asking for anything
|
// Before unlocking, check that the source secret and the destination
|
||||||
|
// vault exist, and that the destination is not the source under another
|
||||||
|
// name
|
||||||
_, err := cli.checkCrossVaultMove(
|
_, err := cli.checkCrossVaultMove(
|
||||||
srcVault, srcSecretName, destVault, destSecretName)
|
srcVault, srcSecretName, destVault, destSecretName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user