delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/11/26/08:49:56

X-Spam-Check-By: sourceware.org
X-Authenticated: #449785
Date: Sat, 26 Nov 2005 14:49:38 +0100 (CET)
From: Martin Koeppe <mkoeppe AT gmx DOT de>
To: cygwin AT cygwin DOT com
Subject: faked inode numbers on network drives
Message-ID: <Pine.LNX.4.62.0511261420410.3810@vmdebian.local.koeppe-net.de>
MIME-Version: 1.0
X-Y-GMX-Trusted: 0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019