version 1.1.2.2, 2007/01/04 06:58:32
|
version 1.2, 2007/05/25 18:35:14
|
|
|
| |
static void Exit(int status) | static void Exit(int status) |
{ | { |
syslog(LOG_INFO, "exit(%d)", status); |
syslog(LOG_DEBUG, "exit(%d)", status); |
exit(status); | exit(status); |
} | } |
| |
|
|
/* Open syslog: */ | /* Open syslog: */ |
| |
openlog("cimservera", LOG_PID, LOG_AUTH); | openlog("cimservera", LOG_PID, LOG_AUTH); |
syslog(LOG_INFO, "started"); |
syslog(LOG_DEBUG, "started"); |
| |
/* Check argumnents. */ | /* Check argumnents. */ |
| |
|
|
Exit(1); | Exit(1); |
} | } |
| |
|
/* Handle request (authenticate or validateUser) */ |
|
|
if (strcmp(request.arg0, "authenticate") == 0) | if (strcmp(request.arg0, "authenticate") == 0) |
{ | { |
int status = PAMAuthenticateInProcess(request.arg1, request.arg2); | int status = PAMAuthenticateInProcess(request.arg1, request.arg2); |
| |
if (status != 0) | if (status != 0) |
{ | { |
syslog(LOG_WARNING, "PAM authentication failed on user \"%s\"", |
syslog(LOG_WARNING, "user \"%s\" failed to authenticate", |
request.arg1); | request.arg1); |
} | } |
| |
|
|
int status = PAMValidateUserInProcess(request.arg1); | int status = PAMValidateUserInProcess(request.arg1); |
| |
if (status != 0) | if (status != 0) |
{ |
syslog(LOG_WARNING, "failed to validate user \"%s\"", request.arg1); |
syslog(LOG_WARNING, "PAM user validation failed on user \"%s\"", |
|
request.arg1); |
|
} |
|
| |
Exit(status == 0 ? 0 : 1); | Exit(status == 0 ? 0 : 1); |
} | } |