int flags)
{
struct cli_state *cli;
- uint16_t fnum;
+ uint16_t fnum = 0xffff;
NTSTATUS status;
const DATA_BLOB *binary = NULL;
}
if (binary == NULL) {
- //TODO
+ goto done;
}
status = cli_ntcreate(
NULL);
if (!NT_STATUS_IS_OK(status)) {
DBG_WARNING("Could not write file: %s\n", nt_errstr(status));
- goto close_done;
+ goto done;
}
-close_done:
- status = cli_close(cli, fnum);
- if (!NT_STATUS_IS_OK(status)) {
- DBG_WARNING("Close(%"PRIu16") failed for %s: %s\n", fnum,
- service_filename, nt_errstr(status));
- }
done:
+ if (fnum != 0xffff) {
+ status = cli_close(cli, fnum);
+ if (!NT_STATUS_IS_OK(status)) {
+ DBG_WARNING("Close(%"PRIu16") failed for %s: %s\n",
+ fnum,
+ service_filename,
+ nt_errstr(status));
+ }
+ }
+
TALLOC_FREE(cli);
return status;
}