diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-09-09 19:27:00 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-09-09 19:27:00 +0200 |
commit | c82f268a1c1c5eff1cbdb410da3c717464bdbdd7 (patch) | |
tree | 00f3aaee7050f96229d3a74b052ca1edf7e5e2b9 /source3/libsmb/clisecdesc.c | |
parent | 372ecdfde372a8bdd666cdf009262776eddd28d4 (diff) | |
parent | 7965249bd613eb41eeca24ba8271189e2f90257c (diff) | |
download | samba-c82f268a1c1c5eff1cbdb410da3c717464bdbdd7.tar.gz samba-c82f268a1c1c5eff1cbdb410da3c717464bdbdd7.tar.bz2 samba-c82f268a1c1c5eff1cbdb410da3c717464bdbdd7.zip |
Merge branch 'v3-devel' of ssh://git.samba.org/data/git/samba into v3-devel
(This used to be commit c3d1b0097590566417bda3fa33a64e994c9c7526)
Diffstat (limited to 'source3/libsmb/clisecdesc.c')
-rw-r--r-- | source3/libsmb/clisecdesc.c | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/source3/libsmb/clisecdesc.c b/source3/libsmb/clisecdesc.c index adc6fba9af..f0b786c899 100644 --- a/source3/libsmb/clisecdesc.c +++ b/source3/libsmb/clisecdesc.c @@ -25,8 +25,8 @@ SEC_DESC *cli_query_secdesc(struct cli_state *cli, int fnum, TALLOC_CTX *mem_ctx) { - char param[8]; - char *rparam=NULL, *rdata=NULL; + uint8_t param[8]; + uint8_t *rparam=NULL, *rdata=NULL; unsigned int rparam_count=0, rdata_count=0; SEC_DESC *psd = NULL; NTSTATUS status; @@ -34,27 +34,22 @@ SEC_DESC *cli_query_secdesc(struct cli_state *cli, int fnum, SIVAL(param, 0, fnum); SIVAL(param, 4, 0x7); - if (!cli_send_nt_trans(cli, - NT_TRANSACT_QUERY_SECURITY_DESC, - 0, - NULL, 0, 0, - param, 8, 4, - NULL, 0, 0x10000)) { - DEBUG(1,("Failed to send NT_TRANSACT_QUERY_SECURITY_DESC\n")); - goto cleanup; - } - + status = cli_trans(talloc_tos(), cli, SMBnttrans, + NULL, -1, /* name, fid */ + NT_TRANSACT_QUERY_SECURITY_DESC, 0, /* function, flags */ + NULL, 0, 0, /* setup, length, max */ + param, 8, 4, /* param, length, max */ + NULL, 0, 0x10000, /* data, length, max */ + NULL, NULL, /* rsetup, length */ + &rparam, &rparam_count, + &rdata, &rdata_count); - if (!cli_receive_nt_trans(cli, - &rparam, &rparam_count, - &rdata, &rdata_count)) { - DEBUG(1,("Failed to recv NT_TRANSACT_QUERY_SECURITY_DESC\n")); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(1, ("NT_TRANSACT_QUERY_SECURITY_DESC failed: %s\n", + nt_errstr(status))); goto cleanup; } - if (cli_is_error(cli)) - goto cleanup; - status = unmarshall_sec_desc(mem_ctx, (uint8 *)rdata, rdata_count, &psd); @@ -66,8 +61,8 @@ SEC_DESC *cli_query_secdesc(struct cli_state *cli, int fnum, cleanup: - SAFE_FREE(rparam); - SAFE_FREE(rdata); + TALLOC_FREE(rparam); + TALLOC_FREE(rdata); return psd; } |