[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-100-gbbe2d30

Jelmer Vernooij jelmer at samba.org
Sun Mar 1 16:30:12 GMT 2009


The branch, master has been updated
       via  bbe2d30f66ebd8537203870b1225179f03d42744 (commit)
       via  4903d20c215a01f70c242cb8cf4d455d0e352b7f (commit)
       via  9f6e2d64852026d118c717d80236177fd74331eb (commit)
       via  9ffb6d2d9e78ed192b8215194b6328d03d1ddad3 (commit)
      from  08b180e40e5179cc02d4aa1867d5063f47b85790 (commit)

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


- Log -----------------------------------------------------------------
commit bbe2d30f66ebd8537203870b1225179f03d42744
Merge: 4903d20c215a01f70c242cb8cf4d455d0e352b7f 08b180e40e5179cc02d4aa1867d5063f47b85790
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Mar 1 17:29:04 2009 +0100

    Merge branch 'master' of git://git.samba.org/samba into convenience

commit 4903d20c215a01f70c242cb8cf4d455d0e352b7f
Merge: 9f6e2d64852026d118c717d80236177fd74331eb 09ac816b36e45fd537af2f7fe7c57a11f5c744f5
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Mar 1 16:41:57 2009 +0100

    Merge branch 'master' of git://git.samba.org/samba into convenience

commit 9f6e2d64852026d118c717d80236177fd74331eb
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Mar 1 12:59:58 2009 +0100

    Sync smb_iconv_t type, convert_string return type with Samba 3 equivalents.

commit 9ffb6d2d9e78ed192b8215194b6328d03d1ddad3
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Mar 1 06:33:40 2009 +0100

    Add allow_badcharcnv argument to all conversion function, for
    consistency with Samba 3.

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

Summary of changes:
 lib/util/charset/charcnv.c                     |   11 +++++++-
 lib/util/charset/charset.h                     |   11 ++++----
 lib/util/charset/tests/iconv.c                 |    6 ++--
 lib/util/charset/util_unistr.c                 |   31 ++++++++++++-----------
 source3/include/includes.h                     |    2 +-
 source3/include/proto.h                        |    9 -------
 source3/include/smb.h                          |   16 ------------
 source4/auth/ntlm/ntlm_check.c                 |    2 +-
 source4/dsdb/common/util.c                     |    2 +-
 source4/dsdb/samdb/ldb_modules/password_hash.c |    6 ++--
 source4/dsdb/schema/schema_init.c              |    2 +-
 source4/dsdb/schema/schema_syntax.c            |    8 +++---
 source4/kdc/kpasswdd.c                         |    4 +-
 source4/lib/registry/ldb.c                     |    4 +-
 source4/lib/registry/tests/generic.c           |    6 ++--
 source4/lib/registry/util.c                    |    4 +-
 source4/lib/tdr/tdr.c                          |    4 +-
 source4/libcli/raw/rawfileinfo.c               |    2 +-
 source4/libcli/raw/rawrequest.c                |    8 +++---
 source4/libcli/smb2/request.c                  |    4 +-
 source4/libnet/libnet_samdump.c                |    2 +-
 source4/librpc/ndr/ndr_string.c                |   20 +++++++-------
 source4/rpc_server/samr/samr_password.c        |    6 ++--
 source4/smb_server/smb/request.c               |    4 +-
 source4/torture/basic/charset.c                |    2 +-
 source4/torture/basic/utable.c                 |    4 +-
 source4/torture/rpc/samlogon.c                 |    2 +-
 source4/torture/rpc/spoolss_win.c              |    2 +-
 28 files changed, 84 insertions(+), 100 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/charset/charcnv.c b/lib/util/charset/charcnv.c
index 1f3b1ac..18be2bc 100644
--- a/lib/util/charset/charcnv.c
+++ b/lib/util/charset/charcnv.c
@@ -240,7 +240,7 @@ convert:
 _PUBLIC_ ssize_t convert_string_convenience(struct smb_iconv_convenience *ic,
 				charset_t from, charset_t to,
 				void const *src, size_t srclen, 
-				void *dest, size_t destlen)
+				void *dest, size_t destlen, bool allow_badcharcnv)
 {
 	size_t i_len, o_len;
 	size_t retval;
@@ -248,6 +248,10 @@ _PUBLIC_ ssize_t convert_string_convenience(struct smb_iconv_convenience *ic,
 	char* outbuf = (char*)dest;
 	smb_iconv_t descriptor;
 
+	if (allow_badcharcnv) {
+		return -1;
+	}
+
 	if (srclen == (size_t)-1)
 		srclen = strlen(inbuf)+1;
 
@@ -305,10 +309,13 @@ _PUBLIC_ ssize_t convert_string_talloc_convenience(TALLOC_CTX *ctx,
 				       struct smb_iconv_convenience *ic, 
 				       charset_t from, charset_t to, 
 				       void const *src, size_t srclen, 
-				       void **dest)
+				       void **dest, bool allow_badcharcnv)
 {
 	smb_iconv_t descriptor;
 
+	if (allow_badcharcnv)
+		return (size_t)-1;
+
 	*dest = NULL;
 
 	if (src == NULL || srclen == (size_t)-1 || srclen == 0)
diff --git a/lib/util/charset/charset.h b/lib/util/charset/charset.h
index f027beb..3acdde3 100644
--- a/lib/util/charset/charset.h
+++ b/lib/util/charset/charset.h
@@ -61,6 +61,7 @@ typedef struct smb_iconv_s {
 	size_t (*push)(void *cd, const char **inbuf, size_t *inbytesleft,
 		       char **outbuf, size_t *outbytesleft);
 	void *cd_direct, *cd_pull, *cd_push;
+	char *from_name, *to_name;
 } *smb_iconv_t;
 
 /* string manipulation flags */
@@ -117,11 +118,11 @@ ssize_t pull_string(char *dest, const void *src, size_t dest_len, size_t src_len
 ssize_t convert_string_talloc(TALLOC_CTX *ctx, 
 				       charset_t from, charset_t to, 
 				       void const *src, size_t srclen, 
-				       void **dest);
+				       void **dest, bool allow_badcharcnv);
 
-ssize_t convert_string(charset_t from, charset_t to,
+size_t convert_string(charset_t from, charset_t to,
 				void const *src, size_t srclen, 
-				void *dest, size_t destlen);
+				void *dest, size_t destlen, bool allow_badcharcnv);
 
 ssize_t iconv_talloc(TALLOC_CTX *mem_ctx, 
 				       smb_iconv_t cd,
@@ -150,12 +151,12 @@ struct smb_iconv_convenience *smb_iconv_convenience_init(TALLOC_CTX *mem_ctx,
 ssize_t convert_string_convenience(struct smb_iconv_convenience *ic,
 				charset_t from, charset_t to,
 				void const *src, size_t srclen, 
-				void *dest, size_t destlen);
+				void *dest, size_t destlen, bool allow_badcharcnv);
 ssize_t convert_string_talloc_convenience(TALLOC_CTX *ctx, 
 				       struct smb_iconv_convenience *ic, 
 				       charset_t from, charset_t to, 
 				       void const *src, size_t srclen, 
-				       void **dest);
+				       void **dest, bool allow_badcharcnv);
 /* iconv */
 smb_iconv_t smb_iconv_open(const char *tocode, const char *fromcode);
 int smb_iconv_close(smb_iconv_t cd);
diff --git a/lib/util/charset/tests/iconv.c b/lib/util/charset/tests/iconv.c
index 1facea6..fbe7b10 100644
--- a/lib/util/charset/tests/iconv.c
+++ b/lib/util/charset/tests/iconv.c
@@ -418,7 +418,7 @@ static bool test_string2key(struct torture_context *tctx)
 
 	torture_comment(tctx, "converting random buffer\n");
 
-	ret = convert_string_talloc(mem_ctx, CH_UTF16MUNGED, CH_UTF8, (void *)buf, len*2, (void**)&dest);
+	ret = convert_string_talloc(mem_ctx, CH_UTF16MUNGED, CH_UTF8, (void *)buf, len*2, (void**)&dest, false);
 	if (ret == -1) {
 		torture_fail(tctx, "Failed to convert random buffer\n");
 	}
@@ -429,7 +429,7 @@ static bool test_string2key(struct torture_context *tctx)
 
 	torture_comment(tctx, "converting fixed buffer to UTF16\n");
 
-	ret = convert_string_talloc(mem_ctx, CH_UTF16MUNGED, CH_UTF16, (void *)le1, 20, (void**)&munged1);
+	ret = convert_string_talloc(mem_ctx, CH_UTF16MUNGED, CH_UTF16, (void *)le1, 20, (void**)&munged1, false);
 	if (ret == -1) {
 		torture_fail(tctx, "Failed to convert fixed buffer to UTF16_MUNGED\n");
 	}
@@ -438,7 +438,7 @@ static bool test_string2key(struct torture_context *tctx)
 
 	torture_comment(tctx, "converting fixed buffer to UTF8\n");
 
-	ret = convert_string_talloc(mem_ctx, CH_UTF16MUNGED, CH_UTF8, (void *)le1, 20, (void**)&out1);
+	ret = convert_string_talloc(mem_ctx, CH_UTF16MUNGED, CH_UTF8, (void *)le1, 20, (void**)&out1, false);
 	if (ret == -1) {
 		torture_fail(tctx, "Failed to convert fixed buffer to UTF8\n");
 	}
diff --git a/lib/util/charset/util_unistr.c b/lib/util/charset/util_unistr.c
index 41b9c94..96c9873 100644
--- a/lib/util/charset/util_unistr.c
+++ b/lib/util/charset/util_unistr.c
@@ -656,7 +656,7 @@ static ssize_t push_ascii(void *dest, const char *src, size_t dest_len, int flag
 	if (flags & (STR_TERMINATE | STR_TERMINATE_ASCII))
 		src_len++;
 
-	return convert_string(CH_UNIX, CH_DOS, src, src_len, dest, dest_len);
+	return convert_string(CH_UNIX, CH_DOS, src, src_len, dest, dest_len, false);
 }
 
 /**
@@ -672,7 +672,7 @@ _PUBLIC_ ssize_t push_ascii_talloc(TALLOC_CTX *ctx, char **dest, const char *src
 {
 	size_t src_len = strlen(src)+1;
 	*dest = NULL;
-	return convert_string_talloc(ctx, CH_UNIX, CH_DOS, src, src_len, (void **)dest);
+	return convert_string_talloc(ctx, CH_UNIX, CH_DOS, src, src_len, (void **)dest, false);
 }
 
 
@@ -706,7 +706,7 @@ static ssize_t pull_ascii(char *dest, const void *src, size_t dest_len, size_t s
 		}
 	}
 
-	ret = convert_string(CH_DOS, CH_UNIX, src, src_len, dest, dest_len);
+	ret = convert_string(CH_DOS, CH_UNIX, src, src_len, dest, dest_len, false);
 
 	if (dest_len)
 		dest[MIN(ret, dest_len-1)] = 0;
@@ -759,7 +759,7 @@ static ssize_t push_ucs2(void *dest, const char *src, size_t dest_len, int flags
 	/* ucs2 is always a multiple of 2 bytes */
 	dest_len &= ~1;
 
-	ret = convert_string(CH_UNIX, CH_UTF16, src, src_len, dest, dest_len);
+	ret = convert_string(CH_UNIX, CH_UTF16, src, src_len, dest, dest_len, false);
 	if (ret == (size_t)-1) {
 		return 0;
 	}
@@ -783,7 +783,7 @@ _PUBLIC_ ssize_t push_ucs2_talloc(TALLOC_CTX *ctx, void **dest, const char *src)
 {
 	size_t src_len = strlen(src)+1;
 	*dest = NULL;
-	return convert_string_talloc(ctx, CH_UNIX, CH_UTF16, src, src_len, dest);
+	return convert_string_talloc(ctx, CH_UNIX, CH_UTF16, src, src_len, dest, false);
 }
 
 
@@ -799,7 +799,7 @@ _PUBLIC_ ssize_t push_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src)
 {
 	size_t src_len = strlen(src)+1;
 	*dest = NULL;
-	return convert_string_talloc(ctx, CH_UNIX, CH_UTF8, src, src_len, (void **)dest);
+	return convert_string_talloc(ctx, CH_UNIX, CH_UTF8, src, src_len, (void **)dest, false);
 }
 
 /**
@@ -835,7 +835,7 @@ static size_t pull_ucs2(char *dest, const void *src, size_t dest_len, size_t src
 	if (src_len != (size_t)-1)
 		src_len &= ~1;
 	
-	ret = convert_string(CH_UTF16, CH_UNIX, src, src_len, dest, dest_len);
+	ret = convert_string(CH_UTF16, CH_UNIX, src, src_len, dest, dest_len, false);
 	if (dest_len)
 		dest[MIN(ret, dest_len-1)] = 0;
 
@@ -854,7 +854,7 @@ _PUBLIC_ ssize_t pull_ascii_talloc(TALLOC_CTX *ctx, char **dest, const char *src
 {
 	size_t src_len = strlen(src)+1;
 	*dest = NULL;
-	return convert_string_talloc(ctx, CH_DOS, CH_UNIX, src, src_len, (void **)dest);
+	return convert_string_talloc(ctx, CH_DOS, CH_UNIX, src, src_len, (void **)dest, false);
 }
 
 /**
@@ -869,7 +869,7 @@ _PUBLIC_ ssize_t pull_ucs2_talloc(TALLOC_CTX *ctx, char **dest, const void *src)
 {
 	size_t src_len = utf16_len(src);
 	*dest = NULL;
-	return convert_string_talloc(ctx, CH_UTF16, CH_UNIX, src, src_len, (void **)dest);
+	return convert_string_talloc(ctx, CH_UTF16, CH_UNIX, src, src_len, (void **)dest, false);
 }
 
 /**
@@ -884,7 +884,7 @@ _PUBLIC_ ssize_t pull_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src)
 {
 	size_t src_len = strlen(src)+1;
 	*dest = NULL;
-	return convert_string_talloc(ctx, CH_UTF8, CH_UNIX, src, src_len, (void **)dest);
+	return convert_string_talloc(ctx, CH_UTF8, CH_UNIX, src, src_len, (void **)dest, false);
 }
 
 /**
@@ -950,13 +950,13 @@ _PUBLIC_ ssize_t pull_string(char *dest, const void *src, size_t dest_len, size_
  * @param destlen maximal length allowed for string
  * @returns the number of bytes occupied in the destination
  **/
-_PUBLIC_ ssize_t convert_string(charset_t from, charset_t to,
+_PUBLIC_ size_t convert_string(charset_t from, charset_t to,
 				void const *src, size_t srclen, 
-				void *dest, size_t destlen)
+				void *dest, size_t destlen, bool allow_badcharcnv)
 {
 	return convert_string_convenience(get_iconv_convenience(), from, to, 
 									  src, srclen,
-									  dest, destlen);
+									  dest, destlen, allow_badcharcnv);
 }
 
 /**
@@ -972,10 +972,11 @@ _PUBLIC_ ssize_t convert_string(charset_t from, charset_t to,
 _PUBLIC_ ssize_t convert_string_talloc(TALLOC_CTX *ctx, 
 				       charset_t from, charset_t to, 
 				       void const *src, size_t srclen, 
-				       void **dest)
+				       void **dest, bool allow_badcharcnv)
 {
 	return convert_string_talloc_convenience(ctx, get_iconv_convenience(),
-											 from, to, src, srclen, dest);
+											 from, to, src, srclen, dest,
+											 allow_badcharcnv);
 }
 
 
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 523a11e..7f8c408 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -594,7 +594,7 @@ struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx);
 #include "trans2.h"
 #include "../libcli/util/error.h"
 #include "ntioctl.h"
-#include "charset.h"
+#include "../lib/util/charset/charset.h"
 #include "dynconfig.h"
 #include "util_getent.h"
 #include "debugparse.h"
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 5bae973..eeb6f19 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -528,15 +528,6 @@ void gencache_iterate(void (*fn)(const char* key, const char *value, time_t time
 int gencache_lock_entry( const char *key );
 void gencache_unlock_entry( const char *key );
 
-/* The following definitions come from lib/iconv.c  */
-
-NTSTATUS smb_register_charset(struct charset_functions *funcs) ;
-size_t smb_iconv(smb_iconv_t cd, 
-		 const char **inbuf, size_t *inbytesleft,
-		 char **outbuf, size_t *outbytesleft);
-smb_iconv_t smb_iconv_open(const char *tocode, const char *fromcode);
-int smb_iconv_close (smb_iconv_t cd);
-
 /* The following definitions come from lib/interface.c  */
 
 bool ismyaddr(const struct sockaddr *ip);
diff --git a/source3/include/smb.h b/source3/include/smb.h
index f020887..189e370 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -167,10 +167,6 @@ typedef uint16 smb_ucs2_t;
 #define COPY_UCS2_CHAR(dest,src) (((unsigned char *)(dest))[0] = ((unsigned char *)(src))[0],\
 				((unsigned char *)(dest))[1] = ((unsigned char *)(src))[1], (dest))
 
-/* Large data type for manipulating uint32 unicode codepoints */
-typedef uint32 codepoint_t;
-#define INVALID_CODEPOINT ((codepoint_t)-1)
-
 /* pipe string names */
 #define PIPE_LANMAN   "\\PIPE\\LANMAN"
 
@@ -1831,18 +1827,6 @@ struct unix_error_map {
 
 #define SAFE_NETBIOS_CHARS ". -_"
 
-/* generic iconv conversion structure */
-typedef struct _smb_iconv_t {
-	size_t (*direct)(void *cd, const char **inbuf, size_t *inbytesleft,
-			 char **outbuf, size_t *outbytesleft);
-	size_t (*pull)(void *cd, const char **inbuf, size_t *inbytesleft,
-		       char **outbuf, size_t *outbytesleft);
-	size_t (*push)(void *cd, const char **inbuf, size_t *inbytesleft,
-		       char **outbuf, size_t *outbytesleft);
-	void *cd_direct, *cd_pull, *cd_push;
-	char *from_name, *to_name;
-} *smb_iconv_t;
-
 /* The maximum length of a trust account password.
    Used when we randomly create it, 15 char passwords
    exceed NT4's max password length */
diff --git a/source4/auth/ntlm/ntlm_check.c b/source4/auth/ntlm/ntlm_check.c
index a3ac7f3..5298432 100644
--- a/source4/auth/ntlm/ntlm_check.c
+++ b/source4/auth/ntlm/ntlm_check.c
@@ -323,7 +323,7 @@ NTSTATUS ntlm_password_check(TALLOC_CTX *mem_ctx,
 		if (lm_response->length && 
 		    (convert_string_talloc(mem_ctx, CH_DOS, CH_UNIX, 
 					  lm_response->data, lm_response->length, 
-					   (void **)&unix_pw) != -1)) {
+					   (void **)&unix_pw, false) != -1)) {
 			if (E_deshash(unix_pw, client_lm.hash)) {
 				lm_ok = true;
 			} else {
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index b02a162..82f5b6e 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -1693,7 +1693,7 @@ NTSTATUS samdb_set_password(struct ldb_context *ctx, TALLOC_CTX *mem_ctx,
 		if (convert_string_talloc_convenience(mem_ctx, lp_iconv_convenience(ldb_get_opaque(ctx, "loadparm")), 
 					  CH_UTF16, CH_UNIX, 
 					  new_password->data, new_password->length, 
-					  (void **)&new_pass) != -1) {
+					  (void **)&new_pass, false) != -1) {
 			
 			
 			/* possibly check password complexity */
diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c
index da4c574..f427e69 100644
--- a/source4/dsdb/samdb/ldb_modules/password_hash.c
+++ b/source4/dsdb/samdb/ldb_modules/password_hash.c
@@ -1339,7 +1339,7 @@ static int setup_password_fields(struct setup_password_fields_io *io)
 		}
 		converted_pw_len = convert_string_talloc_convenience(io->ac, lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), 
 							 CH_UTF8, CH_UTF16, io->n.cleartext_utf8->data, io->n.cleartext_utf8->length, 
-							 (void **)&cleartext_utf16_str);
+							 (void **)&cleartext_utf16_str, false);
 		if (converted_pw_len == -1) {
 			ldb_asprintf_errstring(ldb,
 					       "setup_password_fields: "
@@ -1357,7 +1357,7 @@ static int setup_password_fields(struct setup_password_fields_io *io)
 		}
 		converted_pw_len = convert_string_talloc_convenience(io->ac, lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), 
 							 CH_UTF16MUNGED, CH_UTF8, io->n.cleartext_utf16->data, io->n.cleartext_utf16->length, 
-							 (void **)&cleartext_utf8_str);
+							 (void **)&cleartext_utf8_str, false);
 		if (converted_pw_len == -1) {
 			/* We can't bail out entirely, as these unconvertable passwords are frustratingly valid */
 			io->n.cleartext_utf8 = NULL;	
@@ -1383,7 +1383,7 @@ static int setup_password_fields(struct setup_password_fields_io *io)
 		char *cleartext_unix;
 		converted_pw_len = convert_string_talloc_convenience(io->ac, lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), 
 							 CH_UTF8, CH_UNIX, io->n.cleartext_utf8->data, io->n.cleartext_utf8->length, 
-							 (void **)&cleartext_unix);
+							 (void **)&cleartext_unix, false);
 		if (converted_pw_len != -1) {
 			lm_hash = talloc(io->ac, struct samr_Password);
 			if (!lm_hash) {
diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c
index 763872c..0e8ac5e 100644
--- a/source4/dsdb/schema/schema_init.c
+++ b/source4/dsdb/schema/schema_init.c
@@ -1190,7 +1190,7 @@ static struct drsuapi_DsReplicaAttribute *dsdb_find_object_attr_name(struct dsdb
 		_ret = convert_string_talloc_convenience(mem_ctx, s->iconv_convenience, CH_UTF16, CH_UNIX, \
 					     _a->value_ctr.values[0].blob->data, \
 					     _a->value_ctr.values[0].blob->length, \
-					     (void **)discard_const(&(p)->elem)); \
+					     (void **)discard_const(&(p)->elem), false); \
 		if (_ret == -1) { \
 			DEBUG(0,("%s: invalid data!\n", attr)); \
 			dump_data(0, \
diff --git a/source4/dsdb/schema/schema_syntax.c b/source4/dsdb/schema/schema_syntax.c
index 4141026..965b85a 100644
--- a/source4/dsdb/schema/schema_syntax.c
+++ b/source4/dsdb/schema/schema_syntax.c
@@ -795,7 +795,7 @@ static WERROR dsdb_syntax_UNICODE_drsuapi_to_ldb(struct ldb_context *ldb,
 									CH_UTF16, CH_UNIX,
 					    in->value_ctr.values[i].blob->data,
 					    in->value_ctr.values[i].blob->length,
-					    (void **)&str);
+					    (void **)&str, false);
 		if (ret == -1) {
 			return WERR_FOOBAR;
 		}
@@ -838,7 +838,7 @@ static WERROR dsdb_syntax_UNICODE_ldb_to_drsuapi(struct ldb_context *ldb,
 		ret = convert_string_talloc_convenience(blobs, schema->iconv_convenience, CH_UNIX, CH_UTF16,
 					    in->values[i].data,
 					    in->values[i].length,
-					    (void **)&blobs[i].data);
+					    (void **)&blobs[i].data, false);
 		if (ret == -1) {
 			return WERR_FOOBAR;
 		}
@@ -1165,7 +1165,7 @@ static WERROR dsdb_syntax_PRESENTATION_ADDRESS_drsuapi_to_ldb(struct ldb_context
 		ret = convert_string_talloc_convenience(out->values, schema->iconv_convenience, CH_UTF16, CH_UNIX,
 					    in->value_ctr.values[i].blob->data+4,
 					    in->value_ctr.values[i].blob->length-4,
-					    (void **)&str);
+					    (void **)&str, false);
 		if (ret == -1) {
 			return WERR_FOOBAR;
 		}
@@ -1209,7 +1209,7 @@ static WERROR dsdb_syntax_PRESENTATION_ADDRESS_ldb_to_drsuapi(struct ldb_context
 		ret = convert_string_talloc_convenience(blobs, schema->iconv_convenience, CH_UNIX, CH_UTF16,
 					    in->values[i].data,
 					    in->values[i].length,
-					    (void **)&data);
+					    (void **)&data, false);
 		if (ret == -1) {
 			return WERR_FOOBAR;
 		}
diff --git a/source4/kdc/kpasswdd.c b/source4/kdc/kpasswdd.c
index 39817d9..85e248d 100644
--- a/source4/kdc/kpasswdd.c
+++ b/source4/kdc/kpasswdd.c
@@ -237,7 +237,7 @@ static bool kpasswd_process_request(struct kdc_server *kdc,
 					       CH_UTF8, CH_UTF16, 
 					       (const char *)input->data, 
 					       input->length,
-					       (void **)&password.data);
+					       (void **)&password.data, false);
 
 		if (pw_len == -1) {
 			return false;
@@ -285,7 +285,7 @@ static bool kpasswd_process_request(struct kdc_server *kdc,
 					       CH_UTF8, CH_UTF16, 
 					       (const char *)chpw.newpasswd.data, 
 					       chpw.newpasswd.length,
-					       (void **)&password.data);
+					       (void **)&password.data, false);
 		if (pw_len == -1) {
 			free_ChangePasswdDataMS(&chpw);
 			return false;
diff --git a/source4/lib/registry/ldb.c b/source4/lib/registry/ldb.c
index 1d238f4..41fbd22 100644
--- a/source4/lib/registry/ldb.c
+++ b/source4/lib/registry/ldb.c
@@ -62,7 +62,7 @@ static void reg_ldb_unpack_value(TALLOC_CTX *mem_ctx,
 		if (val != NULL)
 			data->length = convert_string_talloc(mem_ctx, CH_UTF8, CH_UTF16,
 						     val->data, val->length,
-						     (void **)&data->data);
+						     (void **)&data->data, false);
 		else {
 			data->data = NULL;
 			data->length = 0;
@@ -108,7 +108,7 @@ static struct ldb_message *reg_ldb_pack_value(struct ldb_context *ctx,
 			val.length = convert_string_talloc(mem_ctx, CH_UTF16, CH_UTF8,
 						   (void *)data.data,
 						   data.length,
-						   (void **)&val.data);
+						   (void **)&val.data, false);
 			ldb_msg_add_value(msg, "data", &val, NULL);
 		} else {
 			ldb_msg_add_empty(msg, "data", LDB_FLAG_MOD_DELETE, NULL);
diff --git a/source4/lib/registry/tests/generic.c b/source4/lib/registry/tests/generic.c
index f1fa5ad..3a3c3e7 100644
--- a/source4/lib/registry/tests/generic.c
+++ b/source4/lib/registry/tests/generic.c
@@ -54,7 +54,7 @@ static bool test_reg_val_data_string_sz(struct torture_context *ctx)
 {
 	DATA_BLOB db;
 	db.length = convert_string_talloc_convenience(ctx, lp_iconv_convenience(ctx->lp_ctx), CH_UTF8, CH_UTF16,
-					  "bla", 3, (void **)&db.data);
+					  "bla", 3, (void **)&db.data, false);
 	torture_assert_str_equal(ctx, "bla",
 				 reg_val_data_string(ctx, lp_iconv_convenience(ctx->lp_ctx), REG_SZ, db),
 				 "sz failed");
@@ -91,7 +91,7 @@ static bool test_reg_val_description(struct torture_context *ctx)
 	data.length = convert_string_talloc_convenience(ctx, lp_iconv_convenience(ctx->lp_ctx), CH_UTF8, CH_UTF16,
 					    "stationary traveller",
 					    strlen("stationary traveller"),
-					    (void **)&data.data);
+					    (void **)&data.data, false);
 	torture_assert_str_equal(ctx, "camel = REG_SZ : stationary traveller",
 				 reg_val_description(ctx, lp_iconv_convenience(ctx->lp_ctx), "camel", REG_SZ, data),
 				 "reg_val_description failed");
@@ -105,7 +105,7 @@ static bool test_reg_val_description_nullname(struct torture_context *ctx)
 	data.length = convert_string_talloc_convenience(ctx, lp_iconv_convenience(ctx->lp_ctx), CH_UTF8, CH_UTF16,
 					    "west berlin",
 					    strlen("west berlin"),
-					    (void **)&data.data);
+					    (void **)&data.data, false);
 	torture_assert_str_equal(ctx, "<No Name> = REG_SZ : west berlin",
 				 reg_val_description(ctx, lp_iconv_convenience(ctx->lp_ctx), NULL, REG_SZ, data),
 				 "description with null name failed");
diff --git a/source4/lib/registry/util.c b/source4/lib/registry/util.c
index 38f994f..742c3dc 100644
--- a/source4/lib/registry/util.c
+++ b/source4/lib/registry/util.c
@@ -65,7 +65,7 @@ _PUBLIC_ char *reg_val_data_string(TALLOC_CTX *mem_ctx,
 		case REG_SZ:
 			convert_string_talloc_convenience(mem_ctx, iconv_convenience, CH_UTF16, CH_UNIX,
 					      data.data, data.length,
-					      (void **)&ret);
+					      (void **)&ret, false);
 			return ret;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list