aboutsummaryrefslogtreecommitdiff
path: root/actions/context.go
diff options
context:
space:
mode:
authorJoe Richey joerichey@google.com <joerichey@google.com>2017-08-15 18:11:29 -0700
committerJoe Richey joerichey@google.com <joerichey@google.com>2017-08-17 22:49:44 -0700
commit151e8965fa3a9c8f65e316430f9df0fa763fb02d (patch)
tree5be6cb1e1d617e60ba7624abc3c940c65715ba5e /actions/context.go
parentb4d51e0f4d34dbfd78e23662f3dfd90e86ae5e48 (diff)
cmd/fscrypt: purge command now clears cache
Diffstat (limited to 'actions/context.go')
-rw-r--r--actions/context.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/actions/context.go b/actions/context.go
index fb25b54..7e4b64b 100644
--- a/actions/context.go
+++ b/actions/context.go
@@ -31,9 +31,10 @@ package actions
import (
"log"
+ "golang.org/x/sys/unix"
+
"github.com/pkg/errors"
- "github.com/google/fscrypt/crypto"
"github.com/google/fscrypt/filesystem"
"github.com/google/fscrypt/metadata"
)
@@ -101,8 +102,10 @@ func (ctx *Context) checkContext() error {
}
// getService returns the keyring service for this context. We use the presence
-// of the LegacyConfig flag to determine if we should use the legacy services
-// (which are necessary for kernels before v4.8).
+// of the LegacyConfig flag to determine if we should use the legacy services.
+// For ext4 systems before v4.8 and f2fs systems before v4.6, filesystem
+// specific services must be used (these legacy services will still work with
+// later kernels).
func (ctx *Context) getService() string {
// For legacy configurations, we may need non-standard services
if ctx.Config.HasCompatibilityOption(LegacyConfig) {
@@ -111,7 +114,7 @@ func (ctx *Context) getService() string {
return ctx.Mount.Filesystem + ":"
}
}
- return crypto.DefaultService
+ return unix.FS_KEY_DESC_PREFIX
}
// getProtectorOption returns the ProtectorOption for the protector on the