aboutsummaryrefslogtreecommitdiff
path: root/pam_fscrypt
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2020-05-09 14:04:47 -0700
committerEric Biggers <ebiggers@google.com>2020-05-09 14:04:47 -0700
commit8ff53630f1cc90ae23835e9571f9096e211dce67 (patch)
tree56eaebbb984ff3e4e2f8512e17bff3be77fe4bb0 /pam_fscrypt
parent31bc8c843e1862b2d28f31eff85eca3d1dbd4754 (diff)
cmd/fscrypt: add FSCRYPT_ROOT_MNT environmental variable
Allow overriding the mountpoint where login protectors are stored by setting the FSCRYPT_ROOT_MNT environmental variable. The CLI tests need this to avoid touching the real "/".
Diffstat (limited to 'pam_fscrypt')
-rw-r--r--pam_fscrypt/run_fscrypt.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pam_fscrypt/run_fscrypt.go b/pam_fscrypt/run_fscrypt.go
index 3d0acb1..ef7ff92 100644
--- a/pam_fscrypt/run_fscrypt.go
+++ b/pam_fscrypt/run_fscrypt.go
@@ -132,7 +132,8 @@ func setupLogging(args map[string]bool) io.Writer {
// one exists. This protector descriptor (if found) will be cached in the pam
// data, under descriptorLabel.
func loginProtector(handle *pam.Handle) (*actions.Protector, error) {
- ctx, err := actions.NewContextFromMountpoint("/", handle.PamUser)
+ ctx, err := actions.NewContextFromMountpoint(actions.LoginProtectorMountpoint,
+ handle.PamUser)
if err != nil {
return nil, err
}