From 63b22a2f2ac9b6fe977697879bc63861f5f6f866 Mon Sep 17 00:00:00 2001 From: Magnus Hyllander Date: Wed, 17 Jun 2020 13:43:05 +0200 Subject: [PATCH] updatekeys: Make file path absolute "sops updatekeys" is not working the same as when encrypting a file. The reason is that for "sops --encrypt", the file path is made absolute before it is compared with the path_regex in the config file. This is not done for "sops updatekeys", therefore it does not match the correct entry in the config file when updating keys. --- cmd/sops/subcommand/updatekeys/updatekeys.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/sops/subcommand/updatekeys/updatekeys.go b/cmd/sops/subcommand/updatekeys/updatekeys.go index 3541dfa06..143bcfe60 100644 --- a/cmd/sops/subcommand/updatekeys/updatekeys.go +++ b/cmd/sops/subcommand/updatekeys/updatekeys.go @@ -34,6 +34,7 @@ func UpdateKeys(opts Opts) error { if info.IsDir() { return fmt.Errorf("can't operate on a directory") } + opts.InputPath = path return updateFile(opts) }