NTFS vs. Samba

Pierre A. Humblet Pierre.Humblet@ieee.org
Sun Aug 29 15:21:00 GMT 2004


At 05:02 PM 8/29/2004 +0200, Corinna Vinschen wrote:
>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?

Yes. At work I believe I have a real remote NTFS, on which ordinary users
have no permission to change ACLs. Thus it's crucial to be able to allow
ntsec on the local machine but not on the remote machine.
Perhaps smbntsec could take 3 values: off, on everywhere, on on real NTFS.

Pierre

 



More information about the Cygwin-developers mailing list