From 9003a0331a112e8901fae8279f4897a825ee8069 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 15 Dec 2019 19:31:39 -0800 Subject: cmd/fscrypt: add 'fscrypt lock' command Add support for 'fscrypt lock'. This command "locks" a directory, undoing 'fscrypt unlock'. When the filesystem keyring is used, 'fscrypt lock' also detects when a directory wasn't fully locked due to some files still being in-use. It can then be run again later to try to finish locking the files. --- actions/policy.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'actions/policy.go') diff --git a/actions/policy.go b/actions/policy.go index 6ef83ce..2d8c521 100644 --- a/actions/policy.go +++ b/actions/policy.go @@ -406,6 +406,12 @@ func (policy *Policy) Deprovision() error { policy.Context.getKeyringOptions()) } +// NeedsUserKeyring returns true if Provision and Deprovision for this policy +// will use a user keyring, not a filesystem keyring. +func (policy *Policy) NeedsUserKeyring() bool { + return !policy.Context.Config.GetUseFsKeyringForV1Policies() +} + // commitData writes the Policy's current data to the filesystem. func (policy *Policy) commitData() error { return policy.Context.Mount.AddPolicy(policy.data) -- cgit v1.2.3