aboutsummaryrefslogtreecommitdiff
path: root/cmd/fscrypt/errors.go
diff options
context:
space:
mode:
authorJoseph Richey <joerichey@google.com>2020-03-23 14:24:23 -0700
committerGitHub <noreply@github.com>2020-03-23 14:24:23 -0700
commitab531eea551598170e4dd973fa5955f01b5c0318 (patch)
treead01ed9d6ffa3d9715c40ff14041f95978107ba7 /cmd/fscrypt/errors.go
parentb43cb6970da16fea7aa2c073a83891909a2833b1 (diff)
parent02ec13d8d96fc16282998f8355074dad53271591 (diff)
Merge pull request #205 from ebiggers/autoselect-v2
Automatically enable policy_version 2 when kernel support is detected
Diffstat (limited to 'cmd/fscrypt/errors.go')
-rw-r--r--cmd/fscrypt/errors.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/cmd/fscrypt/errors.go b/cmd/fscrypt/errors.go
index bef6c2a..8bda921 100644
--- a/cmd/fscrypt/errors.go
+++ b/cmd/fscrypt/errors.go
@@ -113,6 +113,10 @@ func getErrorSuggestions(err error) string {
return fmt.Sprintf(`You can only use %s to access the user
keyring of another user if you are running as root.`,
shortDisplay(userFlag))
+ case keyring.ErrV2PoliciesUnsupported:
+ return fmt.Sprintf(`v2 encryption policies are only supported by kernel
+ version 5.4 and later. Either use a newer kernel, or change
+ policy_version to 1 in %s.`, actions.ConfigFileLocation)
case actions.ErrBadConfigFile:
return `Run "sudo fscrypt setup" to recreate the file.`
case actions.ErrNoConfigFile:
@@ -127,6 +131,13 @@ func getErrorSuggestions(err error) string {
metadata is corrupted.`
case actions.ErrMissingProtectorName:
return fmt.Sprintf("Use %s to specify a protector name.", shortDisplay(nameFlag))
+ case actions.ErrAccessDeniedPossiblyV2:
+ return fmt.Sprintf(`This may be caused by the directory using a v2
+ encryption policy and the current kernel not supporting it. If
+ indeed the case, then this directory can only be used on kernel
+ v5.4 and later. You can create directories accessible on older
+ kernels by changing policy_version to 1 in %s.`,
+ actions.ConfigFileLocation)
case ErrNoDestructiveOps:
return fmt.Sprintf("Use %s to automatically run destructive operations.", shortDisplay(forceFlag))
case ErrSpecifyProtector: