]> git.apps.os.sepia.ceph.com Git - fscrypt.git/commit
cmd/fscrypt: adjust user and keyring validation and preparation
authorEric Biggers <ebiggers@google.com>
Mon, 16 Dec 2019 03:31:39 +0000 (19:31 -0800)
committerEric Biggers <ebiggers@google.com>
Sun, 5 Jan 2020 18:02:13 +0000 (10:02 -0800)
commit0829eb74863bd279ae012779e52040ecc7f7178e
tree6f43409dc24be3e7e0aa66fb4ed53b668125972f
parent9003a0331a112e8901fae8279f4897a825ee8069
cmd/fscrypt: adjust user and keyring validation and preparation

Don't force the user to provide a --user argument when running fscrypt
as root if they're doing something where the TargetUser isn't actually
needed, such as provisioning/deprovisioning a v1 encryption policy
to/from the filesystem keyring, or creating a non-login protector.

Also don't set up the user keyring (or check for it being set up) if it
won't actually be used.

Finally, if we'll be provisioning/deprovisioning a v1 encryption policy
to/from the filesystem keyring, make sure the command is running as
root, since the kernel requires this.
cmd/fscrypt/commands.go
cmd/fscrypt/errors.go
cmd/fscrypt/flags.go
cmd/fscrypt/protector.go