From: Volker Lendecke Date: Tue, 22 Nov 2022 15:00:53 +0000 (+0100) Subject: smbd: Allow POSIX getinfo levels for smb3 unix extensions X-Git-Tag: talloc-2.4.0~461 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=357bafe62584e2ca1bbf0dfaf6f949262daf59dc;p=thirdparty%2Fsamba.git smbd: Allow POSIX getinfo levels for smb3 unix extensions Signed-off-by: Volker Lendecke Reviewed-by: David Mulder Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Tue Nov 29 11:23:58 UTC 2022 on sn-devel-184 --- diff --git a/source3/smbd/smb2_trans2.c b/source3/smbd/smb2_trans2.c index e2724dc0e88..03222498a03 100644 --- a/source3/smbd/smb2_trans2.c +++ b/source3/smbd/smb2_trans2.c @@ -3563,10 +3563,21 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn, size_t len = 0; if (INFO_LEVEL_IS_UNIX(info_level)) { - if (!lp_smb1_unix_extensions()) { - return NT_STATUS_INVALID_LEVEL; + bool ok = false; + + if (lp_smb1_unix_extensions() && req->posix_pathnames) { + DBG_DEBUG("SMB1 unix extensions activated\n"); + ok = true; } - if (!req->posix_pathnames) { + + if (lp_smb3_unix_extensions() && + (fsp != NULL) && + (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN)) { + DBG_DEBUG("SMB2 posix open\n"); + ok = true; + } + + if (!ok) { return NT_STATUS_INVALID_LEVEL; } }