#include "portable.h"
+#ifdef SLAPD_ALIAS_DEREF
+
#include <stdio.h>
#include <string.h>
#include <ac/socket.h> /* Get struct sockaddr for slap.h */
Debug( LDAP_DEBUG_TRACE,
- "<= dereferencing dn %s\n",
+ "<= dereferencing dn: \"%s\"\n",
dn, 0, 0 );
newDN = ch_strdup ( dn );
}
}
- /* free reader lock */
- cache_return_entry_r(&li->li_cache, eMatched);
+ if(eMatched != NULL) {
+ /* free reader lock */
+ cache_return_entry_r(&li->li_cache, eMatched);
+ }
/*
* the final part of the DN might be an alias
*/
if (depth >= be->be_maxDerefDepth) {
Debug( LDAP_DEBUG_TRACE,
- "<= max deref depth exceeded in derefDN for %s, result %s\n",
+ "<= max deref depth exceeded in derefDN for \"%s\", result \"%s\"\n",
dn, newDN, 0 );
send_ldap_result( conn, op, LDAP_ALIAS_PROBLEM, "",
"Maximum alias dereference depth exceeded for base" );
newDN = ch_strdup ( dn );
}
- Debug( LDAP_DEBUG_TRACE, "<= returning deref DN of %s\n", newDN, 0, 0 );
+ Debug( LDAP_DEBUG_TRACE, "<= returning deref DN of \"%s\"\n", newDN, 0, 0 );
if (matched != NULL) free(matched);
return newDN;
}
+
+#endif /* SLAPD_ALIAS_DEREF */