libsmbclient issue while accessing AD shares with DFS replication

Dhivya Sundhari SDhivya at novell.com
Mon Aug 26 07:25:57 MDT 2013


Hi, 


We are using libsmbclient apis to talk to AD share. 


It works perfectly fine with DFS.. But in case of DFS replication, we are facing issues.. 


Here is what we do 
>> 
file = smbc_getFunctionOpen(c)(c, smb_path, O_RDWR|O_TRUNC, 0666); 
.. 
.. 
if((smbc_getFunctionFstat(c)(c, file, pSt)) < 0) 
.. 
.. 
while(//chunk by chunk)  
writtenLen = smbc_getFunctionWrite(c)(c, file, writebuf, len); 
>> 


Our understanding is, trans2_reqeust Get_Dfs_referral is made for each of the smbclient apis. 
AD returns referrals in different order for subsequent calls and the request ends up on to a different member server. 
And so in the above case smbc_write fails with EBADF (errno 9) 


cli_resolve_path always calls cli_dfs_get_referral and is taking the first referral from the responded referral list.. 


Is there any control over the referrals? We basically want every call to stick to one server always (untill the server is active).. 

Thanks in advance for the help.. 

Thanks, 
Dhivya 


More information about the samba-technical mailing list