  			break;
  		default:
  			reply_nterror(req, NT_STATUS_INVALID_LEVEL);
-@@ -5103,6 +5105,7 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
+@@ -2331,8 +2333,7 @@ close_if_end = %d requires_resume_key = %d level = 0x%x, max_data_bytes = %d\n",
+ 	ntstatus = filename_convert(ctx, conn,
+ 				    req->flags2 & FLAGS2_DFS_PATHNAMES,
+ 				    directory,
+-				    (UCF_SAVE_LCOMP |
+-					UCF_ALWAYS_ALLOW_WCARD_LCOMP),
++				    ucf_flags,
+ 				    &mask_contains_wcard,
+ 				    &smb_dname);
+ 	if (!NT_STATUS_IS_OK(ntstatus)) {
+@@ -5103,6 +5104,7 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
  	} else {
  		uint32_t name_hash;
  		char *fname = NULL;

 
 		/* qpathinfo */
 		if (total_params < 7) {
@@ -5114,9 +5117,16 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
 
 		DEBUG(3,("call_trans2qfilepathinfo: TRANSACT2_QPATHINFO: level = %d\n", info_level));
 

 /*
  * smb_filename
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index 25301e6..b2ed239 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -383,7 +383,7 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
 
 	if((!conn->case_sensitive || !(conn->fs_capabilities &
 				       FILE_CASE_SENSITIVE_SEARCH)) &&
-	    stat_cache_lookup(conn, &smb_fname->base_name, &dirpath, &start,
+	    stat_cache_lookup(conn, posix_pathnames, &smb_fname->base_name, &dirpath, &start,
 			      &smb_fname->st)) {
 		goto done;
 	}
@@ -977,26 +977,39 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
 }
 
