From f70cc4cdc188fd8bf9f8f84cb55d15c122e463dd Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 21 Jun 2003 00:45:03 +0000 Subject: This patch works towards to goal of common code shared between idmap_ldap and pdb_ldap. So far, it's just a function rename, so that the next patch can be a very simple matter of copying functions, without worrying about what changed in the process. Also removes the 'static' pointers for the rebind procedures, replacing them with a linked list of value/key lookups. (Only needed on older LDAP client libs) Andrew Bartlett (This used to be commit f93167a7e1c56157481a934d2225fe19786a3bff) --- source3/sam/idmap_ldap.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'source3/sam/idmap_ldap.c') diff --git a/source3/sam/idmap_ldap.c b/source3/sam/idmap_ldap.c index 379f7729ab..b31ce18925 100644 --- a/source3/sam/idmap_ldap.c +++ b/source3/sam/idmap_ldap.c @@ -575,8 +575,8 @@ static NTSTATUS ldap_allocate_id(unid_t *id, int id_type) snprintf(new_id_str, sizeof(new_id_str), "%u", ((id_type & ID_USERID) ? id->uid : id->gid) + 1); - ldap_set_mod( &mods, LDAP_MOD_DELETE, type, id_str ); - ldap_set_mod( &mods, LDAP_MOD_ADD, type, new_id_str ); + smbldap_set_mod( &mods, LDAP_MOD_DELETE, type, id_str ); + smbldap_set_mod( &mods, LDAP_MOD_ADD, type, new_id_str ); rc = ldap_modify_s(ldap_state.ldap_struct, dn, mods); @@ -829,9 +829,9 @@ static NTSTATUS ldap_set_mapping(const DOM_SID *sid, unid_t id, int id_type) snprintf(id_str, sizeof(id_str), "%u", ((id_type & ID_USERID) ? id.uid : id.gid)); sid_to_string( sid_str, sid ); - ldap_set_mod( &mods, LDAP_MOD_ADD, "objectClass", LDAP_OBJ_IDMAP_ENTRY ); - ldap_set_mod( &mods, LDAP_MOD_ADD, type, id_str ); - ldap_set_mod( &mods, LDAP_MOD_ADD, + smbldap_set_mod( &mods, LDAP_MOD_ADD, "objectClass", LDAP_OBJ_IDMAP_ENTRY ); + smbldap_set_mod( &mods, LDAP_MOD_ADD, type, id_str ); + smbldap_set_mod( &mods, LDAP_MOD_ADD, get_attr_key2string(sidmap_attr_list, LDAP_ATTR_SID), sid_str ); do { @@ -910,10 +910,10 @@ static NTSTATUS ldap_idmap_init( char *params ) snprintf( uid_str, sizeof(uid_str), "%d", luid ); snprintf( gid_str, sizeof(gid_str), "%d", lgid ); - ldap_set_mod( &mods, LDAP_MOD_ADD, "objectClass", LDAP_OBJ_IDPOOL ); - ldap_set_mod( &mods, LDAP_MOD_ADD, + smbldap_set_mod( &mods, LDAP_MOD_ADD, "objectClass", LDAP_OBJ_IDPOOL ); + smbldap_set_mod( &mods, LDAP_MOD_ADD, get_attr_key2string(idpool_attr_list, LDAP_ATTR_UIDNUMBER), uid_str ); - ldap_set_mod( &mods, LDAP_MOD_ADD, + smbldap_set_mod( &mods, LDAP_MOD_ADD, get_attr_key2string(idpool_attr_list, LDAP_ATTR_GIDNUMBER), gid_str ); do { @@ -931,15 +931,15 @@ static NTSTATUS ldap_idmap_init( char *params ) mods = NULL; snprintf( dn, sizeof(dn), "%s,%s", IDMAP_USER_SUFFIX, lp_ldap_idmap_suffix() ); - ldap_set_mod( &mods, LDAP_MOD_ADD, "objectClass", LDAP_OBJ_OU ); - ldap_set_mod( &mods, LDAP_MOD_ADD, "ou", "idmap people" ); + smbldap_set_mod( &mods, LDAP_MOD_ADD, "objectClass", LDAP_OBJ_OU ); + smbldap_set_mod( &mods, LDAP_MOD_ADD, "ou", "idmap people" ); ldap_add_s(ldap_state.ldap_struct, dn, mods); ldap_mods_free( mods, True ); mods = NULL; snprintf( dn, sizeof(dn), "%s,%s", IDMAP_GROUP_SUFFIX, lp_ldap_idmap_suffix() ); - ldap_set_mod( &mods, LDAP_MOD_ADD, "objectClass", LDAP_OBJ_OU ); - ldap_set_mod( &mods, LDAP_MOD_ADD, "ou", "idmap group" ); + smbldap_set_mod( &mods, LDAP_MOD_ADD, "objectClass", LDAP_OBJ_OU ); + smbldap_set_mod( &mods, LDAP_MOD_ADD, "ou", "idmap group" ); ldap_add_s(ldap_state.ldap_struct, dn, mods); ldap_mods_free( mods, True ); #endif -- cgit