version 1.19.2.2, 2013/06/03 22:35:02
|
version 1.19.2.3, 2013/07/20 18:32:37
|
|
|
| |
#if defined(PEGASUS_PAM_AUTHENTICATION) | #if defined(PEGASUS_PAM_AUTHENTICATION) |
# include "PAMAuth.h" | # include "PAMAuth.h" |
|
#else |
|
/* PAM_SUCCESS is defined to 0 by PAM */ |
|
#define PAM_SUCCESS 0 |
#endif | #endif |
| |
/* | /* |
|
|
| |
#if defined(PEGASUS_PAM_AUTHENTICATION) | #if defined(PEGASUS_PAM_AUTHENTICATION) |
| |
if (PAMAuthenticate(request.username, request.password) != 0) |
status = PAMAuthenticate(request.username, request.password); |
|
|
|
if (status == PAM_SUCCESS) |
{ | { |
status = -1; |
Log(LL_TRACE, |
break; |
"Basic authentication through PAM: " |
|
"username = %s, successful.", |
|
request.username); |
|
} |
|
else |
|
{ |
|
Log(LL_TRACE, |
|
"Basic authentication through PAM: " |
|
"username = %s, failed with PAM return code= %d.", |
|
request.username, |
|
status); |
} | } |
|
|
| |
#else /* !PEGASUS_PAM_AUTHENTICATION */ | #else /* !PEGASUS_PAM_AUTHENTICATION */ |
| |
|
|
} | } |
} | } |
| |
|
Log(LL_TRACE, "Basic authentication attempt: username = %s, " |
|
"successful = %s", |
|
request.username, status == PAM_SUCCESS ? "TRUE" : "FALSE" ); |
|
|
#endif /* !PEGASUS_PAM_AUTHENTICATION */ | #endif /* !PEGASUS_PAM_AUTHENTICATION */ |
} | } |
while (0); | while (0); |
| |
Log(LL_TRACE, "Basic authentication attempt: username = %s, " |
|
"successful = %s", |
|
request.username, status == 0 ? "TRUE" : "FALSE" ); |
|
|
|
/* Send response message. */ | /* Send response message. */ |
| |
response.status = status; | response.status = status; |
|
|
| |
#if defined(PEGASUS_PAM_AUTHENTICATION) | #if defined(PEGASUS_PAM_AUTHENTICATION) |
| |
if (PAMValidateUser(request.username) != 0) |
status = PAMValidateUser(request.username); |
status = -1; |
|
| |
#else /* !PEGASUS_PAM_AUTHENTICATION */ | #else /* !PEGASUS_PAM_AUTHENTICATION */ |
| |