adaptivecomputing/torque — pull request #236 by craigprescott (2014-06-03 20:51:51+00:00)
Title: Munge auth: credential filename uniqueness, improved error logging

* Use mkstemp() to create the temporary credential file instead of
using a filename based upon timestamps. This solves the problem of
munge auth failures due to the credential filenames not being unique.

* Make daughter routines of req_altauthenuser() return PBSE_* codes.
Replace req_reject() calls in these routines with log_err() calls
using the aforementioned PBSE codes. Add log_err() calls in these
routines for additional error conditions for complete coverage, so
we can actually tell from the server log what exactly went wrong if
a munge auth attempt failed. Call req_reject() once in
req_altauthenuser() instead.

* Use non-blocking I/O for reading the munge credential in
pipe_and_read_unmunge().

* Don't delete the credential file if there was a problem unmunge-ing
the request.