]> git.apps.os.sepia.ceph.com Git - fscrypt.git/commit
pam: return error when PAM info item is unset
authorEric Biggers <ebiggers@google.com>
Sun, 25 Mar 2018 06:21:29 +0000 (23:21 -0700)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 25 Mar 2018 06:50:36 +0000 (23:50 -0700)
commit81942ab75c02e720970d6af069e8b8cf3ef847bb
tree1df58e59595ea964928c57ae78136dd53e647d51
parent3ef69aaafcfe6df03097d9ebdc8e4c7f7516999b
pam: return error when PAM info item is unset

pam_fscrypt is crashing with a segfault in copyIntoSecret() when using
Ctrl-C to interrupt a 'sudo' prompt.  It is dereferencing a NULL pointer
that is supposed point to the PAM_AUTHTOK item.  The problem is that the
Go code assumes pam_get_item() returns a non-success status if the item
is unset, when actually it sets the data pointer to NULL and returns
PAM_SUCCESS.

Fix it by making pam.Handle.GetItem() return an error in that case.
pam/pam.go