]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Allow POSIX getinfo levels for smb3 unix extensions
authorVolker Lendecke <vl@samba.org>
Tue, 22 Nov 2022 15:00:53 +0000 (16:00 +0100)
committerVolker Lendecke <vl@samba.org>
Tue, 29 Nov 2022 11:23:58 +0000 (11:23 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Mulder <dmulder@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Nov 29 11:23:58 UTC 2022 on sn-devel-184

source3/smbd/smb2_trans2.c

index e2724dc0e88931b408d212ce9a431d8f9decca88..03222498a03df333f47ed7a1ccc2ed1987ffe90e 100644 (file)
@@ -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;
                }
        }