From 5d5d596206e08be5bb159d9a474dc0b10e07b169 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 10 May 2005 12:21:02 +0000 Subject: 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) --- source3/libsmb/clidfs.c | 14 +++++++++++--- source3/utils/net_groupmap.c | 4 +--- 2 files changed, 12 insertions(+), 6 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 */ diff --git a/source3/utils/net_groupmap.c b/source3/utils/net_groupmap.c index b20a37c726..9aae620f6e 100644 --- a/source3/utils/net_groupmap.c +++ b/source3/utils/net_groupmap.c @@ -670,7 +670,6 @@ static int net_groupmap_listmem(int argc, const char **argv) DOM_SID alias; DOM_SID *members; int i, num; - NTSTATUS result; if ( (argc != 1) || !string_to_sid(&alias, argv[0]) ) { @@ -679,8 +678,7 @@ static int net_groupmap_listmem(int argc, const char **argv) } if (!pdb_enum_aliasmem(&alias, &members, &num)) { - d_printf("Could not list members for sid %s: %s\n", - argv[0], nt_errstr(result)); + d_printf("Could not list members for sid %s\n", argv[0]); return -1; } -- cgit