summaryrefslogtreecommitdiff
path: root/source3/lib/smbldap.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-05-28 22:12:00 +1000
committerAndrew Tridgell <tridge@samba.org>2009-05-28 22:12:00 +1000
commit67b83d2489788f1899c253fdab554d0998f9c044 (patch)
tree637060cb6bd4ab16fa9464d2bc168ad6c99e0b11 /source3/lib/smbldap.c
parent08be1420ba52ef9bba90d0f811c7810841ee8568 (diff)
parente63d9c29c99c5311c9f4a8dbe432ff4cea4fb924 (diff)
downloadsamba-67b83d2489788f1899c253fdab554d0998f9c044.tar.gz
samba-67b83d2489788f1899c253fdab554d0998f9c044.tar.bz2
samba-67b83d2489788f1899c253fdab554d0998f9c044.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba
Diffstat (limited to 'source3/lib/smbldap.c')
-rw-r--r--source3/lib/smbldap.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source3/lib/smbldap.c b/source3/lib/smbldap.c
index 4360d3ab57..b6921c329c 100644
--- a/source3/lib/smbldap.c
+++ b/source3/lib/smbldap.c
@@ -389,6 +389,26 @@ ATTRIB_MAP_ENTRY sidmap_attr_list[] = {
return result;
}
+ bool smbldap_pull_sid(LDAP *ld, LDAPMessage *msg, const char *attrib,
+ struct dom_sid *sid)
+{
+ struct berval **values;
+ bool ret = False;
+
+ values = ldap_get_values_len(ld, msg, attrib);
+
+ if (!values) {
+ return false;
+ }
+
+ if (values[0] != NULL) {
+ ret = sid_parse(values[0]->bv_val, values[0]->bv_len, sid);
+ }
+
+ ldap_value_free_len(values);
+ return ret;
+}
+
static int ldapmsg_destructor(LDAPMessage **result) {
ldap_msgfree(*result);
return 0;