diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
commit | 6da26870e0ae5acd6ff49a30ec2f6886b44d095e (patch) | |
tree | 850c71039563c16a5d563c47e7ba2ab645baf198 /source3/auth/auth_util.c | |
parent | 6925a799d04c6fa59dd2ddef1f5510f9bb7d17d1 (diff) | |
parent | 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 (diff) | |
download | samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.gz samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.bz2 samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.zip |
Merge 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 as Samba-4.0alpha16
Diffstat (limited to 'source3/auth/auth_util.c')
-rw-r--r-- | source3/auth/auth_util.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c index b7ec9fff70..64c290eb04 100644 --- a/source3/auth/auth_util.c +++ b/source3/auth/auth_util.c @@ -23,7 +23,6 @@ #include "includes.h" #include "auth.h" -#include "smbd/globals.h" #include "../libcli/auth/libcli_auth.h" #include "../lib/crypto/arcfour.h" #include "rpc_client/init_lsa.h" @@ -520,7 +519,7 @@ NTSTATUS create_local_token(TALLOC_CTX *mem_ctx, t = session_info->security_token; - ids = TALLOC_ARRAY(talloc_tos(), struct wbcUnixId, + ids = talloc_array(talloc_tos(), struct wbcUnixId, t->num_sids); if (ids == NULL) { return NT_STATUS_NO_MEMORY; @@ -669,7 +668,7 @@ NTSTATUS make_server_info_pw(struct auth_serversupplied_info **server_info, return NT_STATUS_NO_MEMORY; } - status = samu_to_SamInfo3(result, sampass, global_myname(), + status = samu_to_SamInfo3(result, sampass, lp_netbios_name(), &result->info3, &result->extra); TALLOC_FREE(sampass); if (!NT_STATUS_IS_OK(status)) { @@ -759,7 +758,7 @@ static NTSTATUS make_new_server_info_guest(struct auth_serversupplied_info **ses struct auth_serversupplied_info *server_info; static const char zeros[16] = {0}; const char *guest_account = lp_guestaccount(); - const char *domain = global_myname(); + const char *domain = lp_netbios_name(); struct netr_SamInfo3 info3; TALLOC_CTX *tmp_ctx; NTSTATUS status; @@ -774,6 +773,8 @@ static NTSTATUS make_new_server_info_guest(struct auth_serversupplied_info **ses status = get_guest_info3(tmp_ctx, &info3); if (!NT_STATUS_IS_OK(status)) { + DEBUG(0, ("get_guest_info3 failed with %s\n", + nt_errstr(status))); goto done; } @@ -783,6 +784,8 @@ static NTSTATUS make_new_server_info_guest(struct auth_serversupplied_info **ses &server_info, &info3); if (!NT_STATUS_IS_OK(status)) { + DEBUG(0, ("make_server_info_info3 failed with %s\n", + nt_errstr(status))); goto done; } @@ -794,8 +797,8 @@ static NTSTATUS make_new_server_info_guest(struct auth_serversupplied_info **ses status = create_local_token(tmp_ctx, server_info, NULL, session_info); TALLOC_FREE(server_info); if (!NT_STATUS_IS_OK(status)) { - DEBUG(10, ("create_local_token failed: %s\n", - nt_errstr(status))); + DEBUG(0, ("create_local_token failed: %s\n", + nt_errstr(status))); goto done; } talloc_steal(NULL, *session_info); @@ -812,7 +815,7 @@ static NTSTATUS make_new_server_info_guest(struct auth_serversupplied_info **ses status = NT_STATUS_OK; done: TALLOC_FREE(tmp_ctx); - return NT_STATUS_OK; + return status; } /*************************************************************************** @@ -908,7 +911,7 @@ struct auth_serversupplied_info *copy_serverinfo(TALLOC_CTX *mem_ctx, dst->utok.gid = src->utok.gid; dst->utok.ngroups = src->utok.ngroups; if (src->utok.ngroups != 0) { - dst->utok.groups = (gid_t *)TALLOC_MEMDUP( + dst->utok.groups = (gid_t *)talloc_memdup( dst, src->utok.groups, sizeof(gid_t)*dst->utok.ngroups); } else { |