From: Volker Lendecke Date: Wed, 30 Aug 2023 07:22:13 +0000 (+0200) Subject: libsmb: Fix parsing symlink reparse points X-Git-Tag: tevent-0.16.0~698 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebb6eb9c2fcab06eadea21cecb7258c326042fac;p=thirdparty%2Fsamba.git libsmb: Fix parsing symlink reparse points Untested code is broken code. For symlinks we need to hand over the full reparse buffer into symlink_reparse_buffer_parse(), as this is also used for the smb2 error response handling. For that, the "reserved" field in [MS-FSCC] 2.1.2.4 Symbolic Link Reparse Data Buffer is used for the "unparsed" field. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Fri Sep 8 17:24:19 UTC 2023 on atb-devel-224 --- diff --git a/libcli/smb/reparse.c b/libcli/smb/reparse.c index 61b893123a4..1c4ad444bfc 100644 --- a/libcli/smb/reparse.c +++ b/libcli/smb/reparse.c @@ -230,8 +230,8 @@ NTSTATUS reparse_data_buffer_parse(TALLOC_CTX *mem_ctx, case IO_REPARSE_TAG_SYMLINK: ret = symlink_reparse_buffer_parse(mem_ctx, &dst->parsed.lnk, - reparse_data, - reparse_data_length); + buf, + buflen); if (ret != 0) { return map_nt_error_from_unix_common(ret); } diff --git a/selftest/knownfail.d/symlink b/selftest/knownfail.d/symlink index ade7b9e70c6..64135666aec 100644 --- a/selftest/knownfail.d/symlink +++ b/selftest/knownfail.d/symlink @@ -2,4 +2,3 @@ ^samba.tests.smb2symlink.samba.tests.smb2symlink.Smb2SymlinkTests.test_symlinkerror_file ^samba.tests.smb2symlink.samba.tests.smb2symlink.Smb2SymlinkTests.test_symlinkerror_absolute_outside_share ^samba.tests.smb2symlink.samba.tests.smb2symlink.Smb2SymlinkTests.test_symlinkerror_absolute_inshare -^samba.tests.smb2symlink.samba.tests.smb2symlink.Smb2SymlinkTests.test_symlink_reparse_data_buffer_parse