Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Down VPN if pam_open_session errors out.
AFAICT, the core pluto daemon is single-threaded, and I don't see any locking around states, so it's very unlikely it's safe to call delete_state directly from the xauth thread. So there are two broad approaches I considered to doing this: a timer on the main thread to check status or using the existing whack interface. A timer would have the downside that we'd have to decide how long is too long to wait for PAM, and we could have an issue where we give up waiting, down the VPN, then pam comes back and says OK. And even if PAM comes back and says no, we'd have to then keep polling (to notice quickly) or just deal with it taking 30s–1min to down the VPN after we get the failure back, which seems unacceptable. Just using the existing whack interface has an advantage: it's easy. It's also relatively immediate. So I picked this. Instead of copy & pasting the code to generate/send the message, just exec'd the program. This should almost never happen anyway, so cost of that is minimal. TODO: Internal tickets TABLET-1402 and TABLET-1403.
- Loading branch information