From: Volker Lendecke Date: Tue, 26 May 2020 07:01:57 +0000 (+0200) Subject: pylibsmb: Use async cli_unlink also for smb2 X-Git-Tag: ldb-2.2.0~278 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1692b8a65180c3c90d5ae40fc05400228510b3d6;p=thirdparty%2Fsamba.git pylibsmb: Use async cli_unlink also for smb2 Async cli_smb2_unlink was just added Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/libsmb/pylibsmb.c b/source3/libsmb/pylibsmb.c index bfa6f1bec24..38bcae73db0 100644 --- a/source3/libsmb/pylibsmb.c +++ b/source3/libsmb/pylibsmb.c @@ -1258,20 +1258,15 @@ static NTSTATUS unlink_file(struct py_cli_state *self, const char *filename) { NTSTATUS status; uint16_t attrs = (FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN); + struct tevent_req *req = NULL; - if (self->is_smb1) { - struct tevent_req *req = NULL; - - req = cli_unlink_send(NULL, self->ev, self->cli, filename, - attrs); - if (!py_tevent_req_wait_exc(self, req)) { - return NT_STATUS_INTERNAL_ERROR; - } - status = cli_unlink_recv(req); - TALLOC_FREE(req); - } else { - status = cli_unlink(self->cli, filename, attrs); + req = cli_unlink_send( + NULL, self->ev, self->cli, filename, attrs); + if (!py_tevent_req_wait_exc(self, req)) { + return NT_STATUS_INTERNAL_ERROR; } + status = cli_unlink_recv(req); + TALLOC_FREE(req); return status; }