/* backend.c - routines for dealing with back-end databases */
+#include "portable.h"
+
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
extern int ldbm_back_config();
extern int ldbm_back_init();
extern int ldbm_back_close();
+extern int ldbm_back_group();
#endif
#ifdef LDAP_PASSWD
be->be_config = ldbm_back_config;
be->be_init = ldbm_back_init;
be->be_close = ldbm_back_close;
+#ifdef ACLGROUP
+ be->be_group = ldbm_back_group;
+#endif
be->be_type = "ldbm";
foundit = 1;
}
be->be_config = passwd_back_config;
be->be_init = NULL;
be->be_close = NULL;
+#ifdef ACLGROUP
+ be->be_group = NULL;
+#endif
be->be_type = "passwd";
foundit = 1;
}
be->be_config = shell_back_config;
be->be_init = shell_back_init;
be->be_close = NULL;
+#ifdef ACLGROUP
+ be->be_group = NULL;
+#endif
be->be_type = "shell";
foundit = 1;
}
dnlen = strlen( dn );
for ( i = 0; i < nbackends; i++ ) {
for ( j = 0; backends[i].be_suffix != NULL &&
- backends[i].be_suffix[j] != NULL; j++ ) {
+ backends[i].be_suffix[j] != NULL; j++ )
+ {
+#ifdef LDAP_ALLOW_NULL_SEARCH_BASE
+ /* Add greg@greg.rim.or.jp
+ * It's quick hack for cheap client
+ * Some browser offer a NULL base at ldap_search
+ */
+ if(dnlen == 0) {
+ Debug( LDAP_DEBUG_TRACE,
+ "select_backend: use default backend\n", 0, 0, 0 );
+ return (&backends[i]);
+ }
+#endif /* LDAP_ALLOW_NULL_SEARCH_BASE */
+
len = strlen( backends[i].be_suffix[j] );
if ( len > dnlen ) {
}
}
}
+
+#ifdef ACLGROUP
+int
+be_group(Backend *be, char *bdn, char *edn)
+{
+ if (be->be_group)
+ return(be->be_group(be, bdn, edn));
+ else
+ return(1);
+}
+#endif