Bug 3645 - Dfs links with path following share not parsed correctly
Summary: Dfs links with path following share not parsed correctly
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: smbclient (show other bugs)
Version: 3.0.21c
Hardware: All All
: P3 normal
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
Depends on:
Reported: 2006-03-29 13:56 UTC by Joseph Jackson
Modified: 2007-03-10 14:41 UTC (History)
3 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Jackson 2006-03-29 13:56:25 UTC
The "smbclient" tool fails to follow MS Dfs links properly if those links refer to more than just a server and share. According to the MS docs on Dfs, links can include additional path components after the share. To verify that links can contain additional directory levels, look at the very last section of this document:
It shows the "dfscmd /map" command taking a second argument of the form:

As an example, we have a Dfs link in our environment that refers to:
The smbclient tool gets seriously confused by the last component.

I was able to create a patch against 3.0.12 that fixes the problem. (Contact me if it's of interest to you.) The source/libsmb/clidfs.c function split_dfs_path() needs to return not only server and share but also the optional path. If a non-null path is returned, cli_resolve_path() needs to copy it to the front of the current directory variable, targetpath.

I've verified that the bug still exists in 3.0.21c. I was unable to locate the equivalent functionality in the 4.0 sources in the time that I have available.

Joseph Jackson, Carnegie Mellon University.
Comment 1 Christian Peper 2006-06-07 06:26:03 UTC
This bug is related if not the same as bug report #3651
Comment 2 rajeev 2006-08-04 00:09:59 UTC

Can you check out this following thread and let me know if you can help by sharing your code plz ?


Comment 3 Andrew Ferguson 2006-08-26 15:15:10 UTC
Hi, I based a patch on the comments to this thread and attached it to bug 3651. 

Joseph, do you want to compare it to your own patch? I have no objection to retracting my patch so you can submit your's since obviously you created your patch months before mine. Cheers, Andrew
Comment 4 rajeev 2006-08-26 15:23:25 UTC
(In reply to comment #3)

Andrew - Thank you thank you. If this works, lemme buy you a beer. I have been knocking these doors for while now with no response from any one... I will try this pronto and will let you know.. 

Comment 5 Andrew Ferguson 2007-03-10 11:40:26 UTC
This bug should be closed since bug 3651 has also been fixed by check-in 21133.
Comment 6 Jeremy Allison 2007-03-10 14:41:06 UTC
Closed as per submitters request.