[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Thu Jun 1 21:43:02 UTC 2017


The branch, master has been updated
       via  1f4b07e s4:torture: Fix comparison between pointer and zero character constant
       via  1670d00 waf: Do not trhow a format-truncation error for test/snprintf.c
       via  94e21c1 replace: Use the same size as d_name member of struct dirent
       via  9e9bff1 password_hash: conditional compilation for crypt_r
      from  5ccfd38 dnsserver: Stop dns_name_equal doing OOB read

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


- Log -----------------------------------------------------------------
commit 1f4b07e5942235bddcfa999b3575f719752d81c4
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Jun 1 14:28:08 2017 +0200

    s4:torture: Fix comparison between pointer and zero character constant
    
    Fixes building with GCC 7.1
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu Jun  1 23:42:58 CEST 2017 on sn-devel-144

commit 1670d00be88108a483f04c9763012504499b99e4
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Jun 1 14:24:42 2017 +0200

    waf: Do not trhow a format-truncation error for test/snprintf.c
    
    This fixes building with GCC 7.1
    
    Error:
    ../lib/replace/test/testsuite.c:355:6: error: ā€˜%dā€™ directive output
    truncated writing 1 byte into a region of size 0
    [-Werror=format-truncation=]
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 94e21c139f9b0c1d28ee85fdcb9b7490cc64e27b
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Jun 1 14:16:56 2017 +0200

    replace: Use the same size as d_name member of struct dirent
    
    This fixes an error with GCC 7.1
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 9e9bff1f278ae7c2927cc3fa648f8ec8eb98b8c4
Author: Gary Lockyer <gary at catalyst.net.nz>
Date:   Wed May 31 10:35:25 2017 +1200

    password_hash: conditional compilation for crypt_r
    
    Add check for crypt_r, and if absent fall back to crypt
    
    Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
    Reviewed-by: Volker Lendecke <vl at samba.org>

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

Summary of changes:
 lib/replace/test/os2_delete.c                  |  2 +-
 lib/replace/wscript                            |  3 ++-
 source4/dsdb/samdb/ldb_modules/password_hash.c | 12 +++++++++++-
 source4/torture/masktest.c                     |  2 +-
 4 files changed, 15 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/replace/test/os2_delete.c b/lib/replace/test/os2_delete.c
index 0816f61..4b99ccf 100644
--- a/lib/replace/test/os2_delete.c
+++ b/lib/replace/test/os2_delete.c
@@ -63,7 +63,7 @@ static int os2_delete(DIR *d)
 	off_t offsets[READDIR_SIZE];
 	int i, j;
 	struct dirent *de;
-	char names[READDIR_SIZE][30];
+	char names[READDIR_SIZE][256];
 
 	/* scan, remembering offsets */
 	for (i=0, de=readdir(d); 
diff --git a/lib/replace/wscript b/lib/replace/wscript
index f681d02..eeb1b3e 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -466,6 +466,7 @@ removeea setea
             conf.DEFINE('HAVE_ROBUST_MUTEXES', 1)
 
     conf.CHECK_FUNCS_IN('crypt', 'crypt', checklibc=True)
+    conf.CHECK_FUNCS_IN('crypt_r', 'crypt', checklibc=True)
 
     conf.CHECK_VARIABLE('rl_event_hook', define='HAVE_DECL_RL_EVENT_HOOK', always=True,
                         headers='readline.h readline/readline.h readline/history.h')
@@ -707,7 +708,7 @@ def build(bld):
                         source='''test/testsuite.c test/strptime.c
                         test/os2_delete.c test/getifaddrs.c''',
                         deps='replace',
-                        cflags="-Wno-format-zero-length")
+                        cflags="-Wno-format-zero-length -Wno-format-truncation")
 
     if bld.env.standalone_replace:
         bld.SAMBA_BINARY('replace_testsuite',
diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c
index 6a1ae3b..8e8dc2c 100644
--- a/source4/dsdb/samdb/ldb_modules/password_hash.c
+++ b/source4/dsdb/samdb/ldb_modules/password_hash.c
@@ -1487,11 +1487,13 @@ static int setup_primary_userPassword_hash(
 	const char *salt = NULL;        /* Randomly generated salt */
 	const char *cmd = NULL;         /* command passed to crypt */
 	const char *hash = NULL;        /* password hash generated by crypt */
-	struct crypt_data crypt_data;   /* working storage used by crypt */
 	int algorithm = 0;              /* crypt hash algorithm number */
 	int rounds = 0;                 /* The number of hash rounds */
 	DATA_BLOB *hash_blob = NULL;
 	TALLOC_CTX *frame = talloc_stackframe();
+#ifdef HAVE_CRYPT_R
+	struct crypt_data crypt_data;   /* working storage used by crypt */
+#endif
 
 	/* Genrate a random password salt */
 	salt = generate_random_str_list(frame,
@@ -1531,7 +1533,15 @@ static int setup_primary_userPassword_hash(
 	 * Relies on the assertion that cleartext_utf8->data is a zero
 	 * terminated UTF-8 string
 	 */
+#ifdef HAVE_CRYPT_R
 	hash = crypt_r((char *)io->n.cleartext_utf8->data, cmd, &crypt_data);
+#else
+	/*
+	 * No crypt_r falling back to crypt, which is NOT thread safe
+	 * Thread safety MT-Unsafe race:crypt
+	 */
+	hash = crypt((char *)io->n.cleartext_utf8->data, cmd);
+#endif
 	if (hash == NULL) {
 		char buf[1024];
 		ldb_asprintf_errstring(
diff --git a/source4/torture/masktest.c b/source4/torture/masktest.c
index 9c5906f..9a047e2 100644
--- a/source4/torture/masktest.c
+++ b/source4/torture/masktest.c
@@ -160,7 +160,7 @@ static void get_real_name(TALLOC_CTX *mem_ctx, struct smbcli_state *cli,
 		*long_name = strlower_talloc(mem_ctx, last_hit.long_name);
 	}
 
-	if (*short_name == '\0') {
+	if (*short_name[0] == '\0') {
 		*short_name = talloc_strdup(mem_ctx, *long_name);
 	}
 }


-- 
Samba Shared Repository



More information about the samba-cvs mailing list