Skip to content

Commit

Permalink
s4:libcli: Fix error in smbcli_deltree()
Browse files Browse the repository at this point in the history
Commit 094afe6 fixed an uninitialized variable, which meant we
tried to delete the file twice. The 2nd time fails, so the function
returns an error, instead of success (even though the file is now gone).

Note we want to be using the source3 SMB library code going forward.
However, fixing this bug makes it easier to write tests against the
(currently s4) SMB python bindings.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Tim Beale <[email protected]>
Reviewed-by: Andrew Bartlett <[email protected]>
  • Loading branch information
tlbeale authored and abartlet committed Dec 12, 2018
1 parent da30c82 commit 31d4f69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source4/libcli/clideltree.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ int smbcli_deltree(struct smbcli_tree *tree, const char *dname)

/* it might be a file */
status = smbcli_unlink(tree, dname);
if (NT_STATUS_IS_OK(smbcli_unlink(tree, dname))) {
if (NT_STATUS_IS_OK(status)) {
return 1;
}
if (NT_STATUS_EQUAL(smbcli_nt_error(tree), NT_STATUS_OBJECT_NAME_NOT_FOUND) ||
Expand Down

0 comments on commit 31d4f69

Please sign in to comment.