Bug 4777 - msdfs support fails to support a dir of "deep" paths
msdfs support fails to support a dir of "deep" paths
Status: RESOLVED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: File Services
3.0.25b
Other Windows XP
: P3 normal
: none
Assigned To: Jeremy Allison
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-07-11 09:53 UTC by Bill Marshall
Modified: 2007-07-22 12:07 UTC (History)
2 users (show)

See Also:


Attachments
trace of failed connect (6.78 KB, application/octet-stream)
2007-07-11 09:54 UTC, Bill Marshall
no flags Details
Patch (439 bytes, patch)
2007-07-11 15:57 UTC, Jeremy Allison
no flags Details
Patch for 3.0.25c (595 bytes, patch)
2007-07-11 18:38 UTC, Jeremy Allison
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bill Marshall 2007-07-11 09:53:05 UTC
Long ago, msdfs support in the server was busted. See http://lists.samba.org/archive/samba-technical/2002-August/023584.html

Something very similar is going on again.

Basically you can't dir a "long path" and have it work unless you've already cached/connected farther up in the tree.

Dir will fail.
C:\>dir   \\rchs4bld\home\wrm3\test\a\b\c
The system cannot find the path specified.

Connect up "high"
C:\>dir   \\rchs4bld\home\wrm3\test
 Volume in drive \\rchs4bld\home is home
 Volume Serial Number is 248C-022A

 Directory of \\rchs4bld\home\wrm3\test

07/11/2007  09:31 AM    <DIR>          .
07/11/2007  09:31 AM    <DIR>          ..
07/11/2007  09:31 AM    <DIR>          a
               0 File(s)              0 bytes
               3 Dir(s)  25,845,100,544 bytes free

Dir now works.
C:\>dir   \\rchs4bld\home\wrm3\test\a\b\c
 Volume in drive \\rchs4bld\home is home
 Volume Serial Number is 248C-022A

 Directory of \\rchs4bld\home\wrm3\test\a\b\c

07/11/2007  09:31 AM    <DIR>          .
07/11/2007  09:31 AM    <DIR>          ..
07/11/2007  09:31 AM                 0 testfile
               1 File(s)              0 bytes
               2 Dir(s)  25,845,100,544 bytes free

I'll attach a trace.
Comment 1 Bill Marshall 2007-07-11 09:54:51 UTC
Created attachment 2806 [details]
trace of failed connect

Here's a wireshark trace
Comment 2 Jeremy Allison 2007-07-11 14:20:30 UTC
Can't reproduce this accessing a local path. I need more data on how you have set this up and what you're trying to do.
Jeremy.
Comment 3 Bill Marshall 2007-07-11 14:44:57 UTC
Details on the dfs setup.
In the global we have
host msdfs = yes

[home]
        path = /home/dfshome
        comment = All home directories
        msdfs root = yes
        read only = yes
        public = yes

# ls -l /home/dfshome/wrm3
lrwxrwxrwx  1 root root 35 Jul 10 14:40 /home/dfshome/wrm3 -> msdfs:server2.xxx.yyy.com\wrm3

Then on server2 we have:
# ls   /home/DOMAIN/wrm3/test/a/b/c/testfile
/home/DOMAIN/wrm3/test/a/b/c/testfile

So in your example,  dir \\samba1\locktest\a\deep\dir\tree\a\b\c
the 1st "a" directory should be a dfs link. I tested dfs linking to the same and to another server. Fails both times.

When the dfs link points to the same server, you get a slightly different error.
>dir \\rchs4bld\home\wrm3\x\y\z
Access is denied.
Comment 4 Jeremy Allison 2007-07-11 15:57:30 UTC
Created attachment 2807 [details]
Patch

Patch that will be in 3.0.25c. Sorry for this bug. This was tested, but not via direct deep links (this wouldn't occur when browsing through the link).
Jeremy.
Comment 5 Bill Marshall 2007-07-11 17:27:02 UTC
I'm confused. The initial case where the samba dfs server hands off to another server is ok now, but when I have the dfs server pointing back to itself (not sure if this is relevant) it fails.

But I'm just hitting the up arrow, so I can't be messing up the path any.

>dfsutil.exe  /PKTflush

Microsoft(R) Windows(TM) Dfs Utility Version 4.2
Copyright (C) Microsoft Corporation 1991-2005. All Rights Reserved.


DfsUtil command completed successfully.

C:\>dir  \\rchs4bld\home\wrm3\x\y\z
Access is denied.

C:\>dir  \\rchs4bld\home\wrm3
 Volume in drive \\rchs4bld\home is home
 Volume Serial Number is 248C-022A

 Directory of \\rchs4bld\home\wrm3

07/11/2007  02:29 PM    <DIR>          .
07/11/2007  02:29 PM    <DIR>          ..
07/11/2007  02:29 PM    <DIR>          x
               0 File(s)              0 bytes
               3 Dir(s)  1,020,599,885,824 bytes free

C:\>dir  \\rchs4bld\home\wrm3\x\y\z
 Volume in drive \\rchs4bld\home is home
 Volume Serial Number is 248C-022A

 Directory of \\rchs4bld\home\wrm3\x\y\z

07/11/2007  02:29 PM    <DIR>          .
07/11/2007  02:29 PM    <DIR>          ..
07/11/2007  02:29 PM                 0 testfile
               1 File(s)              0 bytes
               2 Dir(s)  1,020,599,885,824 bytes free

Log file:
[2007/07/11 17:23:16, 3] smbd/trans2.c:call_trans2qfilepathinfo(3252)
  call_trans2qfilepathinfo: TRANSACT2_QPATHINFO: level = 1004
[2007/07/11 17:23:16, 10] smbd/msdfs.c:parse_dfs_path(84)
  parse_dfs_path: temp = |rchs4bld\home\wrm3\x\y\z| after trimming \'s
[2007/07/11 17:23:16, 10] smbd/msdfs.c:parse_dfs_path(107)
  parse_dfs_path: hostname: rchs4bld
[2007/07/11 17:23:16, 10] smbd/msdfs.c:parse_dfs_path(139)
  parse_dfs_path: servicename: home
[2007/07/11 17:23:16, 10] smbd/msdfs.c:parse_dfs_path(164)
  parse_dfs_path: rest of the path: wrm3/x/y/z
[2007/07/11 17:23:16, 10] smbd/msdfs.c:dfs_path_lookup(375)
  dfs_path_lookup: Conn path = /home/dfshome reqpath = wrm3/x/y/z
[2007/07/11 17:23:16, 5] smbd/filename.c:unix_convert(147)
  unix_convert called on file "wrm3/x/y/z"
[2007/07/11 17:23:16, 10] smbd/statcache.c:stat_cache_lookup(215)
  stat_cache_lookup: lookup failed for name [WRM3/X/Y/Z]
[2007/07/11 17:23:16, 10] smbd/statcache.c:stat_cache_lookup(215)
  stat_cache_lookup: lookup failed for name [WRM3/X/Y]
[2007/07/11 17:23:16, 10] smbd/statcache.c:stat_cache_lookup(215)
  stat_cache_lookup: lookup failed for name [WRM3/X]
[2007/07/11 17:23:16, 10] smbd/statcache.c:stat_cache_lookup(215)
  stat_cache_lookup: lookup failed for name [WRM3]
[2007/07/11 17:23:16, 5] smbd/filename.c:unix_convert(246)
  unix_convert begin: name = wrm3/x/y/z, dirpath = , start = wrm3/x/y/z
[2007/07/11 17:23:16, 10] smbd/mangle_hash2.c:is_mangled(276)
  is_mangled wrm3/x/y/z ?
[2007/07/11 17:23:16, 10] smbd/mangle_hash2.c:is_mangled_component(215)
  is_mangled_component wrm3/x/y/z (len 4) ?
[2007/07/11 17:23:16, 10] smbd/mangle_hash2.c:is_mangled_component(215)
  is_mangled_component x/y/z (len 1) ?
[2007/07/11 17:23:16, 10] smbd/mangle_hash2.c:is_mangled_component(215)
  is_mangled_component y/z (len 1) ?
[2007/07/11 17:23:16, 10] smbd/mangle_hash2.c:is_mangled_component(215)
  is_mangled_component z (len 1) ?
[2007/07/11 17:23:16, 10] smbd/mangle_hash2.c:is_mangled(276)
  is_mangled wrm3 ?
[2007/07/11 17:23:16, 10] smbd/mangle_hash2.c:is_mangled_component(215)
  is_mangled_component wrm3 (len 4) ?
[2007/07/11 17:23:16, 5] smbd/statcache.c:stat_cache_add(140)
  stat_cache_add: Added entry (84d7050:size5) WRM3 -> wrm3
[2007/07/11 17:23:16, 10] smbd/mangle_hash2.c:is_mangled(276)
  is_mangled x ?
[2007/07/11 17:23:16, 10] smbd/mangle_hash2.c:is_mangled_component(215)
  is_mangled_component x (len 1) ?
[2007/07/11 17:23:16, 5] smbd/dir.c:OpenDir(1078)
  OpenDir: Can't open wrm3. Too many levels of symbolic links
[2007/07/11 17:23:16, 3] smbd/filename.c:scan_directory(581)
  scan dir didn't open dir [wrm3]
[2007/07/11 17:23:16, 5] smbd/filename.c:unix_convert(384)
  Intermediate not found x
[2007/07/11 17:23:16, 10] smbd/msdfs.c:dfs_redirect(534)
  dfs_redirect: dfs_path_lookup failed for \rchs4bld\home\wrm3\x\y\z with NT_ST\
ATUS_ACCESS_DENIED
[2007/07/11 17:23:16, 3] smbd/error.c:error_packet_set(106)
  error packet at smbd/trans2.c(3268) cmd=50 (SMBtrans2) NT_STATUS_ACCESS_DENIE\
D

Comment 6 Jeremy Allison 2007-07-11 18:38:43 UTC
Created attachment 2808 [details]
Patch for 3.0.25c

This should fix it for AIX (which returns a strange ELOOP error on opendir on an invalid symlink). I'm guessing you're on AIX Bill ?
Jeremy.
Comment 7 Bill Marshall 2007-07-12 08:33:28 UTC
Looks like that fixed it. (on linux too.)

We do have some AIX around, but I'm running linux.
# uname -a
Linux rchs4bld.rchland.ibm.com 2.6.9-55.0.2.ELsmp #1 SMP Tue Jun 12 17:59:08 EDT 2007 i686 i686 i386 GNU/Linux
# cat /etc/redhat-release
Red Hat Enterprise Linux ES release 4 (Nahant Update 5)

Comment 8 Jeremy Allison 2007-07-12 12:42:38 UTC
Strange - never seen that errno from opendir on linux (wonder what your loop looks like). Anyway, fix is checked into the main codebases so should be in 3.0.25c.
Thanks,
Jeremy.