s4:s3compat provide new check_sam_security_info3 hook to Samba4's auth
authorAndrew Bartlett <abartlet@samba.org>
Mon, 17 May 2010 09:07:14 +0000 (19:07 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 3 Jun 2010 01:14:09 +0000 (11:14 +1000)
This hook avoids a conversion to and from the 'server_info' structure
on the source3 side of the interface.

Andrew Bartlett

source4/s3compat/auth_samba4.c

index 95d7c94cf6bfdba5f845c2da9902224f346d3c28..385904748e43ada27534a7102ba59acd69c7d21b 100644 (file)
@@ -84,27 +84,14 @@ NTSTATUS auth_samba4_init(void)
 }
 
 /* Winbindd calls directly to this function, not via the full auth stack */
-NTSTATUS check_sam_security(const DATA_BLOB *challenge,
-                           TALLOC_CTX *mem_ctx,
-                           const struct auth_usersupplied_info *user_info,
-                           struct auth_serversupplied_info **server_info)
+NTSTATUS check_sam_security_info3(const DATA_BLOB *challenge,
+                                 TALLOC_CTX *mem_ctx,
+                                 const struct auth_usersupplied_info *user_info,
+                                 struct netr_SamInfo3 **info3)
 {
        NTSTATUS status;
-        TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
-       struct netr_SamInfo3 *info3 = NULL;
-       NT_STATUS_HAVE_NO_MEMORY(tmp_ctx);
        
-       status = s3compat_authenticate(tmp_ctx, challenge->data, user_info, &info3);
-       NT_STATUS_NOT_OK_RETURN_AND_FREE(status, tmp_ctx);
-
-       status = make_server_info_info3(mem_ctx, user_info->client.account_name,
-                                       user_info->mapped.domain_name, server_info,
-                                       info3);
-       if (!NT_STATUS_IS_OK(status)) {
-               DEBUG(10, ("make_server_info_info3 failed: %s\n",
-                          nt_errstr(status)));
-       }
-       talloc_free(tmp_ctx);
+       status = s3compat_authenticate(mem_ctx, challenge->data, user_info, info3);
        return status;
 }