1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

Convert cli_query_secdesc to the async trans call

(This used to be commit ab41017896)
This commit is contained in:
Volker Lendecke 2008-09-09 15:03:51 +02:00 committed by Volker Lendecke
parent bb2a7183b9
commit 7965249bd6

View File

@ -25,8 +25,8 @@
SEC_DESC *cli_query_secdesc(struct cli_state *cli, int fnum, SEC_DESC *cli_query_secdesc(struct cli_state *cli, int fnum,
TALLOC_CTX *mem_ctx) TALLOC_CTX *mem_ctx)
{ {
char param[8]; uint8_t param[8];
char *rparam=NULL, *rdata=NULL; uint8_t *rparam=NULL, *rdata=NULL;
unsigned int rparam_count=0, rdata_count=0; unsigned int rparam_count=0, rdata_count=0;
SEC_DESC *psd = NULL; SEC_DESC *psd = NULL;
NTSTATUS status; NTSTATUS status;
@ -34,27 +34,22 @@ SEC_DESC *cli_query_secdesc(struct cli_state *cli, int fnum,
SIVAL(param, 0, fnum); SIVAL(param, 0, fnum);
SIVAL(param, 4, 0x7); SIVAL(param, 4, 0x7);
if (!cli_send_nt_trans(cli, status = cli_trans(talloc_tos(), cli, SMBnttrans,
NT_TRANSACT_QUERY_SECURITY_DESC, NULL, -1, /* name, fid */
0, NT_TRANSACT_QUERY_SECURITY_DESC, 0, /* function, flags */
NULL, 0, 0, NULL, 0, 0, /* setup, length, max */
param, 8, 4, param, 8, 4, /* param, length, max */
NULL, 0, 0x10000)) { NULL, 0, 0x10000, /* data, length, max */
DEBUG(1,("Failed to send NT_TRANSACT_QUERY_SECURITY_DESC\n")); NULL, NULL, /* rsetup, length */
&rparam, &rparam_count,
&rdata, &rdata_count);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("NT_TRANSACT_QUERY_SECURITY_DESC failed: %s\n",
nt_errstr(status)));
goto cleanup; goto cleanup;
} }
if (!cli_receive_nt_trans(cli,
&rparam, &rparam_count,
&rdata, &rdata_count)) {
DEBUG(1,("Failed to recv NT_TRANSACT_QUERY_SECURITY_DESC\n"));
goto cleanup;
}
if (cli_is_error(cli))
goto cleanup;
status = unmarshall_sec_desc(mem_ctx, (uint8 *)rdata, rdata_count, status = unmarshall_sec_desc(mem_ctx, (uint8 *)rdata, rdata_count,
&psd); &psd);
@ -66,8 +61,8 @@ SEC_DESC *cli_query_secdesc(struct cli_state *cli, int fnum,
cleanup: cleanup:
SAFE_FREE(rparam); TALLOC_FREE(rparam);
SAFE_FREE(rdata); TALLOC_FREE(rdata);
return psd; return psd;
} }