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 | ced0c42f055a672f6b4ab6ba809b0f63c83b431e (patch) | |
tree | abc192e20f72ceb94579209e17529ddbe5dde891 | |
parent | 585f5f8831f13260808a82611656fc6ca5caee81 (diff) | |
download | samba-ced0c42f055a672f6b4ab6ba809b0f63c83b431e.tar.gz samba-ced0c42f055a672f6b4ab6ba809b0f63c83b431e.tar.xz samba-ced0c42f055a672f6b4ab6ba809b0f63c83b431e.zip |
make use of unmarshall_sec_desc
-rw-r--r-- | source/libads/ldap.c | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/source/libads/ldap.c b/source/libads/ldap.c index e9124a387ce..348ccacaee0 100644 --- a/source/libads/ldap.c +++ b/source/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); } /* |