1
0
mirror of https://github.com/samba-team/samba.git synced 2025-10-24 15:33:20 +03:00

r26429: Avoid use of global_smb_iconv_convenience.

This commit is contained in:
Jelmer Vernooij
2007-12-13 22:46:09 +01:00
committed by Stefan Metzmacher
parent 5a3a851dc7
commit d37136b7ab
39 changed files with 176 additions and 138 deletions

View File

@@ -24,6 +24,7 @@
#include "librpc/gen_ndr/ndr_misc.h"
#include "ntvfs/ntvfs.h"
#include "libcli/raw/libcliraw.h"
#include "param/param.h"
#define BLOB_CHECK(cmd) do { \
NTSTATUS _status; \
@@ -138,10 +139,10 @@ size_t smbsrv_blob_push_string(TALLOC_CTX *mem_ctx,
alignment = 1;
if (dest_len > 0) {
SCVAL(blob->data + offset, 0, 0);
ret = push_string(global_smb_iconv_convenience, blob->data + offset + 1, str, dest_len-1, flags);
ret = push_string(lp_iconv_convenience(global_loadparm), blob->data + offset + 1, str, dest_len-1, flags);
}
} else {
ret = push_string(global_smb_iconv_convenience, blob->data + offset, str, dest_len, flags);
ret = push_string(lp_iconv_convenience(global_loadparm), blob->data + offset, str, dest_len, flags);
}
/* sometimes the string needs to be terminated, but the length

View File

@@ -26,6 +26,7 @@
#include "ntvfs/ntvfs.h"
#include "libcli/raw/libcliraw.h"
#include "librpc/gen_ndr/ndr_security.h"
#include "param/param.h"
/*
hold the state of a nttrans op while in progress. Needed to allow for async backend
@@ -372,7 +373,7 @@ static NTSTATUS nttrans_notify_change_send(struct nttrans_op *op)
ssize_t len;
SIVAL(p, 4, info->nttrans.out.changes[i].action);
len = push_string(global_smb_iconv_convenience, p + 12, info->nttrans.out.changes[i].name.s,
len = push_string(lp_iconv_convenience(global_loadparm), p + 12, info->nttrans.out.changes[i].name.s,
op->trans->out.params.length -
(p+12 - op->trans->out.params.data), STR_UNICODE);
SIVAL(p, 8, len);

View File

@@ -27,6 +27,7 @@
#include "smbd/service_stream.h"
#include "lib/stream/packet.h"
#include "ntvfs/ntvfs.h"
#include "param/param.h"
/* we over allocate the data buffer to prevent too many realloc calls */
@@ -408,7 +409,7 @@ size_t req_push_str(struct smbsrv_request *req, uint8_t *dest, const char *str,
dest = req->out.buffer + PTR_DIFF(dest, buf0);
}
len = push_string(global_smb_iconv_convenience, dest, str, len, flags);
len = push_string(lp_iconv_convenience(global_loadparm), dest, str, len, flags);
grow_size = len + PTR_DIFF(dest, req->out.data);
@@ -494,7 +495,7 @@ static size_t req_pull_ucs2(struct smbsrv_request *req, const char **dest, const
return src_len2 + alignment;
}
ret = convert_string_talloc(req, global_smb_iconv_convenience, CH_UTF16, CH_UNIX, src, src_len2, (void **)&dest2);
ret = convert_string_talloc(req, lp_iconv_convenience(global_loadparm), CH_UTF16, CH_UNIX, src, src_len2, (void **)&dest2);
if (ret == -1) {
*dest = NULL;
@@ -543,7 +544,7 @@ static size_t req_pull_ascii(struct smbsrv_request *req, const char **dest, cons
src_len2++;
}
ret = convert_string_talloc(req, global_smb_iconv_convenience, CH_DOS, CH_UNIX, src, src_len2, (void **)&dest2);
ret = convert_string_talloc(req, lp_iconv_convenience(global_loadparm), CH_DOS, CH_UNIX, src, src_len2, (void **)&dest2);
if (ret == -1) {
*dest = NULL;

View File

@@ -24,6 +24,7 @@
#include "smb_server/service_smb_proto.h"
#include "smb_server/smb2/smb2_server.h"
#include "ntvfs/ntvfs.h"
#include "param/param.h"
static void smb2srv_create_send(struct ntvfs_request *ntvfs)
{
@@ -352,7 +353,7 @@ static void smb2srv_notify_send(struct ntvfs_request *ntvfs)
ssize_t len;
SIVAL(p, 4, io->smb2.out.changes[i].action);
len = push_string(global_smb_iconv_convenience, p + 12, io->smb2.out.changes[i].name.s,
len = push_string(lp_iconv_convenience(global_loadparm), p + 12, io->smb2.out.changes[i].name.s,
blob.length - (p+12 - blob.data), STR_UNICODE);
SIVAL(p, 8, len);