1 /* config.c - ldbm backend configuration file routine */
4 * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
5 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
11 #include <ac/string.h>
23 struct bdb_info *bdb = (struct bdb_info *) be->be_private;
26 fprintf( stderr, "%s: line %d: "
27 "bdb database info is null!\n",
32 /* directory is the DB_HOME */
33 if ( strcasecmp( argv[0], "directory" ) == 0 ) {
35 fprintf( stderr, "%s: line %d: "
36 "missing dir in \"directory <dir>\" line\n",
40 if ( bdb->bi_dbenv_home ) {
41 free( bdb->bi_dbenv_home );
43 bdb->bi_dbenv_home = ch_strdup( argv[1] );
45 /* mode with which to create new database files */
46 } else if ( strcasecmp( argv[0], "mode" ) == 0 ) {
48 fprintf( stderr, "%s: line %d: "
49 "missing mode in \"mode <mode>\" line\n",
53 bdb->bi_dbenv_mode = strtol( argv[1], NULL, 0 );
56 /* attribute to index */
57 } else if ( strcasecmp( argv[0], "index" ) == 0 ) {
60 fprintf( stderr, "%s: line %d: "
61 "missing attr in \"index <attr> [pres,eq,approx,sub]\" line\n",
64 } else if ( argc > 3 ) {
65 fprintf( stderr, "%s: line %d: "
66 "extra junk after \"index <attr> [pres,eq,approx,sub]\" "
70 rc = attr_index_config( li, fname, lineno, argc - 1, &argv[1] );
72 if( rc != LDAP_SUCCESS ) return 1;
77 fprintf( stderr, "%s: line %d: "
78 "unknown directive \"%s\" in bdb database definition (ignored)\n",
79 fname, lineno, argv[0] );