[SCM] Samba Shared Repository - branch master updated - 031c5d2753281ac4e8ae2a46f4e1b4bf19d2fa70

Jeremy Allison jra at samba.org
Thu Oct 30 00:10:38 GMT 2008


The branch, master has been updated
       via  031c5d2753281ac4e8ae2a46f4e1b4bf19d2fa70 (commit)
       via  0a6ff29e290123aa70daa8e293426249453352ce (commit)
       via  680975d07bb071238b3099c4b54a7c564668183a (commit)
       via  35ef924f33a7b5e74d9319e6fdd4092cdf625f77 (commit)
       via  f1a70d1e2aad74d25c312b21a8ba3fc4b0e52839 (commit)
       via  a238144c6ebf4d51e0d8c8b3cfd0e87814573c85 (commit)
      from  753af36a3e194f645ec0b68a033199035e71c909 (commit)

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


- Log -----------------------------------------------------------------
commit 031c5d2753281ac4e8ae2a46f4e1b4bf19d2fa70
Merge: 0a6ff29e290123aa70daa8e293426249453352ce 753af36a3e194f645ec0b68a033199035e71c909
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Oct 29 17:10:04 2008 -0700

    Merge branch 'master' of ssh://jra@git.samba.org/data/git/samba

commit 0a6ff29e290123aa70daa8e293426249453352ce
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Oct 29 17:07:14 2008 -0700

    Fix CID: 456 - resource leak on function exit.
    Jeremy.

commit 680975d07bb071238b3099c4b54a7c564668183a
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Oct 29 16:43:19 2008 -0700

    Fix CID 606 - failed to return -1 after socket() fail.
    Jeremy.

commit 35ef924f33a7b5e74d9319e6fdd4092cdf625f77
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Oct 29 16:28:57 2008 -0700

    Fix CID 574 - tidies up the code expression.
    Jeremy.

commit f1a70d1e2aad74d25c312b21a8ba3fc4b0e52839
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Oct 29 16:02:45 2008 -0700

    Coverity fix CID: 592 - null deref (can't happen but doesn't hurt to be sure).
    Jeremy.

commit a238144c6ebf4d51e0d8c8b3cfd0e87814573c85
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Oct 29 15:55:45 2008 -0700

    Coverity fix #CID: 607 - resource leak on error path.
    Jeremy.

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

Summary of changes:
 source3/client/mount.cifs.c                |   13 +++++++++++++
 source3/lib/readline.c                     |    1 +
 source3/modules/vfs_smb_traffic_analyzer.c |    1 +
 source3/smbd/notify_inotify.c              |    4 ++--
 source3/winbindd/winbindd_dual.c           |    2 +-
 5 files changed, 18 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/client/mount.cifs.c b/source3/client/mount.cifs.c
index fd8014c..2a9c2b7 100644
--- a/source3/client/mount.cifs.c
+++ b/source3/client/mount.cifs.c
@@ -441,6 +441,7 @@ static int parse_options(char ** optionsp, int * filesys_flags)
 					goto nocopy;
 				} else {
 					printf("username specified with no parameter\n");
+					SAFE_FREE(out);
 					return 1;	/* needs_arg; */
 				}
 			} else {
@@ -473,6 +474,7 @@ static int parse_options(char ** optionsp, int * filesys_flags)
 					domain_name = check_for_domain(&value);
 				} else {
 					printf("username too long\n");
+					SAFE_FREE(out);
 					return 1;
 				}
 			}
@@ -488,6 +490,7 @@ static int parse_options(char ** optionsp, int * filesys_flags)
 				got_password = 1;
 			} else {
 				printf("password too long\n");
+				SAFE_FREE(out);
 				return 1;
 			}
 		} else if (strncmp(data, "sec", 3) == 0) {
@@ -505,6 +508,7 @@ static int parse_options(char ** optionsp, int * filesys_flags)
 				got_ip = 1;
 			} else {
 				printf("ip address too long\n");
+				SAFE_FREE(out);
 				return 1;
 			}
 		} else if ((strncmp(data, "unc", 3) == 0)
@@ -512,6 +516,7 @@ static int parse_options(char ** optionsp, int * filesys_flags)
 		   || (strncmp(data, "path", 4) == 0)) {
 			if (!value || !*value) {
 				printf("invalid path to network resource\n");
+				SAFE_FREE(out);
 				return 1;  /* needs_arg; */
 			} else if(strnlen(value,5) < 5) {
 				printf("UNC name too short");
@@ -526,6 +531,7 @@ static int parse_options(char ** optionsp, int * filesys_flags)
 						got_unc = 1;
 				} else if (strncmp(value, "\\\\", 2) != 0) {	                   
 					printf("UNC Path does not begin with // or \\\\ \n");
+					SAFE_FREE(out);
 					return 1;
 				} else {
 					if(got_unc)
@@ -535,6 +541,7 @@ static int parse_options(char ** optionsp, int * filesys_flags)
 				}
 			} else {
 				printf("CIFS: UNC name too long\n");
+				SAFE_FREE(out);
 				return 1;
 			}
 		} else if ((strncmp(data, "dom" /* domain */, 3) == 0)
@@ -544,12 +551,14 @@ static int parse_options(char ** optionsp, int * filesys_flags)
 			   and "WORKGRP" etc. */
 			if (!value || !*value) {
 				printf("CIFS: invalid domain name\n");
+				SAFE_FREE(out);
 				return 1;	/* needs_arg; */
 			}
 			if (strnlen(value, DOMAIN_SIZE+1) < DOMAIN_SIZE+1) {
 				got_domain = 1;
 			} else {
 				printf("domain name too long\n");
+				SAFE_FREE(out);
 				return 1;
 			}
 		} else if (strncmp(data, "cred", 4) == 0) {
@@ -558,10 +567,12 @@ static int parse_options(char ** optionsp, int * filesys_flags)
 				if(rc) {
 					printf("error %d (%s) opening credential file %s\n",
 						rc, strerror(rc), value);
+					SAFE_FREE(out);
 					return 1;
 				}
 			} else {
 				printf("invalid credential file name specified\n");
+				SAFE_FREE(out);
 				return 1;
 			}
 		} else if (strncmp(data, "uid", 3) == 0) {
@@ -600,6 +611,7 @@ static int parse_options(char ** optionsp, int * filesys_flags)
 		} else if (strcmp(data, "file_mode") == 0 || strcmp(data, "fmask")==0) {
 			if (!value || !*value) {
 				printf ("Option '%s' requires a numerical argument\n", data);
+				SAFE_FREE(out);
 				return 1;
 			}
 
@@ -614,6 +626,7 @@ static int parse_options(char ** optionsp, int * filesys_flags)
 		} else if (strcmp(data, "dir_mode") == 0 || strcmp(data, "dmask")==0) {
 			if (!value || !*value) {
 				printf ("Option '%s' requires a numerical argument\n", data);
+				SAFE_FREE(out);
 				return 1;
 			}
 
diff --git a/source3/lib/readline.c b/source3/lib/readline.c
index cafb5a9..34867aa 100644
--- a/source3/lib/readline.c
+++ b/source3/lib/readline.c
@@ -105,6 +105,7 @@ static char *smb_readline_replacement(const char *prompt, void (*callback)(void)
 			callback();
 		}
 	}
+	SAFE_FREE(line);
 	return NULL;
 }
 
diff --git a/source3/modules/vfs_smb_traffic_analyzer.c b/source3/modules/vfs_smb_traffic_analyzer.c
index 9456afb..63cc904 100644
--- a/source3/modules/vfs_smb_traffic_analyzer.c
+++ b/source3/modules/vfs_smb_traffic_analyzer.c
@@ -123,6 +123,7 @@ static int smb_traffic_analyzer_connect_unix_socket(vfs_handle_struct *handle,
 		DEBUG(1, ("smb_traffic_analyzer_connect_unix_socket: "
 			"Couldn't create socket, "
 			"make sure stad is running!\n"));
+		return -1;
 	}
 	remote.sun_family = AF_UNIX;
 	strlcpy(remote.sun_path, name,
diff --git a/source3/smbd/notify_inotify.c b/source3/smbd/notify_inotify.c
index fa0f0ed..c6c12a9 100644
--- a/source3/smbd/notify_inotify.c
+++ b/source3/smbd/notify_inotify.c
@@ -243,14 +243,14 @@ static void inotify_handler(struct event_context *ev, struct fd_event *fde,
 	e0 = e = (struct inotify_event *)TALLOC_SIZE(in, bufsize);
 	if (e == NULL) return;
 
-	if (read(in->fd, e0, bufsize) != bufsize) {
+	if (sys_read(in->fd, e0, bufsize) != bufsize) {
 		DEBUG(0,("Failed to read all inotify data\n"));
 		talloc_free(e0);
 		return;
 	}
 
 	/* we can get more than one event in the buffer */
-	while (bufsize >= sizeof(*e)) {
+	while (e && (bufsize >= sizeof(*e))) {
 		struct inotify_event *e2 = NULL;
 		bufsize -= e->len + sizeof(*e);
 		if (bufsize >= sizeof(*e)) {
diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
index 994c94b..03d1e04 100644
--- a/source3/winbindd/winbindd_dual.c
+++ b/source3/winbindd/winbindd_dual.c
@@ -1259,7 +1259,7 @@ static bool fork_domain_child(struct winbindd_child *child)
 
 		set_domain_online_request(child->domain);
 
-		if (primary_domain != child->domain) {
+		if (primary_domain && (primary_domain != child->domain)) {
 			/* We need to talk to the primary
 			 * domain as well as the trusted
 			 * domain inside a trusted domain


-- 
Samba Shared Repository


More information about the samba-cvs mailing list