[SCM] Samba Shared Repository - branch master updated

Günther Deschner gd at samba.org
Fri Apr 17 08:50:03 MDT 2015


The branch, master has been updated
       via  9b33732 ctdb: Coverity fix for CID 1125630
       via  a689cd5 ctdb: Coverity fix for CID 1125625
       via  450b7c6 s3-passdb: fix memleak in pdb_default_get_trusted_domain().
      from  d0db0f0 docs: Update vfs_gpfs manpage for the removed fileset quota check

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 9b33732a57a919059bf17e9348a60019146e9e1d
Author: Rajesh Joseph <rjoseph at redhat.com>
Date:   Thu Apr 16 11:55:53 2015 +0530

    ctdb: Coverity fix for CID 1125630
    
    Due to usage of CTDB_NO_MEMORY macro,
    some of the resources are not freed in failure cases.
    
    Signed-off-by: Rajesh Joseph <rjoseph at redhat.com>
    Reviewed-by: Guenther Deschner <gd at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    Autobuild-User(master): Günther Deschner <gd at samba.org>
    Autobuild-Date(master): Fri Apr 17 16:49:05 CEST 2015 on sn-devel-104

commit a689cd5d955214fe94f19af9d1b5aec6d44d568a
Author: Rajesh Joseph <rjoseph at redhat.com>
Date:   Thu Apr 16 12:25:28 2015 +0530

    ctdb: Coverity fix for CID 1125625
    
    Memory allocated by ctdb_sys_find_ifname is not
    freed by the caller.
    
    Signed-off-by: Rajesh Joseph <rjoseph at redhat.com>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 450b7c619f89c596b6391a3f353364fa0943e500
Author: Günther Deschner <gd at samba.org>
Date:   Mon Mar 30 12:32:20 2015 +0200

    s3-passdb: fix memleak in pdb_default_get_trusted_domain().
    
    Guenther
    
    Signed-off-by: Günther Deschner <gd at samba.org>
    Reviewed-by: Alexander Bokovoy <ab at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 ctdb/server/ctdb_takeover.c    | 15 +++++++++++++--
 ctdb/tools/ctdb.c              | 11 ++++++++++-
 source3/passdb/pdb_interface.c | 10 +++++++++-
 3 files changed, 32 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c
index 2b274f7..cf1a1c3 100644
--- a/ctdb/server/ctdb_takeover.c
+++ b/ctdb/server/ctdb_takeover.c
@@ -1005,11 +1005,22 @@ int32_t ctdb_control_release_ip(struct ctdb_context *ctdb,
 		pip->pnn));
 
 	state = talloc(ctdb, struct takeover_callback_state);
-	CTDB_NO_MEMORY(ctdb, state);
+	if (state == NULL) {
+		ctdb_set_error(ctdb, "Out of memory at %s:%d",
+			       __FILE__, __LINE__);
+		free(iface);
+		return -1;
+	}
 
 	state->c = talloc_steal(state, c);
 	state->addr = talloc(state, ctdb_sock_addr);       
-	CTDB_NO_MEMORY(ctdb, state->addr);
+	if (state->addr == NULL) {
+		ctdb_set_error(ctdb, "Out of memory at %s:%d",
+			       __FILE__, __LINE__);
+		free(iface);
+		talloc_free(state);
+		return -1;
+	}
 	*state->addr = pip->addr;
 	state->vnn   = vnn;
 
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index e7f166d..66d0383 100644
--- a/ctdb/tools/ctdb.c
+++ b/ctdb/tools/ctdb.c
@@ -2418,6 +2418,7 @@ static int control_addip(struct ctdb_context *ctdb, int argc, const char **argv)
 static int control_ipiface(struct ctdb_context *ctdb, int argc, const char **argv)
 {
 	ctdb_sock_addr addr;
+	char *iface = NULL;
 
 	if (argc != 1) {
 		usage();
@@ -2428,7 +2429,15 @@ static int control_ipiface(struct ctdb_context *ctdb, int argc, const char **arg
 		return -1;
 	}
 
-	printf("IP on interface %s\n", ctdb_sys_find_ifname(&addr));
+	iface = ctdb_sys_find_ifname(&addr);
+	if (iface == NULL) {
+		printf("Failed to get interface name for ip: %s", argv[0]);
+		return -1;
+	}
+
+	printf("IP on interface %s\n", iface);
+
+	free(iface);
 
 	return 0;
 }
diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c
index 3a3fe2e..f73c383 100644
--- a/source3/passdb/pdb_interface.c
+++ b/source3/passdb/pdb_interface.c
@@ -2298,9 +2298,17 @@ static NTSTATUS pdb_default_get_trusted_domain(struct pdb_methods *methods,
 	taiob.current.count = 1;
 	taiob.current.array = &aia;
 	unix_to_nt_time(&aia.LastUpdateTime, last_set_time);
+
 	aia.AuthType = TRUST_AUTH_TYPE_CLEAR;
-	aia.AuthInfo.clear.password = (uint8_t *) pwd;
 	aia.AuthInfo.clear.size = strlen(pwd);
+	aia.AuthInfo.clear.password = (uint8_t *)talloc_memdup(tdom, pwd,
+							       aia.AuthInfo.clear.size);
+	SAFE_FREE(pwd);
+	if (aia.AuthInfo.clear.password == NULL) {
+		talloc_free(tdom);
+		return NT_STATUS_NO_MEMORY;
+	}
+
 	taiob.previous.count = 0;
 	taiob.previous.array = NULL;
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list