s3/smbd: in call_trans2qfilepathinfo call lstat when dealing with posix pathnames
authorRalph Boehme <slow@samba.org>
Sun, 11 Sep 2016 13:35:37 +0000 (15:35 +0200)
committerJeremy Allison <jra@samba.org>
Sun, 11 Sep 2016 17:57:26 +0000 (19:57 +0200)
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.

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

index 1775316330e2a45a07b5bf891d21a66a67dd672c..a01bb81d2ba1e0851d86b31176f1c123f5df2346 100644 (file)
@@ -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: "