[SCM] Samba Shared Repository - branch v4-0-test updated

Karolin Seeger kseeger at samba.org
Sat Dec 28 15:22:05 MST 2013


The branch, v4-0-test has been updated
       via  bdafdcb ldb: bad if test in ldb_comparison_fold()
       via  5b9e579 s3: smbpasswd - fix crashes on invalid input.
       via  64302c1 s3:configure: require tevent >= 0.9.18 as external library
      from  eca8433 smbtorture: New torture test for bug #9870.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit bdafdcbdf40f9bf814f9e3fbec9d32a13d0ef92e
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Dec 6 15:58:02 2013 -0800

    ldb: bad if test in ldb_comparison_fold()
    
    Found by David Binderman <dcb314 at hotmail.com>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10305
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    Autobuild-User(master): Michael Adam <obnox at samba.org>
    Autobuild-Date(master): Sat Dec  7 11:10:47 CET 2013 on sn-devel-104
    
    Autobuild-User(v4-0-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-0-test): Sat Dec 28 23:21:12 CET 2013 on sn-devel-104

commit 5b9e5793dfb6ff7111f4096d5c290af634f0714c
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Dec 12 09:37:25 2013 -0800

    s3: smbpasswd - fix crashes on invalid input.
    
    get_pass can return NULL on error. Ensure that
    this is always the case and fix all callers to cope
    (some already did).
    
    Reported by Joonas Kuorilehto <joneskoo at codenomicon.com>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10320
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Mon Dec 16 15:17:58 CET 2013 on sn-devel-104
    
    (cherry picked from commit ef5a3bedab74420baf0c653cf8e304fe6c2a13b4)

commit 64302c156019647828553598917136ae509ac315
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Dec 17 12:57:53 2013 +0100

    s3:configure: require tevent >= 0.9.18 as external library
    
    0.9.16 might be enough, but this matches the waf build.
    So 0.9.18 is less likely to produce regressions in the future.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10330
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

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

Summary of changes:
 lib/ldb/common/attrib_handlers.c |    2 +-
 source3/configure.in             |    2 +-
 source3/utils/net.c              |    5 +++++
 source3/utils/passwd_util.c      |   14 +++++++++-----
 source3/utils/smbpasswd.c        |   14 ++++++++++++++
 5 files changed, 30 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/ldb/common/attrib_handlers.c b/lib/ldb/common/attrib_handlers.c
index daeb422..4b94d39 100644
--- a/lib/ldb/common/attrib_handlers.c
+++ b/lib/ldb/common/attrib_handlers.c
@@ -254,7 +254,7 @@ int ldb_comparison_fold(struct ldb_context *ldb, void *mem_ctx,
 	if (n2 == 0 && n1 != 0) {
 		return (int)toupper(*s1);
 	}
-	if (n2 == 0 && n2 == 0) {
+	if (n1 == 0 && n2 == 0) {
 		return 0;
 	}
 	return (int)toupper(*s1) - (int)toupper(*s2);
diff --git a/source3/configure.in b/source3/configure.in
index f5487c3..f4403e1 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -1873,7 +1873,7 @@ AC_ARG_ENABLE(external_libtevent,
 
 if test "x$enable_external_libtevent" != xno
 then
-	PKG_CHECK_MODULES(LIBTEVENT, tevent >= 0.9.11,
+	PKG_CHECK_MODULES(LIBTEVENT, tevent >= 0.9.18,
 		[ enable_external_libtevent=yes ],
 		[ if test x$enable_external_libtevent = xyes; then
 			AC_MSG_ERROR([Unable to find libtevent])
diff --git a/source3/utils/net.c b/source3/utils/net.c
index eccb522..a31214f 100644
--- a/source3/utils/net.c
+++ b/source3/utils/net.c
@@ -105,6 +105,11 @@ static int net_changesecretpw(struct net_context *c, int argc,
 		}
 
 		trust_pw = get_pass(_("Enter machine password: "), c->opt_stdin);
+		if (trust_pw == NULL) {
+			    d_fprintf(stderr,
+				      _("Error in reading machine password\n"));
+			    return 1;
+		}
 
 		if (!secrets_store_machine_password(trust_pw, lp_workgroup(), sec_channel_type)) {
 			    d_fprintf(stderr,
diff --git a/source3/utils/passwd_util.c b/source3/utils/passwd_util.c
index 293f163..6bc2d60 100644
--- a/source3/utils/passwd_util.c
+++ b/source3/utils/passwd_util.c
@@ -42,11 +42,12 @@ char *stdin_new_passwd( void)
 	 * the newline that ends the password, then replace the newline with
 	 * a null terminator.
 	 */
-	if ( fgets(new_pw, sizeof(new_pw), stdin) != NULL) {
-		if ((len = strlen(new_pw)) > 0) {
-			if(new_pw[len-1] == '\n')
-				new_pw[len - 1] = 0;
-		}
+	if ( fgets(new_pw, sizeof(new_pw), stdin) == NULL) {
+		return NULL;
+	}
+	if ((len = strlen(new_pw)) > 0) {
+		if(new_pw[len-1] == '\n')
+			new_pw[len - 1] = 0;
 	}
 	return(new_pw);
 }
@@ -61,6 +62,9 @@ char *get_pass( const char *prompt, bool stdin_get)
 	char *p;
 	if (stdin_get) {
 		p = stdin_new_passwd();
+		if (p == NULL) {
+			return NULL;
+		}
 	} else {
 		p = getpass( prompt);
 	}
diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c
index 66c80da..082da93 100644
--- a/source3/utils/smbpasswd.c
+++ b/source3/utils/smbpasswd.c
@@ -216,11 +216,17 @@ static char *prompt_for_new_password(bool stdin_get)
 	ZERO_ARRAY(new_pw);
 
 	p = get_pass("New SMB password:", stdin_get);
+	if (p == NULL) {
+		return NULL;
+	}
 
 	fstrcpy(new_pw, p);
 	SAFE_FREE(p);
 
 	p = get_pass("Retype new SMB password:", stdin_get);
+	if (p == NULL) {
+		return NULL;
+	}
 
 	if (strcmp(p, new_pw)) {
 		fprintf(stderr, "Mismatch - password unchanged.\n");
@@ -310,6 +316,10 @@ static int process_root(int local_flags)
 		printf("Setting stored password for \"%s\" in secrets.tdb\n", ldap_admin_dn);
 		if ( ! *ldap_secret ) {
 			new_passwd = prompt_for_new_password(stdin_passwd_get);
+			if (new_passwd == NULL) {
+				fprintf(stderr, "Failed to read new password!\n");
+				exit(1);
+			}
 			fstrcpy(ldap_secret, new_passwd);
 		}
 		if (!store_ldap_admin_pw(ldap_secret)) {
@@ -537,6 +547,10 @@ static int process_nonroot(int local_flags)
 
 	if (remote_machine != NULL) {
 		old_pw = get_pass("Old SMB password:",stdin_passwd_get);
+		if (old_pw == NULL) {
+			fprintf(stderr, "Unable to get old password.\n");
+			exit(1);
+		}
 	}
 
 	if (!new_passwd) {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list