aboutsummaryrefslogtreecommitdiff
path: root/actions/recovery.go
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2020-05-09 14:52:07 -0700
committerEric Biggers <ebiggers@google.com>2020-05-09 15:21:31 -0700
commit37457cce5b0436493dba7cdac6e1af5f51d25f47 (patch)
tree8f2e234aab045971fd5f4f74ff2836a4e19aa9a8 /actions/recovery.go
parente9919b0bfd00c7d228531ebafa410cbfdafcb2e3 (diff)
actions/protector: improve errors
ErrProtectorName: Rename to ErrLoginProtectorName for clarity, and include the name and user. ErrMissingProtectorName: Include the correct protector source. ErrDuplicateName: Rename to ErrProtectorNameExists for clarity, and remove a level of wrapping by including the name directly. ErrDuplicateUID: Rename to ErrLoginProtectorExists for clarity, and remove a level of wrapping by including the user directly.
Diffstat (limited to 'actions/recovery.go')
-rw-r--r--actions/recovery.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/actions/recovery.go b/actions/recovery.go
index 1c55ec5..458349b 100644
--- a/actions/recovery.go
+++ b/actions/recovery.go
@@ -23,8 +23,6 @@ import (
"os"
"strconv"
- "github.com/pkg/errors"
-
"github.com/google/fscrypt/crypto"
"github.com/google/fscrypt/metadata"
)
@@ -72,7 +70,7 @@ func AddRecoveryPassphrase(policy *Policy, dirname string) (*crypto.Key, *Protec
if err == nil {
break
}
- if errors.Cause(err) != ErrDuplicateName {
+ if _, ok := err.(*ErrProtectorNameExists); !ok {
return nil, nil, err
}
seq++