version 1.3, 2007/07/24 19:42:03
|
version 1.3.4.3, 2008/04/08 18:24:07
|
|
|
| |
#include <Executor/PAMAuth.h> | #include <Executor/PAMAuth.h> |
#include <Executor/Socket.h> | #include <Executor/Socket.h> |
|
#include <Pegasus/Common/PegasusVersion.h> |
#include <stdio.h> | #include <stdio.h> |
#include <stdlib.h> | #include <stdlib.h> |
#include <syslog.h> | #include <syslog.h> |
|
|
| |
static void Exit(int status) | static void Exit(int 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_DEBUG, "started"); |
|
| |
/* Check arguments. */ | /* Check arguments. */ |
| |
|
|
{ | { |
int status = PAMAuthenticateInProcess(request.arg1, request.arg2); | int status = PAMAuthenticateInProcess(request.arg1, request.arg2); |
| |
if (status != 0) |
|
{ |
|
syslog(LOG_WARNING, "user \"%s\" failed to authenticate", |
|
request.arg1); |
|
} |
|
|
|
response.status = status; | response.status = status; |
| |
if (SendBlock(sock, &response, sizeof(response)) != sizeof(response)) | if (SendBlock(sock, &response, sizeof(response)) != sizeof(response)) |
|
|
{ | { |
int status = PAMValidateUserInProcess(request.arg1); | int status = PAMValidateUserInProcess(request.arg1); |
| |
if (status != 0) |
|
{ |
|
syslog(LOG_WARNING, "failed to validate user \"%s\"", request.arg1); |
|
} |
|
|
|
response.status = status; | response.status = status; |
| |
if (SendBlock(sock, &response, sizeof(response)) != sizeof(response)) | if (SendBlock(sock, &response, sizeof(response)) != sizeof(response)) |