summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2006-04-26 16:51:09 +0000
committerCorinna Vinschen <corinna@vinschen.de>2006-04-26 16:51:09 +0000
commit330a2faed95927d539db8bae15748eb1e0e12a02 (patch)
tree3c343e2d30e9e0a53b2f4ec577355718fb3d0b0e /winsup/cygwin/path.cc
parent13ac451951ca86151fc13722216f386c8298c34b (diff)
downloadcygnal-330a2faed95927d539db8bae15748eb1e0e12a02.tar.gz
cygnal-330a2faed95927d539db8bae15748eb1e0e12a02.tar.bz2
cygnal-330a2faed95927d539db8bae15748eb1e0e12a02.zip
* fhandler.h (fhandler_base): Change fstat_helper prototype
to take file size and inode number as 64 bit values. * fhandler_disk_file.cc (FS_IS_SAMBA): Move to path.cc (FS_IS_SAMBA_WITH_QUOTA): Ditto. (path_conv::hasgood_inode): Delete. (path_conv::is_samba): Delete. (path_conv::isgood_inode): Centralized function to recognize a good inode number. (fhandler_base::fstat_by_handle): Constify fvi_size and fai_size. Accomodate argument change in fstat_helper. (fhandler_base::fstat_by_name): Ditto. (fhandler_base::fstat_helper): Accomodate argument change. Call path_conv::isgood_inode to recognize good inodes. (fhandler_disk_file::opendir): Explain Samba weirdness here. Call path_conv::fs_is_samba instead of path_conv::is_samba. (fhandler_disk_file::readdir): Add STATUS_INVALID_INFO_CLASS as valid return code from NtQueryDirectoryFile to indicate that FileIdBothDirectoryInformation is not supported. Call path_conv::isgood_inode to recognize good inodes. * ntdll.h (STATUS_INVALID_INFO_CLASS): Define. * path.cc (fs_info::update): Rework file system recognition and set appropriate flags. * path.h (struct fs_info): Add is_ntfs, is_samba and is_nfs flags. Constify pure read accessors.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc25
1 files changed, 18 insertions, 7 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 44ceb6c1c..a95d311e7 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -423,15 +423,26 @@ fs_info::update (const char *win32_path)
return false;
}
- /* FIXME: Samba by default returns "NTFS" in file system name, but
- * doesn't support Extended Attributes. If there's some fast way to
- * distinguish between samba and real ntfs, it should be implemented
- * here.
- */
- has_ea (!is_remote_drive () && strcmp (fsname, "NTFS") == 0);
+#define FS_IS_SAMBA (FILE_CASE_SENSITIVE_SEARCH \
+ | FILE_CASE_PRESERVED_NAMES \
+ | FILE_PERSISTENT_ACLS)
+#define FS_IS_SAMBA_WITH_QUOTA \
+ (FILE_CASE_SENSITIVE_SEARCH \
+ | FILE_CASE_PRESERVED_NAMES \
+ | FILE_PERSISTENT_ACLS \
+ | FILE_VOLUME_QUOTAS)
+ is_fat (strncasematch (fsname, "FAT", 3));
+ is_samba (strcmp (fsname, "NTFS") == 0 && is_remote_drive ()
+ && (flags () == FS_IS_SAMBA || flags () == FS_IS_SAMBA_WITH_QUOTA));
+ is_ntfs (strcmp (fsname, "NTFS") == 0 && !is_samba ());
+ is_nfs (strcmp (fsname, "NFS") == 0);
+
+ has_ea (is_ntfs ());
has_acls ((flags () & FS_PERSISTENT_ACLS)
&& (allow_smbntsec || !is_remote_drive ()));
- is_fat (strncasematch (fsname, "FAT", 3));
+ hasgood_inode (((flags () & FILE_PERSISTENT_ACLS)
+ && drive_type () != DRIVE_UNKNOWN)
+ || is_nfs ());
/* Known file systems with buggy open calls. Further explanation
in fhandler.cc (fhandler_disk_file::open). */
has_buggy_open (!strcmp (fsname, "SUNWNFS"));