svn commit: samba r2650 - in branches/SAMBA_4_0/source: auth libcli/auth

tridge at samba.org tridge at samba.org
Sun Sep 26 05:38:46 GMT 2004


Author: tridge
Date: 2004-09-26 05:38:45 +0000 (Sun, 26 Sep 2004)
New Revision: 2650

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source&rev=2650&nolog=1

Log:
fixed a memory leak in make_server_info()

Modified:
   branches/SAMBA_4_0/source/auth/auth_builtin.c
   branches/SAMBA_4_0/source/auth/auth_sam.c
   branches/SAMBA_4_0/source/auth/auth_server.c
   branches/SAMBA_4_0/source/auth/auth_unix.c
   branches/SAMBA_4_0/source/auth/auth_util.c
   branches/SAMBA_4_0/source/libcli/auth/gensec_krb5.c


Changeset:
Modified: branches/SAMBA_4_0/source/auth/auth_builtin.c
===================================================================
--- branches/SAMBA_4_0/source/auth/auth_builtin.c	2004-09-26 04:59:03 UTC (rev 2649)
+++ branches/SAMBA_4_0/source/auth/auth_builtin.c	2004-09-26 05:38:45 UTC (rev 2650)
@@ -43,7 +43,7 @@
 
 	if (!(user_info->internal_username.str 
 	      && *user_info->internal_username.str)) {
-		nt_status = make_server_info_guest(server_info);
+		nt_status = make_server_info_guest(auth_context, server_info);
 	}
 
 	return nt_status;

Modified: branches/SAMBA_4_0/source/auth/auth_sam.c
===================================================================
--- branches/SAMBA_4_0/source/auth/auth_sam.c	2004-09-26 04:59:03 UTC (rev 2649)
+++ branches/SAMBA_4_0/source/auth/auth_sam.c	2004-09-26 05:38:45 UTC (rev 2650)
@@ -304,7 +304,7 @@
 		return nt_status;
 	}
 
-	if (!NT_STATUS_IS_OK(nt_status = make_server_info(server_info, username))) {		
+	if (!NT_STATUS_IS_OK(nt_status = make_server_info(auth_context, server_info, username))) {		
 		DEBUG(0,("check_sam_security: make_server_info_sam() failed with '%s'\n", nt_errstr(nt_status)));
 		return nt_status;
 	}

Modified: branches/SAMBA_4_0/source/auth/auth_server.c
===================================================================
--- branches/SAMBA_4_0/source/auth/auth_server.c	2004-09-26 04:59:03 UTC (rev 2649)
+++ branches/SAMBA_4_0/source/auth/auth_server.c	2004-09-26 05:38:45 UTC (rev 2650)
@@ -354,7 +354,7 @@
 	if NT_STATUS_IS_OK(nt_status) {
 		struct passwd *pass = Get_Pwnam(user_info->internal_username.str);
 		if (pass) {
-			nt_status = make_server_info_pw(server_info, pass);
+			nt_status = make_server_info_pw(auth_context, server_info, pass);
 		} else {
 			nt_status = NT_STATUS_NO_SUCH_USER;
 		}

Modified: branches/SAMBA_4_0/source/auth/auth_unix.c
===================================================================
--- branches/SAMBA_4_0/source/auth/auth_unix.c	2004-09-26 04:59:03 UTC (rev 2649)
+++ branches/SAMBA_4_0/source/auth/auth_unix.c	2004-09-26 05:38:45 UTC (rev 2650)
@@ -108,7 +108,7 @@
 
 	if (NT_STATUS_IS_OK(nt_status)) {
 		if (pass) {
-			make_server_info_pw(server_info, pass);
+			make_server_info_pw(auth_context, server_info, pass);
 		} else {
 			/* we need to do somthing more useful here */
 			nt_status = NT_STATUS_NO_SUCH_USER;

Modified: branches/SAMBA_4_0/source/auth/auth_util.c
===================================================================
--- branches/SAMBA_4_0/source/auth/auth_util.c	2004-09-26 04:59:03 UTC (rev 2649)
+++ branches/SAMBA_4_0/source/auth/auth_util.c	2004-09-26 05:38:45 UTC (rev 2650)
@@ -399,10 +399,11 @@
  Make a user_info struct
 ***************************************************************************/
 
-NTSTATUS make_server_info(struct auth_serversupplied_info **server_info, 
+NTSTATUS make_server_info(TALLOC_CTX *mem_ctx,
+			  struct auth_serversupplied_info **server_info, 
 			  const char *username)
 {
-	*server_info = talloc_p(NULL, struct auth_serversupplied_info);
+	*server_info = talloc_p(mem_ctx, struct auth_serversupplied_info);
 	if (!*server_info) {
 		DEBUG(0,("make_server_info: malloc failed!\n"));
 		return NT_STATUS_NO_MEMORY;
@@ -415,12 +416,12 @@
 /***************************************************************************
  Make (and fill) a user_info struct for a guest login.
 ***************************************************************************/
-NTSTATUS make_server_info_guest(struct auth_serversupplied_info **server_info)
+NTSTATUS make_server_info_guest(TALLOC_CTX *mem_ctx, struct auth_serversupplied_info **server_info)
 {
 	NTSTATUS nt_status;
 	static const char zeros[16];
 
-	nt_status = make_server_info(server_info, "");
+	nt_status = make_server_info(mem_ctx, server_info, "");
 
 	if (!NT_STATUS_IS_OK(nt_status)) {
 		return nt_status;

Modified: branches/SAMBA_4_0/source/libcli/auth/gensec_krb5.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/auth/gensec_krb5.c	2004-09-26 04:59:03 UTC (rev 2649)
+++ branches/SAMBA_4_0/source/libcli/auth/gensec_krb5.c	2004-09-26 05:38:45 UTC (rev 2650)
@@ -611,7 +611,7 @@
 
 	*session_info_out = NULL;
 
-	nt_status = make_server_info(&server_info, gensec_krb5_state->peer_principal);
+	nt_status = make_server_info(gensec_security, &server_info, gensec_krb5_state->peer_principal);
 	if (!NT_STATUS_IS_OK(nt_status)) {
 		return nt_status;
 	}



More information about the samba-cvs mailing list