libsmbclient issue while accessing AD shares with DFS replication

Jeremy Allison jra at samba.org
Wed Aug 28 11:55:55 MDT 2013


On Mon, Aug 26, 2013 at 07:25:57AM -0600, Dhivya Sundhari wrote:
> 
> 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).. 

No, there currently isn't any control over the referrals.

If you'd like to propose an API to add that control I'd
be very happy to give it serious consideration to add
into the code.

Thanks !

Jeremy.


More information about the samba-technical mailing list