Merge branch 'v3-2-test' of ssh://jra@git.samba.org/data/git/samba into v3-2-test
authorJeremy Allison <jra@samba.org>
Fri, 15 Feb 2008 17:35:18 +0000 (09:35 -0800)
committerJeremy Allison <jra@samba.org>
Fri, 15 Feb 2008 17:35:18 +0000 (09:35 -0800)
(This used to be commit 847874ca757ac8ca32082305c8caed5abc7fed1d)

1  2 
source3/nsswitch/libwbclient/wbc_pam.c

index d614474cb71fda4afad27364f50255a5e7c4c893,de49a6b54342c59e9616693ffff6be010b16843f..9b8a913a57be41cebe1d796b4e06f446ebd1abde
@@@ -326,19 -372,24 +372,27 @@@ wbcErr wbcAuthenticateUserEx(const stru
                request.data.auth_crap.nt_resp_len =
                                MIN(params->password.response.nt_length,
                                    sizeof(request.data.auth_crap.nt_resp));
-               memcpy(request.data.auth_crap.lm_resp,
-                      params->password.response.lm_data,
-                      request.data.auth_crap.lm_resp_len);
-               memcpy(request.data.auth_crap.nt_resp,
-                      params->password.response.nt_data,
-                      request.data.auth_crap.nt_resp_len);
+               if (params->password.response.lm_data) {
+                       memcpy(request.data.auth_crap.lm_resp,
+                              params->password.response.lm_data,
+                              request.data.auth_crap.lm_resp_len);
+               }
+               if (params->password.response.nt_data) {
+                       memcpy(request.data.auth_crap.nt_resp,
+                              params->password.response.nt_data,
+                              request.data.auth_crap.nt_resp_len);
+               }
                break;
 +      default:
 +              wbc_status = WBC_ERR_INVALID_PARAM;
 +              BAIL_ON_WBC_ERROR(wbc_status);
        }
  
+       if (cmd == 0) {
+               wbc_status = WBC_ERR_INVALID_PARAM;
+               BAIL_ON_WBC_ERROR(wbc_status);
+       }
        wbc_status = wbcRequestResponse(cmd,
                                        &request,
                                        &response);