summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-03-22 23:45:57 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:14 -0500
commita17af5920aa5fc1c6eb6b0259509a85e1aad0fa8 (patch)
tree5391b0c68a0ad790f567ea3b5f8b0487c94c2032 /source3/libsmb
parent19996e23c3fc49b56ad263e6243b60a3ea4303da (diff)
downloadsamba-a17af5920aa5fc1c6eb6b0259509a85e1aad0fa8.tar.gz
samba-a17af5920aa5fc1c6eb6b0259509a85e1aad0fa8.tar.bz2
samba-a17af5920aa5fc1c6eb6b0259509a85e1aad0fa8.zip
r5981: Hack to fix DFS code to work with Win98 server. JERRY PLEASE REVIEW THIS !
I don't think this is correct - it just happens to work and fix bug #2530 to return all the files. Jeremy. (This used to be commit 1ee180a6dd7f8d787396f359a8ff3ed25433357b)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clidfs.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index dcffdf42fe..e2456800dd 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -595,8 +595,26 @@ BOOL cli_resolve_path( const char *mountpt, struct cli_state *rootcli, const cha
/* we got an error, check for DFS referral */
- if ( !cli_dfs_check_error(rootcli) )
+ if ( !cli_dfs_check_error(rootcli) ) {
+ /* Check for Win98 server - doesn't support this call. */
+ uint32 flgs2 = SVAL(rootcli->inbuf,smb_flg2);
+
+ /* only deal with DS when we negotiated NT_STATUS codes and UNICODE */
+
+ if ( !( (flgs2&FLAGS2_32_BIT_ERROR_CODES) && (flgs2&FLAGS2_UNICODE_STRINGS) ) ) {
+ uint8 eclass = 0;
+ uint32 ecode = 0;
+ cli_dos_error(rootcli, &eclass, &ecode);
+ if ((eclass == ERRDOS) && (ecode == ERRbadfunc)) {
+ rootcli->dfsroot = 0;
+ *targetcli = rootcli;
+ pstrcpy( targetpath, path );
+ return True;
+ }
+ }
+
return False;
+ }
/* check for the referral */