mirror of
https://github.com/samba-team/samba.git
synced 2025-08-24 21:49:29 +03:00
libwbclient: let wbcAuthenticateUser() use wbcAuthenticateUserEx()
metze
(This used to be commit 237c2e9738
)
This commit is contained in:
@ -34,30 +34,16 @@
|
||||
wbcErr wbcAuthenticateUser(const char *username,
|
||||
const char *password)
|
||||
{
|
||||
wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
|
||||
struct winbindd_request request;
|
||||
struct winbindd_response response;
|
||||
wbcErr wbc_status = WBC_ERR_SUCCESS;
|
||||
struct wbcAuthUserParams params;
|
||||
|
||||
if (!username) {
|
||||
wbc_status = WBC_ERR_INVALID_PARAM;
|
||||
BAIL_ON_WBC_ERROR(wbc_status);
|
||||
}
|
||||
ZERO_STRUCT(params);
|
||||
|
||||
/* Initialize request */
|
||||
params.account_name = username;
|
||||
params.level = WBC_AUTH_USER_LEVEL_PLAIN;
|
||||
params.password.plaintext = password;
|
||||
|
||||
ZERO_STRUCT(request);
|
||||
ZERO_STRUCT(response);
|
||||
|
||||
/* dst is already null terminated from the memset above */
|
||||
|
||||
strncpy(request.data.auth.user, username,
|
||||
sizeof(request.data.auth.user)-1);
|
||||
strncpy(request.data.auth.pass, password,
|
||||
sizeof(request.data.auth.user)-1);
|
||||
|
||||
wbc_status = wbcRequestResponse(WINBINDD_PAM_AUTH,
|
||||
&request,
|
||||
&response);
|
||||
wbc_status = wbcAuthenticateUserEx(¶ms, NULL, NULL);
|
||||
BAIL_ON_WBC_ERROR(wbc_status);
|
||||
|
||||
done:
|
||||
|
Reference in New Issue
Block a user