$(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)
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)
$(PASSDB_OBJ) $(LIBTSOCKET_OBJ) $(GROUPDB_OBJ) \
$(SMBLDAP_OBJ) $(LIBNMB_OBJ) \
$(WBCOMMON_OBJ) \
+ $(LIBCLI_LDAP_NDR_OBJ) \
$(LIBNDR_GEN_OBJ0) $(LIBNDR_NETLOGON_OBJ) @BUILD_INIPARSER@
$(POPT_LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) \
$(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(LIBWBCLIENT_LIBS) @INIPARSERLIBS@
-bin/pam_smbpass.@SHLIBEXT@: $(BINARY_PREREQS) $(PAM_SMBPASS_OBJ) $(LIBTALLOC) $(LIBWBCLIENT) $(LIBTDB)
+bin/pam_smbpass.@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)
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);
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 */
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;
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);
-}
#include "includes.h"
#include "ads.h"
#include "libads/ldap_schema.h"
+#include "../libcli/ldap/ldap_ndr.h"
#ifdef HAVE_LDAP
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;
}
#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;
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;
}
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(
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,
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,
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;
}
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,
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,
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,
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,
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;
}
#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
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);
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);
#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
*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);
#include "ads.h"
#include "idmap.h"
#include "idmap_adex.h"
+#include "../libcli/ldap/ldap_ndr.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_IDMAP
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);
#include "../libds/common/flags.h"
#include "ads.h"
#include "secrets.h"
+#include "../libcli/ldap/ldap_ndr.h"
#ifdef HAVE_ADS
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);
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;
}
LIBSAMBA_SRC = '${LIBSMB_SRC0}'
LIBCLI_LDAP_MESSAGE_SRC = '''../libcli/ldap/ldap_message.c'''
-LIBCLI_LDAP_NDR_SRC = '''../libcli/ldap/ldap_ndr.c'''
+LIBCLI_LDAP_NDR_SRC = '''../libcli/ldap/ldap_ndr.c lib/ldb_compat.c'''
CLDAP_SRC = '''libads/cldap.c
- ../libcli/cldap/cldap.c lib/ldb_compat.c
+ ../libcli/cldap/cldap.c
../lib/util/idtree.c
${LIBCLI_LDAP_MESSAGE_SRC} ${LIBCLI_LDAP_NDR_SRC}'''