summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_disk_file.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2006-03-31 20:07:13 +0000
committerCorinna Vinschen <corinna@vinschen.de>2006-03-31 20:07:13 +0000
commitb7b1c2d787cc76c6db285e18aea4c4f07a21059d (patch)
tree05642afc1b21b9dd017733c63262388e4138650d /winsup/cygwin/fhandler_disk_file.cc
parentab4a589f9074af87e2c7dfbd08afb621eba2c7da (diff)
downloadcygnal-b7b1c2d787cc76c6db285e18aea4c4f07a21059d.tar.gz
cygnal-b7b1c2d787cc76c6db285e18aea4c4f07a21059d.tar.bz2
cygnal-b7b1c2d787cc76c6db285e18aea4c4f07a21059d.zip
* fhandler_disk_file.cc (FS_IS_SAMBA_WITH_QUOTA): New define.
(path_conv::hasgood_inode): Recognize Samba with quota support compiled in. (path_conv::is_samba): Ditto. Fix comment to include Samba version numbers for later reference.
Diffstat (limited to 'winsup/cygwin/fhandler_disk_file.cc')
-rw-r--r--winsup/cygwin/fhandler_disk_file.cc20
1 files changed, 15 insertions, 5 deletions
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
index 0c1ed37ab..5fc20d37c 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -200,6 +200,12 @@ path_conv::ndisk_links (DWORD nNumberOfLinks)
| 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)
+
bool
path_conv::hasgood_inode ()
{
@@ -223,7 +229,8 @@ path_conv::hasgood_inode ()
testing for the flag values returned by a 3.x Samba explicitely
for now. But note the comment in the below "is_samba" function. */
if (!(fs_flags () & FILE_SUPPORTS_OBJECT_IDS)
- && fs_flags () != FS_IS_SAMBA)
+ && fs_flags () != FS_IS_SAMBA
+ && fs_flags () != FS_IS_SAMBA_WITH_QUOTA)
return false;
}
return true;
@@ -232,9 +239,10 @@ path_conv::hasgood_inode ()
bool
path_conv::is_samba ()
{
- /* Something weird happens on Samba. FileIdBothDirectoryInformation
- seems to work nicely, but only up to the 128th entry in the
- directory. After reaching this entry, the next call to
+ /* Something weird happens on Samba up to version 3.0.21c, which is
+ fixed in 3.0.22. FileIdBothDirectoryInformation seems to work
+ nicely, but only up to the 128th entry in the directory. After
+ reaching this entry, the next call to
NtQueryDirectoryFile(FileIdBothDirectoryInformation) returns
STATUS_INVAILD_LEVEL. Why should we care, we can just switch to
FileBothDirectoryInformation, isn't it? Nope! The next call to
@@ -245,7 +253,9 @@ path_conv::is_samba ()
can read the whole directory unmolested. So we have to excempt
Samba from the usage of FileIdBothDirectoryInformation entirely,
even though Samba returns valid File IDs. */
- return drive_type () == DRIVE_REMOTE && fs_flags () == FS_IS_SAMBA;
+ return drive_type () == DRIVE_REMOTE
+ && (fs_flags () == FS_IS_SAMBA
+ || fs_flags () == FS_IS_SAMBA_WITH_QUOTA);
}
int __stdcall