* fhandler.cc (fhandler_base::open): Always open NFS files with

FILE_READ_EA, even when opening with O_WRONLY to allow fstat.
	* fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): Call
	FlushFileBuffers if file has been opened for writing.  Explain why.
	(fhandler_base::fstat_by_handle): Renew content of pc.fnoi if called
	via fstat.  Explain why.  Fix formatting.
	* path.cc (symlink_info::check): Try to open file the second time with
	FILE_READ_EA permissions since it's needed in later calls to
	fhandler_base::fstat_by_nfs_ea.
This commit is contained in:
Corinna Vinschen
2010-09-21 16:07:20 +00:00
parent 6fb0ddfe34
commit 7ba1698ed9
4 changed files with 52 additions and 11 deletions

View File

@@ -2296,10 +2296,11 @@ restart:
FILE_OPEN_REPARSE_POINT
| FILE_OPEN_FOR_BACKUP_INTENT,
eabuf, easize);
if (status == STATUS_ACCESS_DENIED)
if (status == STATUS_ACCESS_DENIED && eabuf)
{
status = NtCreateFile (&h, access = MIN_STAT_ACCESS, &attr, &io,
NULL, 0, FILE_SHARE_VALID_FLAGS, FILE_OPEN,
status = NtCreateFile (&h, access = MIN_STAT_ACCESS | FILE_READ_EA,
&attr, &io, NULL, 0, FILE_SHARE_VALID_FLAGS,
FILE_OPEN,
FILE_OPEN_REPARSE_POINT
| FILE_OPEN_FOR_BACKUP_INTENT,
eabuf, easize);