-/*
- * Copyright 1999, Dmitry Kovalev <mit@openldap.org>, All rights reserved.
+/* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Redistribution and use in source and binary forms are permitted only
- * as authorized by the OpenLDAP Public License. A copy of this
- * license is available at http://www.OpenLDAP.org/license.html or
- * in file LICENSE in the top-level directory of the distribution.
+ * Copyright 1999-2004 The OpenLDAP Foundation.
+ * Portions Copyright 1999 Dmitry Kovalev.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
+ */
+/* ACKNOWLEDGEMENTS:
+ * This work was initially developed by Dmitry Kovalev for inclusion
+ * by OpenLDAP Software.
*/
#include "portable.h"
#ifdef SLAPD_SQL
#include <stdio.h>
-#include <string.h>
+#include "ac/string.h"
#include <sys/types.h>
#include "slap.h"
#include "back-sql.h"
Debug( LDAP_DEBUG_TRACE, "<==backsql_db_config(): "
"subtree_cond=%s\n", si->subtree_cond.bv_val, 0, 0 );
+ } else if ( !strcasecmp( argv[ 0 ], "children_cond" ) ) {
+ if ( argc < 2 ) {
+ Debug( LDAP_DEBUG_TRACE,
+ "<==backsql_db_config (%s line %d): "
+ "missing SQL condition "
+ "in \"children_cond\" directive\n",
+ fname, lineno, 0 );
+ return 1;
+ }
+ ber_str2bv( argv[ 1 ], 0, 1, &si->children_cond );
+ Debug( LDAP_DEBUG_TRACE, "<==backsql_db_config(): "
+ "subtree_cond=%s\n", si->children_cond.bv_val, 0, 0 );
+
} else if ( !strcasecmp( argv[ 0 ], "oc_query" ) ) {
if ( argc < 2 ) {
Debug( LDAP_DEBUG_TRACE,
BACKSQL_FAIL_IF_NO_MAPPING( si ) ? "yes" : "no", 0, 0 );
} else {
- Debug( LDAP_DEBUG_TRACE, "<==backsql_db_config (%s line %d): "
- "unknown directive \"%s\" (ignored)\n",
- fname, lineno, argv[ 0 ] );
+ return SLAP_CONF_UNKNOWN;
}
return 0;