]> git.apps.os.sepia.ceph.com Git - fscrypt.git/commitdiff
pam_fscrypt: log errors getting protector in policiesUsingProtector()
authorEric Biggers <ebiggers@google.com>
Wed, 23 Feb 2022 20:35:04 +0000 (12:35 -0800)
committerEric Biggers <ebiggers@google.com>
Wed, 23 Feb 2022 20:35:04 +0000 (12:35 -0800)
If the error is anything other than ErrNotSetup, it might be helpful to
know what is going on.

pam_fscrypt/run_fscrypt.go

index 8c640ced8c445d1cd7c92d6e1b97f26eb1e042b4..a563ab5c3d3fe072e6cfc300a109b01e863e403c 100644 (file)
@@ -173,6 +173,9 @@ func policiesUsingProtector(protector *actions.Protector) []*actions.Policy {
                // Skip mountpoints that do not use the protector.
                if _, _, err := mount.GetProtector(protector.Descriptor(),
                        protector.Context.TrustedUser); err != nil {
+                       if _, ok := err.(*filesystem.ErrNotSetup); !ok {
+                               log.Print(err)
+                       }
                        continue
                }
                policyDescriptors, err := mount.ListPolicies(protector.Context.TrustedUser)