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-09-14 21:44:09 +0200
committerArthur de Jong <arthur@arthurdejong.org>2007-09-14 21:44:09 +0200
commitf645df69737893f7846e70f27d0b9ab41165078e (patch)
tree97bf6e13e657b075e0385fc72ce78c2a2afef268 /nslcd/util.c
parentbc0bac94bbefd984a83d6d62fed132337719e014 (diff)
revert special casing for alias_byname() to other functions and some logging strings simplifications
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@394 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nslcd/util.c')
-rw-r--r--nslcd/util.c69
1 files changed, 0 insertions, 69 deletions
diff --git a/nslcd/util.c b/nslcd/util.c
index 73be117..0dad86c 100644
--- a/nslcd/util.c
+++ b/nslcd/util.c
@@ -525,75 +525,6 @@ enum nss_status _nss_ldap_getrdnvalue(
return status;
}
-int _nss_ldap_write_rndvalue(TFILE *fp,MYLDAP_SESSION *session,LDAPMessage *entry,const char *rdntype)
-{
- char *dn;
- int status=456;
- char **vals;
- int32_t tmpint32;
- char **exploded_dn;
- char **exploded_rdn;
- char rdnava[64];
- int rdnavalen;
- int i;
- /* log call */
- log_log(LOG_DEBUG,"_nss_ldap_write_rndvalue(%s)",rdntype);
- /* get the dn from the entry */
- dn=_nss_ldap_get_dn(session,entry);
- if (dn==NULL)
- return NSLCD_RESULT_NOTFOUND;
- /* append a `=' to the rdntype */
- snprintf(rdnava,sizeof(rdnava),"%s=",rdntype);
- rdnavalen=strlen(rdnava);
- /* explode dn */
- exploded_dn=ldap_explode_dn(dn,0);
- if (exploded_dn!=NULL)
- {
- /*
- * attempt to get the naming attribute's principal
- * value by parsing the RDN. We need to support
- * multivalued RDNs (as they're essentially mandated
- * for services)
- */
- exploded_rdn=ldap_explode_rdn(exploded_dn[0],0);
- if (exploded_rdn!=NULL)
- {
- for (i=0;exploded_rdn[i]!=NULL;i++)
- {
- /* if the values begins with rndava */
- if (strncasecmp(exploded_rdn[i],rdnava,rdnavalen)==0)
- {
- /* FIXME: handle case where WRITE fails */
- WRITE_STRING(fp,exploded_rdn[i]+rdnavalen);
- status=0;
- break;
- }
- }
- ldap_value_free(exploded_rdn);
- }
- ldap_value_free(exploded_dn);
- }
- ldap_memfree(dn);
- /*
- * If examining the DN failed, then pick the nominal first
- * value of cn as the canonical name (recall that attributes
- * are sets, not sequences)
- */
- if (status==456)
- {
- vals=_nss_ldap_get_values(session,entry,rdntype);
- if (vals!=NULL)
- {
- /* write the first entry */
- WRITE_STRING(fp,vals[0]);
- status=NSS_STATUS_SUCCESS;
- ldap_value_free(vals);
- status=0;
- }
- }
- return status;
-}
-
int _nss_ldap_escape_string(const char *src,char *buffer,size_t buflen)
{
int pos=0;