* 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:
@@ -501,16 +501,19 @@ fhandler_base::open (int flags, mode_t mode)
|
||||
break;
|
||||
}
|
||||
|
||||
if (query_open () && pc.fs_is_nfs ())
|
||||
if (pc.fs_is_nfs ())
|
||||
{
|
||||
/* Make sure we can read EAs of files on an NFS share. Also make
|
||||
sure that we're going to act on the file itself, even if it'a
|
||||
sure that we're going to act on the file itself, even if it's a
|
||||
a symlink. */
|
||||
access |= FILE_READ_EA;
|
||||
if (query_open () >= query_write_control)
|
||||
access |= FILE_WRITE_EA;
|
||||
plen = sizeof nfs_aol_ffei;
|
||||
p = (PFILE_FULL_EA_INFORMATION) &nfs_aol_ffei;
|
||||
if (query_open ())
|
||||
{
|
||||
if (query_open () >= query_write_control)
|
||||
access |= FILE_WRITE_EA;
|
||||
plen = sizeof nfs_aol_ffei;
|
||||
p = (PFILE_FULL_EA_INFORMATION) &nfs_aol_ffei;
|
||||
}
|
||||
}
|
||||
|
||||
if ((flags & O_TRUNC) && ((flags & O_ACCMODE) != O_RDONLY))
|
||||
|
Reference in New Issue
Block a user