version 1.1.2.5, 2007/01/12 23:17:56
|
version 1.2, 2007/05/25 18:35:07
|
|
|
/* | /* |
**============================================================================== | **============================================================================== |
** | ** |
** CimserveaSend() |
** CimserveraSend() |
** | ** |
** Sends *size* bytes on the given socket. | ** Sends *size* bytes on the given socket. |
** | ** |
**============================================================================== | **============================================================================== |
*/ | */ |
| |
static ssize_t CimserveaSend(int sock, void* buffer, size_t size) |
static ssize_t CimserveraSend(int sock, void* buffer, size_t size) |
{ | { |
size_t r = size; | size_t r = size; |
char* p = (char*)buffer; | char* p = (char*)buffer; |
|
|
Strlcpy(request.arg1, username, EXECUTOR_BUFFER_SIZE); | Strlcpy(request.arg1, username, EXECUTOR_BUFFER_SIZE); |
Strlcpy(request.arg2, password, EXECUTOR_BUFFER_SIZE); | Strlcpy(request.arg2, password, EXECUTOR_BUFFER_SIZE); |
| |
if (CimserveaSend(sock, &request, sizeof(request)) != sizeof(request)) |
if (CimserveraSend(sock, &request, sizeof(request)) != sizeof(request)) |
{ | { |
status = -1; | status = -1; |
break; | break; |
} | } |
| |
/* Get exist status from CIMSERVERA program. */ |
/* Get exit status from CIMSERVERA program. */ |
| |
waitpid(pid, &childStatus, 0); | waitpid(pid, &childStatus, 0); |
| |
|
|
/* | /* |
**============================================================================== | **============================================================================== |
** | ** |
** CimserveraAuthenticate() |
** CimserveraValidateUser() |
** | ** |
**============================================================================== | **============================================================================== |
*/ | */ |
|
|
Strlcpy(request.arg0, "validateUser", EXECUTOR_BUFFER_SIZE); | Strlcpy(request.arg0, "validateUser", EXECUTOR_BUFFER_SIZE); |
Strlcpy(request.arg1, username, EXECUTOR_BUFFER_SIZE); | Strlcpy(request.arg1, username, EXECUTOR_BUFFER_SIZE); |
| |
if (CimserveaSend(sock, &request, sizeof(request)) != sizeof(request)) |
if (CimserveraSend(sock, &request, sizeof(request)) != sizeof(request)) |
{ | { |
status = -1; | status = -1; |
break; | break; |
} | } |
| |
/* Get exist status from CIMSERVERA program. */ |
/* Get exit status from CIMSERVERA program. */ |
| |
waitpid(pid, &childStatus, 0); | waitpid(pid, &childStatus, 0); |
| |
|
|
** | ** |
** PAMAuthenticateInProcess() | ** PAMAuthenticateInProcess() |
** | ** |
** Peforms basic PAM authentication on the given username and password. |
** Performs basic PAM authentication on the given username and password. |
** | ** |
**============================================================================== | **============================================================================== |
*/ | */ |
|
|
** | ** |
** PAMAuthenticate() | ** PAMAuthenticate() |
** | ** |
** Peforms basic PAM authentication on the given username and password. |
** Performs basic PAM authentication on the given username and password. |
** | ** |
**============================================================================== | **============================================================================== |
*/ | */ |