From: Chris B. <buc...@us...> - 2012-03-12 19:25:23
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "SFCB - Small Footprint CIM Broker". The branch, master has been updated via e6677b03ffce1d4745422d158a2a18dc348a8520 (commit) from 9f7a510022cb5291179a4f678bf3d1a41c46295f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit e6677b03ffce1d4745422d158a2a18dc348a8520 Author: buccella <buc...@li...> Date: Mon Mar 12 15:25:09 2012 -0400 [ 3367361 ] Allow for releasing auth handle after CIM request completes ----------------------------------------------------------------------- Summary of changes: diff --git a/ChangeLog b/ChangeLog index ea43e22..e72c481 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-03-12 Chris Buccella <buc...@li...> + + * httpAdapter.c, sfcBasicPAMAuthentication.c: + [ 3367361 ] Allow for releasing auth handle after CIM request completes + 2012-03-10 Chris Buccella <buc...@li...> * httpAdapter.c: diff --git a/NEWS b/NEWS index f83ec4e..7ef94e2 100644 --- a/NEWS +++ b/NEWS @@ -97,6 +97,7 @@ New Features: - 3440300 Allow forced chunked responses - 3367333 New entry point for authentication library - 3367332 RHOST Support for PAM +- 3367361 Allow for releasing auth handle after CIM request completes Bugs Fixed: diff --git a/httpAdapter.c b/httpAdapter.c index 7ec86ce..5a4a6c5 100644 --- a/httpAdapter.c +++ b/httpAdapter.c @@ -1199,6 +1199,10 @@ doHttpRequest(CommHndl conn_fd) if (response.buffer != NULL) cleanupCimXmlRequest(&response); + if (extras.release) { + extras.release(extras.authHandle); + } + #ifdef SFCB_DEBUG if (uset && (_sfcb_trace_mask & TRACE_RESPONSETIMING)) { gettimeofday(&ev, NULL); diff --git a/sfcBasicPAMAuthentication.c b/sfcBasicPAMAuthentication.c index 4b2ba80..5904b66 100644 --- a/sfcBasicPAMAuthentication.c +++ b/sfcBasicPAMAuthentication.c @@ -59,6 +59,11 @@ sfcBasicConv(int num_msg, const struct pam_message **msg, return PAM_CONV_ERR; } +void closePam(pam_handle_t* handle) { + int rc = PAM_SUCCESS; + pam_end(handle, rc); +} + static int _sfcBasicAuthenticateRemote(char *user, char *pw, AuthExtras *extras) { @@ -94,7 +99,13 @@ _sfcBasicAuthenticateRemote(char *user, char *pw, AuthExtras *extras) retval = 0; } - pam_end(pamh, rc); + /* if we keep the handle around, it means we'll call pam_end() later */ + if (extras) { + extras->authHandle = pamh; + extras->release = closePam; + } + else + pam_end(pamh, rc); return retval; } hooks/post-receive -- SFCB - Small Footprint CIM Broker |