summaryrefslogtreecommitdiff
path: root/source3/libads
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2007-12-29 22:47:03 +0100
committerVolker Lendecke <vl@samba.org>2007-12-29 23:13:03 +0100
commit240391be5345aef88a25c1221942202ba33588b8 (patch)
tree81aacf7e4b616895c91b0aaabe9e61e9a1d5be47 /source3/libads
parenta59280792cab616f5b269960ab68bc44ccc1fd38 (diff)
downloadsamba-240391be5345aef88a25c1221942202ba33588b8.tar.gz
samba-240391be5345aef88a25c1221942202ba33588b8.tar.bz2
samba-240391be5345aef88a25c1221942202ba33588b8.zip
Make use of [un]marshall_sec_desc
(This used to be commit 54576733d6c0511dc7379f964b1cb035913b7c8d)
Diffstat (limited to 'source3/libads')
-rw-r--r--source3/libads/ldap.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 348ccacaee..953693ce48 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -2384,20 +2384,22 @@ int ads_count_replies(ADS_STRUCT *ads, void *res)
LDAPMessage *msg, const char *field, SEC_DESC **sd)
{
struct berval **values;
- bool ret = False;
+ bool ret = true;
values = ldap_get_values_len(ads->ldap.ld, msg, field);
- if (!values) return False;
+ if (!values) return false;
if (values[0]) {
- prs_struct ps;
- prs_init(&ps, values[0]->bv_len, mem_ctx, UNMARSHALL);
- prs_copy_data_in(&ps, values[0]->bv_val, values[0]->bv_len);
- prs_set_offset(&ps,0);
-
- ret = sec_io_desc("sd", sd, &ps, 1);
- prs_mem_free(&ps);
+ NTSTATUS status;
+ status = unmarshall_sec_desc(mem_ctx,
+ (uint8 *)values[0]->bv_val,
+ values[0]->bv_len, sd);
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0, ("unmarshall_sec_desc failed: %s\n",
+ nt_errstr(status)));
+ ret = false;
+ }
}
ldap_value_free_len(values);