summaryrefslogtreecommitdiff
path: root/libcli
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2022-10-14 17:12:26 +0200
committerJeremy Allison <jra@samba.org>2022-11-22 18:27:33 +0000
commitf2c0f118fcccc19072639a7bccad673cc86dc5a6 (patch)
tree121ed615dd36986d3e6577c7b9cc2920f06b608a /libcli
parent9e07a8181247385a169e02adc184a03590d35573 (diff)
downloadsamba-f2c0f118fcccc19072639a7bccad673cc86dc5a6.tar.gz
samba-f2c0f118fcccc19072639a7bccad673cc86dc5a6.tar.bz2
samba-f2c0f118fcccc19072639a7bccad673cc86dc5a6.zip
smbd: Pass unparsed_path_length to symlink_reparse_buffer_marshall()
[MS-FSCC] 2.1.2.4 Symbolic Link Reparse Data Buffer lists this field as reserved, but [MS-SMB2] 2.2.2.2.1 Symbolic Link Error Response is the exact same format with the reserved field as UnparsedPathLength. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'libcli')
-rw-r--r--libcli/smb/reparse_symlink.c11
-rw-r--r--libcli/smb/reparse_symlink.h9
2 files changed, 15 insertions, 5 deletions
diff --git a/libcli/smb/reparse_symlink.c b/libcli/smb/reparse_symlink.c
index 04f26dc1162..31a438013fc 100644
--- a/libcli/smb/reparse_symlink.c
+++ b/libcli/smb/reparse_symlink.c
@@ -29,8 +29,13 @@
#include "lib/util/debug.h"
bool symlink_reparse_buffer_marshall(
- const char *substitute, const char *printname, uint32_t flags,
- TALLOC_CTX *mem_ctx, uint8_t **pdst, size_t *pdstlen)
+ const char *substitute,
+ const char *printname,
+ uint16_t unparsed_path_length,
+ uint32_t flags,
+ TALLOC_CTX *mem_ctx,
+ uint8_t **pdst,
+ size_t *pdstlen)
{
uint8_t *dst = NULL;
size_t dst_len;
@@ -87,7 +92,7 @@ bool symlink_reparse_buffer_marshall(
SIVAL(dst, 0, IO_REPARSE_TAG_SYMLINK); /* ReparseTag */
SSVAL(dst, 4, 12 + subst_len + print_len); /* ReparseDataLength */
- SSVAL(dst, 6, 0); /* Reserved */
+ SSVAL(dst, 6, unparsed_path_length); /* Reserved */
SSVAL(dst, 8, 0); /* SubstituteNameOffset */
SSVAL(dst, 10, subst_len); /* SubstituteNameLength */
SSVAL(dst, 12, subst_len); /* PrintNameOffset */
diff --git a/libcli/smb/reparse_symlink.h b/libcli/smb/reparse_symlink.h
index b561fa9fc98..7791d71663e 100644
--- a/libcli/smb/reparse_symlink.h
+++ b/libcli/smb/reparse_symlink.h
@@ -34,8 +34,13 @@ struct symlink_reparse_struct {
};
bool symlink_reparse_buffer_marshall(
- const char *substitute, const char *printname, uint32_t flags,
- TALLOC_CTX *mem_ctx, uint8_t **pdst, size_t *pdstlen);
+ const char *substitute,
+ const char *printname,
+ uint16_t unparsed_path_length,
+ uint32_t flags,
+ TALLOC_CTX *mem_ctx,
+ uint8_t **pdst,
+ size_t *pdstlen);
struct symlink_reparse_struct *symlink_reparse_buffer_parse(
TALLOC_CTX *mem_ctx, const uint8_t *src, size_t srclen);