[SCM] Samba Shared Repository - branch master updated

Günther Deschner gd at samba.org
Mon Sep 20 17:14:48 MDT 2010


The branch, master has been updated
       via  1585c4d lib/tdb: fix c++ build warning in tdb_header_hash().
       via  80ca590 s3-lib/util Remove unused smb_uuid_unpack()
       via  03011bf s3-libads call common GUID_from_ndr_blob()
       via  6acb47b s3-uuid Remove unused smb_uuid_pack()
       via  d7bc452 s3: Replace sid_binstring and sid_guidstring with PIDL-based alternatives
      from  d44e86b Open alpha 14.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 1585c4df68a66569524a41def95488666dd827dd
Author: Günther Deschner <gd at samba.org>
Date:   Mon Sep 20 16:01:51 2010 -0700

    lib/tdb: fix c++ build warning in tdb_header_hash().
    
    Guenther

commit 80ca590d38d16723c6f457249e4051d5aa5843c5
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Sep 17 18:06:05 2010 +1000

    s3-lib/util Remove unused smb_uuid_unpack()
    
    Andrew Bartlett
    
    Signed-off-by: Günther Deschner <gd at samba.org>

commit 03011bf11837e75474f91f422ddf35d827d31cd1
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Sep 17 18:04:05 2010 +1000

    s3-libads call common GUID_from_ndr_blob()
    
    This does a length-limited check, and so avoids reading beyond the
    allocated memory if the server sends less than 16 bytes.
    
    Andrew Bartlett
    
    Signed-off-by: Günther Deschner <gd at samba.org>

commit 6acb47b1154562415bf966f72262481d25e58708
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Sep 17 17:46:51 2010 +1000

    s3-uuid Remove unused smb_uuid_pack()
    
    Signed-off-by: Günther Deschner <gd at samba.org>

commit d7bc452a893a77eb21b547cd8cdf8b420c60ab5d
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Sep 17 12:33:44 2010 +1000

    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 at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 lib/tdb/common/open.c                          |    2 +-
 source3/Makefile.in                            |   12 +++--
 source3/include/proto.h                        |    7 ---
 source3/lib/util_sid.c                         |   20 ---------
 source3/lib/util_uuid.c                        |   53 ------------------------
 source3/libads/ldap.c                          |   36 ++++++++--------
 source3/libads/ldap_schema.c                   |    3 +-
 source3/passdb/pdb_ads.c                       |   21 +++++----
 source3/printing/nt_printing_ads.c             |    7 ++-
 source3/winbindd/idmap_ad.c                    |    5 +-
 source3/winbindd/idmap_adex/gc_util.c          |    3 +-
 source3/winbindd/idmap_adex/provider_unified.c |    3 +-
 source3/winbindd/winbindd_ads.c                |    5 +-
 source3/wscript_build                          |    6 +-
 14 files changed, 56 insertions(+), 127 deletions(-)
 delete mode 100644 source3/lib/util_uuid.c


Changeset truncated at 500 lines:

diff --git a/lib/tdb/common/open.c b/lib/tdb/common/open.c
index d195c1c..a964994 100644
--- a/lib/tdb/common/open.c
+++ b/lib/tdb/common/open.c
@@ -55,7 +55,7 @@ void tdb_header_hash(struct tdb_context *tdb,
 	hash_key.dsize = sizeof(TDB_MAGIC_FOOD);
 	*magic1_hash = tdb->hash_fn(&hash_key);
 
-	hash_key.dptr = CONVERT(tdb_magic);
+	hash_key.dptr = (unsigned char *)CONVERT(tdb_magic);
 	hash_key.dsize = sizeof(tdb_magic);
 	*magic2_hash = tdb->hash_fn(&hash_key);
 
diff --git a/source3/Makefile.in b/source3/Makefile.in
index ce8c865..b7dfc6e 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -453,7 +453,7 @@ LIB_OBJ = $(LIBSAMBAUTIL_OBJ) $(UTIL_OBJ) $(CRYPTO_OBJ) \
 	  lib/util_pw.o lib/access.o lib/smbrun.o \
 	  lib/bitmap.o lib/dprintf.o $(UTIL_REG_OBJ) \
 	  lib/wins_srv.o \
-	  lib/util_str.o lib/clobber.o lib/util_sid.o lib/util_uuid.o \
+	  lib/util_str.o lib/clobber.o lib/util_sid.o \
 	  lib/util_unistr.o lib/util_file.o \
 	  lib/util.o lib/util_names.o \
 	  lib/util_sock.o lib/sock_exec.o lib/util_sec.o \
@@ -557,14 +557,14 @@ LIBSAMBA_OBJ = $(LIBSMB_OBJ0) \
 	       $(LIBSMB_ERR_OBJ)
 
 LIBCLI_LDAP_MESSAGE_OBJ = ../libcli/ldap/ldap_message.o
-LIBCLI_LDAP_NDR_OBJ = ../libcli/ldap/ldap_ndr.o
+LIBCLI_LDAP_NDR_OBJ = ../libcli/ldap/ldap_ndr.o lib/ldb_compat.o
 
 LIBTSOCKET_OBJ = ../lib/tsocket/tsocket.o \
 		../lib/tsocket/tsocket_helpers.o \
 		../lib/tsocket/tsocket_bsd.o
 
 CLDAP_OBJ = libads/cldap.o \
-	../libcli/cldap/cldap.o lib/ldb_compat.o \
+	../libcli/cldap/cldap.o \
 	../lib/util/idtree.o \
 	$(LIBCLI_LDAP_MESSAGE_OBJ) $(LIBCLI_LDAP_NDR_OBJ) $(LIBTSOCKET_OBJ)
 
@@ -998,6 +998,7 @@ SMBPASSWD_OBJ = utils/smbpasswd.o $(PASSWD_UTIL_OBJ) $(PASSCHANGE_OBJ) \
 PDBEDIT_OBJ = utils/pdbedit.o $(PASSWD_UTIL_OBJ) $(PARAM_OBJ) $(PASSDB_OBJ) \
 		$(LIBSAMBA_OBJ) $(LIBTSOCKET_OBJ) \
 		$(LIB_NONSMBD_OBJ) $(GROUPDB_OBJ) \
+		$(LIBCLI_LDAP_NDR_OBJ) \
 		$(POPT_LIB_OBJ) $(SMBLDAP_OBJ) ../lib/util/asn1.o
 
 SMBGET_OBJ = utils/smbget.o $(POPT_LIB_OBJ) $(LIBSMBCLIENT_OBJ1)
@@ -1443,6 +1444,7 @@ NTLM_AUTH_OBJ = ${NTLM_AUTH_OBJ1} $(LIBSAMBA_OBJ) $(POPT_LIB_OBJ) \
 		$(PASSDB_OBJ) $(LIBTSOCKET_OBJ) $(GROUPDB_OBJ) \
 		$(SMBLDAP_OBJ) $(LIBNMB_OBJ) \
 		$(WBCOMMON_OBJ) \
+		$(LIBCLI_LDAP_NDR_OBJ) \
 		$(LIBNDR_GEN_OBJ0) $(LIBNDR_NETLOGON_OBJ) @BUILD_INIPARSER@
 
 
@@ -3013,9 +3015,9 @@ bin/ntlm_auth at EXEEXT@: $(BINARY_PREREQS) $(NTLM_AUTH_OBJ) $(PARAM_OBJ) \
 		$(POPT_LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) \
 		$(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(LIBWBCLIENT_LIBS) @INIPARSERLIBS@
 
-bin/pam_smbpass. at SHLIBEXT@: $(BINARY_PREREQS) $(PAM_SMBPASS_OBJ) $(LIBTALLOC) $(LIBWBCLIENT) $(LIBTDB)
+bin/pam_smbpass. at SHLIBEXT@: $(BINARY_PREREQS) $(PAM_SMBPASS_OBJ) $(LIBCLI_LDAP_NDR_OBJ) $(LIBTALLOC) $(LIBWBCLIENT) $(LIBTDB)
 	@echo "Linking shared library $@"
-	@$(SHLD) $(LDSHFLAGS) -o $@ $(PAM_SMBPASS_OBJ) -lpam $(DYNEXP) \
+	@$(SHLD) $(LDSHFLAGS) -o $@ $(PAM_SMBPASS_OBJ) $(LIBCLI_LDAP_NDR_OBJ) -lpam $(DYNEXP) \
 		$(LIBS) $(LDAP_LIBS) $(NSCD_LIBS) \
 		$(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(LIBWBCLIENT_LIBS)
 
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 5bb91c5..d7b9cb0 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1295,7 +1295,6 @@ void sid_copy(struct dom_sid *dst, const struct dom_sid *src);
 bool sid_linearize(char *outbuf, size_t len, const struct dom_sid *sid);
 bool sid_parse(const char *inbuf, size_t len, struct dom_sid *sid);
 bool non_mappable_sid(struct dom_sid *sid);
-char *sid_binstring(TALLOC_CTX *mem_ctx, const struct dom_sid *sid);
 char *sid_binstring_hex(const struct dom_sid *sid);
 NTSTATUS add_sid_to_array(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
 			  struct dom_sid **sids, uint32_t *num);
@@ -1583,12 +1582,6 @@ int tolower_ascii(int c);
 int isupper_ascii(int c);
 int islower_ascii(int c);
 
-/* The following definitions come from lib/util_uuid.c  */
-
-void smb_uuid_pack(const struct GUID uu, UUID_FLAT *ptr);
-void smb_uuid_unpack(const UUID_FLAT in, struct GUID *uu);
-char *guid_binstring(TALLOC_CTX *mem_ctx, const struct GUID *guid);
-
 /* The following definitions come from lib/version.c  */
 
 const char *samba_version_string(void);
diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c
index d75c8e2..d28333f 100644
--- a/source3/lib/util_sid.c
+++ b/source3/lib/util_sid.c
@@ -333,26 +333,6 @@ bool non_mappable_sid(struct dom_sid *sid)
  Caller must free.
 *****************************************************************/
 
-char *sid_binstring(TALLOC_CTX *mem_ctx, const struct dom_sid *sid)
-{
-	uint8_t *buf;
-	char *s;
-	int len = ndr_size_dom_sid(sid, 0);
-	buf = talloc_array(mem_ctx, uint8_t, len);
-	if (!buf) {
-		return NULL;
-	}
-	sid_linearize((char *)buf, len, sid);
-	s = binary_string_rfc2254(mem_ctx, buf, len);
-	TALLOC_FREE(buf);
-	return s;
-}
-
-/*****************************************************************
- Return the binary string representation of a struct dom_sid.
- Caller must free.
-*****************************************************************/
-
 char *sid_binstring_hex(const struct dom_sid *sid)
 {
 	char *buf, *s;
diff --git a/source3/lib/util_uuid.c b/source3/lib/util_uuid.c
deleted file mode 100644
index 656ba2a..0000000
--- a/source3/lib/util_uuid.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* 
- *  Unix SMB/CIFS implementation.
- *  UUID server routines
- *  Copyright (C) Theodore Ts'o               1996, 1997,
- *  Copyright (C) Jim McDonough <jmcd at us.ibm.com> 2002, 2003
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 3 of the License, or
- *  (at your option) any later version.
- *  
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *  
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "includes.h"
-
-void smb_uuid_pack(const struct GUID uu, UUID_FLAT *ptr)
-{
-	SIVAL(ptr->info, 0, uu.time_low);
-	SSVAL(ptr->info, 4, uu.time_mid);
-	SSVAL(ptr->info, 6, uu.time_hi_and_version);
-	memcpy(ptr->info+8, uu.clock_seq, 2);
-	memcpy(ptr->info+10, uu.node, 6);
-}
-
-void smb_uuid_unpack(const UUID_FLAT in, struct GUID *uu)
-{
-	uu->time_low = IVAL(in.info, 0);
-	uu->time_mid = SVAL(in.info, 4);
-	uu->time_hi_and_version = SVAL(in.info, 6);
-	memcpy(uu->clock_seq, in.info+8, 2);
-	memcpy(uu->node, in.info+10, 6);
-}
-
-/*****************************************************************
- Return the binary string representation of a GUID.
- Caller must free.
-*****************************************************************/
-
-char *guid_binstring(TALLOC_CTX *mem_ctx, const struct GUID *guid)
-{
-	UUID_FLAT guid_flat;
-
-	smb_uuid_pack(*guid, &guid_flat);
-
-	return binary_string_rfc2254(mem_ctx, guid_flat.info, UUID_FLAT_SIZE);
-}
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 3525876..32138a7 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -2127,13 +2127,16 @@ static void dump_guid(ADS_STRUCT *ads, const char *field, struct berval **values
 {
 	int i;
 	for (i=0; values[i]; i++) {
+		NTSTATUS status;
+		DATA_BLOB in = data_blob_const(values[i]->bv_val, values[i]->bv_len);
+		struct GUID guid;
 
-		UUID_FLAT guid;
-		struct GUID tmp;
-
-		memcpy(guid.info, values[i]->bv_val, sizeof(guid.info));
-		smb_uuid_unpack(guid, &tmp);
-		printf("%s: %s\n", field, GUID_string(talloc_tos(), &tmp));
+		status = GUID_from_ndr_blob(&in, &guid);
+		if (NT_STATUS_IS_OK(status)) {
+			printf("%s: %s\n", field, GUID_string(talloc_tos(), &guid));
+		} else {
+			printf("%s: INVALID GUID\n", field);
+		}
 	}
 }
 
@@ -2609,22 +2612,17 @@ int ads_count_replies(ADS_STRUCT *ads, void *res)
  **/
  bool ads_pull_guid(ADS_STRUCT *ads, LDAPMessage *msg, struct GUID *guid)
 {
-	char **values;
-	UUID_FLAT flat_guid;
-
-	values = ldap_get_values(ads->ldap.ld, msg, "objectGUID");
-	if (!values)
-		return False;
+	DATA_BLOB blob;
+	NTSTATUS status;
 
-	if (values[0]) {
-		memcpy(&flat_guid.info, values[0], sizeof(UUID_FLAT));
-		smb_uuid_unpack(flat_guid, guid);
-		ldap_value_free(values);
-		return True;
+	if (!smbldap_talloc_single_blob(talloc_tos(), ads->ldap.ld, msg, "objectGUID",
+					&blob)) {
+		return false;
 	}
-	ldap_value_free(values);
-	return False;
 
+	status = GUID_from_ndr_blob(&blob, guid);
+	talloc_free(blob.data);
+	return NT_STATUS_IS_OK(status);
 }
 
 
diff --git a/source3/libads/ldap_schema.c b/source3/libads/ldap_schema.c
index 80ec45c..66c9bf4 100644
--- a/source3/libads/ldap_schema.c
+++ b/source3/libads/ldap_schema.c
@@ -21,6 +21,7 @@
 #include "includes.h"
 #include "ads.h"
 #include "libads/ldap_schema.h"
+#include "../libcli/ldap/ldap_ndr.h"
 
 #ifdef HAVE_LDAP
 
@@ -124,7 +125,7 @@ const char *ads_get_attrname_by_guid(ADS_STRUCT *ads,
 		goto done;
 	}
 
-	guid_bin = guid_binstring(mem_ctx, schema_guid);
+	guid_bin = ldap_encode_ndr_GUID(mem_ctx, schema_guid);
 	if (!guid_bin) {
 		goto done;
 	}
diff --git a/source3/passdb/pdb_ads.c b/source3/passdb/pdb_ads.c
index 9eb5b60..fb2a5e3 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;
 	}
diff --git a/source3/printing/nt_printing_ads.c b/source3/printing/nt_printing_ads.c
index 4b39173..56086c9 100644
--- a/source3/printing/nt_printing_ads.c
+++ b/source3/printing/nt_printing_ads.c
@@ -187,10 +187,13 @@ static WERROR nt_printer_publish_ads(struct messaging_context *msg_ctx,
 
 	/* retreive the guid and store it locally */
 	if (ADS_ERR_OK(ads_search_dn(ads, &res, prt_dn, attrs))) {
+		bool guid_ok;
 		ZERO_STRUCT(guid);
-		ads_pull_guid(ads, res, &guid);
+		guid_ok = ads_pull_guid(ads, res, &guid);
 		ads_msgfree(ads, res);
-		store_printer_guid(msg_ctx, printer, guid);
+		if (guid_ok) {
+			store_printer_guid(msg_ctx, printer, guid);
+		}
 	}
 	TALLOC_FREE(ctx);
 
diff --git a/source3/winbindd/idmap_ad.c b/source3/winbindd/idmap_ad.c
index f2e47a7..9f2f260 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 56bd954..77b318c 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 191f771..9f5cc88 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 367d38b..fa498d6 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;
 	}
diff --git a/source3/wscript_build b/source3/wscript_build
index e5ad33b..fe70ce4 100644
--- a/source3/wscript_build
+++ b/source3/wscript_build
@@ -219,7 +219,7 @@ LIB_SRC = '''${LIBSAMBAUTIL_SRC} ${UTIL_SRC} ${CRYPTO_SRC}
           lib/util_pw.c lib/access.c lib/smbrun.c
           lib/bitmap.c lib/dprintf.c ${UTIL_REG_SRC}
           lib/wins_srv.c
-          lib/util_str.c lib/clobber.c lib/util_sid.c lib/util_uuid.c
+          lib/util_str.c lib/clobber.c lib/util_sid.c
           lib/util_unistr.c lib/util_file.c lib/util_names.c


-- 
Samba Shared Repository


More information about the samba-cvs mailing list