Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/nslcd/util.c
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2007-07-24 15:38:56 +0200
committerArthur de Jong <arthur@arthurdejong.org>2007-07-24 15:38:56 +0200
commitd6f0e2fbfde1a928580cbfdd6845facf2ff1aea2 (patch)
tree2f6fbb9914f283a068672551254eacc9ade34f7b /nslcd/util.c
parentfaee906ac541a533b61d1b51aad34fde4f3f8509 (diff)
switch to a new interface for doing attribute mapping, splitting the attribute mapping stuff into a separate file
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@326 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nslcd/util.c')
-rw-r--r--nslcd/util.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/nslcd/util.c b/nslcd/util.c
index ecac7b7..bd08825 100644
--- a/nslcd/util.c
+++ b/nslcd/util.c
@@ -54,6 +54,8 @@
#include "common.h"
#include "log.h"
#include "cfg.h"
+#include "ldap-schema.h"
+#include "attmap.h"
static void *__cache = NULL;
@@ -297,9 +299,9 @@ enum nss_status _nss_ldap_dn2uid(const char *dn,char **uid,char **buffer,
const char *attrs[4];
LDAPMessage *res;
- attrs[0] = ATM (LM_PASSWD, uid);
- attrs[1] = ATM (LM_GROUP, uniqueMember);
- attrs[2] = AT (objectClass);
+ attrs[0] = attmap_passwd_uid;
+ attrs[1] = attmap_group_uniqueMember;
+ attrs[2] = attmap_objectClass;
attrs[3] = NULL;
if (_nss_ldap_read (dn, attrs, &res) == NSS_STATUS_SUCCESS)
@@ -307,7 +309,7 @@ enum nss_status _nss_ldap_dn2uid(const char *dn,char **uid,char **buffer,
LDAPMessage *e = _nss_ldap_first_entry (res);
if (e != NULL)
{
- if (has_objectclass(e,OC(posixGroup)))
+ if (has_objectclass(e,attmap_group_objectClass))
{
*pIsNestedGroup = 1;
*pRes = res;
@@ -316,7 +318,7 @@ enum nss_status _nss_ldap_dn2uid(const char *dn,char **uid,char **buffer,
}
status =
- _nss_ldap_assign_attrval (e, ATM (LM_PASSWD, uid), uid,
+ _nss_ldap_assign_attrval (e, attmap_passwd_uid, uid,
buffer, buflen);
if (status == NSS_STATUS_SUCCESS)
dn2uid_cache_put (dn, *uid);