charcnv: removed the allow_badcharcnv and allow_bad_conv options to convert_string*()
authorAndrew Tridgell <tridge@samba.org>
Wed, 23 Mar 2011 23:59:41 +0000 (10:59 +1100)
committerAndrew Tridgell <tridge@samba.org>
Thu, 24 Mar 2011 00:47:26 +0000 (01:47 +0100)
we shouldn't accept bad multi-byte strings, it just hides problems

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Mar 24 01:47:26 CET 2011 on sn-devel-104

52 files changed:
lib/tdr/tdr.c
lib/util/charset/charcnv.c
lib/util/charset/charset.h
lib/util/charset/tests/iconv.c
lib/util/charset/util_unistr.c
libcli/auth/msrpc_parse.c
libcli/auth/ntlm_check.c
libcli/auth/smbencrypt.c
libgpo/gpo_ini.c
librpc/ndr/ndr_drsuapi.c
librpc/ndr/ndr_string.c
source3/include/proto.h
source3/lib/charcnv.c
source3/lib/dprintf.c
source3/lib/eventlog/eventlog.c
source3/lib/smbldap.c
source3/lib/tldap_util.c
source3/libsmb/clifile.c
source3/libsmb/climessage.c
source3/libsmb/clirap.c
source3/libsmb/clitrans.c
source3/passdb/pdb_ads.c
source3/registry/reg_parse.c
source3/rpc_server/lsa/srv_lsa_nt.c
source3/smbd/mangle_hash2.c
source3/smbd/message.c
source3/smbd/smb2_create.c
source3/smbd/smb2_find.c
source3/smbd/smb2_ioctl.c
source3/smbd/smb2_tcon.c
source3/torture/utable.c
source3/utils/ntlm_auth_diagnostics.c
source3/web/cgi.c
source4/dsdb/samdb/ldb_modules/password_hash.c
source4/dsdb/samdb/ldb_modules/samldb.c
source4/dsdb/schema/schema_syntax.c
source4/kdc/kpasswdd.c
source4/lib/registry/ldb.c
source4/lib/registry/patchfile_dotreg.c
source4/lib/registry/tests/generic.c
source4/lib/registry/util.c
source4/libcli/raw/rawfileinfo.c
source4/libcli/raw/rawrequest.c
source4/libcli/smb2/request.c
source4/libnet/libnet_samdump.c
source4/rpc_server/samr/samr_password.c
source4/smb_server/smb/request.c
source4/torture/basic/charset.c
source4/torture/basic/utable.c
source4/torture/rpc/forest_trust.c
source4/torture/rpc/samlogon.c
source4/torture/rpc/winreg.c

index ab016d0..8ce238b 100644 (file)
@@ -163,7 +163,7 @@ NTSTATUS tdr_pull_charset(struct tdr_pull *tdr, TALLOC_CTX *ctx, const char **v,
 
        TDR_PULL_NEED_BYTES(tdr, el_size*length);
        
-       if (!convert_string_talloc(ctx, chset, CH_UNIX, tdr->data.data+tdr->offset, el_size*length, discard_const_p(void *, v), &ret, false)) {
+       if (!convert_string_talloc(ctx, chset, CH_UNIX, tdr->data.data+tdr->offset, el_size*length, discard_const_p(void *, v), &ret)) {
                return NT_STATUS_INVALID_PARAMETER;
        }
 
@@ -183,7 +183,7 @@ NTSTATUS tdr_push_charset(struct tdr_push *tdr, const char **v, uint32_t length,
        required = el_size * length;
        TDR_PUSH_NEED_BYTES(tdr, required);
 
-       ret = convert_string(CH_UNIX, chset, *v, strlen(*v), tdr->data.data+tdr->data.length, required, false);
+       ret = convert_string(CH_UNIX, chset, *v, strlen(*v), tdr->data.data+tdr->data.length, required);
        if (ret == -1) {
                return NT_STATUS_INVALID_PARAMETER;
        }
index 7fed755..1e1f2a3 100644 (file)
@@ -123,10 +123,9 @@ convert:
  * @returns the number of bytes occupied in the destination
  **/
 _PUBLIC_ bool 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, size_t *converted_size,
-                               bool allow_badcharcnv)
+                                        charset_t from, charset_t to,
+                                        void const *src, size_t srclen, 
+                                        void *dest, size_t destlen, size_t *converted_size)
 {
        size_t i_len, o_len;
        size_t retval;
@@ -191,11 +190,10 @@ _PUBLIC_ bool convert_string_convenience(struct smb_iconv_convenience *ic,
  **/
 
 _PUBLIC_ bool 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 *dst, size_t *converted_size, 
-                                          bool allow_badcharcnv)
+                                               struct smb_iconv_convenience *ic, 
+                                               charset_t from, charset_t to, 
+                                               void const *src, size_t srclen, 
+                                               void *dst, size_t *converted_size)
 {
        void **dest = (void **)dst;
        smb_iconv_t descriptor;
index 943bfa4..494a4eb 100644 (file)
@@ -155,14 +155,13 @@ ssize_t push_string(void *dest, const char *src, size_t dest_len, int flags);
 ssize_t pull_string(char *dest, const void *src, size_t dest_len, size_t src_len, int flags);
 
 bool convert_string_talloc(TALLOC_CTX *ctx, 
-                                      charset_t from, charset_t to, 
-                                      void const *src, size_t srclen, 
-                                      void *dest, size_t *converted_size, 
-                                          bool allow_badcharcnv);
+                          charset_t from, charset_t to, 
+                          void const *src, size_t srclen, 
+                          void *dest, size_t *converted_size);
 
 size_t convert_string(charset_t from, charset_t to,
-                               void const *src, size_t srclen, 
-                               void *dest, size_t destlen, bool allow_badcharcnv);
+                     void const *src, size_t srclen, 
+                     void *dest, size_t destlen);
 
 ssize_t iconv_talloc(TALLOC_CTX *mem_ctx, 
                                       smb_iconv_t cd,
@@ -206,13 +205,12 @@ struct smb_iconv_convenience *smb_iconv_convenience_reinit(TALLOC_CTX *mem_ctx,
 bool 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, size_t *converted_size,
-                               bool allow_badcharcnv);
+                               void *dest, size_t destlen, size_t *converted_size);
 bool 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, size_t *converted_size, bool allow_badcharcnv);
+                                      void *dest, size_t *converted_size);
 /* iconv */
 smb_iconv_t smb_iconv_open(const char *tocode, const char *fromcode);
 int smb_iconv_close(smb_iconv_t cd);
index a1a0d97..9b48771 100644 (file)
@@ -419,7 +419,7 @@ static bool test_string2key(struct torture_context *tctx)
 
        torture_comment(tctx, "converting random buffer\n");
 
-       if (!convert_string_talloc(mem_ctx, CH_UTF16MUNGED, CH_UTF8, (void *)buf, len*2, (void**)&dest, &ret, false)) {
+       if (!convert_string_talloc(mem_ctx, CH_UTF16MUNGED, CH_UTF8, (void *)buf, len*2, (void**)&dest, &ret)) {
                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");
 
-       if (!convert_string_talloc(mem_ctx, CH_UTF16MUNGED, CH_UTF16, (void *)le1, 20, (void**)&munged1, &ret, false)) {
+       if (!convert_string_talloc(mem_ctx, CH_UTF16MUNGED, CH_UTF16, (void *)le1, 20, (void**)&munged1, &ret)) {
                torture_fail(tctx, "Failed to convert fixed buffer to UTF16_MUNGED\n");
        }
 
@@ -437,7 +437,7 @@ static bool test_string2key(struct torture_context *tctx)
 
        torture_comment(tctx, "converting fixed buffer to UTF8\n");
 
-       if (!convert_string_talloc(mem_ctx, CH_UTF16MUNGED, CH_UTF8, (void *)le1, 20, (void**)&out1, &ret, false)) {
+       if (!convert_string_talloc(mem_ctx, CH_UTF16MUNGED, CH_UTF8, (void *)le1, 20, (void**)&out1, &ret)) {
                torture_fail(tctx, "Failed to convert fixed buffer to UTF8\n");
        }
 
index ad2ba68..c59620e 100644 (file)
@@ -370,7 +370,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, false);
+       return convert_string(CH_UNIX, CH_DOS, src, src_len, dest, dest_len);
 }
 
 /**
@@ -386,7 +386,7 @@ _PUBLIC_ bool push_ascii_talloc(TALLOC_CTX *ctx, char **dest, const char *src, s
 {
        size_t src_len = strlen(src)+1;
        *dest = NULL;
-       return convert_string_talloc(ctx, CH_UNIX, CH_DOS, src, src_len, (void **)dest, converted_size, false);
+       return convert_string_talloc(ctx, CH_UNIX, CH_DOS, src, src_len, (void **)dest, converted_size);
 }
 
 
@@ -420,7 +420,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, false);
+       ret = convert_string(CH_DOS, CH_UNIX, src, src_len, dest, dest_len);
 
        if (dest_len)
                dest[MIN(ret, dest_len-1)] = 0;
@@ -473,7 +473,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, false);
+       ret = convert_string(CH_UNIX, CH_UTF16, src, src_len, dest, dest_len);
        if (ret == (size_t)-1) {
                return 0;
        }
@@ -497,7 +497,7 @@ _PUBLIC_ bool push_ucs2_talloc(TALLOC_CTX *ctx, smb_ucs2_t **dest, const char *s
 {
        size_t src_len = strlen(src)+1;
        *dest = NULL;
-       return convert_string_talloc(ctx, CH_UNIX, CH_UTF16, src, src_len, (void **)dest, converted_size, false);
+       return convert_string_talloc(ctx, CH_UNIX, CH_UTF16, src, src_len, (void **)dest, converted_size);
 }
 
 
@@ -513,7 +513,7 @@ _PUBLIC_ bool push_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src, si
 {
        size_t src_len = strlen(src)+1;
        *dest = NULL;
-       return convert_string_talloc(ctx, CH_UNIX, CH_UTF8, src, src_len, (void **)dest, converted_size, false);
+       return convert_string_talloc(ctx, CH_UNIX, CH_UTF8, src, src_len, (void **)dest, converted_size);
 }
 
 /**
@@ -549,7 +549,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, false);
+       ret = convert_string(CH_UTF16, CH_UNIX, src, src_len, dest, dest_len);
        if (dest_len)
                dest[MIN(ret, dest_len-1)] = 0;
 
@@ -568,7 +568,7 @@ _PUBLIC_ bool pull_ascii_talloc(TALLOC_CTX *ctx, char **dest, const char *src, s
 {
        size_t src_len = strlen(src)+1;
        *dest = NULL;
-       return convert_string_talloc(ctx, CH_DOS, CH_UNIX, src, src_len, (void **)dest, converted_size, false);
+       return convert_string_talloc(ctx, CH_DOS, CH_UNIX, src, src_len, (void **)dest, converted_size);
 }
 
 /**
@@ -583,7 +583,7 @@ _PUBLIC_ bool pull_ucs2_talloc(TALLOC_CTX *ctx, char **dest, const smb_ucs2_t *s
 {
        size_t src_len = utf16_len(src);
        *dest = NULL;
-       return convert_string_talloc(ctx, CH_UTF16, CH_UNIX, src, src_len, (void **)dest, converted_size, false);
+       return convert_string_talloc(ctx, CH_UTF16, CH_UNIX, src, src_len, (void **)dest, converted_size);
 }
 
 /**
@@ -598,7 +598,7 @@ _PUBLIC_ bool pull_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src, si
 {
        size_t src_len = strlen(src)+1;
        *dest = NULL;
-       return convert_string_talloc(ctx, CH_UTF8, CH_UNIX, src, src_len, (void **)dest, converted_size, false);
+       return convert_string_talloc(ctx, CH_UTF8, CH_UNIX, src, src_len, (void **)dest, converted_size);
 }
 
 /**
@@ -665,15 +665,13 @@ _PUBLIC_ ssize_t pull_string(char *dest, const void *src, size_t dest_len, size_
  * @returns the number of bytes occupied in the destination
  **/
 _PUBLIC_ size_t convert_string(charset_t from, charset_t to,
-                               void const *src, size_t srclen, 
-                               void *dest, size_t destlen, 
-                               bool allow_badcharcnv)
+                              void const *src, size_t srclen, 
+                              void *dest, size_t destlen)
 {
        size_t ret;
        if (!convert_string_convenience(get_iconv_convenience(), from, to, 
-                                                                         src, srclen,
-                                                                         dest, destlen, &ret,
-                                                                         allow_badcharcnv))
+                                       src, srclen,
+                                       dest, destlen, &ret))
                return -1;
        return ret;
 }
@@ -690,14 +688,12 @@ _PUBLIC_ size_t convert_string(charset_t from, charset_t to,
  **/
 
 _PUBLIC_ bool convert_string_talloc(TALLOC_CTX *ctx, 
-                                      charset_t from, charset_t to, 
-                                      void const *src, size_t srclen, 
-                                      void *dest, size_t *converted_size, 
-                                          bool allow_badcharcnv)
+                                   charset_t from, charset_t to, 
+                                   void const *src, size_t srclen, 
+                                   void *dest, size_t *converted_size)
 {
        return convert_string_talloc_convenience(ctx, get_iconv_convenience(),
-                                                                                        from, to, src, srclen, dest,
-                                                                                        converted_size, 
-                                                                                        allow_badcharcnv);
+                                                from, to, src, srclen, dest,
+                                                converted_size);
 }
 
index 7ac6fb5..1351dfa 100644 (file)
@@ -264,7 +264,7 @@ bool msrpc_parse(TALLOC_CTX *mem_ctx,
                                        size_t pull_len;
                                        if (!convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX, 
                                                                   blob->data + ptr, len1, 
-                                                                  ps, &pull_len, false)) {
+                                                                  ps, &pull_len)) {
                                                ret = false;
                                                goto cleanup;
                                        }
@@ -300,7 +300,7 @@ bool msrpc_parse(TALLOC_CTX *mem_ctx,
 
                                        if (!convert_string_talloc(mem_ctx, CH_DOS, CH_UNIX, 
                                                                   blob->data + ptr, len1, 
-                                                                  ps, &pull_len, false)) {
+                                                                  ps, &pull_len)) {
                                                ret = false;
                                                goto cleanup;
                                        }
index da16ce2..9cbd495 100644 (file)
@@ -322,7 +322,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, NULL, false))) {
+                                          (void *)&unix_pw, NULL))) {
                        if (E_deshash(unix_pw, client_lm.hash)) {
                                lm_ok = true;
                        } else {
index f7c60e7..3274f11 100644 (file)
@@ -596,8 +596,7 @@ bool decode_pw_buffer(TALLOC_CTX *ctx,
                                   &in_buffer[512 - byte_len],
                                   byte_len,
                                   (void *)pp_new_pwrd,
-                                  new_pw_len,
-                                  false)) {
+                                  new_pw_len)) {
                DEBUG(0, ("decode_pw_buffer: failed to convert incoming password\n"));
                return false;
        }
index 7df56a8..a4bff0e 100644 (file)
@@ -88,7 +88,7 @@ static NTSTATUS convert_file_from_ucs2(TALLOC_CTX *mem_ctx,
        }
 
        if (!convert_string_talloc(mem_ctx, CH_UTF16LE, CH_UNIX, data_in, n,
-                                  (void *)&data_out, &converted_size, false))
+                                  (void *)&data_out, &converted_size))
        {
                status = NT_STATUS_INVALID_BUFFER_SIZE;
                goto out;
index 86ecdcb..35216ff 100644 (file)
@@ -109,7 +109,7 @@ static void _print_drsuapi_DsAttributeValue_str(struct ndr_print *ndr, const cha
                                   CH_UTF16, CH_UNIX,
                                   r->blob->data,
                                   r->blob->length,
-                                  (void **)&str, NULL, false)) {
+                                  (void **)&str, NULL)) {
                ndr_print_string(ndr, "string", "INVALID CONVERSION");
        } else {
                ndr_print_string(ndr, "string", str);
index 610676c..402cf4e 100644 (file)
@@ -86,7 +86,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags,
                                                   ndr->data+ndr->offset,
                                                   (len2 + c_len_term)*byte_mul,
                                                   (void **)(void *)&as,
-                                                  &converted_size, false))
+                                                  &converted_size))
                        {
                                return ndr_pull_error(ndr, NDR_ERR_CHARCNV,
                                                      "Bad character conversion with flags 0x%x", flags);
@@ -124,7 +124,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags,
                                                   ndr->data+ndr->offset,
                                                   (len1 + c_len_term)*byte_mul,
                                                   (void **)(void *)&as,
-                                                  &converted_size, false))
+                                                  &converted_size))
                        {
                                return ndr_pull_error(ndr, NDR_ERR_CHARCNV, 
                                                      "Bad character conversion with flags 0x%x", flags);
@@ -163,7 +163,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags,
                                                   ndr->data+ndr->offset,
                                                   (len1 + c_len_term)*byte_mul,
                                                   (void **)(void *)&as,
-                                                  &converted_size, false))
+                                                  &converted_size))
                        {
                                return ndr_pull_error(ndr, NDR_ERR_CHARCNV, 
                                                      "Bad character conversion with flags 0x%x", flags);
@@ -198,7 +198,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags,
                                                   ndr->data+ndr->offset,
                                                   (len3 + c_len_term)*byte_mul,
                                                   (void **)(void *)&as,
-                                                  &converted_size, false))
+                                                  &converted_size))
                        {
                                return ndr_pull_error(ndr, NDR_ERR_CHARCNV, 
                                                      "Bad character conversion with flags 0x%x", flags);
@@ -230,7 +230,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags,
                                                   CH_UNIX,
                                                   ndr->data+ndr->offset, len3,
                                                   (void **)(void *)&as,
-                                                  &converted_size, false))
+                                                  &converted_size))
                        {
                                return ndr_pull_error(ndr, NDR_ERR_CHARCNV, 
                                                      "Bad character conversion with flags 0x%x", flags);
@@ -249,7 +249,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags,
                if (!convert_string_talloc(ndr->current_mem_ctx, chset, CH_UNIX,
                                           ndr->data+ndr->offset, len1,
                                           (void **)(void *)&as,
-                                          &converted_size, false))
+                                          &converted_size))
                {
                        return ndr_pull_error(ndr, NDR_ERR_CHARCNV, 
                                              "Bad character conversion with flags 0x%x", flags);
@@ -274,7 +274,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags,
                                                   CH_UNIX,
                                                   ndr->data+ndr->offset, len1,
                                                   (void **)(void *)&as,
-                                                  &converted_size, false))
+                                                  &converted_size))
                        {
                                return ndr_pull_error(ndr, NDR_ERR_CHARCNV, 
                                                      "Bad character conversion with flags 0x%x", flags);
@@ -334,7 +334,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_string(struct ndr_push *ndr, int ndr_flags,
                s_len++;
        }
        if (!convert_string_talloc(ndr, CH_UNIX, chset, s, s_len,
-                                  (void **)(void *)&dest, &d_len, false))
+                                  (void **)(void *)&dest, &d_len))
        {
                return ndr_push_error(ndr, NDR_ERR_CHARCNV, 
                                      "Bad character push conversion with flags 0x%x", flags);
@@ -684,7 +684,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_charset(struct ndr_pull *ndr, int ndr_flags,
        if (!convert_string_talloc(ndr->current_mem_ctx, chset, CH_UNIX,
                                   ndr->data+ndr->offset, length*byte_mul,
                                   discard_const_p(void *, var),
-                                  &converted_size, false))
+                                  &converted_size))
        {
                return ndr_pull_error(ndr, NDR_ERR_CHARCNV, 
                                      "Bad character conversion");
@@ -707,7 +707,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_charset(struct ndr_push *ndr, int ndr_flags,
        NDR_PUSH_NEED_BYTES(ndr, required);
        ret = convert_string(CH_UNIX, chset, 
                             var, strlen(var),
-                            ndr->data+ndr->offset, required, false);
+                            ndr->data+ndr->offset, required);
        if (ret == -1) {
                return ndr_push_error(ndr, NDR_ERR_CHARCNV, 
                                      "Bad character conversion");
index d166813..8e1bcc6 100644 (file)
@@ -415,7 +415,7 @@ void gfree_charcnv(void);
 void init_iconv(void);
 size_t convert_string(charset_t from, charset_t to,
                      void const *src, size_t srclen, 
-                     void *dest, size_t destlen, bool allow_bad_conv);
+                     void *dest, size_t destlen);
 size_t unix_strupper(const char *src, size_t srclen, char *dest, size_t destlen);
 char *talloc_strdup_upper(TALLOC_CTX *ctx, const char *s);
 char *strupper_talloc(TALLOC_CTX *ctx, const char *s);
index 1779c4f..6addc90 100644 (file)
@@ -88,7 +88,6 @@ void init_iconv(void)
  * @param srclen length of the source string in bytes
  * @param dest pointer to destination string (multibyte or singlebyte)
  * @param destlen maximal length allowed for string
- * @param allow_bad_conv determines if a "best effort" conversion is acceptable (never returns errors)
  * @returns the number of bytes occupied in the destination
  *
  * Ensure the srclen contains the terminating zero.
@@ -97,7 +96,7 @@ void init_iconv(void)
 
 static size_t convert_string_internal(charset_t from, charset_t to,
                      void const *src, size_t srclen, 
-                     void *dest, size_t destlen, bool allow_bad_conv)
+                     void *dest, size_t destlen)
 {
        size_t i_len, o_len;
        size_t retval;
@@ -138,8 +137,6 @@ static size_t convert_string_internal(charset_t from, charset_t to,
                                reason="Incomplete multibyte sequence";
                                if (!conv_silent)
                                        DEBUG(3,("convert_string_internal: Conversion error: %s(%s)\n",reason,inbuf));
-                               if (allow_bad_conv)
-                                       goto use_as_is;
                                return (size_t)-1;
                        case E2BIG:
                                reason="No more room"; 
@@ -159,9 +156,6 @@ static size_t convert_string_internal(charset_t from, charset_t to,
                                reason="Illegal multibyte sequence";
                                if (!conv_silent)
                                        DEBUG(3,("convert_string_internal: Conversion error: %s(%s)\n",reason,inbuf));
-                               if (allow_bad_conv)
-                                       goto use_as_is;
-                               
                                return (size_t)-1;
                        default:
                                if (!conv_silent)
@@ -171,87 +165,6 @@ static size_t convert_string_internal(charset_t from, charset_t to,
                /* smb_panic(reason); */
        }
        return destlen-o_len;
-
- use_as_is:
-
-       /* 
-        * Conversion not supported. This is actually an error, but there are so
-        * many misconfigured iconv systems and smb.conf's out there we can't just
-        * fail. Do a very bad conversion instead.... JRA.
-        */
-
-       {
-               if (o_len == 0 || i_len == 0)
-                       return destlen - o_len;
-
-               if (((from == CH_UTF16LE)||(from == CH_UTF16BE)) &&
-                               ((to != CH_UTF16LE)||(to != CH_UTF16BE))) {
-                       /* Can't convert from utf16 any endian to multibyte.
-                          Replace with the default fail char.
-                       */
-                       if (i_len < 2)
-                               return destlen - o_len;
-                       if (i_len >= 2) {
-                               *outbuf = lp_failed_convert_char();
-
-                               outbuf++;
-                               o_len--;
-
-                               inbuf += 2;
-                               i_len -= 2;
-                       }
-
-                       if (o_len == 0 || i_len == 0)
-                               return destlen - o_len;
-
-                       /* Keep trying with the next char... */
-                       goto again;
-
-               } else if (from != CH_UTF16LE && from != CH_UTF16BE && to == CH_UTF16LE) {
-                       /* Can't convert to UTF16LE - just widen by adding the
-                          default fail char then zero.
-                       */
-                       if (o_len < 2)
-                               return destlen - o_len;
-
-                       outbuf[0] = lp_failed_convert_char();
-                       outbuf[1] = '\0';
-
-                       inbuf++;
-                       i_len--;
-
-                       outbuf += 2;
-                       o_len -= 2;
-
-                       if (o_len == 0 || i_len == 0)
-                               return destlen - o_len;
-
-                       /* Keep trying with the next char... */
-                       goto again;
-
-               } else if (from != CH_UTF16LE && from != CH_UTF16BE &&
-                               to != CH_UTF16LE && to != CH_UTF16BE) {
-                       /* Failed multibyte to multibyte. Just copy the default fail char and
-                               try again. */
-                       outbuf[0] = lp_failed_convert_char();
-
-                       inbuf++;
-                       i_len--;
-
-                       outbuf++;
-                       o_len--;
-
-                       if (o_len == 0 || i_len == 0)
-                               return destlen - o_len;
-
-                       /* Keep trying with the next char... */
-                       goto again;
-
-               } else {
-                       /* Keep compiler happy.... */
-                       return destlen - o_len;
-               }
-       }
 }
 
 /**
@@ -262,7 +175,6 @@ static size_t convert_string_internal(charset_t from, charset_t to,
  * @param srclen length of the source string in bytes, or -1 for nul terminated.
  * @param dest pointer to destination string (multibyte or singlebyte)
  * @param destlen maximal length allowed for string - *NEVER* -1.
- * @param allow_bad_conv determines if a "best effort" conversion is acceptable (never returns errors)
  * @returns the number of bytes occupied in the destination
  *
  * Ensure the srclen contains the terminating zero.
@@ -273,7 +185,7 @@ static size_t convert_string_internal(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, bool allow_bad_conv)
+                     void *dest, size_t destlen)
 {
        /*
         * NB. We deliberately don't do a strlen here if srclen == -1.
@@ -311,7 +223,7 @@ size_t convert_string(charset_t from, charset_t to,
 #ifdef BROKEN_UNICODE_COMPOSE_CHARACTERS
                                goto general_case;
 #else
-                               size_t ret = convert_string_internal(from, to, p, slen, q, dlen, allow_bad_conv);
+                               size_t ret = convert_string_internal(from, to, p, slen, q, dlen);
                                if (ret == (size_t)-1) {
                                        return ret;
                                }
@@ -351,7 +263,7 @@ size_t convert_string(charset_t from, charset_t to,
 #ifdef BROKEN_UNICODE_COMPOSE_CHARACTERS
                                goto general_case;
 #else
-                               size_t ret = convert_string_internal(from, to, p, slen, q, dlen, allow_bad_conv);
+                               size_t ret = convert_string_internal(from, to, p, slen, q, dlen);
                                if (ret == (size_t)-1) {
                                        return ret;
                                }
@@ -391,7 +303,7 @@ size_t convert_string(charset_t from, charset_t to,
 #ifdef BROKEN_UNICODE_COMPOSE_CHARACTERS
                                goto general_case;
 #else
-                               size_t ret = convert_string_internal(from, to, p, slen, q, dlen, allow_bad_conv);
+                               size_t ret = convert_string_internal(from, to, p, slen, q, dlen);
                                if (ret == (size_t)-1) {
                                        return ret;
                                }
@@ -412,7 +324,7 @@ size_t convert_string(charset_t from, charset_t to,
 #ifdef BROKEN_UNICODE_COMPOSE_CHARACTERS
   general_case:
 #endif
-       return convert_string_internal(from, to, src, srclen, dest, destlen, allow_bad_conv);
+       return convert_string_internal(from, to, src, srclen, dest, destlen);
 }
 
 /**
@@ -434,7 +346,7 @@ size_t convert_string(charset_t from, charset_t to,
  */
 bool convert_string_talloc(TALLOC_CTX *ctx, charset_t from, charset_t to,
                           void const *src, size_t srclen, void *dst,
-                          size_t *converted_size, bool allow_bad_conv)
+                          size_t *converted_size)
 
 {
        size_t i_len, o_len, destlen = (srclen * 3) / 2;
@@ -516,8 +428,6 @@ bool convert_string_talloc(TALLOC_CTX *ctx, charset_t from, charset_t to,
                                reason="Incomplete multibyte sequence";
                                if (!conv_silent)
                                        DEBUG(3,("convert_string_talloc: Conversion error: %s(%s)\n",reason,inbuf));
-                               if (allow_bad_conv)
-                                       goto use_as_is;
                                break;
                        case E2BIG:
                                goto convert;
@@ -525,8 +435,6 @@ bool convert_string_talloc(TALLOC_CTX *ctx, charset_t from, charset_t to,
                                reason="Illegal multibyte sequence";
                                if (!conv_silent)
                                        DEBUG(3,("convert_string_talloc: Conversion error: %s(%s)\n",reason,inbuf));
-                               if (allow_bad_conv)
-                                       goto use_as_is;
                                break;
                }
                if (!conv_silent)
@@ -562,89 +470,6 @@ bool convert_string_talloc(TALLOC_CTX *ctx, charset_t from, charset_t to,
 
        *converted_size = destlen;
        return true;
-
- use_as_is:
-
-       /* 
-        * Conversion not supported. This is actually an error, but there are so
-        * many misconfigured iconv systems and smb.conf's out there we can't just
-        * fail. Do a very bad conversion instead.... JRA.
-        */
-
-       {
-               if (o_len == 0 || i_len == 0)
-                       goto out;
-
-               if (((from == CH_UTF16LE)||(from == CH_UTF16BE)) &&
-                               ((to != CH_UTF16LE)||(to != CH_UTF16BE))) {
-                       /* Can't convert from utf16 any endian to multibyte.
-                          Replace with the default fail char.
-                       */
-
-                       if (i_len < 2)
-                               goto out;
-
-                       if (i_len >= 2) {
-                               *outbuf = lp_failed_convert_char();
-
-                               outbuf++;
-                               o_len--;
-
-                               inbuf += 2;
-                               i_len -= 2;
-                       }
-
-                       if (o_len == 0 || i_len == 0)
-                               goto out;
-
-                       /* Keep trying with the next char... */
-                       goto again;
-
-               } else if (from != CH_UTF16LE && from != CH_UTF16BE && to == CH_UTF16LE) {
-                       /* Can't convert to UTF16LE - just widen by adding the
-                          default fail char then zero.
-                       */
-                       if (o_len < 2)
-                               goto out;
-
-                       outbuf[0] = lp_failed_convert_char();
-                       outbuf[1] = '\0';
-
-                       inbuf++;
-                       i_len--;
-
-                       outbuf += 2;
-                       o_len -= 2;
-
-                       if (o_len == 0 || i_len == 0)
-                               goto out;
-
-                       /* Keep trying with the next char... */
-                       goto again;
-
-               } else if (from != CH_UTF16LE && from != CH_UTF16BE &&
-                               to != CH_UTF16LE && to != CH_UTF16BE) {
-                       /* Failed multibyte to multibyte. Just copy the default fail char and
-                          try again. */
-                       outbuf[0] = lp_failed_convert_char();
-
-                       inbuf++;
-                       i_len--;
-
-                       outbuf++;
-                       o_len--;
-
-                       if (o_len == 0 || i_len == 0)
-                               goto out;
-
-                       /* Keep trying with the next char... */
-                       goto again;
-
-               } else {
-                       /* Keep compiler happy.... */
-                       goto out;
-               }
-       }
 }
 
 size_t unix_strupper(const char *src, size_t srclen, char *dest, size_t destlen)
@@ -661,7 +486,7 @@ size_t unix_strupper(const char *src, size_t srclen, char *dest, size_t destlen)
                return srclen;
        }
 
-       size = convert_string(CH_UTF16LE, CH_UNIX, buffer, size, dest, destlen, True);
+       size = convert_string(CH_UTF16LE, CH_UNIX, buffer, size, dest, destlen);
        TALLOC_FREE(buffer);
        return size;
 }
@@ -702,7 +527,7 @@ char *talloc_strdup_upper(TALLOC_CTX *ctx, const char *s)
 
                if (!convert_string_talloc(ctx, CH_UNIX, CH_UTF16LE, s,
                                           strlen(s)+1, (void *)&ubuf,
-                                          &converted_size, True))
+                                          &converted_size))
                {
                        return NULL;
                }
@@ -711,7 +536,7 @@ char *talloc_strdup_upper(TALLOC_CTX *ctx, const char *s)
 
                if (!convert_string_talloc(ctx, CH_UTF16LE, CH_UNIX, ubuf,
                                           converted_size, (void *)&out_buffer,
-                                          &converted_size2, True))
+                                          &converted_size2))
                {
                        TALLOC_FREE(ubuf);
                        return NULL;
@@ -737,8 +562,7 @@ size_t unix_strlower(const char *src, size_t srclen, char *dest, size_t destlen)
        smb_ucs2_t *buffer = NULL;
 
        if (!convert_string_talloc(talloc_tos(), CH_UNIX, CH_UTF16LE, src, srclen,
-                                  (void **)(void *)&buffer, &size,
-                                  True))
+                                  (void **)(void *)&buffer, &size))
        {
                smb_panic("failed to create UCS2 buffer");
        }
@@ -746,7 +570,7 @@ size_t unix_strlower(const char *src, size_t srclen, char *dest, size_t destlen)
                TALLOC_FREE(buffer);
                return srclen;
        }
-       size = convert_string(CH_UTF16LE, CH_UNIX, buffer, size, dest, destlen, True);
+       size = convert_string(CH_UTF16LE, CH_UNIX, buffer, size, dest, destlen);
        TALLOC_FREE(buffer);
        return size;
 }
@@ -824,7 +648,7 @@ size_t push_ascii(void *dest, const char *src, size_t dest_len, int flags)
                src_len++;
        }
 
-       ret = convert_string(CH_UNIX, CH_DOS, src, src_len, dest, dest_len, True);
+       ret = convert_string(CH_UNIX, CH_DOS, src, src_len, dest, dest_len);
        if (ret == (size_t)-1 &&
                        (flags & (STR_TERMINATE | STR_TERMINATE_ASCII))
                        && dest_len > 0) {
@@ -861,7 +685,7 @@ size_t push_ascii_nstring(void *dest, const char *src)
        for (i = 0; buffer[i] != 0 && (i < buffer_len); i++) {
                unsigned char mb[10];
                /* Convert one smb_ucs2_t character at a time. */
-               size_t mb_len = convert_string(CH_UTF16LE, CH_DOS, buffer+i, sizeof(smb_ucs2_t), mb, sizeof(mb), False);
+               size_t mb_len = convert_string(CH_UTF16LE, CH_DOS, buffer+i, sizeof(smb_ucs2_t), mb, sizeof(mb));
                if ((mb_len != (size_t)-1) && (dest_len + mb_len <= MAX_NETBIOSNAME_LEN - 1)) {
                        memcpy((char *)dest + dest_len, mb, mb_len);
                        dest_len += mb_len;
@@ -887,7 +711,7 @@ bool push_ascii_talloc(TALLOC_CTX *mem_ctx, char **dest, const char *src, size_t
 
        *dest = NULL;
        return convert_string_talloc(mem_ctx, CH_UNIX, CH_DOS, src, src_len,
-                                    (void **)dest, converted_size, True);
+                                    (void **)dest, converted_size);
 }
 
 /**
@@ -925,7 +749,7 @@ size_t pull_ascii(char *dest, const void *src, size_t dest_len, size_t src_len,
                }
        }
 
-       ret = convert_string(CH_DOS, CH_UNIX, src, src_len, dest, dest_len, True);
+       ret = convert_string(CH_DOS, CH_UNIX, src, src_len, dest, dest_len);
        if (ret == (size_t)-1) {
                ret = 0;
                dest_len = 0;
@@ -1005,7 +829,7 @@ static size_t pull_ascii_base_talloc(TALLOC_CTX *ctx,
        /* src_len != -1 here. */
 
        if (!convert_string_talloc(ctx, CH_DOS, CH_UNIX, src, src_len, &dest,
-                                    &dest_len, True)) {
+                                    &dest_len)) {
                dest_len = 0;
        }
 
@@ -1092,7 +916,7 @@ size_t push_ucs2(const void *base_ptr, void *dest, const char *src, size_t dest_
        /* ucs2 is always a multiple of 2 bytes */
        dest_len &= ~1;
 
-       ret =  convert_string(CH_UNIX, CH_UTF16LE, src, src_len, dest, dest_len, True);
+       ret =  convert_string(CH_UNIX, CH_UTF16LE, src, src_len, dest, dest_len);
        if (ret == (size_t)-1) {
                if ((flags & STR_TERMINATE) &&
                                dest &&
@@ -1141,7 +965,7 @@ bool push_ucs2_talloc(TALLOC_CTX *ctx, smb_ucs2_t **dest, const char *src,
 
        *dest = NULL;
        return convert_string_talloc(ctx, CH_UNIX, CH_UTF16LE, src, src_len,
-                                    (void **)dest, converted_size, True);
+                                    (void **)dest, converted_size);
 }
 
 
@@ -1180,7 +1004,7 @@ static size_t push_utf8(void *dest, const char *src, size_t dest_len, int flags)
                src_len++;
        }
 
-       ret = convert_string(CH_UNIX, CH_UTF8, src, src_len, dest, dest_len, True);
+       ret = convert_string(CH_UNIX, CH_UTF8, src, src_len, dest, dest_len);
        TALLOC_FREE(tmpbuf);
        return ret;
 }
@@ -1208,7 +1032,7 @@ bool push_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src,
 
        *dest = NULL;
        return convert_string_talloc(ctx, CH_UNIX, CH_UTF8, src, src_len,
-                                    (void**)dest, converted_size, True);
+                                    (void**)dest, converted_size);
 }
 
 /**
@@ -1261,7 +1085,7 @@ size_t pull_ucs2(const void *base_ptr, char *dest, const void *src, size_t dest_
        if (src_len != (size_t)-1)
                src_len &= ~1;
 
-       ret = convert_string(CH_UTF16LE, CH_UNIX, src, src_len, dest, dest_len, True);
+       ret = convert_string(CH_UTF16LE, CH_UNIX, src, src_len, dest, dest_len);
        if (ret == (size_t)-1) {
                ret = 0;
                dest_len = 0;
@@ -1362,7 +1186,7 @@ size_t pull_ucs2_base_talloc(TALLOC_CTX *ctx,
        src_len &= ~1;
 
        if (!convert_string_talloc(ctx, CH_UTF16LE, CH_UNIX, src, src_len,
-                                  (void *)&dest, &dest_len, True)) {
+                                  (void *)&dest, &dest_len)) {
                dest_len = 0;
        }
 
@@ -1416,7 +1240,7 @@ bool pull_ucs2_talloc(TALLOC_CTX *ctx, char **dest, const smb_ucs2_t *src,
 
        *dest = NULL;
        return convert_string_talloc(ctx, CH_UTF16LE, CH_UNIX, src, src_len,
-                                    (void **)dest, converted_size, True);
+                                    (void **)dest, converted_size);
 }
 
 /**
@@ -1437,7 +1261,7 @@ bool pull_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src,
 
        *dest = NULL;
        return convert_string_talloc(ctx, CH_UTF8, CH_UNIX, src, src_len,
-                                    (void **)dest, converted_size, True);
+                                    (void **)dest, converted_size);
 }
 
  
@@ -1459,7 +1283,7 @@ bool pull_ascii_talloc(TALLOC_CTX *ctx, char **dest, const char *src,
 
        *dest = NULL;
        return convert_string_talloc(ctx, CH_DOS, CH_UNIX, src, src_len,
-                                    (void **)dest, converted_size, True);
+                                    (void **)dest, converted_size);
 }
 
 /**
index 835d340..73bacdc 100644 (file)
@@ -65,7 +65,7 @@ again:
                goto out;
        }
 
-       clen = convert_string(CH_UNIX, CH_DISPLAY, p, ret, p2, maxlen, True);
+       clen = convert_string(CH_UNIX, CH_DISPLAY, p, ret, p2, maxlen);
        if (clen == -1) {
                ret = -1;
                goto out;
index c91258e..7006234 100644 (file)
@@ -952,7 +952,7 @@ NTSTATUS evlog_tdb_entry_to_evt_entry(TALLOC_CTX *mem_ctx,
                size_t len;
                if (!convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX,
                                           t->sid.data, t->sid.length,
-                                          (void *)&sid_str, &len, false)) {
+                                          (void *)&sid_str, &len)) {
                        return NT_STATUS_INVALID_SID;
                }
                if (len > 0) {
index 568a7ee..c094fbe 100644 (file)
@@ -276,7 +276,7 @@ ATTRIB_MAP_ENTRY sidmap_attr_list[] = {
                return False;
        }
 
-       if (convert_string(CH_UTF8, CH_UNIX,values[0], -1, value, max_len, False) == (size_t)-1) {
+       if (convert_string(CH_UTF8, CH_UNIX,values[0], -1, value, max_len) == (size_t)-1) {
                DEBUG(1, ("smbldap_get_single_attribute: string conversion of [%s] = [%s] failed!\n", 
                          attribute, values[0]));
                ldap_value_free(values);
index 7697a43..ae3dab3 100644 (file)
@@ -78,7 +78,7 @@ char *tldap_talloc_single_attribute(struct tldap_message *msg,
        }
        if (!convert_string_talloc(mem_ctx, CH_UTF8, CH_UNIX,
                                   val.data, val.length,
-                                  &result, &len, false)) {
+                                  &result, &len)) {
                return NULL;
        }
        return result;
@@ -197,8 +197,7 @@ bool tldap_add_mod_str(TALLOC_CTX *mem_ctx,
        bool ret;
 
        if (!convert_string_talloc(talloc_tos(), CH_UNIX, CH_UTF8, str,
-                                  strlen(str), &utf8.data, &utf8.length,
-                                  false)) {
+                                  strlen(str), &utf8.data, &utf8.length)) {
                return false;
        }
 
@@ -290,12 +289,12 @@ static int compare_utf8_blobs(const DATA_BLOB *d1, const DATA_BLOB *d2)
        int ret;
 
        if (!convert_string_talloc(talloc_tos(), CH_UTF8, CH_UNIX, d1->data,
-                                  d1->length, &s1, &s1len, false)) {
+                                  d1->length, &s1, &s1len)) {
                /* can't do much here */
                return 0;
        }
        if (!convert_string_talloc(talloc_tos(), CH_UTF8, CH_UNIX, d2->data,
-                                  d2->length, &s2, &s2len, false)) {
+                                  d2->length, &s2, &s2len)) {
                /* can't do much here */
                TALLOC_FREE(s1);
                return 0;
index 72f0e4b..fcf3156 100644 (file)
@@ -58,7 +58,7 @@ static uint8_t *internal_bytes_push_str(uint8_t *buf, bool ucs2,
        if (!convert_string_talloc(talloc_tos(), CH_UNIX,
                                   ucs2 ? CH_UTF16LE : CH_DOS,
                                   str, str_len, &converted,
-                                  &converted_size, true)) {
+                                  &converted_size)) {
                return NULL;
        }
 
@@ -445,8 +445,7 @@ NTSTATUS cli_posix_readlink_recv(struct tevent_req *req, struct cli_state *cli,
                                state->data,
                                state->num_data,
                                &converted,
-                               &converted_size,
-                               true)) {
+                               &converted_size)) {
                return NT_STATUS_NO_MEMORY;
        }
 
@@ -5417,7 +5416,7 @@ NTSTATUS cli_shadow_copy_data_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
                ret = convert_string_talloc(
                        names, CH_UTF16LE, CH_UNIX,
                        src, 2 * sizeof(SHADOW_COPY_LABEL),
-                       &names[i], &converted_size, True);
+                       &names[i], &converted_size);
                if (!ret) {
                        TALLOC_FREE(names);
                        return NT_STATUS_INVALID_NETWORK_RESPONSE;
index 4c730c4..2c2921a 100644 (file)
@@ -47,12 +47,12 @@ static struct tevent_req *cli_message_start_send(TALLOC_CTX *mem_ctx,
 
        if (!convert_string_talloc(talloc_tos(), CH_UNIX, CH_DOS,
                                   username, strlen(username)+1,
-                                  &utmp, &ulen, true)) {
+                                  &utmp, &ulen)) {
                goto fail;
        }
        if (!convert_string_talloc(talloc_tos(), CH_UNIX, CH_DOS,
                                   host, strlen(host)+1,
-                                  &htmp, &hlen, true)) {
+                                  &htmp, &hlen)) {
                goto fail;
        }
 
@@ -154,7 +154,7 @@ static struct tevent_req *cli_message_text_send(TALLOC_CTX *mem_ctx,
        SSVAL(&state->vwv, 0, grp);
 
        if (convert_string_talloc(talloc_tos(), CH_UNIX, CH_DOS, msg, msglen,
-                                 &tmp, &tmplen, true)) {
+                                 &tmp, &tmplen)) {
                msg = tmp;
                msglen = tmplen;
        } else {
index 1756c47..141db71 100644 (file)
@@ -1039,7 +1039,7 @@ static bool parse_streams_blob(TALLOC_CTX *mem_ctx, const uint8_t *rdata,
                tmp_buf[nlen+1] = 0;
 
                if (!convert_string_talloc(streams, CH_UTF16, CH_UNIX, tmp_buf,
-                                          nlen+2, &vstr, &size, false))
+                                          nlen+2, &vstr, &size))
                {
                        TALLOC_FREE(tmp_buf);
                        goto fail;
@@ -1285,8 +1285,7 @@ NTSTATUS cli_qpathinfo_alt_name(struct cli_state *cli, const char *fname, fstrin
                                   rdata + 4,
                                   len,
                                   &converted,
-                                  &converted_size,
-                                  true)) {
+                                  &converted_size)) {
                return NT_STATUS_NO_MEMORY;
        }
        fstrcpy(alt_name, converted);
index 42632f3..dab8c10 100644 (file)
@@ -384,7 +384,7 @@ struct tevent_req *cli_trans_send(
                                       cli_ucs2(cli) ? CH_UTF16LE : CH_DOS,
                                       pipe_name, strlen(pipe_name) + 1,
                                       &state->pipe_name_conv,
-                                      &state->pipe_name_conv_len, true))) {
+                                      &state->pipe_name_conv_len))) {
                tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
                return tevent_req_post(req, ev);
        }
index 654bc5d..dc728ee 100644 (file)
@@ -388,7 +388,7 @@ static bool pdb_ads_init_ads_from_sam(struct pdb_ads_state *state,
                ret &= convert_string_talloc(talloc_tos(),
                                             CH_UNIX, CH_UTF16LE,
                                             pw_quote, strlen(pw_quote),
-                                            &pw_utf16, &pw_utf16_len, false);
+                                            &pw_utf16, &pw_utf16_len);
                if (!ret) {
                        goto fail;
                }
@@ -1652,8 +1652,7 @@ static bool pdb_ads_dnblob2sid(struct pdb_ads_state *state, DATA_BLOB *dnblob,
        bool ret;
 
        if (!convert_string_talloc(talloc_tos(), CH_UTF8, CH_UNIX,
-                                  dnblob->data, dnblob->length, &dn, &len,
-                                  false)) {
+                                  dnblob->data, dnblob->length, &dn, &len)) {
                return false;
        }
        rc = pdb_ads_search_fmt(state, dn, TLDAP_SCOPE_BASE,
index b76bcfe..c03b39c 100644 (file)
@@ -162,7 +162,7 @@ static bool act_val_sz(struct reg_parse* p, cbuf* value, bool cont)
 
                if (convert_string_talloc(p->valblob, CH_UNIX, CH_UTF16LE,
                                          src, strlen(src)+1,
-                                         &dst, &dlen, true))
+                                         &dst, &dlen))
                {
                        cbuf_swapptr(p->valblob, &dst, dlen);
                } else {
index 061b481..be8747b 100644 (file)
@@ -1647,8 +1647,7 @@ static NTSTATUS add_trusted_domain_user(TALLOC_CTX *mem_ctx,
                                                           auth_struct->incoming.current.array[i].AuthInfo.clear.password,
                                                           auth_struct->incoming.current.array[i].AuthInfo.clear.size,
                                                           &dummy,
-                                                          &dummy_size,
-                                                          false)) {
+                                                          &dummy_size)) {
                                        return NT_STATUS_UNSUCCESSFUL;
                                }
                                if (!pdb_set_plaintext_passwd(sam_acct, dummy)) {
index f0a4e34..f93deab 100644 (file)
@@ -633,7 +633,7 @@ static bool is_legal_name(const char *name)
                         * for mb UNIX asian characters like Japanese (SJIS) here.
                         * JRA.
                         */
-                       if (convert_string(CH_UNIX, CH_UTF16LE, name, 2, mbc, 2, False) == 2) {
+                       if (convert_string(CH_UNIX, CH_UTF16LE, name, 2, mbc, 2) == 2) {
                                /* Was a good mb string. */
                                name += 2;
                                continue;
index 386aca1..f2ca420 100644 (file)
@@ -73,7 +73,7 @@ static void msg_deliver(struct msg_state *state)
 
        if (!convert_string_talloc(talloc_tos(), CH_DOS, CH_UNIX, state->msg,
                                   talloc_get_size(state->msg), (void *)&msg,
-                                  &len, true)) {
+                                  &len)) {
                DEBUG(3, ("Conversion failed, delivering message in DOS "
                          "codepage format\n"));
                msg = state->msg;
index b191b74..70f0dba 100644 (file)
@@ -212,7 +212,7 @@ NTSTATUS smbd_smb2_request_process_create(struct smbd_smb2_request *smb2req)
                                   in_name_buffer.data,
                                   in_name_buffer.length,
                                   &in_name_string,
-                                  &in_name_string_size, false);
+                                  &in_name_string_size);
        if (!ok) {
                return smbd_smb2_request_error(smb2req, NT_STATUS_ILLEGAL_CHARACTER);
        }
index 1ee493b..fe5dee6 100644 (file)
@@ -107,7 +107,7 @@ NTSTATUS smbd_smb2_request_process_find(struct smbd_smb2_request *req)
                                   in_file_name_buffer.data,
                                   in_file_name_buffer.length,
                                   &in_file_name_string,
-                                  &in_file_name_string_size, false);
+                                  &in_file_name_string_size);
        if (!ok) {
                return smbd_smb2_request_error(req, NT_STATUS_ILLEGAL_CHARACTER);
        }
index 672965f..5a42d59 100644 (file)
@@ -303,7 +303,7 @@ static struct tevent_req *smbd_smb2_ioctl_send(TALLOC_CTX *mem_ctx,
                                           in_file_name_buffer.data,
                                           in_file_name_buffer.length,
                                           &in_file_name_string,
-                                          &in_file_name_string_size, false);
+                                          &in_file_name_string_size);
                if (!ok) {
                        tevent_req_nterror(req, NT_STATUS_ILLEGAL_CHARACTER);
                        return tevent_req_post(req, ev);
index 01c7e01..39b8eb1 100644 (file)
@@ -81,7 +81,7 @@ NTSTATUS smbd_smb2_request_process_tcon(struct smbd_smb2_request *req)
                                   in_path_buffer.data,
                                   in_path_buffer.length,
                                   &in_path_string,
-                                  &in_path_string_size, false);
+                                  &in_path_string_size);
        if (!ok) {
                return smbd_smb2_request_error(req, NT_STATUS_ILLEGAL_CHARACTER);
        }
index e4d2dee..b7789d3 100644 (file)
@@ -51,7 +51,7 @@ bool torture_utable(int dummy)
                p = fname+strlen(fname);
                len = convert_string(CH_UTF16LE, CH_UNIX, 
                                     &c2, 2, 
-                                    p, sizeof(fname)-strlen(fname), True);
+                                    p, sizeof(fname)-strlen(fname));
                p[len] = 0;
                fstrcat(fname,"_a_long_extension");
 
@@ -113,7 +113,7 @@ static char *form_name(int c)
 
        len = convert_string(CH_UTF16LE, CH_UNIX, 
                             &c2, 2, 
-                            p, sizeof(fname)-strlen(fname), True);
+                            p, sizeof(fname)-strlen(fname));
        p[len] = 0;
        return fname;
 }
index 1b9b133..41462c0 100644 (file)
@@ -479,7 +479,7 @@ static bool test_plaintext(enum ntlm_break break_which)
                                   CH_DOS, password,
                                   strlen(password)+1, 
                                   &lm_response.data,
-                                  &lm_response.length, True)) {
+                                  &lm_response.length)) {
                DEBUG(0, ("convert_string_talloc failed!\n"));
                exit(1);
        }
index e3356a2..1c610df 100644 (file)
@@ -207,14 +207,14 @@ void cgi_load_variables(void)
 
                convert_string_talloc(frame, CH_UTF8, CH_UNIX,
                               variables[i].name, strlen(variables[i].name),
-                              &dest, &dest_len, True);
+                              &dest, &dest_len);
                SAFE_FREE(variables[i].name);
                variables[i].name = SMB_STRDUP(dest ? dest : "");
 
                dest = NULL;
                convert_string_talloc(frame, CH_UTF8, CH_UNIX,
                               variables[i].value, strlen(variables[i].value),
-                              &dest, &dest_len, True);
+                              &dest, &dest_len);
                SAFE_FREE(variables[i].value);
                variables[i].value = SMB_STRDUP(dest ? dest : "");
                TALLOC_FREE(frame);
@@ -359,11 +359,11 @@ static bool cgi_handle_authorization(char *line)
 
        convert_string(CH_UTF8, CH_UNIX, 
                       line, -1, 
-                      user, sizeof(user), True);
+                      user, sizeof(user));
 
        convert_string(CH_UTF8, CH_UNIX, 
                       p+1, -1, 
-                      user_pass, sizeof(user_pass), True);
+                      user_pass, sizeof(user_pass));
 
        /*
         * Try and get the user from the UNIX password file.
index 53d12d9..470a2b0 100644 (file)
@@ -1689,8 +1689,7 @@ static int setup_given_passwords(struct setup_password_fields_io *io,
                                           g->cleartext_utf8->data,
                                           g->cleartext_utf8->length,
                                           (void *)&cleartext_utf16_blob->data,
-                                          &cleartext_utf16_blob->length,
-                                          false)) {
+                                          &cleartext_utf16_blob->length)) {
                        if (g->cleartext_utf8->length != 0) {
                                talloc_free(cleartext_utf16_blob);
                                ldb_asprintf_errstring(ldb,
@@ -1717,8 +1716,7 @@ static int setup_given_passwords(struct setup_password_fields_io *io,
                                           g->cleartext_utf16->data,
                                           g->cleartext_utf16->length,
                                           (void *)&cleartext_utf8_blob->data,
-                                          &cleartext_utf8_blob->length,
-                                          false)) {
+                                          &cleartext_utf8_blob->length)) {
                        if (g->cleartext_utf16->length != 0) {
                                /* We must bail out here, the input wasn't even
                                 * a multiple of 2 bytes */
index f59aae8..2134185 100644 (file)
@@ -335,7 +335,7 @@ found:
                                   CH_UNIX, CH_UTF16,
                                   newpass, strlen(newpass),
                                   (void *)&newpass_utf16.data,
-                                  &newpass_utf16.length, false)) {
+                                  &newpass_utf16.length)) {
                ldb_asprintf_errstring(ldb,
                                       "samldb_rodc_add: "
                                       "failed to generate UTF16 password from random password");
index 6d27005..88badc7 100644 (file)
@@ -1484,7 +1484,7 @@ static WERROR dsdb_syntax_UNICODE_drsuapi_to_ldb(const struct dsdb_syntax_ctx *c
                                           CH_UTF16, CH_UNIX,
                                           in->value_ctr.values[i].blob->data,
                                           in->value_ctr.values[i].blob->length,
-                                          (void **)&str, NULL, false)) {
+                                          (void **)&str, NULL)) {
                        return WERR_FOOBAR;
                }
 
@@ -1524,7 +1524,7 @@ static WERROR dsdb_syntax_UNICODE_ldb_to_drsuapi(const struct dsdb_syntax_ctx *c
                if (!convert_string_talloc(blobs,
                                           CH_UNIX, CH_UTF16,
                                           in->values[i].data, in->values[i].length,
-                                          (void **)&blobs[i].data, &blobs[i].length, false)) {
+                                          (void **)&blobs[i].data, &blobs[i].length)) {
                        return WERR_FOOBAR;
                }
        }
@@ -1549,7 +1549,7 @@ static WERROR dsdb_syntax_UNICODE_validate_one_val(const struct dsdb_syntax_ctx
                                   val->data,
                                   val->length,
                                   (void **)&dst,
-                                  &size, false);
+                                  &size);
        TALLOC_FREE(dst);
        if (!ok) {
                return WERR_DS_INVALID_ATTRIBUTE_SYNTAX;
@@ -2246,7 +2246,7 @@ static WERROR dsdb_syntax_PRESENTATION_ADDRESS_drsuapi_to_ldb(const struct dsdb_
                if (!convert_string_talloc(out->values, CH_UTF16, CH_UNIX,
                                           in->value_ctr.values[i].blob->data+4,
                                           in->value_ctr.values[i].blob->length-4,
-                                          (void **)&str, NULL, false)) {
+                                          (void **)&str, NULL)) {
                        return WERR_FOOBAR;
                }
 
@@ -2289,7 +2289,7 @@ static WERROR dsdb_syntax_PRESENTATION_ADDRESS_ldb_to_drsuapi(const struct dsdb_
                if (!convert_string_talloc(blobs, CH_UNIX, CH_UTF16,
                                           in->values[i].data,
                                           in->values[i].length,
-                                          (void **)&data, &ret, false)) {
+                                          (void **)&data, &ret)) {
                        return WERR_FOOBAR;
                }
 
index 117cab0..8ac92cd 100644 (file)
@@ -242,7 +242,7 @@ static bool kpasswd_process_request(struct kdc_server *kdc,
                                               CH_UTF8, CH_UTF16,
                                               (const char *)input->data,
                                               input->length,
-                                              (void **)&password.data, &pw_len, false)) {
+                                              (void **)&password.data, &pw_len)) {
                        return false;
                }
                password.length = pw_len;
@@ -282,7 +282,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, &pw_len, false)) {
+                                              (void **)&password.data, &pw_len)) {
                        free_ChangePasswdDataMS(&chpw);
                        return false;
                }
index a6f00aa..5244a20 100644 (file)
@@ -65,7 +65,7 @@ static void reg_ldb_unpack_value(TALLOC_CTX *mem_ctx,
                        /* The data should be provided as UTF16 string */
                        convert_string_talloc(mem_ctx, CH_UTF8, CH_UTF16,
                                              val->data, val->length,
-                                             (void **)&data->data, &data->length, false);
+                                             (void **)&data->data, &data->length);
                } else {
                        data->data = NULL;
                        data->length = 0;
@@ -159,8 +159,7 @@ static struct ldb_message *reg_ldb_pack_value(struct ldb_context *ctx,
                        /* The data is provided as UTF16 string */
                        ret2 = convert_string_talloc(mem_ctx, CH_UTF16, CH_UTF8,
                                                     (void *)data.data, data.length,
-                                                    (void **)&val->data, &val->length,
-                                                    false);
+                                                    (void **)&val->data, &val->length);
                        if (ret2) {
                                ret = ldb_msg_add_value(msg, "data", val, NULL);
                        } else {
index 8fac00b..073c12e 100644 (file)
@@ -79,8 +79,8 @@ static char *reg_val_dotreg_string(TALLOC_CTX *mem_ctx, uint32_t type,
                case REG_EXPAND_SZ:
                case REG_SZ:
                        convert_string_talloc(mem_ctx,
-                                                         CH_UTF16, CH_UNIX, data.data, data.length,
-                                                         (void **)&ret, NULL, false);
+                                             CH_UTF16, CH_UNIX, data.data, data.length,
+                                             (void **)&ret, NULL);
                        break;
                case REG_DWORD:
                case REG_DWORD_BIG_ENDIAN:
index 68fcdd5..2ef6f84 100644 (file)
@@ -91,7 +91,7 @@ static bool test_reg_val_data_string_sz(struct torture_context *ctx)
 {
        DATA_BLOB db;
        convert_string_talloc(ctx, CH_UTF8, CH_UTF16,
-                                         "bla", 3, (void **)&db.data, &db.length, false);
+                                         "bla", 3, (void **)&db.data, &db.length);
        torture_assert_str_equal(ctx, "bla",
                                 reg_val_data_string(ctx, REG_SZ, db),
                                 "sz failed");
@@ -128,7 +128,7 @@ static bool test_reg_val_description(struct torture_context *ctx)
        convert_string_talloc(ctx, CH_UTF8, CH_UTF16,
                                            "stationary traveller",
                                            strlen("stationary traveller"),
-                                           (void **)&data.data, &data.length, false);
+                                           (void **)&data.data, &data.length);
        torture_assert_str_equal(ctx, "camel = REG_SZ : stationary traveller",
                                 reg_val_description(ctx, "camel", REG_SZ, data),
                                 "reg_val_description failed");
@@ -142,7 +142,7 @@ static bool test_reg_val_description_nullname(struct torture_context *ctx)
        convert_string_talloc(ctx, CH_UTF8, CH_UTF16,
                                            "west berlin",
                                            strlen("west berlin"),
-                                           (void **)&data.data, &data.length, false);
+                                           (void **)&data.data, &data.length);
        torture_assert_str_equal(ctx, "<No Name> = REG_SZ : west berlin",
                                 reg_val_description(ctx, NULL, REG_SZ, data),
                                 "description with null name failed");
index bbcc869..3bbfaf2 100644 (file)
@@ -37,7 +37,7 @@ _PUBLIC_ char *reg_val_data_string(TALLOC_CTX *mem_ctx, uint32_t type,
                        convert_string_talloc(mem_ctx,
                                              CH_UTF16, CH_UNIX,
                                              data.data, data.length,
-                                             (void **)&ret, NULL, false);
+                                             (void **)&ret, NULL);
                        break;
                case REG_DWORD:
                case REG_DWORD_BIG_ENDIAN:
@@ -162,7 +162,7 @@ _PUBLIC_ bool reg_string_to_val(TALLOC_CTX *mem_ctx, const char *type_str,
                                                     CH_UNIX, CH_UTF16,
                                                     data_str, strlen(data_str)+1,
                                                     (void **)&data->data,
-                                                    &data->length, false);
+                                                    &data->length);
                        break;
                case REG_MULTI_SZ:
                case REG_EXPAND_SZ:
index 08598a2..5efa4dd 100644 (file)
@@ -64,7 +64,7 @@ NTSTATUS smbcli_parse_stream_info(DATA_BLOB blob, TALLOC_CTX *mem_ctx,
                }
                ret = convert_string_talloc(io->streams, 
                                             CH_UTF16, CH_UNIX,
-                                            blob.data+ofs+24, nlen, &vstr, NULL, false);
+                                            blob.data+ofs+24, nlen, &vstr, NULL);
                if (!ret) {
                        return NT_STATUS_ILLEGAL_CHARACTER;
                }
index eb39fff..bf02688 100644 (file)
@@ -586,7 +586,7 @@ static size_t smbcli_req_pull_ucs2(struct request_bufinfo *bufinfo, TALLOC_CTX *
                return 0;
        }
 
-       ret = convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX, src, src_len2, (void **)dest, &ret_size, false);
+       ret = convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX, src, src_len2, (void **)dest, &ret_size);
        if (!ret) {
                *dest = NULL;
                return 0;
@@ -629,7 +629,7 @@ size_t smbcli_req_pull_ascii(struct request_bufinfo *bufinfo, TALLOC_CTX *mem_ct
                src_len2++;
        }
 
-       ret = convert_string_talloc(mem_ctx, CH_DOS, CH_UNIX, src, src_len2, (void **)dest, &ret_size, false);
+       ret = convert_string_talloc(mem_ctx, CH_DOS, CH_UNIX, src, src_len2, (void **)dest, &ret_size);
 
        if (!ret) {
                *dest = NULL;
@@ -783,7 +783,7 @@ size_t smbcli_blob_pull_ucs2(TALLOC_CTX* mem_ctx,
 
        src_len2 = utf16_len_n(src, src_len);
 
-       ret = convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX, src, src_len2, (void **)&dest2, &ret_size, false);
+       ret = convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX, src, src_len2, (void **)&dest2, &ret_size);
        if (!ret) {
                *dest = NULL;
                return 0;
@@ -830,7 +830,7 @@ static size_t smbcli_blob_pull_ascii(TALLOC_CTX *mem_ctx,
                src_len2++;
        }
 
-       ret = convert_string_talloc(mem_ctx, CH_DOS, CH_UNIX, src, src_len2, (void **)&dest2, &ret_size, false);
+       ret = convert_string_talloc(mem_ctx, CH_DOS, CH_UNIX, src, src_len2, (void **)&dest2, &ret_size);
 
        if (!ret) {
                *dest = NULL;
index 358d133..bf96d05 100644 (file)
@@ -705,7 +705,7 @@ NTSTATUS smb2_pull_o16s16_string(struct smb2_request_buffer *buf, TALLOC_CTX *me
        }
 
        ret = convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX, 
-                                    blob.data, blob.length, &vstr, NULL, false);
+                                    blob.data, blob.length, &vstr, NULL);
        data_blob_free(&blob);
        (*str) = (char *)vstr;
        if (!ret) {
@@ -736,8 +736,7 @@ NTSTATUS smb2_push_o16s16_string(struct smb2_request_buffer *buf,
        }
 
        ret = convert_string_talloc(buf->buffer, CH_UNIX, CH_UTF16, 
-                                    str, strlen(str), (void **)&blob.data, &blob.length, 
-                                        false);
+                                   str, strlen(str), (void **)&blob.data, &blob.length);
        if (!ret) {
                return NT_STATUS_ILLEGAL_CHARACTER;
        }
index ab58598..85473f3 100644 (file)
@@ -187,7 +187,7 @@ NTSTATUS libnet_SamDump(struct libnet_context *ctx, TALLOC_CTX *mem_ctx,
                        }
                        if (!convert_string_talloc_convenience(mem_ctx, lpcfg_iconv_convenience(ctx->lp_ctx), CH_UTF16, CH_UNIX,
                                                  s->secret.data, s->secret.length, 
-                                                 (void **)&secret_string, NULL, false)) {
+                                                 (void **)&secret_string, NULL)) {
                                r->out.error_string = talloc_asprintf(mem_ctx, 
                                                                      "Could not convert secret for domain %s to a string",
                                                                      t->name);
index 3cc6829..45cc498 100644 (file)
@@ -238,7 +238,7 @@ NTSTATUS dcesrv_samr_OemChangePasswordUser2(struct dcesrv_call_state *dce_call,
                                  CH_DOS, CH_UNIX,
                                  (const char *)new_password.data,
                                  new_password.length,
-                                 (void **)&new_pass, NULL, false)) {
+                                 (void **)&new_pass, NULL)) {
                DEBUG(3,("samr: failed to convert incoming password buffer to unix charset\n"));
                return NT_STATUS_WRONG_PASSWORD;
        }
@@ -247,7 +247,7 @@ NTSTATUS dcesrv_samr_OemChangePasswordUser2(struct dcesrv_call_state *dce_call,
                                               CH_DOS, CH_UTF16,
                                               (const char *)new_password.data,
                                               new_password.length,
-                                              (void **)&new_unicode_password.data, &unicode_pw_len, false)) {
+                                              (void **)&new_unicode_password.data, &unicode_pw_len)) {
                DEBUG(3,("samr: failed to convert incoming password buffer to UTF16 charset\n"));
                return NT_STATUS_WRONG_PASSWORD;
        }
@@ -401,7 +401,7 @@ NTSTATUS dcesrv_samr_ChangePasswordUser3(struct dcesrv_call_state *dce_call,
                                          CH_UTF16, CH_UNIX,
                                          (const char *)new_password.data,
                                          new_password.length,
-                                         (void **)&new_pass, NULL, false)) {
+                                         (void **)&new_pass, NULL)) {
                        E_deshash(new_pass, new_lm_hash);
                        E_old_pw_hash(new_nt_hash, lm_pwd->hash, lm_verifier.hash);
                        if (memcmp(lm_verifier.hash, r->in.lm_verifier->hash, 16) != 0) {
index 65ed3d0..59a34a0 100644 (file)
@@ -512,7 +512,7 @@ static size_t req_pull_ucs2(struct request_bufinfo *bufinfo, const char **dest,
                return src_len2 + alignment;
        }
 
-       ret = convert_string_talloc(bufinfo->mem_ctx, CH_UTF16, CH_UNIX, src, src_len2, (void **)&dest2, NULL, false);
+       ret = convert_string_talloc(bufinfo->mem_ctx, CH_UTF16, CH_UNIX, src, src_len2, (void **)&dest2, NULL);
 
        if (!ret) {
                *dest = NULL;
@@ -561,7 +561,7 @@ static size_t req_pull_ascii(struct request_bufinfo *bufinfo, const char **dest,
                src_len2++;
        }
 
-       ret = convert_string_talloc(bufinfo->mem_ctx, CH_DOS, CH_UNIX, src, src_len2, (void **)&dest2, NULL, false);
+       ret = convert_string_talloc(bufinfo->mem_ctx, CH_DOS, CH_UNIX, src, src_len2, (void **)&dest2, NULL);
 
        if (!ret) {
                *dest = NULL;
index e09297e..301efab 100644 (file)
@@ -55,7 +55,7 @@ static NTSTATUS unicode_open(struct torture_context *tctx,
        }
        SSVAL(ucs_name, i*2, 0);
 
-       if (!convert_string_talloc_convenience(ucs_name, lpcfg_iconv_convenience(tctx->lp_ctx), CH_UTF16, CH_UNIX, ucs_name, (1+u_name_len)*2, (void **)&fname, &i, false)) {
+       if (!convert_string_talloc_convenience(ucs_name, lpcfg_iconv_convenience(tctx->lp_ctx), CH_UTF16, CH_UNIX, ucs_name, (1+u_name_len)*2, (void **)&fname, &i)) {
                torture_comment(tctx, "Failed to convert UCS2 Name into unix - convert_string_talloc() failure\n");
                talloc_free(ucs_name);
                return NT_STATUS_NO_MEMORY;
index ffa2565..eaa3f39 100644 (file)
@@ -52,7 +52,7 @@ bool torture_utable(struct torture_context *tctx,
                p = fname+strlen(fname);
                len = convert_string(CH_UTF16, CH_UNIX, 
                                     c2, 2, 
-                                    p, sizeof(fname)-strlen(fname), false);
+                                    p, sizeof(fname)-strlen(fname));
                p[len] = 0;
                strncat(fname,"_a_long_extension",sizeof(fname)-1);
 
@@ -111,7 +111,7 @@ static char *form_name(int c)
 
        len = convert_string(CH_UTF16, CH_UNIX, 
                             c2, 2, 
-                            p, sizeof(fname)-strlen(fname), false);
+                            p, sizeof(fname)-strlen(fname));
        if (len == -1)
                return NULL;
        p[len] = 0;
index 3ef3f1d..060ac43 100644 (file)
@@ -436,8 +436,7 @@ static bool get_trust_domain_passwords_auth_blob(TALLOC_CTX *mem_ctx,
        if (!convert_string_talloc(mem_ctx, CH_UNIX, CH_UTF16, password,
                                  strlen(password),
                                  &auth_info_array[0].AuthInfo.clear.password,
-                                 &converted_size,
-                                 false)) {
+                                 &converted_size)) {
                return false;
        }
 
index 0ba0d26..e624f00 100644 (file)
@@ -1192,7 +1192,7 @@ static bool test_plaintext(struct samlogon_state *samlogon_state, enum ntlm_brea
        if (!convert_string_talloc(samlogon_state->mem_ctx,
                                   CH_UNIX, CH_DOS,
                                   password, strlen(password)+1,
-                                  (void**)&dospw, NULL, false)) {
+                                  (void**)&dospw, NULL)) {
                DEBUG(0, ("convert_string_talloc failed!\n"));
                exit(1);
        }
index 8a9a5e4..55164cd 100644 (file)
@@ -2771,8 +2771,7 @@ static bool test_symlink_keys(struct torture_context *tctx,
                convert_string_talloc(tctx, CH_UNIX, CH_UTF16,
                                      kernel_mode_path,
                                      strlen(kernel_mode_path), /* not NULL terminated */
-                                     &blob.data, &blob.length,
-                                     false),
+                                     &blob.data, &blob.length),
                "failed to convert");
 
        torture_assert(tctx,