smbd: base POSIX semantics in call_trans2findfirst() on req->posix_pathnames
authorRalph Boehme <slow@samba.org>
Thu, 15 Oct 2020 08:27:23 +0000 (10:27 +0200)
committerRalph Boehme <slow@samba.org>
Fri, 23 Oct 2020 07:56:33 +0000 (07:56 +0000)
This will require a SMB1 client to enable SMB1 POSIX extensions, just sending
POSIX info-level requests without first enabling them won't cut it.

As discussed with Jeremy, SMB1 POSIX extensions is a global thing and the client
that wants to use it is expected to enable them explicitly before making use of
POSIX info-levels.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/trans2.c

index dcf50375d2c674d69bfe65701309298c62721a4d..c39d21da909d06c11de8eeedb87925f7284f4491 100644 (file)
@@ -2784,19 +2784,22 @@ close_if_end = %d requires_resume_key = %d backup_priv = %d level = 0x%x, max_da
                        break;
                case SMB_FIND_FILE_UNIX:
                case SMB_FIND_FILE_UNIX_INFO2:
-                       /* Always use filesystem for UNIX mtime query. */
-                       ask_sharemode = false;
                        if (!lp_unix_extensions()) {
                                reply_nterror(req, NT_STATUS_INVALID_LEVEL);
                                goto out;
                        }
-                       ucf_flags |= UCF_UNIX_NAME_LOOKUP;
                        break;
                default:
                        reply_nterror(req, NT_STATUS_INVALID_LEVEL);
                        goto out;
        }
 
+       if (req->posix_pathnames) {
+               /* Always use filesystem for UNIX mtime query. */
+               ask_sharemode = false;
+               ucf_flags |= UCF_UNIX_NAME_LOOKUP;
+       }
+
        if (req->posix_pathnames) {
                srvstr_get_path_posix(talloc_tos(),
                                params,