From nobody@FreeBSD.org  Tue Jun 19 09:30:17 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 59B0116A46C
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 19 Jun 2007 09:30:17 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 4CD6313C4C2
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 19 Jun 2007 09:30:17 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l5J9UH4N044215
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 19 Jun 2007 09:30:17 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l5J9UGAj044214;
	Tue, 19 Jun 2007 09:30:16 GMT
	(envelope-from nobody)
Message-Id: <200706190930.l5J9UGAj044214@www.freebsd.org>
Date: Tue, 19 Jun 2007 09:30:16 GMT
From: Julian Noble <julian@precisium.com.au>
To: freebsd-gnats-submit@FreeBSD.org
Subject: smbfs does not properly implement DFS referrals
X-Send-Pr-Version: www-3.0

>Number:         113852
>Category:       kern
>Synopsis:       [smbfs] smbfs does not properly implement DFS referrals
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-fs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 19 09:40:00 GMT 2007
>Closed-Date:    
>Last-Modified:  Mon May 18 04:21:02 UTC 2009
>Originator:     Julian Noble
>Release:        6.2
>Organization:
Precisium
>Environment:
FreeBSD nplex.precisium.net 6.2-RELEASE-p2 FreeBSD 6.2-RELEASE-p2 #0: Sun Mar 11 05:11:37 UTC 2007     root@nplex.precisium.net:/usr/obj/usr/src/sys/SMP  i386

>Description:
It occurs when you have a Microsoft Distributed File System
Tree where the msdfs links are to subfolders of the destination share.

smbfs only properly follows 'simple' msdfs links e.g:
ln -s msdfs:resourceserver/shareA mystuff

In practice - dfs links are likely to point to folders below the share, eg:
ln -s msdfs:resourceserver/shareA/thestuff  mystuff

Such links are browseable by Microsoft clients but not by FreeBSD's smbfs (or pre samba 3.025 versions of smbclient)


>How-To-Repeat:
Create an msdfs link on a dfs server pointing to a folder below a share on some resource server.
e.g

relevant parts of dfsserver's smb.conf:
-------------------
[global]
netbios name = dfsserver
host msdfs = yes

[dfs]
path = /export/dfsroot
msdfs root = yes
-------------------

add DFS referral link on dfsserver:
-------------------
root# cd /export/dfsroot
root# ln -s msdfs:resourceserver/shareA/thestuff mystuff
-------------------


fstab e.g:
-------------------
//someuser@dfsserver/dfs /mount/mydfs smbfs rw,noauto-I=dfsserver,-T=2,-W=somedomain 0 0
-------------------

now try to access it:
-------------------
root# mount /mount/mydfs
root# cd /mount/mydfs; ls

(listing shows contents of the dfsserver's /export/dfsroot ok, including 'mystuff'. Standard subfolders can be browsed.)

root# cd mystuff
mystuff: No such file or directory.






>Fix:
samba 3.0.25a has updated DFS code that fixes this issue for the
'smbclient' utility.

smbclient used to have the same trouble as smbfs in following deep DFS
referrals so perhaps the updated smbclient code may be of some use in
updating smbfs.




>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-fs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon May 18 04:20:53 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=113852 
>Unformatted:
