From 51551e0d53fa6abf2c7036ec8a8758f68249b5da Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 24 Feb 2020 09:42:46 -0800 Subject: [PATCH] libsmb: Pass the correct path to cli_posix_stat() This fixes doing strlen() on talloc_tos(), about which valgrind is pretty unhappy. Without this patch we survive the tests because we have fallbacks to the non-posix flavors of stat(). With this patch in place cli_posix_stat() becomes functional in this code path. This creates conflicts with the readdir libsmbclient tests, which need fixing separately. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14101 Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- selftest/knownfail.d/libsmbclient | 2 ++ source3/libsmb/libsmb_file.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 selftest/knownfail.d/libsmbclient diff --git a/selftest/knownfail.d/libsmbclient b/selftest/knownfail.d/libsmbclient new file mode 100644 index 00000000000..dddd6d24920 --- /dev/null +++ b/selftest/knownfail.d/libsmbclient @@ -0,0 +1,2 @@ +samba4.libsmbclient.readdirplus2.NT1.readdirplus2.* +samba4.libsmbclient.readdirplus_seek.NT1.readdirplus_seek.* diff --git a/source3/libsmb/libsmb_file.c b/source3/libsmb/libsmb_file.c index 852c3952e1b..50b8f33788a 100644 --- a/source3/libsmb/libsmb_file.c +++ b/source3/libsmb/libsmb_file.c @@ -503,7 +503,7 @@ SMBC_getatr(SMBCCTX * context, if (srv->try_posixinfo) { SMB_STRUCT_STAT sbuf; - status = cli_posix_stat(targetcli, frame, &sbuf); + status = cli_posix_stat(targetcli, targetpath, &sbuf); if (NT_STATUS_IS_OK(status)) { setup_stat_from_stat_ex(&sbuf, path, sb); -- 2.47.2