From 50ca074832b567ee1440b18c33b1fdbab6a2c25e Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Fri, 14 Sep 2007 21:51:05 +0000 Subject: add note about free()ing the returned value and add logging git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@398 ef36b2f9-881f-0410-afb5-c4e39611909c --- nslcd/passwd.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nslcd/passwd.c') diff --git a/nslcd/passwd.c b/nslcd/passwd.c index bd0a1fb..1f5d1b8 100644 --- a/nslcd/passwd.c +++ b/nslcd/passwd.c @@ -241,12 +241,16 @@ static enum nss_status _nss_ldap_parse_pw( return NSS_STATUS_SUCCESS; } +/* Note that our caller has to free the returned value with ldap_free() */ char *passwd_username2dn(MYLDAP_SESSION *session,const char *username) { char *userdn=NULL; static const char *no_attrs[]={ NULL }; char filter[1024]; LDAPMessage *res,*e; + /* log call */ + log_log(LOG_DEBUG,"passwd_username2dn(%s)",username); + /* do the LDAP request */ mkfilter_passwd_byname(username,filter,sizeof(filter)); if (_nss_ldap_search_sync(session,passwd_base,passwd_scope,filter,no_attrs,1,&res)==NSS_STATUS_SUCCESS) { -- cgit v1.2.3