This is the mail archive of the
cygwin-developers@cygwin.com
mailing list for the Cygwin project.
NTFS vs. Samba
- From: Corinna Vinschen <vinschen at redhat dot com>
- To: cygwin-developers at cygwin dot com
- Date: Sun, 29 Aug 2004 17:02:46 +0200
- Subject: NTFS vs. Samba
- Reply-to: cygwin-developers at cygwin dot com
Hi,
looking into the differences which would allow to distinguish a real
NTFS from a faked Samba NTFS file system, I examined the return values
from GetVolumeInformation again.
I tested with Samba 2.2.8a, Samba 3.0.2, NTFS on NT4 and NTFS on XP.
The only differences between Samba and real NTFS are the state of the
FILE_UNICODE_ON_DISK and FILE_FILE_COMPRESSION flags. They are TRUE on
both NTFS and FALSE on both Samba FS.
In theory the FILE_FILE_COMPRESSION flag should be sufficient to determine
the NTFS-ness of the FS.
We have this code in path.cc:
/* 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);
has_acls ((flags () & FS_PERSISTENT_ACLS)
&& (allow_smbntsec || !is_remote_drive ()));
I would *love* to change this, so that allow_smbntsec only affects Samba,
but not real remote NTFS:
bool is_ntfs = !strcmp (fsname, "NTFS");
bool is_samba = is_ntfs && is_remote_drive ()
&& !(flags () & FILE_FILE_COMPRESSION);
has_ea ((is_ntfs && !is_samba) || !strcmp (fsname, "FAT"));
has_acls ((flags () & FS_PERSISTENT_ACLS)
&& (allow_smbntsec || !is_samba));
Any good reason not to do this?
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader mailto:cygwin@cygwin.com
Red Hat, Inc.