aboutsummaryrefslogtreecommitdiff
path: root/cmd/fscrypt/errors.go
diff options
context:
space:
mode:
authorJoseph Richey <joerichey@google.com>2017-08-22 11:46:39 -0700
committerGitHub <noreply@github.com>2017-08-22 11:46:39 -0700
commit17794e94ebe140dc74f93abb8132f5295ee2004e (patch)
tree3e79eee2f6e266ea7cd4eab7473bde7faa01e585 /cmd/fscrypt/errors.go
parentb4d51e0f4d34dbfd78e23662f3dfd90e86ae5e48 (diff)
parent50256fab010adfde1b349160460659fb03d8c8ac (diff)
Merge pull request #39 from google/purge
Purge command now clears cache
Diffstat (limited to 'cmd/fscrypt/errors.go')
-rw-r--r--cmd/fscrypt/errors.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/fscrypt/errors.go b/cmd/fscrypt/errors.go
index b0548d5..10dbf1e 100644
--- a/cmd/fscrypt/errors.go
+++ b/cmd/fscrypt/errors.go
@@ -58,6 +58,7 @@ var (
ErrNotEmptyDir = errors.New("not an empty directory")
ErrNotPassphrase = errors.New("protector does not use a passphrase")
ErrUnknownUser = errors.New("unknown user")
+ ErrDropCachesPerm = errors.New("inode cache can only be dropped as root")
)
var loadHelpText = fmt.Sprintf("You may need to mount a linked filesystem. Run with %s for more information.", shortDisplay(verboseFlag))
@@ -112,6 +113,11 @@ func getErrorSuggestions(err error) string {
cannot be encrypted in-place. Instead, encrypt an empty
directory, copy the files into that encrypted directory,
and securely delete the originals with "shred".`
+ case ErrDropCachesPerm:
+ return fmt.Sprintf(`Either this command should be run as root to
+ properly clear the inode cache, or it should be run with
+ %s=false (this may leave encrypted files and directories
+ in an accessible state).`, shortDisplay(dropCachesFlag))
case ErrAllLoadsFailed:
return loadHelpText
default: