* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Fetch number
of links and inode number only if path has good inodes. (fhandler_base::fstat_by_name): Fetch inode number only if path has good inodes.
This commit is contained in:
		
							parent
							
								
									f859880a5b
								
							
						
					
					
						commit
						421ff3ff77
					
				|  | @ -1,3 +1,10 @@ | ||||||
|  | 2010-09-15  Corinna Vinschen  <corinna@vinschen.de> | ||||||
|  | 
 | ||||||
|  | 	* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Fetch number | ||||||
|  | 	of links and inode number only if path has good inodes. | ||||||
|  | 	(fhandler_base::fstat_by_name): Fetch inode number only if path has | ||||||
|  | 	good inodes. | ||||||
|  | 
 | ||||||
| 2010-09-14  Corinna Vinschen  <corinna@vinschen.de> | 2010-09-14  Corinna Vinschen  <corinna@vinschen.de> | ||||||
| 
 | 
 | ||||||
| 	* path.cc (symlink_info::check): Make sure AllocationSize and EndOfFile | 	* path.cc (symlink_info::check): Make sure AllocationSize and EndOfFile | ||||||
|  |  | ||||||
|  | @ -356,25 +356,30 @@ fhandler_base::fstat_by_handle (struct __stat64 *buf) | ||||||
|   NTSTATUS status = 0; |   NTSTATUS status = 0; | ||||||
|   IO_STATUS_BLOCK io; |   IO_STATUS_BLOCK io; | ||||||
| 
 | 
 | ||||||
|   status = NtQueryInformationFile (h, &io, &fsi, sizeof fsi, |   if (!pc.hasgood_inode ()) | ||||||
| 				   FileStandardInformation); |     fsi.NumberOfLinks = 1; | ||||||
|   if (!NT_SUCCESS (status)) |   else | ||||||
|     { |     { | ||||||
|       debug_printf ("%p = NtQueryInformationFile(%S, FileStandardInformation)", |       status = NtQueryInformationFile (h, &io, &fsi, sizeof fsi, | ||||||
| 		    status, pc.get_nt_native_path ()); | 				       FileStandardInformation); | ||||||
|       return -1; |  | ||||||
|     } |  | ||||||
|   if (!ino && pc.hasgood_inode ()) |  | ||||||
|     { |  | ||||||
|       status = NtQueryInformationFile (h, &io, &fii, sizeof fii, |  | ||||||
| 				       FileInternalInformation); |  | ||||||
|       if (!NT_SUCCESS (status)) |       if (!NT_SUCCESS (status)) | ||||||
| 	{ | 	{ | ||||||
| 	  debug_printf ("%p = NtQueryInformationFile(%S, FileInternalInformation)", | 	  debug_printf ("%p = NtQueryInformationFile(%S, FileStandardInformation)", | ||||||
| 			status, pc.get_nt_native_path ()); | 			status, pc.get_nt_native_path ()); | ||||||
| 	  return -1; | 	  return -1; | ||||||
| 	} | 	} | ||||||
|       ino = fii.FileId.QuadPart; |       if (!ino) | ||||||
|  | 	{ | ||||||
|  | 	  status = NtQueryInformationFile (h, &io, &fii, sizeof fii, | ||||||
|  | 					   FileInternalInformation); | ||||||
|  | 	  if (!NT_SUCCESS (status)) | ||||||
|  | 	    { | ||||||
|  | 	      debug_printf ("%p = NtQueryInformationFile(%S, FileInternalInformation)", | ||||||
|  | 			    status, pc.get_nt_native_path ()); | ||||||
|  | 	      return -1; | ||||||
|  | 	    } | ||||||
|  | 	  ino = fii.FileId.QuadPart; | ||||||
|  | 	} | ||||||
|     } |     } | ||||||
|   return fstat_helper (buf, fsi.NumberOfLinks); |   return fstat_helper (buf, fsi.NumberOfLinks); | ||||||
| } | } | ||||||
|  | @ -393,7 +398,8 @@ fhandler_base::fstat_by_name (struct __stat64 *buf) | ||||||
|     WCHAR buf[NAME_MAX + 1]; |     WCHAR buf[NAME_MAX + 1]; | ||||||
|   } fdi_buf; |   } fdi_buf; | ||||||
| 
 | 
 | ||||||
|   if (!ino && wincap.has_fileid_dirinfo () && !pc.has_buggy_fileid_dirinfo ()) |   if (!ino && pc.hasgood_inode () | ||||||
|  |       && wincap.has_fileid_dirinfo () && !pc.has_buggy_fileid_dirinfo ()) | ||||||
|     { |     { | ||||||
|       RtlSplitUnicodePath (pc.get_nt_native_path (), &dirname, &basename); |       RtlSplitUnicodePath (pc.get_nt_native_path (), &dirname, &basename); | ||||||
|       InitializeObjectAttributes (&attr, &dirname, pc.objcaseinsensitive (), |       InitializeObjectAttributes (&attr, &dirname, pc.objcaseinsensitive (), | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue