Dynamic config support for back-sql (untested)

This commit is contained in:
Howard Chu 2011-11-04 22:00:44 -07:00
parent 31b5c396d3
commit 77cd4c53be
5 changed files with 455 additions and 582 deletions

View File

@ -50,6 +50,13 @@ backsql_api_config( backsql_info *bi, const char *name, int argc, char *argv[] )
ch_free( ba2 );
return 1;
}
ba2->ba_argc = argc;
if ( argc ) {
int i;
ba2->ba_argv = ch_malloc( argc * sizeof(char *));
for ( i=0; i<argc; i++ )
ba2->ba_argv[i] = ch_strdup( argv[i] );
}
}
ba2->ba_next = bi->sql_api;

View File

@ -280,6 +280,8 @@ typedef struct backsql_api {
void *ba_private;
struct backsql_api *ba_next;
char **ba_argv;
int ba_argc;
} backsql_api;
/*
@ -510,8 +512,9 @@ typedef struct backsql_info {
struct berval sql_upper_func;
struct berval sql_upper_func_open;
struct berval sql_upper_func_close;
BerVarray sql_concat_func;
struct berval sql_strcast_func;
BerVarray sql_concat_func;
char *sql_concat_patt;
struct berval sql_aliasing;
struct berval sql_aliasing_quote;
@ -570,6 +573,7 @@ typedef struct backsql_info {
BACKSQL_ISF(si, BSQLF_AUTOCOMMIT_ON)
Entry *sql_baseObject;
char *sql_base_ob_file;
#ifdef BACKSQL_ARBITRARY_KEY
#define BACKSQL_BASEOBJECT_IDSTR "baseObject"
#define BACKSQL_BASEOBJECT_KEYVAL BACKSQL_BASEOBJECT_IDSTR

File diff suppressed because it is too large Load Diff

View File

@ -46,6 +46,7 @@ sql_back_initialize(
#endif /* ! BACKSQL_ARBITRARY_KEY */
NULL
};
int rc;
bi->bi_controls = controls;
@ -58,7 +59,7 @@ sql_back_initialize(
Debug( LDAP_DEBUG_TRACE,"==>sql_back_initialize()\n", 0, 0, 0 );
bi->bi_db_init = backsql_db_init;
bi->bi_db_config = backsql_db_config;
bi->bi_db_config = config_generic_wrapper;
bi->bi_db_open = backsql_db_open;
bi->bi_db_close = backsql_db_close;
bi->bi_db_destroy = backsql_db_destroy;
@ -80,8 +81,9 @@ sql_back_initialize(
bi->bi_connection_init = 0;
rc = backsql_init_cf( bi );
Debug( LDAP_DEBUG_TRACE,"<==sql_back_initialize()\n", 0, 0, 0 );
return 0;
return rc;
}
int

View File

@ -308,4 +308,6 @@ extern BI_entry_release_rw backsql_entry_release;
extern BI_connection_destroy backsql_connection_destroy;
int backsql_init_cf( BackendInfo * bi );
#endif /* PROTO_SQL_H */