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/winbindd | |
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/winbindd')
-rw-r--r-- | source3/winbindd/idmap_ad.c | 5 | ||||
-rw-r--r-- | source3/winbindd/idmap_adex/gc_util.c | 3 | ||||
-rw-r--r-- | source3/winbindd/idmap_adex/provider_unified.c | 3 | ||||
-rw-r--r-- | source3/winbindd/winbindd_ads.c | 5 |
4 files changed, 10 insertions, 6 deletions
diff --git a/source3/winbindd/idmap_ad.c b/source3/winbindd/idmap_ad.c index f2e47a7042..9f2f260951 100644 --- a/source3/winbindd/idmap_ad.c +++ b/source3/winbindd/idmap_ad.c @@ -34,6 +34,7 @@ #include "secrets.h" #include "idmap.h" #include "../libcli/security/dom_sid.h" +#include "../libcli/ldap/ldap_ndr.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_IDMAP @@ -563,7 +564,7 @@ again: ids[idx]->status = ID_UNKNOWN; - sidstr = sid_binstring(talloc_tos(), ids[idx]->sid); + sidstr = ldap_encode_ndr_dom_sid(talloc_tos(), ids[idx]->sid); filter = talloc_asprintf_append_buffer(filter, "(objectSid=%s)", sidstr); TALLOC_FREE(sidstr); @@ -885,7 +886,7 @@ static NTSTATUS nss_ad_get_info( struct nss_domain_entry *e, attrs[2] = ctx->ad_schema->posix_gecos_attr; attrs[3] = ctx->ad_schema->posix_gidnumber_attr; - sidstr = sid_binstring(mem_ctx, sid); + sidstr = ldap_encode_ndr_dom_sid(mem_ctx, sid); filter = talloc_asprintf(mem_ctx, "(objectSid=%s)", sidstr); TALLOC_FREE(sidstr); diff --git a/source3/winbindd/idmap_adex/gc_util.c b/source3/winbindd/idmap_adex/gc_util.c index 56bd9542f6..77b318cb2d 100644 --- a/source3/winbindd/idmap_adex/gc_util.c +++ b/source3/winbindd/idmap_adex/gc_util.c @@ -23,6 +23,7 @@ #include "idmap.h" #include "idmap_adex.h" #include "libads/cldap.h" +#include "../libcli/ldap/ldap_ndr.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_IDMAP @@ -719,7 +720,7 @@ done: *name = NULL; - sid_string = sid_binstring(frame, sid); + sid_string = ldap_encode_ndr_dom_sid(frame, sid); BAIL_ON_PTR_ERROR(sid_string, nt_status); filter = talloc_asprintf(frame, "(objectSid=%s)", sid_string); diff --git a/source3/winbindd/idmap_adex/provider_unified.c b/source3/winbindd/idmap_adex/provider_unified.c index 191f77159c..9f5cc884a5 100644 --- a/source3/winbindd/idmap_adex/provider_unified.c +++ b/source3/winbindd/idmap_adex/provider_unified.c @@ -24,6 +24,7 @@ #include "ads.h" #include "idmap.h" #include "idmap_adex.h" +#include "../libcli/ldap/ldap_ndr.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_IDMAP @@ -485,7 +486,7 @@ static NTSTATUS search_forest(struct likewise_cell *forest_cell, switch (fdata->ftype) { case SidFilter: - sid_binstr = sid_binstring(frame, &fdata->filter.sid); + sid_binstr = ldap_encode_ndr_dom_sid(frame, &fdata->filter.sid); BAIL_ON_PTR_ERROR(sid_binstr, nt_status); filter = talloc_asprintf(frame, "(objectSid=%s)", sid_binstr); diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c index 367d38ba15..fa498d63df 100644 --- a/source3/winbindd/winbindd_ads.c +++ b/source3/winbindd/winbindd_ads.c @@ -27,6 +27,7 @@ #include "../libds/common/flags.h" #include "ads.h" #include "secrets.h" +#include "../libcli/ldap/ldap_ndr.h" #ifdef HAVE_ADS @@ -542,7 +543,7 @@ static NTSTATUS query_user(struct winbindd_domain *domain, return NT_STATUS_SERVER_DISABLED; } - sidstr = sid_binstring(talloc_tos(), sid); + sidstr = ldap_encode_ndr_dom_sid(talloc_tos(), sid); ret = asprintf(&ldap_exp, "(objectSid=%s)", sidstr); TALLOC_FREE(sidstr); @@ -1044,7 +1045,7 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain, goto done; } - if ((sidbinstr = sid_binstring(talloc_tos(), group_sid)) == NULL) { + if ((sidbinstr = ldap_encode_ndr_dom_sid(talloc_tos(), group_sid)) == NULL) { status = NT_STATUS_NO_MEMORY; goto done; } |