summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-05-10 12:21:02 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:52 -0500
commit5d5d596206e08be5bb159d9a474dc0b10e07b169 (patch)
tree046d2f4280a8dae442728ca08752711b76fac4d8 /source3/libsmb
parent34ea46ef8c4d94f59c11a7b1edc79db382970e0c (diff)
downloadsamba-5d5d596206e08be5bb159d9a474dc0b10e07b169.tar.gz
samba-5d5d596206e08be5bb159d9a474dc0b10e07b169.tar.bz2
samba-5d5d596206e08be5bb159d9a474dc0b10e07b169.zip
r6706: * fix bug that prevented smbclient from creating directories
on non-dfs paths * add patch from James Peach to remove use of uninitialized variables (This used to be commit c71f20f1ae5ccfd49cf81af0299c96fe27351222)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clidfs.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index 6d1e597410..30c8701619 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -464,7 +464,7 @@ BOOL cli_dfs_make_full_path( pstring path, const char *server, const char *share
check for dfs referral
********************************************************************/
-static BOOL cli_dfs_check_error( struct cli_state *cli )
+static BOOL cli_dfs_check_error( struct cli_state *cli, NTSTATUS status )
{
uint32 flgs2 = SVAL(cli->inbuf,smb_flg2);
@@ -473,7 +473,7 @@ static BOOL cli_dfs_check_error( struct cli_state *cli )
if ( !( (flgs2&FLAGS2_32_BIT_ERROR_CODES) && (flgs2&FLAGS2_UNICODE_STRINGS) ) )
return False;
- if ( NT_STATUS_EQUAL( NT_STATUS_PATH_NOT_COVERED, NT_STATUS(IVAL(cli->inbuf,smb_rcls)) ) )
+ if ( NT_STATUS_EQUAL( status, NT_STATUS(IVAL(cli->inbuf,smb_rcls)) ) )
return True;
return False;
@@ -605,9 +605,17 @@ BOOL cli_resolve_path( const char *mountpt, struct cli_state *rootcli, const cha
return True;
}
+ /* special case where client asked for a path that does not exist */
+
+ if ( cli_dfs_check_error(rootcli, NT_STATUS_OBJECT_NAME_NOT_FOUND) ) {
+ *targetcli = rootcli;
+ pstrcpy( targetpath, path );
+ return True;
+ }
+
/* we got an error, check for DFS referral */
- if ( !cli_dfs_check_error(rootcli) )
+ if ( !cli_dfs_check_error(rootcli, NT_STATUS_PATH_NOT_COVERED) )
return False;
/* check for the referral */