]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Inline dos_PutUniCode() into its only caller
authorVolker Lendecke <vl@samba.org>
Wed, 20 May 2026 13:29:45 +0000 (15:29 +0200)
committerMartin Schwenke <martins@samba.org>
Thu, 11 Jun 2026 12:16:31 +0000 (12:16 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
source3/include/proto.h
source3/lib/charcnv.c
source3/smbd/smb2_trans2.c

index 97d69b6393befc4aa14e496f05639f0c7772f907..208298aa7cb1065dd9836dfd2609e5729cf2c11c 100644 (file)
@@ -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  */
index dcd6b5a7d6b8aedd70067b3b03c95c2d182de90e..d7ee2e75e396a91eb991cc52424952464f1ad9c1 100644 (file)
@@ -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().
  */
index 5c2e4cc1fb42fe4d08c4567e5e9d82d0a2b75a12..8342ff003332aee987918089eeacd1c263311687 100644 (file)
@@ -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;