summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-02-15 10:46:19 +0100
committerStefan Metzmacher <metze@samba.org>2008-02-15 11:55:17 +0100
commit23b7f7ea095644b1a5ba104fde5841676dfc9ed4 (patch)
tree7e77cc4b780b9f3d779f0028195ad7300081ca8c
parenta12528f82650aee6bef80fee858600d502464614 (diff)
downloadsamba-23b7f7ea095644b1a5ba104fde5841676dfc9ed4.tar.gz
samba-23b7f7ea095644b1a5ba104fde5841676dfc9ed4.tar.bz2
samba-23b7f7ea095644b1a5ba104fde5841676dfc9ed4.zip
libwbclient: let wbcAuthenticateUser() use wbcAuthenticateUserEx()
metze (This used to be commit 237c2e9738ae29ca7046d6f886d6f777a6206045)
-rw-r--r--source3/nsswitch/libwbclient/wbc_pam.c28
1 files changed, 7 insertions, 21 deletions
diff --git a/source3/nsswitch/libwbclient/wbc_pam.c b/source3/nsswitch/libwbclient/wbc_pam.c
index aac7e690ff..de49a6b543 100644
--- a/source3/nsswitch/libwbclient/wbc_pam.c
+++ b/source3/nsswitch/libwbclient/wbc_pam.c
@@ -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;
-
- if (!username) {
- wbc_status = WBC_ERR_INVALID_PARAM;
- BAIL_ON_WBC_ERROR(wbc_status);
- }
-
- /* Initialize request */
-
- ZERO_STRUCT(request);
- ZERO_STRUCT(response);
+ wbcErr wbc_status = WBC_ERR_SUCCESS;
+ struct wbcAuthUserParams params;
- /* dst is already null terminated from the memset above */
+ ZERO_STRUCT(params);
- strncpy(request.data.auth.user, username,
- sizeof(request.data.auth.user)-1);
- strncpy(request.data.auth.pass, password,
- sizeof(request.data.auth.user)-1);
+ params.account_name = username;
+ params.level = WBC_AUTH_USER_LEVEL_PLAIN;
+ params.password.plaintext = password;
- wbc_status = wbcRequestResponse(WINBINDD_PAM_AUTH,
- &request,
- &response);
+ wbc_status = wbcAuthenticateUserEx(&params, NULL, NULL);
BAIL_ON_WBC_ERROR(wbc_status);
done: