From 3d18997afda94504e9db24115aaa56a58086a653 Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Thu, 11 Mar 2004 16:32:19 +0000 Subject: Get MungedDial actually working with full TS strings in it for pdb_ldap. I know this isn't pretty, but neither was our assumption that all strings from the directory fit inside a pstring. There was no way this worked before will all versions of usrmgr (for example, the only version of mine that has the TS Confic button). (This used to be commit d275c0e384db08c2a6efc28e52844f676ff71fb6) --- source3/sam/idmap_ldap.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source3/sam/idmap_ldap.c') diff --git a/source3/sam/idmap_ldap.c b/source3/sam/idmap_ldap.c index 55f4578448..2124fb6879 100644 --- a/source3/sam/idmap_ldap.c +++ b/source3/sam/idmap_ldap.c @@ -204,7 +204,7 @@ static NTSTATUS ldap_next_rid(struct ldap_idmap_state *state, uint32 *rid, algorithmic_rid_base. The other two are to avoid stomping on the different sets of algorithmic RIDs */ - if (smbldap_get_single_attribute(state->smbldap_state->ldap_struct, entry, + if (smbldap_get_single_pstring(state->smbldap_state->ldap_struct, entry, get_attr_key2string(dominfo_attr_list, LDAP_ATTR_ALGORITHMIC_RID_BASE), algorithmic_rid_base_string)) { @@ -224,7 +224,7 @@ static NTSTATUS ldap_next_rid(struct ldap_idmap_state *state, uint32 *rid, if (alg_rid_base > BASE_RID) { /* we have a non-default 'algorithmic rid base', so we have 'low' rids that we can allocate to new users */ - if (smbldap_get_single_attribute(state->smbldap_state->ldap_struct, entry, + if (smbldap_get_single_pstring(state->smbldap_state->ldap_struct, entry, get_attr_key2string(dominfo_attr_list, LDAP_ATTR_NEXT_RID), old_rid_string)) { *rid = (uint32)atol(old_rid_string); @@ -250,14 +250,14 @@ static NTSTATUS ldap_next_rid(struct ldap_idmap_state *state, uint32 *rid, if (!next_rid) { /* not got one already */ switch (rid_type) { case USER_RID_TYPE: - if (smbldap_get_single_attribute(state->smbldap_state->ldap_struct, entry, + if (smbldap_get_single_pstring(state->smbldap_state->ldap_struct, entry, get_attr_key2string(dominfo_attr_list, LDAP_ATTR_NEXT_USERRID), old_rid_string)) { *rid = (uint32)atol(old_rid_string); } break; case GROUP_RID_TYPE: - if (smbldap_get_single_attribute(state->smbldap_state->ldap_struct, entry, + if (smbldap_get_single_pstring(state->smbldap_state->ldap_struct, entry, get_attr_key2string(dominfo_attr_list, LDAP_ATTR_NEXT_GROUPRID), old_rid_string)) { *rid = (uint32)atol(old_rid_string); @@ -297,7 +297,7 @@ static NTSTATUS ldap_next_rid(struct ldap_idmap_state *state, uint32 *rid, pstring domain_sid_string; int error = 0; - if (!smbldap_get_single_attribute(state->smbldap_state->ldap_struct, domain_result, + if (!smbldap_get_single_pstring(state->smbldap_state->ldap_struct, domain_result, get_attr_key2string(dominfo_attr_list, LDAP_ATTR_DOM_SID), domain_sid_string)) { ldap_mods_free(mods, True); @@ -420,7 +420,7 @@ static NTSTATUS ldap_allocate_id(unid_t *id, int id_type) } entry = ldap_first_entry(ldap_state.smbldap_state->ldap_struct, result); - if (!smbldap_get_single_attribute(ldap_state.smbldap_state->ldap_struct, entry, type, id_str)) { + if (!smbldap_get_single_pstring(ldap_state.smbldap_state->ldap_struct, entry, type, id_str)) { DEBUG(0,("ldap_allocate_id: %s attribute not found\n", type)); goto out; @@ -528,7 +528,7 @@ static NTSTATUS ldap_get_sid_from_id(DOM_SID *sid, unid_t id, int id_type) entry = ldap_first_entry(ldap_state.smbldap_state->ldap_struct, result); - if ( !smbldap_get_single_attribute(ldap_state.smbldap_state->ldap_struct, entry, LDAP_ATTRIBUTE_SID, sid_str) ) + if ( !smbldap_get_single_pstring(ldap_state.smbldap_state->ldap_struct, entry, LDAP_ATTRIBUTE_SID, sid_str) ) goto out; if (!string_to_sid(sid, sid_str)) @@ -642,7 +642,7 @@ static NTSTATUS ldap_get_id_from_sid(unid_t *id, int *id_type, const DOM_SID *si DEBUG(10, ("Found mapping entry at dn=%s, looking for %s\n", dn, type)); - if ( smbldap_get_single_attribute(ldap_state.smbldap_state->ldap_struct, entry, type, id_str) ) { + if ( smbldap_get_single_pstring(ldap_state.smbldap_state->ldap_struct, entry, type, id_str) ) { if ( (*id_type & ID_USERID) ) id->uid = strtoul(id_str, NULL, 10); else -- cgit