aboutsummaryrefslogtreecommitdiff
path: root/cmd/fscrypt/commands.go
diff options
context:
space:
mode:
authorJoseph Richey <joerichey@google.com>2017-07-17 13:28:16 -0700
committerGitHub <noreply@github.com>2017-07-17 13:28:16 -0700
commit4d6827a49491e941ea535178789b29e4c6b6d51f (patch)
tree00f10a4333fb4f5b2226be8372e83f5ea45df44c /cmd/fscrypt/commands.go
parent465e31bd92d70d983f45a186ce29b9ff9cd1fd40 (diff)
parent5d727874440e4e451b45baba4ad7e277b9399730 (diff)
Merge pull request #19 from google/fix
Separate encryption support from metadata support
Diffstat (limited to 'cmd/fscrypt/commands.go')
-rw-r--r--cmd/fscrypt/commands.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/cmd/fscrypt/commands.go b/cmd/fscrypt/commands.go
index 2049b57..4f53fe2 100644
--- a/cmd/fscrypt/commands.go
+++ b/cmd/fscrypt/commands.go
@@ -198,11 +198,12 @@ func checkEncryptable(ctx *actions.Context, path string) error {
return errors.Wrap(ErrNotEmptyDir, path)
}
- log.Printf("ensuring %s is not encrypted and filesystem is using fscrypt", path)
+ log.Printf("ensuring %s supports encryption and filesystem is using fscrypt", path)
switch _, err := actions.GetPolicyFromPath(ctx, path); errors.Cause(err) {
case metadata.ErrNotEncrypted:
- // We are not encrypted
- return nil
+ // We are not encrypted. Finally, we check that the filesystem
+ // supports encryption
+ return ctx.Mount.CheckSupport()
case nil:
// We are encrypted
return errors.Wrap(metadata.ErrEncrypted, path)