summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2007-12-16 14:15:16 +0100
committerVolker Lendecke <vl@samba.org>2007-12-16 14:15:16 +0100
commitd365a43785238fc59f2fd8a262d30a2a1aae7078 (patch)
tree1320897a94d5c0303612ab8ded2487acb35c2552
parent8c6e781c3cd878ee30601560f8bac3a45471a0bf (diff)
downloadsamba-d365a43785238fc59f2fd8a262d30a2a1aae7078.tar.gz
samba-d365a43785238fc59f2fd8a262d30a2a1aae7078.tar.bz2
samba-d365a43785238fc59f2fd8a262d30a2a1aae7078.zip
make use of unmarshall_sec_desc
(This used to be commit ced0c42f055a672f6b4ab6ba809b0f63c83b431e)
-rw-r--r--source3/libads/ldap.c31
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);
}
/*