[PATCH 5/6] libcli/smb: Introduce smbXcli_conn_can_dfs

George K Colley gcolley at apple.com
Sat May 18 11:14:02 MDT 2013


I have been meaning to pass this info along to the Samba team for some time and keep forgetting. Your email thread refreshed my memory. Don't know if you know about it or not. Really helps the client with performance when looking for Dfs links:

From: David Kruse 

Yes, this behavior is consistent for Full, Both, FullId, or BothId query dir calls.  It will pack the reparse tag into the EaSize value if ATTRIBUTE_REPARSE_POINT is set.  I verified with local, and their also checking to make sure the behavior is covered in MS-FSA.   Hope it helps!
 
    //
    //  EAs and reparse points cannot both be in a file at the same
    //  time. We return different information for each case.
    //
 
    if (FlagOn( DupInfo->FileAttributes, FILE_ATTRIBUTE_REPARSE_POINT)) {
        FullDirInfo->EaSize = DupInfo->ReparsePointTag;
    } else {
        FullDirInfo->EaSize = DupInfo->PackedEaSize;
    }
 
 
From: David Kruse 
Sent: Monday, October 05, 2009 9:22 PM
To: George K Colley
Cc: James Peach
Subject: RE: Determining Reparse Points
 
Interesting.  I wasn't aware they'd overloaded the Reserved fields of the file info structure.  I'll check the FSA doc to see if they speak to it there.
 
Let me ping the local folks real quick to find out if this has always been there or if it was a recent change so you have insight into when it might not be present.
From: George K Colley
To: David Kruse
Cc: James Peach
Subject: Determining Reparse Points

We were looking "http://msdn.microsoft.com/en-us/library/aa365740(VS.85).aspx" notice the following:
 
dwReserved0
If the dwFileAttributes member includes the FILE_ATTRIBUTE_REPARSE_POINT attribute, this member specifies the reparse point tag.

Otherwise, this value is undefined and should not be used.

For more information see Reparse Point Tags.

Name
Value
IO_REPARSE_TAG_DFS
0x8000000A
IO_REPARSE_TAG_DFSR
0x80000012
IO_REPARSE_TAG_HSM
0xC0000004
IO_REPARSE_TAG_HSM2
0x80000006
IO_REPARSE_TAG_MOUNT_POINT
0xA0000003
IO_REPARSE_TAG_SIS
0x80000007
IO_REPARSE_TAG_SYMLINK
0xA000000C

 
Now I thought that was strange. So I did some tracing with my Windows 2003 server and saw something very strange. If I send a FindFirst  with a level of FileBothDirectoryInformation I notice the server sending back this information in the EA Size field. So the File Attributes field has it marked as a Reparse Point. Then I notice that the EA List Length has 0x8000000A set. So I know this item is a real Dfs link. Can I use this field to tell what type of Reparse Point the item contains?
 
George



On May 18, 2013, at 2:36 AM, Stefan (metze) Metzmacher <metze at samba.org> wrote:

> Hi Luk,
> 
>> Signed-off-by: Luk Claes <luk at debian.org>
>> ---
>> libcli/smb/smbXcli_base.c |    9 +++++++++
>> libcli/smb/smbXcli_base.h |    2 ++
>> 2 files changed, 11 insertions(+)
>> 
>> diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
>> index 3fe922a..6d7d866 100644
>> --- a/libcli/smb/smbXcli_base.c
>> +++ b/libcli/smb/smbXcli_base.c
>> @@ -2434,6 +2434,15 @@ bool smbXcli_conn_has_async_calls(struct smbXcli_conn *conn)
>> 		|| (talloc_array_length(conn->pending) != 0));
>> }
>> 
>> +bool smbXcli_conn_can_dfs(struct smbXcli_conn *conn)
> 
> Can you rename this to smbXcli_conn_dfs_supported()?
> 
> metze
> 



More information about the samba-technical mailing list