faked inode numbers on network drives
Martin Koeppe
mkoeppe@gmx.de
Sat Nov 26 18:03:00 GMT 2005
Hello,
while using cygwin and interix/sfu in parallel, I noticed a
"misfeature" in cygwin: inode numbers for files on network shares
aren't shown correctly.
I have a win2003 server with interix and created some hard linked
files. Then I shared these to a win2000 client with both interix and
cygwin installed.
(All 3 files are hardlinked to the same inode number.)
On Windows 2000 within interix/sfu:
C:\>net use T: \\win2003\tmp
C:\>T:
T:\>ls -lin file* <---- from Interix
60977 -rwx------+ 1 131616 1049089 12 May 28 21:58 file1
60977 -rwx------+ 1 131616 1049089 12 May 28 21:58 file2
60977 -rwx------+ 1 131616 1049089 12 May 28 21:58 file3
While the inode number is correct, the link count isn't within
interix, but that's another issue.
Within Cygwin:
$ ls -lin file*
12771340543265474077 -rw-r--r-- 3 400 401 12 May 28 21:58 file1
12771340543265474078 -rw-r--r-- 3 400 401 12 May 28 21:58 file2
12771340543265474079 -rw-r--r-- 3 400 401 12 May 28 21:58 file3
Here the link count is ok, but inode numbers are unnecessarily
faked and therefore are different when they should not.
I looked into the function
cygwin-1.5.18-1/winsup/cygwin/fhandler_disk_file.cc:275
fhandler_base::fstat_helper
There is the following assumption:
/* Assume that if a drive has ACL support it MAY have valid "inodes".
It definitely does not have valid inodes if it does not have ACL
support. */
I think this assumption is wrong. Imagine a samba share without acl
support. It nevertheless has valid inode numbers.
Furthermore, in the following switch() statement, inode numbers on
network drives are always ignored.
And I ask why such an assumption is necessary at all.
In the Windows API there is a function GetVolumeInformation
which is supported from Win95 on and reports FILE_SUPPORTS_OBJECT_IDS
when inode numbers are valid.
Is there a reason for not using this? GetVolumeInformation is already
used in several other places within cygwin.
Please CC me, I'm not on the list.
Martin
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list