Simon Walton
2005-Apr-06 18:18 UTC
[Samba] File browser doesn't remember last directory over Dfs
Hi, I have encountered some strange behaviour after upgrading to 3.0.12 on FreeBSD 4.10 file servers. Normally when users on windows apps use the file browser to select a file it remembers the selected directory between invocations, so that, for example, they can easily read in multiple files from the same directory, or if they click on Save As... it takes them to the directory where they last saved. However if the path follows a Dfs link on the samba server this does not happen, and the file browser always opens up in some default location (under Docs and Settings locally). This was observed on Win 2k SP4 and Win XP SP2. Downgrading to 3.0.7 (on the server with the Dfs tree) fixed the problem. Upgrading to 3.0.13 did not fix it. I turned up logging on the server with the problem and it looks like when you bring up the file browser it tries to stat the location but fails like so: [2005/04/05 14:29:30, 3] smbd/trans2.c:call_trans2findfirst(1351) call_trans2findfirst: dirtype = 22, maxentries = 1366, close_after_first=1, close_if_end = 2 requires_resume_key = 4 level = 0x104, max_data_bytes = 16384 [2005/04/05 14:29:30, 3] smbd/msdfs.c:dfs_redirect(391) dfs_redirect: Redirecting m-6/v/MWD/vid_rez_Archives [2005/04/05 14:29:30, 3] smbd/error.c:error_packet(105) error string = No such file or directory [2005/04/05 14:29:30, 3] smbd/error.c:error_packet(129) error packet at smbd/trans2.c(1381) cmd=50 (SMBtrans2) NT_STATUS_PATH_NOT_COVERED In this example /v/MWD/vid_rez_Archives is a Dfs link. I saw in the archives mention of a problem executing files over Dfs links; I don't know if this is related. Simon Walton
Simon Walton
2005-Apr-08 17:03 UTC
[Samba] Re: File browser doesn't remember last directory over Dfs
I applied the patch below to 3.0.13 and it seems to have fixed this problem. Simon Walton ------------------------------ *** source/include/msdfs.h.orig Fri Mar 11 05:47:05 2005 --- source/include/msdfs.h Thu Apr 7 17:02:39 2005 *************** *** 72,77 **** --- 72,85 ---- return ERROR_BOTH(NT_STATUS_PATH_NOT_COVERED, \ ERRSRV, ERRbadpath);; } + #define RESOLVE_FINDFIRST_DFSPATH(name, conn, inbuf, outbuf) \ + { if ((SVAL(inbuf,smb_flg2) & FLAGS2_DFS_PATHNAMES) && \ + lp_host_msdfs() && lp_msdfs_root(SNUM(conn)) && \ + dfs_redirect(name,conn,True)) \ + return ERROR_BOTH(NT_STATUS_PATH_NOT_COVERED, \ + ERRSRV, ERRbadpath);; } + + #define init_dfsroot(conn, inbuf, outbuf) \ { if (lp_msdfs_root(SNUM(conn)) && lp_host_msdfs()) { \ DEBUG(2,("Serving %s as a Dfs root\n", \ *** source/smbd/trans2.c.orig Fri Mar 18 06:56:41 2005 --- source/smbd/trans2.c Thu Apr 7 17:02:39 2005 *************** *** 1378,1384 **** return ERROR_NT(ntstatus); } ! RESOLVE_DFSPATH(directory, conn, inbuf, outbuf); unix_convert(directory,conn,0,&bad_path,&sbuf); if (bad_path) { --- 1378,1384 ---- return ERROR_NT(ntstatus); } ! RESOLVE_FINDFIRST_DFSPATH(directory, conn, inbuf, outbuf); unix_convert(directory,conn,0,&bad_path,&sbuf); if (bad_path) { Simon Walton wrote:> Hi, > > I have encountered some strange behaviour after upgrading to > 3.0.12 on FreeBSD 4.10 file servers. > Normally when users on windows apps use the file browser to select > a file it remembers the selected directory between invocations, so > that, for example, they can easily read in multiple files from > the same directory, or if they click on Save As... it takes > them to the directory where they last saved. > > However if the path follows a Dfs link on the samba server this > does not happen, and the file browser always opens up in some > default location (under Docs and Settings locally). This was > observed on Win 2k SP4 and Win XP SP2. Downgrading to 3.0.7 > (on the server with the Dfs tree) fixed the problem. Upgrading > to 3.0.13 did not fix it. > > I turned up logging on the server with the problem and it looks > like when you bring up the file browser it tries to stat the location > but fails like so: > > [2005/04/05 14:29:30, 3] smbd/trans2.c:call_trans2findfirst(1351) > call_trans2findfirst: dirtype = 22, maxentries = 1366, > close_after_first=1, close_if_end = 2 requires_resume_key = 4 level = > 0x104, max_data_bytes = 16384 > [2005/04/05 14:29:30, 3] smbd/msdfs.c:dfs_redirect(391) > dfs_redirect: Redirecting m-6/v/MWD/vid_rez_Archives > [2005/04/05 14:29:30, 3] smbd/error.c:error_packet(105) > error string = No such file or directory > [2005/04/05 14:29:30, 3] smbd/error.c:error_packet(129) > error packet at smbd/trans2.c(1381) cmd=50 (SMBtrans2) > NT_STATUS_PATH_NOT_COVERED > > In this example /v/MWD/vid_rez_Archives is a Dfs link. > > I saw in the archives mention of a problem executing files over Dfs > links; > I don't know if this is related. > > Simon Walton >