* fhandler_disk_file.cc (path_conv::isgood_inode): Rearrange, take
Samba versions >= 3.5.4 into account, add comments.
This commit is contained in:
parent
bb39d14401
commit
ece05938f2
|
@ -1,3 +1,8 @@
|
||||||
|
2012-05-21 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* fhandler_disk_file.cc (path_conv::isgood_inode): Rearrange, take
|
||||||
|
Samba versions >= 3.5.4 into account, add comments.
|
||||||
|
|
||||||
2012-05-16 Christopher Faylor <me.cygwin2012@cgf.cx>
|
2012-05-16 Christopher Faylor <me.cygwin2012@cgf.cx>
|
||||||
|
|
||||||
* DevNotes: Add entry cgf-000009.
|
* DevNotes: Add entry cgf-000009.
|
||||||
|
|
|
@ -154,11 +154,26 @@ public:
|
||||||
inline bool
|
inline bool
|
||||||
path_conv::isgood_inode (__ino64_t ino) const
|
path_conv::isgood_inode (__ino64_t ino) const
|
||||||
{
|
{
|
||||||
/* We can't trust remote inode numbers of only 32 bit. That means,
|
/* If the FS doesn't support nonambiguous inode numbers anyway, bail out
|
||||||
remote NT4 NTFS, as well as shares of Samba version < 3.0.
|
immediately. */
|
||||||
The known exception are SFU NFS shares, which return the valid 32 bit
|
if (!hasgood_inode ())
|
||||||
inode number from the remote file system unchanged. */
|
return false;
|
||||||
return hasgood_inode () && (ino > UINT32_MAX || !isremote () || fs_is_nfs ());
|
/* If the inode numbers are 64 bit numbers or if it's a local FS, they
|
||||||
|
are to be trusted. */
|
||||||
|
if (ino > UINT32_MAX || !isremote ())
|
||||||
|
return true;
|
||||||
|
/* The inode numbers returned from a remote NT4 NTFS are ephemeral
|
||||||
|
32 bit numbers. */
|
||||||
|
if (fs_is_ntfs ())
|
||||||
|
return false;
|
||||||
|
/* Starting with version 3.5.4, Samba returns the real inode numbers, if
|
||||||
|
the file is on the same device as the root of the share (Samba function
|
||||||
|
get_FileIndex). 32 bit inode numbers returned by older versions (likely
|
||||||
|
< 3.0) are ephemeral. */
|
||||||
|
if (fs_is_samba () && fs.samba_version () < 0x03050400)
|
||||||
|
return false;
|
||||||
|
/* Otherwise, trust the inode numbers unless proved otherwise. */
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check reparse point for type. IO_REPARSE_TAG_MOUNT_POINT types are
|
/* Check reparse point for type. IO_REPARSE_TAG_MOUNT_POINT types are
|
||||||
|
|
Loading…
Reference in New Issue