]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-sql/config.c
now I remember why I introduced the 'has_ldapinfo_dn_ru' flag
[openldap] / servers / slapd / back-sql / config.c
index 3472496ae66361e9b3407fa2f080acc2f69314c0..d88a57396d590554e58e6f27d0061b6c0f004b7c 100644 (file)
@@ -1,10 +1,21 @@
-/*
- *      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"
@@ -12,7 +23,7 @@
 #ifdef SLAPD_SQL
 
 #include <stdio.h>
-#include <string.h>
+#include "ac/string.h"
 #include <sys/types.h>
 #include "slap.h"
 #include "back-sql.h"
@@ -114,6 +125,19 @@ backsql_db_config(
                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, 
@@ -312,9 +336,7 @@ backsql_db_config(
                        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;