Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/fhandler/disk_file.cc18
-rw-r--r--winsup/cygwin/path.cc12
2 files changed, 26 insertions, 4 deletions
diff --git a/winsup/cygwin/fhandler/disk_file.cc b/winsup/cygwin/fhandler/disk_file.cc
index 0242cae2f..245e9bb75 100644
--- a/winsup/cygwin/fhandler/disk_file.cc
+++ b/winsup/cygwin/fhandler/disk_file.cc
@@ -2348,9 +2348,11 @@ go_ahead:
And, since some filesystems choke on the EAs, we don't
use them unconditionally. */
f_status = (dir->__flags & dirent_nfs_d_ino)
- ? NtCreateFile (&hdl, READ_CONTROL, &attr, &io,
- NULL, 0, FILE_SHARE_VALID_FLAGS,
- FILE_OPEN, FILE_OPEN_FOR_BACKUP_INTENT,
+ ? NtCreateFile (&hdl,
+ READ_CONTROL | FILE_READ_ATTRIBUTES,
+ &attr, &io, NULL, 0,
+ FILE_SHARE_VALID_FLAGS, FILE_OPEN,
+ FILE_OPEN_FOR_BACKUP_INTENT,
&nfs_aol_ffei, sizeof nfs_aol_ffei)
: NtOpenFile (&hdl, READ_CONTROL, &attr, &io,
FILE_SHARE_VALID_FLAGS,
@@ -2364,6 +2366,16 @@ go_ahead:
FILE_INTERNAL_INFORMATION fii;
f_status = NtQueryInformationFile (hdl, &io, &fii, sizeof fii,
FileInternalInformation);
+ /* On NFS fetch the (faked, but useful) DOS attribute.
+ We need it to recognize shortcut FIFOs. */
+ if ((dir->__flags & dirent_nfs_d_ino))
+ {
+ FILE_BASIC_INFORMATION fbi;
+
+ if (NT_SUCCESS (NtQueryInformationFile (hdl, &io, &fbi,
+ sizeof fbi, FileBasicInformation)))
+ FileAttributes = fbi.FileAttributes;
+ }
NtClose (hdl);
if (NT_SUCCESS (f_status))
{
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 6cf6e02ca..0c9d3921a 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -2005,7 +2005,7 @@ symlink_worker (const char *oldpath, path_conv &win32_newpath, bool isdevice)
variable. Device files are always shortcuts. */
wsym_type = isdevice ? WSYM_lnk : allow_winsymlinks;
/* NFS has its own, dedicated way to create symlinks. */
- if (win32_newpath.fs_is_nfs ())
+ if (win32_newpath.fs_is_nfs () && !isdevice)
wsym_type = WSYM_nfs;
/* MVFS doesn't handle the SYSTEM DOS attribute, but it handles the R/O
attribute. Therefore we create symlinks on MVFS always as shortcuts. */
@@ -3477,6 +3477,16 @@ restart:
else if (contents[0] != ':' || contents[1] != '\\'
|| !parse_device (contents))
break;
+ if (fs.is_nfs () && major == _major (FH_FIFO))
+ {
+ conv_hdl.nfsattr ()->type = NF3FIFO;
+ conv_hdl.nfsattr ()->mode = mode;
+ conv_hdl.nfsattr ()->size = 0;
+ /* Marker for fhandler_base::fstat_by_nfs_ea not to override
+ the cached fattr3 data with fresh data from the filesystem,
+ even if the handle is used for other purposes than stat. */
+ conv_hdl.nfsattr ()->filler1 = NF3FIFO;
+ }
}
/* If searching for `foo' and then finding a `foo.lnk' which is