]> git.sur5r.net Git - openldap/commitdiff
make slurpd honor include files in slapd.conf (note: the problem was signalled in...
authorPierangelo Masarati <ando@openldap.org>
Wed, 4 Jul 2001 20:03:49 +0000 (20:03 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 4 Jul 2001 20:03:49 +0000 (20:03 +0000)
servers/slurpd/config.c

index db0150225e4b8c6e947f1c18ac1cec230d3d6a80..e7a5627f5988850cdf4a999eebdc51a62bdf7436 100644 (file)
@@ -111,6 +111,34 @@ slurpd_read_config(
            }
        } else if ( strcasecmp( cargv[0], "replica" ) == 0 ) {
            add_replica( cargv, cargc );
+           
+           /* include another config file */
+       } else if ( strcasecmp( cargv[0], "include" ) == 0 ) {
+           char *savefname;
+           int savelineno;
+
+            if ( cargc < 2 ) {
+#ifdef NEW_LOGGING
+                LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+                        "%s: line %d: missing filename in \"include "
+                        "<filename>\" line.\n", fname, lineno ));
+#else
+                Debug( LDAP_DEBUG_ANY,
+        "%s: line %d: missing filename in \"include <filename>\" line\n",
+                        fname, lineno, 0 );
+#endif
+               
+                return( 1 );
+            }
+           savefname = strdup( cargv[1] );
+           savelineno = lineno;
+           
+           if ( slurpd_read_config( savefname ) != 0 ) {
+               return( 1 );
+           }
+               
+           free( savefname );
+           lineno = savelineno - 1;
        }
     }
     fclose( fp );