]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libwbclient: let wbcAuthenticateUser() use wbcAuthenticateUserEx()
authorStefan Metzmacher <metze@samba.org>
Fri, 15 Feb 2008 09:46:19 +0000 (10:46 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 15 Feb 2008 10:55:17 +0000 (11:55 +0100)
metze

source/nsswitch/libwbclient/wbc_pam.c

index aac7e690fff24776225e8230769b296bab860285..de49a6b54342c59e9616693ffff6be010b16843f 100644 (file)
 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: