The branch, master has been updated
via dda1dd6 s3: Avoid an explicit ZERO_STRUCT
via 6ee0d86 s3: Lift talloc_autofree_context() from
make_auth_context_fixed()
via 242e329 s3: Lift talloc_autofree_context() from
make_auth_context_subsystem()
via 2d8be31 s3: Lift talloc_autofree_context() from
make_auth_context_text_list()
via 61861e4 s3: Lift talloc_autofree_context() from make_auth_context()
via b127445 s3: Fix a memleak in make_new_server_info_system()
via 15a3afb s3: Remove talloc_autofree_context() from init_system_info()
from e4591eb s3: Fix a typo
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit dda1dd63d3c463a9a26d85acf4a9f7cc53396613
Author: Volker Lendecke <[email protected]>
Date: Sat Sep 25 15:40:54 2010 -0700
s3: Avoid an explicit ZERO_STRUCT
commit 6ee0d866c2d7dbdede8511fb906c10f6118fa87d
Author: Volker Lendecke <[email protected]>
Date: Sat Sep 25 15:35:44 2010 -0700
s3: Lift talloc_autofree_context() from make_auth_context_fixed()
commit 242e3296108f513b286787ac12ea768b9c4ed954
Author: Volker Lendecke <[email protected]>
Date: Sat Sep 25 15:31:29 2010 -0700
s3: Lift talloc_autofree_context() from make_auth_context_subsystem()
commit 2d8be31e880bcd1b7444ffd45295cc9948079b6f
Author: Volker Lendecke <[email protected]>
Date: Sat Sep 25 14:51:45 2010 -0700
s3: Lift talloc_autofree_context() from make_auth_context_text_list()
commit 61861e4b7d37d5b483360c0e9faa3dd3a1d0e9f6
Author: Volker Lendecke <[email protected]>
Date: Sat Sep 25 14:50:46 2010 -0700
s3: Lift talloc_autofree_context() from make_auth_context()
commit b12744513ec24a50cc838bc6273513d3ac3ddba9
Author: Volker Lendecke <[email protected]>
Date: Sat Sep 25 14:47:42 2010 -0700
s3: Fix a memleak in make_new_server_info_system()
commit 15a3afbd192cb8c8e4a248aec8f98141af41b8c1
Author: Volker Lendecke <[email protected]>
Date: Sat Sep 25 14:47:31 2010 -0700
s3: Remove talloc_autofree_context() from init_system_info()
-----------------------------------------------------------------------
Summary of changes:
source3/auth/auth.c | 26 ++++++++++++++++++--------
source3/auth/auth_compat.c | 5 ++++-
source3/auth/auth_ntlmssp.c | 2 +-
source3/auth/auth_util.c | 4 +++-
source3/include/proto.h | 7 +++++--
source3/rpc_server/srv_netlog_nt.c | 6 ++++--
source3/smbd/negprot.c | 2 +-
source3/smbd/sesssetup.c | 10 ++++------
8 files changed, 40 insertions(+), 22 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/auth/auth.c b/source3/auth/auth.c
index cabff53..790bfac 100644
--- a/source3/auth/auth.c
+++ b/source3/auth/auth.c
@@ -343,11 +343,12 @@ static int auth_context_destructor(void *ptr)
Make a auth_info struct
***************************************************************************/
-static NTSTATUS make_auth_context(struct auth_context **auth_context)
+static NTSTATUS make_auth_context(TALLOC_CTX *mem_ctx,
+ struct auth_context **auth_context)
{
struct auth_context *ctx;
- ctx = talloc_zero(talloc_autofree_context(), struct auth_context);
+ ctx = talloc_zero(mem_ctx, struct auth_context);
if (!ctx) {
DEBUG(0,("make_auth_context: talloc failed!\n"));
return NT_STATUS_NO_MEMORY;
@@ -420,7 +421,9 @@ bool load_auth_module(struct auth_context *auth_context,
Make a auth_info struct for the auth subsystem
***************************************************************************/
-static NTSTATUS make_auth_context_text_list(struct auth_context
**auth_context, char **text_list)
+static NTSTATUS make_auth_context_text_list(TALLOC_CTX *mem_ctx,
+ struct auth_context **auth_context,
+ char **text_list)
{
auth_methods *list = NULL;
auth_methods *t = NULL;
@@ -431,8 +434,11 @@ static NTSTATUS make_auth_context_text_list(struct
auth_context **auth_context,
return NT_STATUS_UNSUCCESSFUL;
}
- if (!NT_STATUS_IS_OK(nt_status = make_auth_context(auth_context)))
+ nt_status = make_auth_context(mem_ctx, auth_context);
+
+ if (!NT_STATUS_IS_OK(nt_status)) {
return nt_status;
+ }
for (;*text_list; text_list++) {
if (load_auth_module(*auth_context, *text_list, &t)) {
@@ -449,7 +455,8 @@ static NTSTATUS make_auth_context_text_list(struct
auth_context **auth_context,
Make a auth_context struct for the auth subsystem
***************************************************************************/
-NTSTATUS make_auth_context_subsystem(struct auth_context **auth_context)
+NTSTATUS make_auth_context_subsystem(TALLOC_CTX *mem_ctx,
+ struct auth_context **auth_context)
{
char **auth_method_list = NULL;
NTSTATUS nt_status;
@@ -520,7 +527,7 @@ NTSTATUS make_auth_context_subsystem(struct auth_context
**auth_context)
DEBUG(5,("Using specified auth order\n"));
}
- nt_status = make_auth_context_text_list(auth_context,
+ nt_status = make_auth_context_text_list(mem_ctx, auth_context,
auth_method_list);
TALLOC_FREE(auth_method_list);
@@ -531,10 +538,13 @@ NTSTATUS make_auth_context_subsystem(struct auth_context
**auth_context)
Make a auth_info struct with a fixed challenge
***************************************************************************/
-NTSTATUS make_auth_context_fixed(struct auth_context **auth_context, uchar
chal[8])
+NTSTATUS make_auth_context_fixed(TALLOC_CTX *mem_ctx,
+ struct auth_context **auth_context,
+ uchar chal[8])
{
NTSTATUS nt_status;
- if (!NT_STATUS_IS_OK(nt_status =
make_auth_context_subsystem(auth_context))) {
+ nt_status = make_auth_context_subsystem(mem_ctx, auth_context);
+ if (!NT_STATUS_IS_OK(nt_status)) {
return nt_status;
}
diff --git a/source3/auth/auth_compat.c b/source3/auth/auth_compat.c
index bd4c433..ffad36e 100644
--- a/source3/auth/auth_compat.c
+++ b/source3/auth/auth_compat.c
@@ -42,7 +42,10 @@ NTSTATUS check_plaintext_password(const char *smb_name,
struct auth_usersupplied_info *user_info = NULL;
uint8_t chal[8];
NTSTATUS nt_status;
- if (!NT_STATUS_IS_OK(nt_status =
make_auth_context_subsystem(&plaintext_auth_context))) {
+
+ nt_status = make_auth_context_subsystem(talloc_tos(),
+ &plaintext_auth_context);
+ if (!NT_STATUS_IS_OK(nt_status)) {
return nt_status;
}
diff --git a/source3/auth/auth_ntlmssp.c b/source3/auth/auth_ntlmssp.c
index af3a6f3..3905914 100644
--- a/source3/auth/auth_ntlmssp.c
+++ b/source3/auth/auth_ntlmssp.c
@@ -229,7 +229,7 @@ NTSTATUS auth_ntlmssp_start(struct auth_ntlmssp_state
**auth_ntlmssp_state)
return nt_status;
}
- nt_status = make_auth_context_subsystem(&auth_context);
+ nt_status = make_auth_context_subsystem(talloc_tos(), &auth_context);
if (!NT_STATUS_IS_OK(nt_status)) {
return nt_status;
}
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index 8254520..94adc3c 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -761,6 +761,7 @@ static NTSTATUS make_new_server_info_system(TALLOC_CTX
*mem_ctx,
pwd->pw_name,
false,
server_info);
+ TALLOC_FREE(pwd);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -911,7 +912,8 @@ bool init_system_info(void)
if (system_info != NULL)
return True;
- return
NT_STATUS_IS_OK(make_new_server_info_system(talloc_autofree_context(),
&system_info));
+ return NT_STATUS_IS_OK(make_new_server_info_system(NULL,
+ &system_info));
}
NTSTATUS make_server_info_system(TALLOC_CTX *mem_ctx,
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 849a062..c252b0e 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -29,8 +29,11 @@
NTSTATUS smb_register_auth(int version, const char *name, auth_init_function
init);
bool load_auth_module(struct auth_context *auth_context,
const char *module, auth_methods **ret) ;
-NTSTATUS make_auth_context_subsystem(struct auth_context **auth_context) ;
-NTSTATUS make_auth_context_fixed(struct auth_context **auth_context, uchar
chal[8]) ;
+NTSTATUS make_auth_context_subsystem(TALLOC_CTX *mem_ctx,
+ struct auth_context **auth_context);
+NTSTATUS make_auth_context_fixed(TALLOC_CTX *mem_ctx,
+ struct auth_context **auth_context,
+ uchar chal[8]) ;
/* The following definitions come from auth/auth_builtin.c */
diff --git a/source3/rpc_server/srv_netlog_nt.c
b/source3/rpc_server/srv_netlog_nt.c
index d821b04..fb60ef8 100644
--- a/source3/rpc_server/srv_netlog_nt.c
+++ b/source3/rpc_server/srv_netlog_nt.c
@@ -1323,7 +1323,7 @@ static NTSTATUS _netr_LogonSamLogon_base(struct
pipes_struct *p,
{
const char *wksname = nt_workstation;
- status = make_auth_context_fixed(&auth_context,
+ status = make_auth_context_fixed(talloc_tos(), &auth_context,
logon->network->challenge);
if (!NT_STATUS_IS_OK(status)) {
return status;
@@ -1360,7 +1360,9 @@ static NTSTATUS _netr_LogonSamLogon_base(struct
pipes_struct *p,
{
uint8_t chal[8];
- if (!NT_STATUS_IS_OK(status =
make_auth_context_subsystem(&auth_context))) {
+ status = make_auth_context_subsystem(talloc_tos(),
+ &auth_context);
+ if (!NT_STATUS_IS_OK(status)) {
return status;
}
diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c
index 463e1c8..51f2d0c 100644
--- a/source3/smbd/negprot.c
+++ b/source3/smbd/negprot.c
@@ -38,7 +38,7 @@ static void get_challenge(struct smbd_server_connection
*sconn, uint8 buff[8])
DEBUG(10, ("get challenge: creating negprot_global_auth_context\n"));
nt_status = make_auth_context_subsystem(
- &sconn->smb1.negprot.auth_context);
+ sconn, &sconn->smb1.negprot.auth_context);
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0, ("make_auth_context_subsystem returned %s",
nt_errstr(nt_status)));
diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c
index b227d2b..f9e4946 100644
--- a/source3/smbd/sesssetup.c
+++ b/source3/smbd/sesssetup.c
@@ -141,14 +141,12 @@ static NTSTATUS check_guest_password(struct
auth_serversupplied_info **server_in
struct auth_usersupplied_info *user_info = NULL;
NTSTATUS nt_status;
- unsigned char chal[8];
-
- ZERO_STRUCT(chal);
+ static unsigned char chal[8] = { 0, };
DEBUG(3,("Got anonymous request\n"));
- if (!NT_STATUS_IS_OK(nt_status = make_auth_context_fixed(&auth_context,
- chal))) {
+ nt_status = make_auth_context_fixed(talloc_tos(), &auth_context, chal);
+ if (!NT_STATUS_IS_OK(nt_status)) {
return nt_status;
}
@@ -1589,7 +1587,7 @@ void reply_sesssetup_and_X(struct smb_request *req)
struct auth_context *plaintext_auth_context = NULL;
nt_status = make_auth_context_subsystem(
- &plaintext_auth_context);
+ talloc_tos(), &plaintext_auth_context);
if (NT_STATUS_IS_OK(nt_status)) {
uint8_t chal[8];
--
Samba Shared Repository