aboutsummaryrefslogtreecommitdiff
path: root/cmd/fscrypt/status.go
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2020-06-13 10:27:57 -0700
committerGitHub <noreply@github.com>2020-06-13 10:27:57 -0700
commitd4c6fc50bcf6493c21b363ccf69c73561f32dfe8 (patch)
treeacaae325e95953d077e551a10f66169c573653ec /cmd/fscrypt/status.go
parent9649ed0fd0ad4dcfc33454e0a86193fd255e62df (diff)
parent5c1f617c647eb0e9af5ce57758fa58f7e3f4db83 (diff)
Merge pull request #237 from ebiggers/t_v1_policy_fix
Adjust status message for v1 policies unlocked by another user and fix cli-tests/t_v1_policy
Diffstat (limited to 'cmd/fscrypt/status.go')
-rw-r--r--cmd/fscrypt/status.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/cmd/fscrypt/status.go b/cmd/fscrypt/status.go
index 02fdc74..255bb2b 100644
--- a/cmd/fscrypt/status.go
+++ b/cmd/fscrypt/status.go
@@ -68,13 +68,12 @@ func policyUnlockedStatus(policy *actions.Policy, path string) string {
status := policy.GetProvisioningStatus()
// Due to a limitation in the old kernel API for fscrypt, for v1
- // policies using the user keyring that are incompletely locked we'll
- // get KeyAbsent, not KeyAbsentButFilesBusy as expected. If we have a
- // directory path, use a heuristic to try to detect whether it is still
- // usable and thus the policy is actually incompletely locked.
+ // policies using the user keyring that are incompletely locked or are
+ // unlocked by another user, we'll get KeyAbsent. If we have a
+ // directory path, use a heuristic to try to detect these cases.
if status == keyring.KeyAbsent && policy.NeedsUserKeyring() &&
path != "" && isDirUnlockedHeuristic(path) {
- status = keyring.KeyAbsentButFilesBusy
+ return "Partially (incompletely locked, or unlocked by another user)"
}
switch status {