diff options
author | Andrew Tridgell <tridge@samba.org> | 2011-03-24 10:59:41 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2011-03-24 01:47:26 +0100 |
commit | 15e84a9a09c5a86416e964a3258ee35718fbf45a (patch) | |
tree | a3c1d6698668e55b257c96fe2cace1ac7c8edb3a /source3 | |
parent | 451856698fc04a9426ec9cb1ec039574f82f56bb (diff) | |
download | samba-15e84a9a09c5a86416e964a3258ee35718fbf45a.tar.gz samba-15e84a9a09c5a86416e964a3258ee35718fbf45a.tar.bz2 samba-15e84a9a09c5a86416e964a3258ee35718fbf45a.zip |
charcnv: removed the allow_badcharcnv and allow_bad_conv options to convert_string*()
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
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/proto.h | 2 | ||||
-rw-r--r-- | source3/lib/charcnv.c | 228 | ||||
-rw-r--r-- | source3/lib/dprintf.c | 2 | ||||
-rw-r--r-- | source3/lib/eventlog/eventlog.c | 2 | ||||
-rw-r--r-- | source3/lib/smbldap.c | 2 | ||||
-rw-r--r-- | source3/lib/tldap_util.c | 9 | ||||
-rw-r--r-- | source3/libsmb/clifile.c | 7 | ||||
-rw-r--r-- | source3/libsmb/climessage.c | 6 | ||||
-rw-r--r-- | source3/libsmb/clirap.c | 5 | ||||
-rw-r--r-- | source3/libsmb/clitrans.c | 2 | ||||
-rw-r--r-- | source3/passdb/pdb_ads.c | 5 | ||||
-rw-r--r-- | source3/registry/reg_parse.c | 2 | ||||
-rw-r--r-- | source3/rpc_server/lsa/srv_lsa_nt.c | 3 | ||||
-rw-r--r-- | source3/smbd/mangle_hash2.c | 2 | ||||
-rw-r--r-- | source3/smbd/message.c | 2 | ||||
-rw-r--r-- | source3/smbd/smb2_create.c | 2 | ||||
-rw-r--r-- | source3/smbd/smb2_find.c | 2 | ||||
-rw-r--r-- | source3/smbd/smb2_ioctl.c | 2 | ||||
-rw-r--r-- | source3/smbd/smb2_tcon.c | 2 | ||||
-rw-r--r-- | source3/torture/utable.c | 4 | ||||
-rw-r--r-- | source3/utils/ntlm_auth_diagnostics.c | 2 | ||||
-rw-r--r-- | source3/web/cgi.c | 8 |
22 files changed, 60 insertions, 241 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index d166813467..8e1bcc6417 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -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); diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c index 1779c4fbf7..6addc90e22 100644 --- a/source3/lib/charcnv.c +++ b/source3/lib/charcnv.c @@ -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); } /** diff --git a/source3/lib/dprintf.c b/source3/lib/dprintf.c index 835d34076e..73bacdccbb 100644 --- a/source3/lib/dprintf.c +++ b/source3/lib/dprintf.c @@ -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; diff --git a/source3/lib/eventlog/eventlog.c b/source3/lib/eventlog/eventlog.c index c91258ef12..70062345a6 100644 --- a/source3/lib/eventlog/eventlog.c +++ b/source3/lib/eventlog/eventlog.c @@ -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) { diff --git a/source3/lib/smbldap.c b/source3/lib/smbldap.c index 568a7ee6b9..c094fbe255 100644 --- a/source3/lib/smbldap.c +++ b/source3/lib/smbldap.c @@ -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); diff --git a/source3/lib/tldap_util.c b/source3/lib/tldap_util.c index 7697a4326a..ae3dab38ab 100644 --- a/source3/lib/tldap_util.c +++ b/source3/lib/tldap_util.c @@ -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; diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index 72f0e4b8eb..fcf31561be 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -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; diff --git a/source3/libsmb/climessage.c b/source3/libsmb/climessage.c index 4c730c4b76..2c2921aa0c 100644 --- a/source3/libsmb/climessage.c +++ b/source3/libsmb/climessage.c @@ -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 { diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c index 1756c479b4..141db7131e 100644 --- a/source3/libsmb/clirap.c +++ b/source3/libsmb/clirap.c @@ -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); diff --git a/source3/libsmb/clitrans.c b/source3/libsmb/clitrans.c index 42632f394f..dab8c10c84 100644 --- a/source3/libsmb/clitrans.c +++ b/source3/libsmb/clitrans.c @@ -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); } diff --git a/source3/passdb/pdb_ads.c b/source3/passdb/pdb_ads.c index 654bc5de6f..dc728ee454 100644 --- a/source3/passdb/pdb_ads.c +++ b/source3/passdb/pdb_ads.c @@ -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, diff --git a/source3/registry/reg_parse.c b/source3/registry/reg_parse.c index b76bcfe2a7..c03b39c29d 100644 --- a/source3/registry/reg_parse.c +++ b/source3/registry/reg_parse.c @@ -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 { diff --git a/source3/rpc_server/lsa/srv_lsa_nt.c b/source3/rpc_server/lsa/srv_lsa_nt.c index 061b481071..be8747b4d2 100644 --- a/source3/rpc_server/lsa/srv_lsa_nt.c +++ b/source3/rpc_server/lsa/srv_lsa_nt.c @@ -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)) { diff --git a/source3/smbd/mangle_hash2.c b/source3/smbd/mangle_hash2.c index f0a4e34207..f93deab9db 100644 --- a/source3/smbd/mangle_hash2.c +++ b/source3/smbd/mangle_hash2.c @@ -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; diff --git a/source3/smbd/message.c b/source3/smbd/message.c index 386aca1727..f2ca420bf9 100644 --- a/source3/smbd/message.c +++ b/source3/smbd/message.c @@ -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; diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c index b191b74fcc..70f0dba404 100644 --- a/source3/smbd/smb2_create.c +++ b/source3/smbd/smb2_create.c @@ -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); } diff --git a/source3/smbd/smb2_find.c b/source3/smbd/smb2_find.c index 1ee493b906..fe5dee618e 100644 --- a/source3/smbd/smb2_find.c +++ b/source3/smbd/smb2_find.c @@ -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); } diff --git a/source3/smbd/smb2_ioctl.c b/source3/smbd/smb2_ioctl.c index 672965f470..5a42d59e9a 100644 --- a/source3/smbd/smb2_ioctl.c +++ b/source3/smbd/smb2_ioctl.c @@ -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); diff --git a/source3/smbd/smb2_tcon.c b/source3/smbd/smb2_tcon.c index 01c7e01c65..39b8eb1ae7 100644 --- a/source3/smbd/smb2_tcon.c +++ b/source3/smbd/smb2_tcon.c @@ -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); } diff --git a/source3/torture/utable.c b/source3/torture/utable.c index e4d2dee6f3..b7789d35bc 100644 --- a/source3/torture/utable.c +++ b/source3/torture/utable.c @@ -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; } diff --git a/source3/utils/ntlm_auth_diagnostics.c b/source3/utils/ntlm_auth_diagnostics.c index 1b9b133e4f..41462c052b 100644 --- a/source3/utils/ntlm_auth_diagnostics.c +++ b/source3/utils/ntlm_auth_diagnostics.c @@ -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); } diff --git a/source3/web/cgi.c b/source3/web/cgi.c index e3356a2f7e..1c610dfd52 100644 --- a/source3/web/cgi.c +++ b/source3/web/cgi.c @@ -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. |