From 10527a360abeb6599befc744204014aa7398e22a Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Sun, 11 Sep 2016 15:35:37 +0200 Subject: [PATCH] s3/smbd: in call_trans2qfilepathinfo call lstat when dealing with posix pathnames This might be an info level SMB_INFO_QUERY_ALL_EAS which is not covered by INFO_LEVEL_IS_UNIX(). If smb_fname is a symlink we would then stat it in POSIX context. Bug: https://bugzilla.samba.org/show_bug.cgi?id=12256 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison (cherry picked from commit b13b3c11054f918f18841186a6efc5dedd2ffd66) --- source3/smbd/trans2.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 1775316..a01bb81 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -5767,7 +5767,8 @@ static void call_trans2qfilepathinfo(connection_struct *conn, } if (info_level == SMB_QUERY_FILE_UNIX_BASIC || info_level == SMB_QUERY_FILE_UNIX_INFO2 || - info_level == SMB_QUERY_FILE_UNIX_LINK) { + info_level == SMB_QUERY_FILE_UNIX_LINK || + req->posix_pathnames) { ucf_flags |= UCF_UNIX_NAME_LOOKUP; } } @@ -5831,7 +5832,7 @@ static void call_trans2qfilepathinfo(connection_struct *conn, return; } - if (INFO_LEVEL_IS_UNIX(info_level)) { + if (INFO_LEVEL_IS_UNIX(info_level) || req->posix_pathnames) { /* Always do lstat for UNIX calls. */ if (SMB_VFS_LSTAT(conn, smb_fname_base) != 0) { DEBUG(3,("call_trans2qfilepathinfo: " @@ -5877,7 +5878,7 @@ static void call_trans2qfilepathinfo(connection_struct *conn, } } - if (INFO_LEVEL_IS_UNIX(info_level)) { + if (INFO_LEVEL_IS_UNIX(info_level) || req->posix_pathnames) { /* Always do lstat for UNIX calls. */ if (SMB_VFS_LSTAT(conn, smb_fname)) { DEBUG(3,("call_trans2qfilepathinfo: " -- 2.7.4