diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2010-09-21 20:07:20 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2010-09-21 20:07:20 +0400 |
commit | 7ba1698ed99abca171d2beb9091168e20cdd8b34 (patch) | |
tree | dac48a44f52a36f3dbeb973526857860b7138114 /winsup/cygwin/fhandler.cc | |
parent | 6fb0ddfe34df8360faf7bca096bdd45678d1c825 (diff) |
* 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.
Diffstat (limited to 'winsup/cygwin/fhandler.cc')
-rw-r--r-- | winsup/cygwin/fhandler.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 1998979f7..64451f672 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -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)) |