From: Volker Lendecke Date: Wed, 20 May 2026 13:29:45 +0000 (+0200) Subject: smbd: Inline dos_PutUniCode() into its only caller X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0979035ef1aee3c7361f63bbb8736e51d40ee73;p=thirdparty%2Fsamba.git smbd: Inline dos_PutUniCode() into its only caller Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke --- diff --git a/source3/include/proto.h b/source3/include/proto.h index 97d69b6393b..208298aa7cb 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -60,7 +60,6 @@ size_t pull_string_talloc(TALLOC_CTX *ctx, const void *src, size_t src_len, int flags); -size_t dos_PutUniCode(char *dst, const char *src, size_t len); int rpcstr_push_talloc(TALLOC_CTX *ctx, smb_ucs2_t **dest, const char *src); /* The following definitions come from lib/dmallocmsg.c */ diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c index dcd6b5a7d6b..d7ee2e75e39 100644 --- a/source3/lib/charcnv.c +++ b/source3/lib/charcnv.c @@ -21,7 +21,6 @@ */ #include "includes.h" -#include "lib/util/string_wrappers.h" /** * Destroy global objects allocated by init_iconv() @@ -502,23 +501,6 @@ size_t pull_string_talloc(TALLOC_CTX *ctx, flags); } -/******************************************************************* - Write a string in (little-endian) unicode format. src is in - the current DOS codepage. len is the length in bytes of the - string pointed to by dst. - - if null_terminate is True then null terminate the packet (adds 2 bytes) - - the return value is the length in bytes consumed by the string, including the - null termination if applied -********************************************************************/ - -size_t dos_PutUniCode(char *dst, const char *src, size_t len) -{ - return push_string_check(dst, src, len, STR_UNICODE | STR_NOALIGN); -} - - /* Converts a string from internal samba format to unicode. Always terminates. * Actually just a wrapper round push_ucs2_talloc(). */ diff --git a/source3/smbd/smb2_trans2.c b/source3/smbd/smb2_trans2.c index 5c2e4cc1fb4..8342ff00333 100644 --- a/source3/smbd/smb2_trans2.c +++ b/source3/smbd/smb2_trans2.c @@ -3511,10 +3511,11 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn, /* Pathname with leading '\'. */ { size_t byte_len; - byte_len = dos_PutUniCode( + byte_len = push_string_check( pdata + 4, dos_fname, - (size_t)max_data_bytes); + (size_t)max_data_bytes, + STR_UNICODE | STR_NOALIGN); DBG_DEBUG("SMB_FILE_NAME_INFORMATION\n"); SIVAL(pdata,0,byte_len); data_size = 4 + byte_len;