From 42b8a431f04afcd487d3c4c6280ccce06359b508 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Thu, 15 Oct 2020 10:27:23 +0200 Subject: [PATCH] smbd: base POSIX semantics in call_trans2findfirst() on req->posix_pathnames 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 Reviewed-by: Jeremy Allison --- source3/smbd/trans2.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index dcf50375d2c..c39d21da909 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -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,