[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Wed Feb 1 04:17:02 UTC 2017


The branch, master has been updated
       via  7fd3eb6 util:charset: Return EILSEQ in smb_iconv() if newer libc is detected
       via  669d215 auth: fix mem leak & use appropriate free function
      from  39ac4ae ctdb-tests: Use replace headers instead of system headers

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


- Log -----------------------------------------------------------------
commit 7fd3eb6c04bebd5c8cd25b81198dc0112703497a
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Jan 30 17:17:38 2017 +0100

    util:charset: Return EILSEQ in smb_iconv() if newer libc is detected
    
    This is the behaviour of glibc 2.24 and newer.
    
    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): Wed Feb  1 05:16:46 CET 2017 on sn-devel-144

commit 669d2152cb9c1111d36127daee64b4bbfc141b7a
Author: Aurelien Aptel <aaptel at suse.com>
Date:   Tue Jan 17 14:39:02 2017 +0100

    auth: fix mem leak & use appropriate free function
    
    coverity fix.
    
    cli_credentials_set_principal does a strdup, we want to free 'name'
    regardless of the result in 'ok'.
    
    Signed-off-by: Aurelien Aptel <aaptel at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

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

Summary of changes:
 auth/credentials/credentials_krb5.c |  2 +-
 lib/util/charset/iconv.c            |  6 +++---
 lib/util/charset/wscript_configure  | 20 ++++++++++++++++++++
 3 files changed, 24 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/auth/credentials/credentials_krb5.c b/auth/credentials/credentials_krb5.c
index 3663e1d..d2a655e 100644
--- a/auth/credentials/credentials_krb5.c
+++ b/auth/credentials/credentials_krb5.c
@@ -260,11 +260,11 @@ static int cli_credentials_set_from_ccache(struct cli_credentials *cred,
 	}
 
 	ok = cli_credentials_set_principal(cred, name, obtained);
+	krb5_free_unparsed_name(ccache->smb_krb5_context->krb5_context, name);
 	if (!ok) {
 		krb5_free_principal(ccache->smb_krb5_context->krb5_context, princ);
 		return ENOMEM;
 	}
-	free(name);
 
 	realm = smb_krb5_principal_get_realm(ccache->smb_krb5_context->krb5_context,
 					     princ);
diff --git a/lib/util/charset/iconv.c b/lib/util/charset/iconv.c
index bf561f2..e06fa2c 100644
--- a/lib/util/charset/iconv.c
+++ b/lib/util/charset/iconv.c
@@ -740,12 +740,12 @@ static size_t utf8_push(void *cd, const char **inbuf, size_t *inbytesleft,
 		}
 
 		if ((uc[1] & 0xfc) == 0xdc) {
-			/* its the second part of a 4 byte sequence. Illegal */
+			errno = EILSEQ;
+#ifndef HAVE_ICONV_ERRNO_ILLEGAL_MULTIBYTE
 			if (in_left < 4) {
 				errno = EINVAL;
-			} else {
-				errno = EILSEQ;
 			}
+#endif
 			goto error;
 		}
 
diff --git a/lib/util/charset/wscript_configure b/lib/util/charset/wscript_configure
index 804c266..d5ac5d0 100644
--- a/lib/util/charset/wscript_configure
+++ b/lib/util/charset/wscript_configure
@@ -16,3 +16,23 @@ if (conf.CHECK_FUNCS_IN('iconv_open', 'iconv', checklibc=False, headers='iconv.h
     conf.CHECK_FUNCS('iconv_open', headers='iconv.h')):
     
     conf.DEFINE('HAVE_NATIVE_ICONV', 1)
+
+conf.CHECK_CODE('''
+                uint8_t inbuf[2] = { 0x30, 0xdf };
+                uint8_t outbuf[4] = { 0 };
+                char *ptr_in = (char *)inbuf;
+                char *ptr_out = (char *)outbuf;
+                size_t size_in = sizeof(inbuf);
+                size_t size_out = sizeof(outbuf);
+                size_t ret;
+                iconv_t cd;
+                cd = iconv_open("UTF-8", "UTF-16LE");
+                if (cd == 0 || cd == (iconv_t)-1) return -1;
+                ret = iconv(cd, &ptr_in, &size_in, &ptr_out, &size_out);
+                if (ret != (size_t)-1 || errno != EILSEQ) return -1;
+                ''',
+                define='HAVE_ICONV_ERRNO_ILLEGAL_MULTIBYTE',
+                execute=True,
+                msg='Checking errno of iconv for illegal multibyte sequence',
+                lib='iconv',
+                headers='errno.h iconv.h')


-- 
Samba Shared Repository



More information about the samba-cvs mailing list