diff options
author | Volker Lendecke <vl@samba.org> | 2007-12-16 14:15:16 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2007-12-16 14:15:16 +0100 |
commit | d365a43785238fc59f2fd8a262d30a2a1aae7078 (patch) | |
tree | 1320897a94d5c0303612ab8ded2487acb35c2552 /source3 | |
parent | 8c6e781c3cd878ee30601560f8bac3a45471a0bf (diff) | |
download | samba-d365a43785238fc59f2fd8a262d30a2a1aae7078.tar.gz samba-d365a43785238fc59f2fd8a262d30a2a1aae7078.tar.bz2 samba-d365a43785238fc59f2fd8a262d30a2a1aae7078.zip |
make use of unmarshall_sec_desc
(This used to be commit ced0c42f055a672f6b4ab6ba809b0f63c83b431e)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libads/ldap.c | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index e9124a387c..348ccacaee 100644 --- a/source3/libads/ldap.c +++ b/source3/libads/ldap.c @@ -1858,31 +1858,24 @@ static void dump_sid(ADS_STRUCT *ads, const char *field, struct berval **values) */ static void dump_sd(ADS_STRUCT *ads, const char *filed, struct berval **values) { - prs_struct ps; - - SEC_DESC *psd = 0; - TALLOC_CTX *ctx = 0; - - if (!(ctx = talloc_init("sec_io_desc"))) - return; + TALLOC_CTX *frame = talloc_stackframe(); + struct security_descriptor *psd; + NTSTATUS status; - /* prepare data */ - prs_init(&ps, values[0]->bv_len, ctx, UNMARSHALL); - prs_copy_data_in(&ps, values[0]->bv_val, values[0]->bv_len); - prs_set_offset(&ps,0); - - /* parse secdesc */ - if (!sec_io_desc("sd", &psd, &ps, 1)) { - prs_mem_free(&ps); - talloc_destroy(ctx); + status = unmarshall_sec_desc(talloc_tos(), (uint8 *)values[0]->bv_val, + values[0]->bv_len, &psd); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0, ("unmarshall_sec_desc failed: %s\n", + nt_errstr(status))); + TALLOC_FREE(frame); return; } + if (psd) { - ads_disp_sd(ads, ctx, psd); + ads_disp_sd(ads, talloc_tos(), psd); } - prs_mem_free(&ps); - talloc_destroy(ctx); + TALLOC_FREE(frame); } /* |