* @returns the number of bytes occupied in the destination
* on error, returns -1, and sets errno
**/
-_PUBLIC_ ssize_t convert_string_error(struct smb_iconv_convenience *ic,
+_PUBLIC_ ssize_t convert_string_error(struct smb_iconv_handle *ic,
charset_t from, charset_t to,
void const *src, size_t srclen,
void *dest, size_t destlen, size_t *converted_size)
* @param destlen maximal length allowed for string
* @returns the number of bytes occupied in the destination
**/
-_PUBLIC_ bool convert_string_convenience(struct smb_iconv_convenience *ic,
+_PUBLIC_ bool convert_string_handle(struct smb_iconv_handle *ic,
charset_t from, charset_t to,
void const *src, size_t srclen,
void *dest, size_t destlen, size_t *converted_size)
* @returns Size in bytes of the converted string; or -1 in case of error.
**/
-_PUBLIC_ bool convert_string_talloc_convenience(TALLOC_CTX *ctx,
- struct smb_iconv_convenience *ic,
+_PUBLIC_ bool convert_string_talloc_handle(TALLOC_CTX *ctx,
+ struct smb_iconv_handle *ic,
charset_t from, charset_t to,
void const *src, size_t srclen,
void *dst, size_t *converted_size)
#define STR_LEN_NOTERM 256 /* the length field is the unterminated length */
struct loadparm_context;
-struct smb_iconv_convenience;
+struct smb_iconv_handle;
/* replace some string functions with multi-byte
versions */
void const *src, size_t srclen,
void *dest);
-extern struct smb_iconv_convenience *global_iconv_convenience;
-struct smb_iconv_convenience *get_iconv_convenience(void);
-smb_iconv_t get_conv_handle(struct smb_iconv_convenience *ic,
+extern struct smb_iconv_handle *global_iconv_handle;
+struct smb_iconv_handle *get_iconv_handle(void);
+smb_iconv_t get_conv_handle(struct smb_iconv_handle *ic,
charset_t from, charset_t to);
-const char *charset_name(struct smb_iconv_convenience *ic, charset_t ch);
+const char *charset_name(struct smb_iconv_handle *ic, charset_t ch);
codepoint_t next_codepoint_ext(const char *str, charset_t src_charset,
size_t *size);
ssize_t push_codepoint(char *str, codepoint_t c);
/* codepoints */
-codepoint_t next_codepoint_convenience_ext(struct smb_iconv_convenience *ic,
+codepoint_t next_codepoint_handle_ext(struct smb_iconv_handle *ic,
const char *str, charset_t src_charset,
size_t *size);
-codepoint_t next_codepoint_convenience(struct smb_iconv_convenience *ic,
+codepoint_t next_codepoint_handle(struct smb_iconv_handle *ic,
const char *str, size_t *size);
-ssize_t push_codepoint_convenience(struct smb_iconv_convenience *ic,
+ssize_t push_codepoint_handle(struct smb_iconv_handle *ic,
char *str, codepoint_t c);
codepoint_t toupper_m(codepoint_t val);
int codepoint_cmpi(codepoint_t c1, codepoint_t c2);
/* Iconv convenience functions */
-struct smb_iconv_convenience *smb_iconv_convenience_reinit(TALLOC_CTX *mem_ctx,
+struct smb_iconv_handle *smb_iconv_handle_reinit(TALLOC_CTX *mem_ctx,
const char *dos_charset,
const char *unix_charset,
const char *display_charset,
bool native_iconv,
- struct smb_iconv_convenience *old_ic);
+ struct smb_iconv_handle *old_ic);
-bool convert_string_convenience(struct smb_iconv_convenience *ic,
+bool convert_string_handle(struct smb_iconv_handle *ic,
charset_t from, charset_t to,
void const *src, size_t srclen,
void *dest, size_t destlen, size_t *converted_size);
-bool convert_string_talloc_convenience(TALLOC_CTX *ctx,
- struct smb_iconv_convenience *ic,
+bool convert_string_talloc_handle(TALLOC_CTX *ctx,
+ struct smb_iconv_handle *ic,
charset_t from, charset_t to,
void const *src, size_t srclen,
void *dest, size_t *converted_size);
}
-struct smb_iconv_convenience {
+struct smb_iconv_handle {
TALLOC_CTX *child_ctx;
const char *unix_charset;
const char *dos_charset;
smb_iconv_t conv_handles[NUM_CHARSETS][NUM_CHARSETS];
};
-struct smb_iconv_convenience *global_iconv_convenience = NULL;
+struct smb_iconv_handle *global_iconv_handle = NULL;
-struct smb_iconv_convenience *get_iconv_convenience(void)
+struct smb_iconv_handle *get_iconv_handle(void)
{
- if (global_iconv_convenience == NULL)
- global_iconv_convenience = smb_iconv_convenience_reinit(talloc_autofree_context(),
+ if (global_iconv_handle == NULL)
+ global_iconv_handle = smb_iconv_handle_reinit(talloc_autofree_context(),
"ASCII", "UTF-8", "ASCII", true, NULL);
- return global_iconv_convenience;
+ return global_iconv_handle;
}
/**
* Return the name of a charset to give to iconv().
**/
-const char *charset_name(struct smb_iconv_convenience *ic, charset_t ch)
+const char *charset_name(struct smb_iconv_handle *ic, charset_t ch)
{
switch (ch) {
case CH_UTF16: return "UTF-16LE";
/**
re-initialize iconv conversion descriptors
**/
-static int close_iconv_convenience(struct smb_iconv_convenience *data)
+static int close_iconv_handle(struct smb_iconv_handle *data)
{
unsigned c1, c2;
for (c1=0;c1<NUM_CHARSETS;c1++) {
}
/*
- the old_ic is passed in here as the smb_iconv_convenience structure
+ the old_ic is passed in here as the smb_iconv_handle structure
is used as a global pointer in some places (eg. python modules). We
don't want to invalidate those global pointers, but we do want to
update them with the right charset information when loadparm
runs. To do that we need to re-use the structure pointer, but
re-fill the elements in the structure with the updated values
*/
-_PUBLIC_ struct smb_iconv_convenience *smb_iconv_convenience_reinit(TALLOC_CTX *mem_ctx,
+_PUBLIC_ struct smb_iconv_handle *smb_iconv_handle_reinit(TALLOC_CTX *mem_ctx,
const char *dos_charset,
const char *unix_charset,
const char *display_charset,
bool native_iconv,
- struct smb_iconv_convenience *old_ic)
+ struct smb_iconv_handle *old_ic)
{
- struct smb_iconv_convenience *ret;
+ struct smb_iconv_handle *ret;
display_charset = map_locale(display_charset);
if (old_ic != NULL) {
ret = old_ic;
- close_iconv_convenience(ret);
+ close_iconv_handle(ret);
talloc_free(ret->child_ctx);
ZERO_STRUCTP(ret);
} else {
- ret = talloc_zero(mem_ctx, struct smb_iconv_convenience);
+ ret = talloc_zero(mem_ctx, struct smb_iconv_handle);
}
if (ret == NULL) {
return NULL;
return NULL;
}
- talloc_set_destructor(ret, close_iconv_convenience);
+ talloc_set_destructor(ret, close_iconv_handle);
ret->dos_charset = talloc_strdup(ret->child_ctx, dos_charset);
ret->unix_charset = talloc_strdup(ret->child_ctx, unix_charset);
/*
on-demand initialisation of conversion handles
*/
-smb_iconv_t get_conv_handle(struct smb_iconv_convenience *ic,
+smb_iconv_t get_conv_handle(struct smb_iconv_handle *ic,
charset_t from, charset_t to)
{
const char *n1, *n2;
*
* Return INVALID_CODEPOINT if the next character cannot be converted.
*/
-_PUBLIC_ codepoint_t next_codepoint_convenience_ext(
- struct smb_iconv_convenience *ic,
+_PUBLIC_ codepoint_t next_codepoint_handle_ext(
+ struct smb_iconv_handle *ic,
const char *str, charset_t src_charset,
size_t *bytes_consumed)
{
return INVALID_CODEPOINT if the next character cannot be converted
*/
-_PUBLIC_ codepoint_t next_codepoint_convenience(struct smb_iconv_convenience *ic,
+_PUBLIC_ codepoint_t next_codepoint_handle(struct smb_iconv_handle *ic,
const char *str, size_t *size)
{
- return next_codepoint_convenience_ext(ic, str, CH_UNIX, size);
+ return next_codepoint_handle_ext(ic, str, CH_UNIX, size);
}
/*
return the number of bytes occupied by the CH_UNIX character, or
-1 on failure
*/
-_PUBLIC_ ssize_t push_codepoint_convenience(struct smb_iconv_convenience *ic,
+_PUBLIC_ ssize_t push_codepoint_handle(struct smb_iconv_handle *ic,
char *str, codepoint_t c)
{
smb_iconv_t descriptor;
_PUBLIC_ codepoint_t next_codepoint_ext(const char *str, charset_t src_charset,
size_t *size)
{
- return next_codepoint_convenience_ext(get_iconv_convenience(), str,
+ return next_codepoint_handle_ext(get_iconv_handle(), str,
src_charset, size);
}
_PUBLIC_ codepoint_t next_codepoint(const char *str, size_t *size)
{
- return next_codepoint_convenience(get_iconv_convenience(), str, size);
+ return next_codepoint_handle(get_iconv_handle(), str, size);
}
_PUBLIC_ ssize_t push_codepoint(char *str, codepoint_t c)
{
- return push_codepoint_convenience(get_iconv_convenience(), str, c);
+ return push_codepoint_handle(get_iconv_handle(), str, c);
}
size_t size, size2;
codepoint_t c;
- size = push_codepoint_convenience(lpcfg_iconv_convenience(tctx->lp_ctx), (char *)buf, codepoint);
+ size = push_codepoint_handle(lpcfg_iconv_handle(tctx->lp_ctx), (char *)buf, codepoint);
torture_assert(tctx, size != -1 || (codepoint >= 0xd800 && codepoint <= 0x10000),
"Invalid Codepoint range");
buf[size+2] = random();
buf[size+3] = random();
- c = next_codepoint_convenience(lpcfg_iconv_convenience(tctx->lp_ctx), (char *)buf, &size2);
+ c = next_codepoint_handle(lpcfg_iconv_handle(tctx->lp_ctx), (char *)buf, &size2);
torture_assert(tctx, c == codepoint,
talloc_asprintf(tctx,
{
codepoint_t c1=0, c2=0;
size_t size1, size2;
- struct smb_iconv_convenience *iconv_convenience = get_iconv_convenience();
+ struct smb_iconv_handle *iconv_handle = get_iconv_handle();
/* handle null ptr comparisons to simplify the use in qsort */
if (s1 == s2) return 0;
if (s2 == NULL) return 1;
while (*s1 && *s2) {
- c1 = next_codepoint_convenience(iconv_convenience, s1, &size1);
- c2 = next_codepoint_convenience(iconv_convenience, s2, &size2);
+ c1 = next_codepoint_handle(iconv_handle, s1, &size1);
+ c2 = next_codepoint_handle(iconv_handle, s2, &size2);
s1 += size1;
s2 += size2;
{
codepoint_t c1=0, c2=0;
size_t size1, size2;
- struct smb_iconv_convenience *iconv_convenience = get_iconv_convenience();
+ struct smb_iconv_handle *iconv_handle = get_iconv_handle();
/* handle null ptr comparisons to simplify the use in qsort */
if (s1 == s2) return 0;
while (*s1 && *s2 && n) {
n--;
- c1 = next_codepoint_convenience(iconv_convenience, s1, &size1);
- c2 = next_codepoint_convenience(iconv_convenience, s2, &size2);
+ c1 = next_codepoint_handle(iconv_handle, s1, &size1);
+ c2 = next_codepoint_handle(iconv_handle, s2, &size2);
s1 += size1;
s2 += size2;
_PUBLIC_ size_t strlen_m_ext(const char *s, charset_t src_charset, charset_t dst_charset)
{
size_t count = 0;
- struct smb_iconv_convenience *ic = get_iconv_convenience();
+ struct smb_iconv_handle *ic = get_iconv_handle();
if (!s) {
return 0;
while (*s) {
size_t c_size;
- codepoint_t c = next_codepoint_convenience_ext(ic, s, src_charset, &c_size);
+ codepoint_t c = next_codepoint_handle_ext(ic, s, src_charset, &c_size);
s += c_size;
switch (dst_charset) {
_PUBLIC_ char *strchr_m(const char *src, char c)
{
const char *s;
- struct smb_iconv_convenience *ic = get_iconv_convenience();
+ struct smb_iconv_handle *ic = get_iconv_handle();
if (src == NULL) {
return NULL;
}
while (*s) {
size_t size;
- codepoint_t c2 = next_codepoint_convenience(ic, s, &size);
+ codepoint_t c2 = next_codepoint_handle(ic, s, &size);
if (c2 == c) {
return discard_const_p(char, s);
}
*/
_PUBLIC_ char *strrchr_m(const char *s, char c)
{
- struct smb_iconv_convenience *ic = get_iconv_convenience();
+ struct smb_iconv_handle *ic = get_iconv_handle();
char *ret = NULL;
if (s == NULL) {
while (*s) {
size_t size;
- codepoint_t c2 = next_codepoint_convenience(ic, s, &size);
+ codepoint_t c2 = next_codepoint_handle(ic, s, &size);
if (c2 == c) {
ret = discard_const_p(char, s);
}
*/
_PUBLIC_ bool strhaslower(const char *string)
{
- struct smb_iconv_convenience *ic = get_iconv_convenience();
+ struct smb_iconv_handle *ic = get_iconv_handle();
while (*string) {
size_t c_size;
codepoint_t s;
codepoint_t t;
- s = next_codepoint_convenience(ic, string, &c_size);
+ s = next_codepoint_handle(ic, string, &c_size);
string += c_size;
t = toupper_m(s);
*/
_PUBLIC_ bool strhasupper(const char *string)
{
- struct smb_iconv_convenience *ic = get_iconv_convenience();
+ struct smb_iconv_handle *ic = get_iconv_handle();
while (*string) {
size_t c_size;
codepoint_t s;
codepoint_t t;
- s = next_codepoint_convenience(ic, string, &c_size);
+ s = next_codepoint_handle(ic, string, &c_size);
string += c_size;
t = tolower_m(s);
**/
_PUBLIC_ void string_replace_m(char *s, char oldc, char newc)
{
- struct smb_iconv_convenience *ic = get_iconv_convenience();
+ struct smb_iconv_handle *ic = get_iconv_handle();
while (s && *s) {
size_t size;
- codepoint_t c = next_codepoint_convenience(ic, s, &size);
+ codepoint_t c = next_codepoint_handle(ic, s, &size);
if (c == oldc) {
*s = newc;
}
{
size_t size=0;
char *dest;
- struct smb_iconv_convenience *iconv_convenience = get_iconv_convenience();
+ struct smb_iconv_handle *iconv_handle = get_iconv_handle();
if(src == NULL) {
return NULL;
while (*src) {
size_t c_size;
- codepoint_t c = next_codepoint_convenience(iconv_convenience, src, &c_size);
+ codepoint_t c = next_codepoint_handle(iconv_handle, src, &c_size);
src += c_size;
c = tolower_m(c);
- c_size = push_codepoint_convenience(iconv_convenience, dest+size, c);
+ c_size = push_codepoint_handle(iconv_handle, dest+size, c);
if (c_size == -1) {
talloc_free(dest);
return NULL;
{
size_t size=0;
char *dest;
- struct smb_iconv_convenience *iconv_convenience = get_iconv_convenience();
+ struct smb_iconv_handle *iconv_handle = get_iconv_handle();
if (!src) {
return NULL;
while (n-- && *src) {
size_t c_size;
- codepoint_t c = next_codepoint_convenience(iconv_convenience, src, &c_size);
+ codepoint_t c = next_codepoint_handle(iconv_handle, src, &c_size);
src += c_size;
c = toupper_m(c);
- c_size = push_codepoint_convenience(iconv_convenience, dest+size, c);
+ c_size = push_codepoint_handle(iconv_handle, dest+size, c);
if (c_size == -1) {
talloc_free(dest);
return NULL;
_PUBLIC_ void strlower_m(char *s)
{
char *d;
- struct smb_iconv_convenience *iconv_convenience;
+ struct smb_iconv_handle *iconv_handle;
/* this is quite a common operation, so we want it to be
fast. We optimise for the ascii case, knowing that all our
if (!*s)
return;
- iconv_convenience = get_iconv_convenience();
+ iconv_handle = get_iconv_handle();
d = s;
while (*s) {
size_t c_size, c_size2;
- codepoint_t c = next_codepoint_convenience(iconv_convenience, s, &c_size);
- c_size2 = push_codepoint_convenience(iconv_convenience, d, tolower_m(c));
+ codepoint_t c = next_codepoint_handle(iconv_handle, s, &c_size);
+ c_size2 = push_codepoint_handle(iconv_handle, d, tolower_m(c));
if (c_size2 > c_size) {
DEBUG(0,("FATAL: codepoint 0x%x (0x%x) expanded from %d to %d bytes in strlower_m\n",
c, tolower_m(c), (int)c_size, (int)c_size2));
_PUBLIC_ void strupper_m(char *s)
{
char *d;
- struct smb_iconv_convenience *iconv_convenience;
+ struct smb_iconv_handle *iconv_handle;
/* this is quite a common operation, so we want it to be
fast. We optimise for the ascii case, knowing that all our
if (!*s)
return;
- iconv_convenience = get_iconv_convenience();
+ iconv_handle = get_iconv_handle();
d = s;
while (*s) {
size_t c_size, c_size2;
- codepoint_t c = next_codepoint_convenience(iconv_convenience, s, &c_size);
- c_size2 = push_codepoint_convenience(iconv_convenience, d, toupper_m(c));
+ codepoint_t c = next_codepoint_handle(iconv_handle, s, &c_size);
+ c_size2 = push_codepoint_handle(iconv_handle, d, toupper_m(c));
if (c_size2 > c_size) {
DEBUG(0,("FATAL: codepoint 0x%x (0x%x) expanded from %d to %d bytes in strupper_m\n",
c, toupper_m(c), (int)c_size, (int)c_size2));
**/
_PUBLIC_ size_t count_chars_m(const char *s, char c)
{
- struct smb_iconv_convenience *ic = get_iconv_convenience();
+ struct smb_iconv_handle *ic = get_iconv_handle();
size_t count = 0;
while (*s) {
size_t size;
- codepoint_t c2 = next_codepoint_convenience(ic, s, &size);
+ codepoint_t c2 = next_codepoint_handle(ic, s, &size);
if (c2 == c) count++;
s += size;
}
void *dest, size_t destlen)
{
size_t ret;
- if (!convert_string_convenience(get_iconv_convenience(), from, to,
+ if (!convert_string_handle(get_iconv_handle(), from, to,
src, srclen,
dest, destlen, &ret))
return -1;
void const *src, size_t srclen,
void *dest, size_t *converted_size)
{
- return convert_string_talloc_convenience(ctx, get_iconv_convenience(),
+ return convert_string_talloc_handle(ctx, get_iconv_handle(),
from, to, src, srclen, dest,
converted_size);
}
tevent_context_init(ads),
&options,
&session_options,
- lp_iconv_convenience(lp_ctx),
+ lp_iconv_handle(lp_ctx),
lp_gensec_settings(ads, lp_ctx));
if (!NT_STATUS_IS_OK(result)) {
DEBUG(10,("failed to connect: %s\n",
**/
void gfree_charcnv(void)
{
- TALLOC_FREE(global_iconv_convenience);
+ TALLOC_FREE(global_iconv_handle);
initialized = false;
}
**/
void init_iconv(void)
{
- global_iconv_convenience = smb_iconv_convenience_reinit(NULL, lp_dos_charset(),
+ global_iconv_handle = smb_iconv_handle_reinit(NULL, lp_dos_charset(),
lp_unix_charset(), lp_display_charset(),
- true, global_iconv_convenience);
+ true, global_iconv_handle);
}
/**
const char* inbuf = (const char*)src;
char* outbuf = (char*)dest;
smb_iconv_t descriptor;
- struct smb_iconv_convenience *ic;
+ struct smb_iconv_handle *ic;
lazy_initialize_conv();
- ic = get_iconv_convenience();
+ ic = get_iconv_handle();
descriptor = get_conv_handle(ic, from, to);
if (srclen == (size_t)-1) {
char *outbuf = NULL, *ob = NULL;
smb_iconv_t descriptor;
void **dest = (void **)dst;
- struct smb_iconv_convenience *ic;
+ struct smb_iconv_handle *ic;
*dest = NULL;
}
lazy_initialize_conv();
- ic = get_iconv_convenience();
+ ic = get_iconv_handle();
descriptor = get_conv_handle(ic, from, to);
if (descriptor == (smb_iconv_t)-1 || descriptor == (smb_iconv_t)0) {
case KRB5_KPASSWD_VERS_CHANGEPW:
{
DATA_BLOB password;
- if (!convert_string_talloc_convenience(mem_ctx, lpcfg_iconv_convenience(kdc->task->lp_ctx),
+ if (!convert_string_talloc_handle(mem_ctx, lpcfg_iconv_handle(kdc->task->lp_ctx),
CH_UTF8, CH_UTF16,
(const char *)input->data,
input->length,
reply);
}
- if (!convert_string_talloc_convenience(mem_ctx, lpcfg_iconv_convenience(kdc->task->lp_ctx),
+ if (!convert_string_talloc_handle(mem_ctx, lpcfg_iconv_handle(kdc->task->lp_ctx),
CH_UTF8, CH_UTF16,
(const char *)chpw.newpasswd.data,
chpw.newpasswd.length,
if (strcasecmp_m(s->name, secret_name) != 0) {
continue;
}
- if (!convert_string_talloc_convenience(mem_ctx, lpcfg_iconv_convenience(ctx->lp_ctx), CH_UTF16, CH_UNIX,
+ if (!convert_string_talloc_handle(mem_ctx, lpcfg_iconv_handle(ctx->lp_ctx), CH_UTF16, CH_UNIX,
s->secret.data, s->secret.length,
(void **)&secret_string, NULL)) {
r->out.error_string = talloc_asprintf(mem_ctx,
struct loadparm_global *globals;
struct loadparm_service **services;
struct loadparm_service *sDefault;
- struct smb_iconv_convenience *iconv_convenience;
+ struct smb_iconv_handle *iconv_handle;
int iNumServices;
struct loadparm_service *currentService;
bool bInGlobalSection;
return maxjobs;
}
-struct smb_iconv_convenience *lpcfg_iconv_convenience(struct loadparm_context *lp_ctx)
+struct smb_iconv_handle *lpcfg_iconv_handle(struct loadparm_context *lp_ctx)
{
if (lp_ctx == NULL) {
- return get_iconv_convenience();
+ return get_iconv_handle();
}
- return lp_ctx->iconv_convenience;
+ return lp_ctx->iconv_handle;
}
_PUBLIC_ void reload_charcnv(struct loadparm_context *lp_ctx)
{
- struct smb_iconv_convenience *old_ic = lp_ctx->iconv_convenience;
+ struct smb_iconv_handle *old_ic = lp_ctx->iconv_handle;
if (old_ic == NULL) {
- old_ic = global_iconv_convenience;
+ old_ic = global_iconv_handle;
}
- lp_ctx->iconv_convenience = smb_iconv_convenience_reinit_lp(lp_ctx, lp_ctx, old_ic);
- global_iconv_convenience = lp_ctx->iconv_convenience;
+ lp_ctx->iconv_handle = smb_iconv_handle_reinit_lp(lp_ctx, lp_ctx, old_ic);
+ global_iconv_handle = lp_ctx->iconv_handle;
}
void lpcfg_smbcli_options(struct loadparm_context *lp_ctx,
* Return the max print jobs per queue.
*/
int lpcfg_maxprintjobs(struct loadparm_service *service, struct loadparm_service *sDefault);
-struct smb_iconv_convenience *lpcfg_iconv_convenience(struct loadparm_context *lp_ctx);
+struct smb_iconv_handle *lpcfg_iconv_handle(struct loadparm_context *lp_ctx);
void lpcfg_smbcli_options(struct loadparm_context *lp_ctx,
struct smbcli_options *options);
void lpcfg_smbcli_session_options(struct loadparm_context *lp_ctx,
init_module_fn *load_samba_modules(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, const char *subsystem);
const char *lpcfg_messaging_path(TALLOC_CTX *mem_ctx,
struct loadparm_context *lp_ctx);
-struct smb_iconv_convenience *smb_iconv_convenience_reinit_lp(TALLOC_CTX *mem_ctx,
+struct smb_iconv_handle *smb_iconv_handle_reinit_lp(TALLOC_CTX *mem_ctx,
struct loadparm_context *lp_ctx,
- struct smb_iconv_convenience *old_ic);
+ struct smb_iconv_handle *old_ic);
const char *lpcfg_sam_name(struct loadparm_context *lp_ctx);
return smbd_tmp_path(mem_ctx, lp_ctx, "msg");
}
-struct smb_iconv_convenience *smb_iconv_convenience_reinit_lp(TALLOC_CTX *mem_ctx,
+struct smb_iconv_handle *smb_iconv_handle_reinit_lp(TALLOC_CTX *mem_ctx,
struct loadparm_context *lp_ctx,
- struct smb_iconv_convenience *old_ic)
+ struct smb_iconv_handle *old_ic)
{
- return smb_iconv_convenience_reinit(mem_ctx, lpcfg_dos_charset(lp_ctx),
+ return smb_iconv_handle_reinit(mem_ctx, lpcfg_dos_charset(lp_ctx),
lpcfg_unix_charset(lp_ctx),
lpcfg_display_charset(lp_ctx),
lpcfg_parm_bool(lp_ctx, NULL, "iconv", "native", true),
return NT_STATUS_WRONG_PASSWORD;
}
- if (!convert_string_talloc_convenience(mem_ctx, lpcfg_iconv_convenience(dce_call->conn->dce_ctx->lp_ctx),
+ if (!convert_string_talloc_handle(mem_ctx, lpcfg_iconv_handle(dce_call->conn->dce_ctx->lp_ctx),
CH_DOS, CH_UNIX,
(const char *)new_password.data,
new_password.length,
return NT_STATUS_WRONG_PASSWORD;
}
- if (!convert_string_talloc_convenience(mem_ctx, lpcfg_iconv_convenience(dce_call->conn->dce_ctx->lp_ctx),
+ if (!convert_string_talloc_handle(mem_ctx, lpcfg_iconv_handle(dce_call->conn->dce_ctx->lp_ctx),
CH_DOS, CH_UTF16,
(const char *)new_password.data,
new_password.length,
* this) */
if (lm_pwd && r->in.lm_verifier != NULL) {
char *new_pass;
- if (!convert_string_talloc_convenience(mem_ctx, lpcfg_iconv_convenience(dce_call->conn->dce_ctx->lp_ctx),
+ if (!convert_string_talloc_handle(mem_ctx, lpcfg_iconv_handle(dce_call->conn->dce_ctx->lp_ctx),
CH_UTF16, CH_UNIX,
(const char *)new_password.data,
new_password.length,
}
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)) {
+ if (!convert_string_talloc_handle(ucs_name, lpcfg_iconv_handle(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;