The branch, master has been updated via 33c633d... s3:auth make it easier to trace auth modules via bd38c0d... s3:auth fix info3 duplication function via b99dd10... s3:smbd Use the right num_sids from d85d85b... s3:passdb Fix memory leak
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 33c633df0bb49551a833d1bf86db0825b8007546 Author: Simo Sorce <sso...@redhat.com> Date: Sat May 29 16:49:37 2010 -0400 s3:auth make it easier to trace auth modules commit bd38c0d47d6a22a68fea5d9d66a73a9e2521b239 Author: Simo Sorce <sso...@redhat.com> Date: Fri May 28 13:35:56 2010 -0400 s3:auth fix info3 duplication function commit b99dd10b39a4483a1c4b34f5438630ed99374c10 Author: Simo Sorce <sso...@redhat.com> Date: Fri May 28 08:33:18 2010 -0400 s3:smbd Use the right num_sids We use s_i->ptok->num_sids everywhere else in this call and then suddenly we reference s_i->num_sids ----------------------------------------------------------------------- Summary of changes: source3/auth/auth_builtin.c | 5 +++++ source3/auth/auth_domain.c | 4 ++++ source3/auth/auth_netlogond.c | 2 ++ source3/auth/auth_sam.c | 2 ++ source3/auth/auth_server.c | 2 ++ source3/auth/auth_unix.c | 2 ++ source3/auth/auth_wbc.c | 2 ++ source3/auth/auth_winbind.c | 2 ++ source3/auth/server_info.c | 11 ++++++++--- source3/smbd/trans2.c | 2 +- 10 files changed, 30 insertions(+), 4 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/auth/auth_builtin.c b/source3/auth/auth_builtin.c index e2ad848..9e8fec9 100644 --- a/source3/auth/auth_builtin.c +++ b/source3/auth/auth_builtin.c @@ -40,6 +40,8 @@ static NTSTATUS check_guest_security(const struct auth_context *auth_context, /* mark this as 'not for me' */ NTSTATUS nt_status = NT_STATUS_NOT_IMPLEMENTED; + DEBUG(10, ("Check auth for: [%s]\n", user_info->internal_username)); + if (!(user_info->internal_username && *user_info->internal_username)) { nt_status = make_server_info_guest(NULL, server_info); @@ -88,6 +90,9 @@ static NTSTATUS check_name_to_ntstatus_security(const struct auth_context *auth_ NTSTATUS nt_status; fstring user; long error_num; + + DEBUG(10, ("Check auth for: [%s]\n", user_info->internal_username)); + fstrcpy(user, user_info->smb_name); if (strnequal("NT_STATUS", user, strlen("NT_STATUS"))) { diff --git a/source3/auth/auth_domain.c b/source3/auth/auth_domain.c index ef58250..a42f3a1 100644 --- a/source3/auth/auth_domain.c +++ b/source3/auth/auth_domain.c @@ -393,6 +393,8 @@ static NTSTATUS check_ntdomain_security(const struct auth_context *auth_context, return NT_STATUS_INVALID_PARAMETER; } + DEBUG(10, ("Check auth for: [%s]\n", user_info->internal_username)); + /* * Check that the requested domain is not our own machine name. * If it is, we should never check the PDC here, we use our own local @@ -461,6 +463,8 @@ static NTSTATUS check_trustdomain_security(const struct auth_context *auth_conte return NT_STATUS_INVALID_PARAMETER; } + DEBUG(10, ("Check auth for: [%s]\n", user_info->internal_username)); + /* * Check that the requested domain is not our own machine name or domain name. */ diff --git a/source3/auth/auth_netlogond.c b/source3/auth/auth_netlogond.c index e5f2a1b..1442e2f 100644 --- a/source3/auth/auth_netlogond.c +++ b/source3/auth/auth_netlogond.c @@ -170,6 +170,8 @@ static NTSTATUS check_netlogond_security(const struct auth_context *auth_context struct named_mutex *mutex = NULL; const char *ncalrpcsock; + DEBUG(10, ("Check auth for: [%s]\n", user_info->internal_username)); + ncalrpcsock = lp_parm_const_string( GLOBAL_SECTION_SNUM, "auth_netlogond", "socket", NULL); diff --git a/source3/auth/auth_sam.c b/source3/auth/auth_sam.c index 4220b7a..324295f 100644 --- a/source3/auth/auth_sam.c +++ b/source3/auth/auth_sam.c @@ -72,6 +72,8 @@ static NTSTATUS auth_samstrict_auth(const struct auth_context *auth_context, return NT_STATUS_LOGON_FAILURE; } + DEBUG(10, ("Check auth for: [%s]\n", user_info->internal_username)); + is_local_name = is_myname(user_info->domain); is_my_domain = strequal(user_info->domain, lp_workgroup()); diff --git a/source3/auth/auth_server.c b/source3/auth/auth_server.c index 4bcb796..35b7fe6 100644 --- a/source3/auth/auth_server.c +++ b/source3/auth/auth_server.c @@ -281,6 +281,8 @@ static NTSTATUS check_smbserver_security(const struct auth_context *auth_context NTSTATUS nt_status = NT_STATUS_NOT_IMPLEMENTED; bool locally_made_cli = False; + DEBUG(10, ("Check auth for: [%s]\n", user_info->internal_username)); + cli = state->cli; if (cli) { diff --git a/source3/auth/auth_unix.c b/source3/auth/auth_unix.c index 86c5a58..2bc2b06 100644 --- a/source3/auth/auth_unix.c +++ b/source3/auth/auth_unix.c @@ -91,6 +91,8 @@ static NTSTATUS check_unix_security(const struct auth_context *auth_context, NTSTATUS nt_status; struct passwd *pass = NULL; + DEBUG(10, ("Check auth for: [%s]\n", user_info->internal_username)); + become_root(); pass = Get_Pwnam_alloc(talloc_tos(), user_info->internal_username); diff --git a/source3/auth/auth_wbc.c b/source3/auth/auth_wbc.c index b91a573..11cc7ea 100644 --- a/source3/auth/auth_wbc.c +++ b/source3/auth/auth_wbc.c @@ -61,6 +61,8 @@ static NTSTATUS check_wbc_security(const struct auth_context *auth_context, } /* Send off request */ + DEBUG(10, ("Check auth for: [%s]", user_info->internal_username)); + params.account_name = user_info->smb_name; params.domain_name = user_info->domain; params.workstation_name = user_info->wksta_name; diff --git a/source3/auth/auth_winbind.c b/source3/auth/auth_winbind.c index 86a6194..68509e4 100644 --- a/source3/auth/auth_winbind.c +++ b/source3/auth/auth_winbind.c @@ -43,6 +43,8 @@ static NTSTATUS check_winbind_security(const struct auth_context *auth_context, return NT_STATUS_INVALID_PARAMETER; } + DEBUG(10, ("Check auth for: [%s]", user_info->internal_username)); + if (!auth_context) { DEBUG(3,("Password for user %s cannot be checked because we have no auth_info to get the challenge from.\n", user_info->internal_username)); diff --git a/source3/auth/server_info.c b/source3/auth/server_info.c index 2545e7d..f72cdba 100644 --- a/source3/auth/server_info.c +++ b/source3/auth/server_info.c @@ -392,6 +392,7 @@ struct netr_SamInfo3 *copy_netr_SamInfo3(TALLOC_CTX *mem_ctx, struct netr_SamInfo3 *orig) { struct netr_SamInfo3 *info3; + unsigned int i; info3 = talloc_zero(mem_ctx, struct netr_SamInfo3); if (!info3) return NULL; @@ -455,10 +456,14 @@ struct netr_SamInfo3 *copy_netr_SamInfo3(TALLOC_CTX *mem_ctx, } if (orig->sidcount) { - info3->sids = (struct netr_SidAttr *)talloc_memdup(info3, orig->sids, - (sizeof(struct netr_SidAttr) * - orig->sidcount)); + info3->sids = talloc_array(info3, struct netr_SidAttr, + orig->sidcount); RET_NOMEM(info3->sids); + for (i = 0; i < orig->sidcount; i++) { + info3->sids[i].sid = sid_dup_talloc(info3->sids, + orig->sids[i].sid); + RET_NOMEM(info3->sids[i].sid); + } } return info3; diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 8535d46..4032120 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -3396,7 +3396,7 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned } SIVAL(pdata, 24, conn->server_info->utok.ngroups); - SIVAL(pdata, 28, conn->server_info->num_sids); + SIVAL(pdata, 28, conn->server_info->ptok->num_sids); /* We walk the SID list twice, but this call is fairly * infrequent, and I don't expect that it's performance -- Samba Shared Repository