@@ -46,25 +46,10 @@ func (p Pass) checkInitialized() error {
46
46
if passInitialized {
47
47
return nil
48
48
}
49
- // In principle, we could just run `pass init`. However, pass has a bug
50
- // where if gpg fails, it doesn't always exit 1. Additionally, pass
51
- // uses gpg2, but gpg is the default, which may be confusing. So let's
52
- // just explictily check that pass actually can store and retreive a
53
- // password.
54
- password := "pass is initialized"
55
- name := path .Join (getPassDir (), "docker-pass-initialized-check" )
56
-
57
- _ , err := p .runPassHelper (password , "insert" , "-f" , "-m" , name )
49
+ // We just run a `pass ls`, if it fails then pass is not initialized.
50
+ _ , err := p .runPassHelper ("" , "ls" )
58
51
if err != nil {
59
- return fmt .Errorf ("error initializing pass: %v" , err )
60
- }
61
-
62
- stored , err := p .runPassHelper ("" , "show" , name )
63
- if err != nil {
64
- return fmt .Errorf ("error fetching password during initialization: %v" , err )
65
- }
66
- if stored != password {
67
- return fmt .Errorf ("error round-tripping password during initialization: %q != %q" , password , stored )
52
+ return fmt .Errorf ("pass not initialized: %v" , err )
68
53
}
69
54
passInitialized = true
70
55
return nil
0 commit comments