SaslRegexp_t *SaslRegexp = NULL;
int sasl_external_x509dn_convert;
+#ifdef SLAPD_RLOOKUPS
+int use_reverse_lookup = 1;
+#else /* !SLAPD_RLOOKUPS */
+int use_reverse_lookup = 0;
+#endif /* !SLAPD_RLOOKUPS */
+
static char *fp_getline(FILE *fp, int *lineno);
static void fp_getline_init(int *lineno);
static int fp_parse_line(char *line, int *argcp, char **argv);
#endif
+ } else if ( !strcasecmp( cargv[0], "reverse-lookup" ) ) {
+#ifdef SLAPD_RLOOKUPS
+ if ( cargc < 2 ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "config", LDAP_LEVEL_INFO,
+ "%s: line %d: reverse-lookup: "
+ "missing \"on\" or \"off\"\n",
+ fname, lineno ));
+#else
+ Debug( LDAP_DEBUG_ANY,
+"%s: line %d: reverse-lookup: missing \"on\" or \"off\"\n",
+ fname, lineno, 0 );
+#endif
+ return( 1 );
+ }
+
+ if ( !strcasecmp( cargv[1], "on" ) ) {
+ use_reverse_lookup = 1;
+ } else if ( !strcasecmp( cargv[1], "off" ) ) {
+ use_reverse_lookup = 0;
+ } else {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "config", LDAP_LEVEL_INFO,
+ "%s: line %d: reverse-lookup: "
+ "must be \"on\" (default) "
+ "or \"off\"\n",
+ fname, lineno ));
+#else
+ Debug( LDAP_DEBUG_ANY,
+"%s: line %d: reverse-lookup: must be \"on\" (default) or \"off\"\n",
+ fname, lineno, 0 );
+#endif
+ return( 1 );
+ }
+
+#else /* !SLAPD_RLOOKUPS */
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "config", LDAP_LEVEL_INFO,
+ "%s: line %d: reverse lookups "
+ "are not configured (ignored).\n",
+ fname, lineno ));
+#else
+ Debug( LDAP_DEBUG_ANY,
+"%s: line %d: reverse lookups are not configured (ignored).\n",
+ fname, lineno, 0 );
+#endif
+#endif /* !SLAPD_RLOOKUPS */
+
/* pass anything else to the current backend info/db config routine */
} else {
if ( bi != NULL ) {
if ( strncasecmp( type, LDAPI_MOD_URLEXT "=", sizeof(LDAPI_MOD_URLEXT "=") - 1 ) == 0 ) {
char *value = type + sizeof(LDAPI_MOD_URLEXT "=") - 1;
mode_t p = 0;
-
-#if 0
- if ( strlen( value ) != 9 ) {
- return LDAP_OTHER;
- }
-
- switch ( value[ 0 ] ) {
- case 'r':
- p |= S_IRUSR;
- break;
- case '-':
- break;
- default:
- return LDAP_OTHER;
- }
-
- switch ( value[ 1 ] ) {
- case 'w':
- p |= S_IWUSR;
- break;
- case '-':
- break;
- default:
- return LDAP_OTHER;
- }
-
- switch ( value[ 2 ] ) {
- case 'x':
- p |= S_IXUSR;
- break;
- case '-':
- break;
- default:
- return LDAP_OTHER;
- }
-
- switch ( value[ 3 ] ) {
- case 'r':
- p |= S_IRGRP;
- break;
- case '-':
- break;
- default:
- return LDAP_OTHER;
- }
-
- switch ( value[ 4 ] ) {
- case 'w':
- p |= S_IWGRP;
- break;
- case '-':
- break;
- default:
- return LDAP_OTHER;
- }
-
- switch ( value[ 5 ] ) {
- case 'x':
- p |= S_IXGRP;
- break;
- case '-':
- break;
- default:
- return LDAP_OTHER;
- }
-
- switch ( value[ 6 ] ) {
- case 'r':
- p |= S_IROTH;
- break;
- case '-':
- break;
- default:
- return LDAP_OTHER;
- }
-
- switch ( value[ 7 ] ) {
- case 'w':
- p |= S_IWOTH;
- break;
- case '-':
- break;
- default:
- return LDAP_OTHER;
- }
-
- switch ( value[ 8 ] ) {
- case 'x':
- p |= S_IXOTH;
- break;
- case '-':
- break;
- default:
- return LDAP_OTHER;
- }
-#else
int j;
if ( strlen(value) != 3 ) {
return LDAP_OTHER;
}
}
-#endif
*crit = c;
*perms = p;
#endif
) {
#ifdef SLAPD_RLOOKUPS
+ if ( use_reverse_lookup ) {
# ifdef LDAP_PF_INET6
- if ( from.sa_addr.sa_family == AF_INET6 )
- hp = gethostbyaddr(
- (char *)&(from.sa_in6_addr.sin6_addr),
- sizeof(from.sa_in6_addr.sin6_addr),
- AF_INET6 );
- else
+ if ( from.sa_addr.sa_family == AF_INET6 )
+ hp = gethostbyaddr(
+ (char *)&(from.sa_in6_addr.sin6_addr),
+ sizeof(from.sa_in6_addr.sin6_addr),
+ AF_INET6 );
+ else
# endif /* LDAP_PF_INET6 */
- hp = gethostbyaddr(
- (char *) &(from.sa_in_addr.sin_addr),
- sizeof(from.sa_in_addr.sin_addr),
- AF_INET );
- dnsname = hp ? ldap_pvt_str2lower( hp->h_name ) : NULL;
+ hp = gethostbyaddr(
+ (char *) &(from.sa_in_addr.sin_addr),
+ sizeof(from.sa_in_addr.sin_addr),
+ AF_INET );
+ dnsname = hp ? ldap_pvt_str2lower( hp->h_name ) : NULL;
+ }
#else
dnsname = NULL;
#endif /* SLAPD_RLOOKUPS */