diff options
author | Andrew Bartlett <abartlet@samba.org> | 2010-09-17 12:33:44 +1000 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-09-20 16:15:03 -0700 |
commit | d7bc452a893a77eb21b547cd8cdf8b420c60ab5d (patch) | |
tree | 32803f84567980382f85b0164e9e9f10a99c1bbd /source3/passdb | |
parent | d44e86b473554ad549993c928af68e348ccefe2b (diff) | |
download | samba-d7bc452a893a77eb21b547cd8cdf8b420c60ab5d.tar.gz samba-d7bc452a893a77eb21b547cd8cdf8b420c60ab5d.tar.bz2 samba-d7bc452a893a77eb21b547cd8cdf8b420c60ab5d.zip |
s3: Replace sid_binstring and sid_guidstring with PIDL-based alternatives
This reduces the manual marshalling of these structures by removing
the duplication here.
Andrew Bartlett
Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3/passdb')
-rw-r--r-- | source3/passdb/pdb_ads.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/source3/passdb/pdb_ads.c b/source3/passdb/pdb_ads.c index 9eb5b6067e..fb2a5e3c9d 100644 --- a/source3/passdb/pdb_ads.c +++ b/source3/passdb/pdb_ads.c @@ -23,6 +23,7 @@ #include "../libds/common/flags.h" #include "secrets.h" #include "../librpc/gen_ndr/samr.h" +#include "../libcli/ldap/ldap_ndr.h" struct pdb_ads_state { struct sockaddr_un socket_address; @@ -155,7 +156,7 @@ static struct pdb_ads_samu_private *pdb_ads_get_samu_private( result, struct pdb_ads_samu_private); } - sidstr = sid_binstring(talloc_tos(), pdb_get_user_sid(sam)); + sidstr = ldap_encode_ndr_dom_sid(talloc_tos(), pdb_get_user_sid(sam)); if (sidstr == NULL) { return NULL; } @@ -437,7 +438,7 @@ static NTSTATUS pdb_ads_getsampwsid(struct pdb_methods *m, m->private_data, struct pdb_ads_state); char *sidstr, *filter; - sidstr = sid_binstring(talloc_tos(), sid); + sidstr = ldap_encode_ndr_dom_sid(talloc_tos(), sid); NT_STATUS_HAVE_NO_MEMORY(sidstr); filter = talloc_asprintf( @@ -829,7 +830,7 @@ static NTSTATUS pdb_ads_delete_dom_group(struct pdb_methods *m, sid_compose(&sid, &state->domainsid, rid); - sidstr = sid_binstring(talloc_tos(), &sid); + sidstr = ldap_encode_ndr_dom_sid(talloc_tos(), &sid); NT_STATUS_HAVE_NO_MEMORY(sidstr); rc = pdb_ads_search_fmt(state, state->domaindn, TLDAP_SCOPE_SUB, @@ -917,7 +918,7 @@ static NTSTATUS pdb_ads_enum_group_members(struct pdb_methods *m, DATA_BLOB *blobs; uint32_t *members; - sidstr = sid_binstring(talloc_tos(), group); + sidstr = ldap_encode_ndr_dom_sid(talloc_tos(), group); NT_STATUS_HAVE_NO_MEMORY(sidstr); rc = pdb_ads_search_fmt(state, state->domaindn, TLDAP_SCOPE_SUB, @@ -1201,7 +1202,7 @@ static NTSTATUS pdb_ads_delete_alias(struct pdb_methods *m, return NT_STATUS_LDAP(TLDAP_SERVER_DOWN); } - sidstr = sid_binstring(talloc_tos(), sid); + sidstr = ldap_encode_ndr_dom_sid(talloc_tos(), sid); if (sidstr == NULL) { return NT_STATUS_NO_MEMORY; } @@ -1260,7 +1261,7 @@ static NTSTATUS pdb_ads_set_aliasinfo(struct pdb_methods *m, return NT_STATUS_LDAP(TLDAP_SERVER_DOWN); } - sidstr = sid_binstring(talloc_tos(), sid); + sidstr = ldap_encode_ndr_dom_sid(talloc_tos(), sid); NT_STATUS_HAVE_NO_MEMORY(sidstr); rc = pdb_ads_search_fmt(state, state->domaindn, TLDAP_SCOPE_SUB, @@ -1327,7 +1328,7 @@ static NTSTATUS pdb_ads_sid2dn(struct pdb_ads_state *state, char *sidstr, *dn; int rc; - sidstr = sid_binstring(talloc_tos(), sid); + sidstr = ldap_encode_ndr_dom_sid(talloc_tos(), sid); NT_STATUS_HAVE_NO_MEMORY(sidstr); rc = pdb_ads_search_fmt(state, state->domaindn, TLDAP_SCOPE_SUB, @@ -1482,7 +1483,7 @@ static NTSTATUS pdb_ads_enum_aliasmem(struct pdb_methods *m, DATA_BLOB *blobs; struct dom_sid *members; - sidstr = sid_binstring(talloc_tos(), alias); + sidstr = ldap_encode_ndr_dom_sid(talloc_tos(), alias); NT_STATUS_HAVE_NO_MEMORY(sidstr); rc = pdb_ads_search_fmt(state, state->domaindn, TLDAP_SCOPE_SUB, @@ -1651,7 +1652,7 @@ static NTSTATUS pdb_ads_lookup_rids(struct pdb_methods *m, sid_compose(&sid, domain_sid, rids[i]); - sidstr = sid_binstring(talloc_tos(), &sid); + sidstr = ldap_encode_ndr_dom_sid(talloc_tos(), &sid); NT_STATUS_HAVE_NO_MEMORY(sidstr); rc = pdb_ads_search_fmt(state, state->domaindn, @@ -1954,7 +1955,7 @@ static bool pdb_ads_sid_to_id(struct pdb_methods *m, const struct dom_sid *sid, sid_peek_rid(sid, &rid); - sidstr = sid_binstring(talloc_tos(), sid); + sidstr = ldap_encode_ndr_dom_sid(talloc_tos(), sid); if (sidstr == NULL) { return false; } |