Changeset 180
- Timestamp:
- 04/28/07 23:56:58 (17 months ago)
- Location:
- trunk
- Files:
-
- 9 modified
- 1 copied
- 14 moved
-
c2s/authreg.c (modified) (4 diffs)
-
c2s/Makefile.am (modified) (2 diffs)
-
configure.in (modified) (15 diffs)
-
etc/c2s.xml.dist.in (modified) (1 diff)
-
etc/sm.xml.dist.in (modified) (1 diff)
-
Makefile.am (modified) (1 diff)
-
sm/Makefile.am (modified) (3 diffs)
-
sm/mm.c (modified) (4 diffs)
-
sm/storage.c (modified) (6 diffs)
-
storage/authreg_anon.c (moved) (moved from trunk/c2s/authreg_anon.c) (3 diffs)
-
storage/authreg_db.c (moved) (moved from trunk/c2s/authreg_db.c) (3 diffs)
-
storage/authreg_ldap.c (moved) (moved from trunk/c2s/authreg_ldap.c) (3 diffs)
-
storage/authreg_mysql.c (moved) (moved from trunk/c2s/authreg_mysql.c) (2 diffs)
-
storage/authreg_pam.c (moved) (moved from trunk/c2s/authreg_pam.c) (3 diffs)
-
storage/authreg_pgsql.c (moved) (moved from trunk/c2s/authreg_pgsql.c) (2 diffs)
-
storage/authreg_pipe.c (moved) (moved from trunk/c2s/authreg_pipe.c) (3 diffs)
-
storage/authreg_sqlite.c (moved) (moved from trunk/c2s/authreg_sqlite.c) (2 diffs)
-
storage/Makefile.am (copied) (copied from trunk/c2s/Makefile.am) (1 diff)
-
storage/storage_db.c (moved) (moved from trunk/sm/storage_db.c) (3 diffs)
-
storage/storage_fs.c (moved) (moved from trunk/sm/storage_fs.c) (3 diffs)
-
storage/storage_mysql.c (moved) (moved from trunk/sm/storage_mysql.c) (2 diffs)
-
storage/storage_oracle.c (moved) (moved from trunk/sm/storage_oracle.c) (3 diffs)
-
storage/storage_pgsql.c (moved) (moved from trunk/sm/storage_pgsql.c) (2 diffs)
-
storage/storage_sqlite.c (moved) (moved from trunk/sm/storage_sqlite.c) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/c2s/authreg.c
r177 r180 20 20 21 21 #include "c2s.h" 22 23 22 #include <stringprep.h> 23 #include <dlfcn.h> 24 24 25 25 /* authreg module manager */ 26 27 /* if you add a module, you'll need to update these arrays */28 29 #ifdef STORAGE_MYSQL30 extern int ar_mysql_init(authreg_t);31 #endif32 #ifdef STORAGE_PGSQL33 extern int ar_pgsql_init(authreg_t);34 #endif35 #ifdef STORAGE_DB36 extern int ar_db_init(authreg_t);37 #endif38 #ifdef STORAGE_LDAP39 extern int ar_ldap_init(authreg_t);40 #endif41 #ifdef STORAGE_PAM42 extern int ar_pam_init(authreg_t);43 #endif44 #ifdef STORAGE_PIPE45 extern int ar_pipe_init(authreg_t);46 #endif47 #ifdef STORAGE_ANON48 extern int ar_anon_init(authreg_t);49 #endif50 #ifdef STORAGE_SQLITE51 extern int ar_sqlite_init(authreg_t);52 #endif53 54 static const char *module_names[] = {55 #ifdef STORAGE_MYSQL56 "mysql",57 #endif58 #ifdef STORAGE_PGSQL59 "pgsql",60 #endif61 #ifdef STORAGE_DB62 "db",63 #endif64 #ifdef STORAGE_LDAP65 "ldap",66 #endif67 #ifdef STORAGE_PAM68 "pam",69 #endif70 #ifdef STORAGE_PIPE71 "pipe",72 #endif73 #ifdef STORAGE_ANON74 "anon",75 #endif76 #ifdef STORAGE_SQLITE77 "sqlite",78 #endif79 NULL80 };81 82 ar_module_init_fn module_inits[] = {83 #ifdef STORAGE_MYSQL84 ar_mysql_init,85 #endif86 #ifdef STORAGE_PGSQL87 ar_pgsql_init,88 #endif89 #ifdef STORAGE_DB90 ar_db_init,91 #endif92 #ifdef STORAGE_LDAP93 ar_ldap_init,94 #endif95 #ifdef STORAGE_PAM96 ar_pam_init,97 #endif98 #ifdef STORAGE_PIPE99 ar_pipe_init,100 #endif101 #ifdef STORAGE_ANON102 ar_anon_init,103 #endif104 #ifdef STORAGE_SQLITE105 ar_sqlite_init,106 #endif107 NULL108 };109 26 110 27 typedef struct _authreg_error_st { … … 117 34 /** get a handle for the named module */ 118 35 authreg_t authreg_init(c2s_t c2s, char *name) { 119 int n;120 ar_module_init_fn init = NULL;36 char mod_fullpath[PATH_MAX], *modules_path; 37 ar_module_init_fn init_fn = NULL; 121 38 authreg_t ar; 122 123 /* hunt it down */ 124 n = 0; 125 while(module_names[n] != NULL) 126 { 127 if(strcmp(module_names[n], name) == 0) 128 { 129 init = module_inits[n]; 130 break; 131 } 132 n++; 133 } 134 135 if(init == NULL) 136 { 137 log_write(c2s->log, LOG_ERR, "no such auth module '%s'", name); 39 void *handle; 40 41 /* load authreg module */ 42 modules_path = config_get_one(c2s->config, "authreg.path", 0); 43 if (modules_path != NULL) 44 log_write(c2s->log, LOG_NOTICE, "modules search path: %s", modules_path); 45 else 46 log_write(c2s->log, LOG_NOTICE, "modules search path undefined, using default: "LIBRARY_DIR); 47 48 log_write(c2s->log, LOG_INFO, "loading '%s' authreg module", name); 49 #ifndef WIN32 50 if (modules_path != NULL) 51 snprintf(mod_fullpath, PATH_MAX, "%s/authreg_%s.so", modules_path, name); 52 else 53 snprintf(mod_fullpath, PATH_MAX, "%s/authreg_%s.so", LIBRARY_DIR, name); 54 handle = dlopen(mod_fullpath, RTLD_LAZY); 55 if (handle != NULL) 56 init_fn = dlsym(handle, "ar_init"); 57 #else 58 if (modules_path != NULL) 59 snprintf(mod_fullpath, PATH_MAX, "%s\\authreg_%s.dll", modules_path, name); 60 else 61 snprintf(mod_fullpath, PATH_MAX, "authreg_%s.dll", name); 62 handle = (void*) LoadLibrary(mod_fullpath); 63 if (handle != NULL) 64 init_fn = GetProcAddress((HMODULE) handle, "ar_init"); 65 #endif 66 67 if (handle != NULL && init_fn != NULL) { 68 log_debug(ZONE, "preloaded module '%s' (not initialized yet)", name); 69 } else { 70 #ifndef WIN32 71 log_write(c2s->log, LOG_ERR, "failed loading authreg module '%s' (%s)", name, dlerror()); 72 if (handle != NULL) 73 dlclose(handle); 74 #else 75 log_write(c2s->log, LOG_ERR, "failed loading authreg module '%s' (errcode: %x)", name, GetLastError()); 76 if (handle != NULL) 77 FreeLibrary((HMODULE) handle); 78 #endif 138 79 return NULL; 139 80 } … … 146 87 147 88 /* call the initialiser */ 148 if((init )(ar) != 0)149 { 150 log_write(c2s->log, LOG_ERR, "failed to initiali se auth module '%s'", name);89 if((init_fn)(ar) != 0) 90 { 91 log_write(c2s->log, LOG_ERR, "failed to initialize auth module '%s'", name); 151 92 authreg_free(ar); 152 93 return NULL; … … 162 103 163 104 /* its good */ 164 log_write(c2s->log, LOG_NOTICE, "initiali sed auth module '%s'", name);105 log_write(c2s->log, LOG_NOTICE, "initialized auth module '%s'", name); 165 106 166 107 return ar; -
trunk/c2s/Makefile.am
r175 r180 1 INCLUDES = -DCONFIG_DIR=\"$(sysconfdir)\" \2 $(MYSQL_CFLAGS) \3 $(PGSQL_CFLAGS)4 5 1 bin_PROGRAMS = c2s 6 2 7 c2s_SOURCES = authreg.c authreg_anon.c authreg_db.c authreg_ldap.c authreg_pam.c authreg_pipe.c bind.c c2s.c main.c sm.c 8 9 # MySQL support 10 if STORAGE_MYSQL 11 c2s_SOURCES += authreg_mysql.c 12 endif 13 14 # PostgreSQL support 15 if STORAGE_PGSQL 16 c2s_SOURCES += authreg_pgsql.c 17 endif 18 19 # SQLite3 support 20 if STORAGE_SQLITE 21 c2s_SOURCES += authreg_sqlite.c 22 endif 23 3 c2s_SOURCES = authreg.c bind.c c2s.c main.c sm.c 4 c2s_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\" -DLIBRARY_DIR=\"$(pkglibdir)\" 5 c2s_LDFLAGS = -Wl,-export-dynamic 24 6 25 7 noinst_HEADERS = c2s.h … … 28 10 $(top_builddir)/mio/libmio.la \ 29 11 $(top_builddir)/util/libutil.la \ 30 $(top_builddir)/subst/libsubst.la \ 31 $(MYSQL_LIBS) \ 32 $(PGSQL_LIBS) \ 33 $(SQLITE_LIBS) 34 12 $(top_builddir)/subst/libsubst.la -
trunk/configure.in
r177 r180 29 29 dnl basic tools 30 30 AC_PROG_CC 31 AM_PROG_CC_C_O 31 32 AC_PROG_MAKE_SET 32 33 … … 328 329 AC_MSG_CHECKING([if user wants MySQL support]) 329 330 AC_ARG_ENABLE([mysql], 330 AC_HELP_STRING([--enable-mysql], [enable MySQL auth reg/storage support (no)]),331 AC_HELP_STRING([--enable-mysql], [enable MySQL auth/reg/storage support (no)]), 331 332 [enable_mysql=$enableval have_mysql=no], 332 333 [enable_mysql=no have_mysql=no]) … … 368 369 AC_MSG_CHECKING([if user wants PostgreSQL support]) 369 370 AC_ARG_ENABLE([pgsql], 370 AC_HELP_STRING([--enable-pgsql], [enable PostgreSQL auth reg/storage support (no)]),371 AC_HELP_STRING([--enable-pgsql], [enable PostgreSQL auth/reg/storage support (no)]), 371 372 [enable_pgsql=$enableval have_pgsql=no], 372 373 [enable_pgsql=no have_pgsql=no]) … … 409 410 AC_MSG_CHECKING([if user wants SQLite3 support]) 410 411 AC_ARG_ENABLE([sqlite], 411 AS_HELP_STRING([--enable-sqlite], [enable SQLite3 auth reg/storage support (no)]),412 AS_HELP_STRING([--enable-sqlite], [enable SQLite3 auth/reg/storage support (no)]), 412 413 [enable_sqlite=$enableval have_sqlite=no], 413 414 [enable_sqlite=no have_sqlite=no]) … … 430 431 431 432 dnl berkeley db 432 AC_ARG_ENABLE(db, AC_HELP_STRING([--enable-db], [enable Berkeley DB auth reg/storage support (no)]),433 AC_ARG_ENABLE(db, AC_HELP_STRING([--enable-db], [enable Berkeley DB auth/reg/storage support (no)]), 433 434 want_db=$enableval, want_db=no) 434 435 if test "x-$want_db" = "x-yes" ; then … … 466 467 AC_MSG_ERROR([Berkeley DB >= 4.1.24 not found]) 467 468 else 468 AC_DEFINE(STORAGE_DB,1,[Define to 1 if you want to use Berkeley DB for authreg/storage.]) 469 fi 470 fi 469 DB_LIBS="-l$lib" 470 AC_DEFINE(STORAGE_DB,1,[Define to 1 if you want to use Berkeley DB for auth/reg/storage.]) 471 fi 472 fi 473 AC_SUBST(DB_LIBS) 474 AM_CONDITIONAL(STORAGE_DB, [test "x-$have_db_version" = "x-yes"]) 471 475 472 476 … … 495 499 AC_MSG_RESULT(no)) 496 500 fi 497 if test "x-$ want_ldap" = "x-yes" -a "x-$have_ldap_version" = "x-" ; then501 if test "x-$have_ldap_version" = "x-" ; then 498 502 AC_MSG_ERROR([OpenLDAP client libraries >= 2.1.0 not found]) 499 503 else 504 LDAP_LIBS="-llber -lldap" 500 505 AC_DEFINE(STORAGE_LDAP,1,[Define to 1 if you want to use OpenLDAP for auth/reg.]) 501 506 fi 502 507 fi 508 AC_SUBST(LDAP_LIBS) 509 AM_CONDITIONAL(STORAGE_LDAP, [test "x-$have_ldap_version" = "x-yes"]) 503 510 504 511 … … 514 521 AC_MSG_ERROR([PAM application libraries not found]) 515 522 else 523 have_pam="yes" 524 PAM_LIBS="-lpam" 516 525 AC_DEFINE(STORAGE_PAM,1,[Define to 1 if you want to use PAM for auth/reg.]) 517 526 fi 518 527 fi 528 AC_SUBST(PAM_LIBS) 529 AM_CONDITIONAL(STORAGE_PAM, [test "x-$have_pam" = "x-yes"]) 519 530 520 531 … … 532 543 AC_MSG_ERROR([Pipe auth/reg requirements (sys/wait.h, fork(), pipe(), wait()) not found]) 533 544 else 545 have_pipe="yes" 534 546 AC_DEFINE(STORAGE_PIPE,1,[Define to 1 if you want to use pipes for auth/reg.]) 535 547 fi 536 548 fi 549 AM_CONDITIONAL(STORAGE_PIPE, [test "x-$have_pipe" = "x-yes"]) 537 550 538 551 … … 543 556 AC_DEFINE(STORAGE_ANON,1,[Define to 1 if you want anonymous auth.]) 544 557 fi 558 AM_CONDITIONAL(STORAGE_ANON, [test "x-$want_anon" = "x-yes"]) 545 559 546 560 … … 551 565 AC_DEFINE(STORAGE_FS,1,[Define to 1 if you want to use the filesystem for storage.]) 552 566 fi 567 AM_CONDITIONAL(STORAGE_FS, [test "x-$want_fs" = "x-yes"]) 568 553 569 554 570 dnl Oracle … … 557 573 [ ac_oracle_home="$withval" ]) 558 574 559 AC_ARG_ENABLE(oracle, AC_HELP_STRING([--enable-oracle], [enable Oracle auth reg/storage support (no)]),575 AC_ARG_ENABLE(oracle, AC_HELP_STRING([--enable-oracle], [enable Oracle auth/reg/storage support (no)]), 560 576 want_oracle=$enableval, want_oracle=no) 561 577 if test "x-$want_oracle" = "x-yes" ; then … … 578 594 CPPFLAGS="$save_cppflags" 579 595 LIBS="$save_libs" 580 LDFLAGS="$save_ldflags"596 LDFLAGS="$save_ldflags" 581 597 fi 582 598 fi … … 588 604 AC_MSG_ERROR([Oracle client libraries not found]) 589 605 else 590 AC_DEFINE(STORAGE_ORACLE,1,[Define to 1 if you want to use Oracle for authreg/storage.]) 591 fi 592 fi 606 have_oracle="yes" 607 ORACLE_CPPFLAGS="-I$ac_oracle_home/rdbms/demo -I$ac_oracle_home/rdbms/public" 608 ORACLE_LIBS="-L$ac_oracle_home/lib" 609 ORACLE_LDFLAGS="-Wl,-rpath,$ac_oracle_home/lib" 610 AC_DEFINE(STORAGE_ORACLE,1,[Define to 1 if you want to use Oracle for auth/reg/storage.]) 611 fi 612 fi 613 AC_SUBST(ORACLE_CPPFLAGS) 614 AC_SUBST(ORACLE_LIBS) 615 AC_SUBST(ORACLE_LDFLAGS) 616 AM_CONDITIONAL(STORAGE_ORACLE, [test "x-$have_pam" = "x-yes"]) 593 617 594 618 … … 821 845 s2s/Makefile \ 822 846 sm/Makefile \ 847 storage/Makefile \ 823 848 Doxyfile) -
trunk/etc/c2s.xml.dist.in
r165 r180 255 255 <!-- Authentication/registration database configuration --> 256 256 <authreg> 257 <!-- Dynamic authreg modules path --> 258 <path>@pkglibdir@</path> 259 257 260 <!-- Backend module to use --> 258 261 <module>mysql</module> -
trunk/etc/sm.xml.dist.in
r162 r180 71 71 <!-- Storage database configuration --> 72 72 <storage> 73 <!-- Dynamic storage modules path --> 74 <path>@pkglibdir@</path> 75 73 76 <!-- By default, we use the MySQL driver for all storage --> 74 77 <driver>mysql</driver> -
trunk/Makefile.am
r77 r180 1 1 EXTRA_DIST = PROTOCOL Doxyfile.in README.win32 contrib 2 2 3 SUBDIRS = etc tools man mio subst sx util c2s resolver router s2s sm 3 SUBDIRS = etc tools man mio subst sx util c2s resolver router s2s sm storage 4 4 5 5 docs: Doxyfile -
trunk/sm/Makefile.am
r175 r180 1 INCLUDES = -DCONFIG_DIR=\"$(sysconfdir)\" \ 2 -DLIBRARY_DIR=\"$(pkglibdir)\" \ 3 $(MYSQL_CFLAGS) 4 $(PGSQL_CFLAGS) 1 bin_PROGRAMS = sm 5 2 6 bin_PROGRAMS = sm7 3 pkglib_LTLIBRARIES = mod_active.la \ 8 4 mod_announce.la \ … … 29 25 30 26 noinst_HEADERS = sm.h 27 31 28 sm_SOURCES = aci.c \ 32 29 dispatch.c \ … … 40 37 sm.c \ 41 38 user.c \ 42 storage.c \ 43 storage_db.c \ 44 storage_fs.c \ 45 storage_oracle.c 39 storage.c 46 40 41 sm_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\" -DLIBRARY_DIR=\"$(pkglibdir)\" 47 42 sm_LDFLAGS = -Wl,-export-dynamic 48 43 sm_LDADD = $(top_builddir)/sx/libsx.la \ 49 44 $(top_builddir)/mio/libmio.la \ 50 45 $(top_builddir)/util/libutil.la \ 51 $(top_builddir)/subst/libsubst.la \ 52 $(MYSQL_LIBS) \ 53 $(PGSQL_LIBS) \ 54 $(SQLITE_LIBS) 55 56 if STORAGE_MYSQL 57 sm_SOURCES += storage_mysql.c 58 endif 59 60 if STORAGE_PGSQL 61 sm_SOURCES += storage_pgsql.c 62 endif 63 64 if STORAGE_SQLITE 65 sm_SOURCES += storage_sqlite.c 66 endif 46 $(top_builddir)/subst/libsubst.la 67 47 68 48 mod_active_la_SOURCES = mod_active.c -
trunk/sm/mm.c
r161 r180 46 46 mm_t mm; 47 47 int celem, melem, attr, *nlist = NULL; 48 char id[13], name[32], mod_fullpath[ 512], arg[1024], *modules_path;48 char id[13], name[32], mod_fullpath[PATH_MAX], arg[1024], *modules_path; 49 49 mod_chain_t chain = (mod_chain_t) NULL; 50 50 mod_instance_t **list = NULL, mi; … … 64 64 log_write(sm->log, LOG_NOTICE, "modules search path: %s", modules_path); 65 65 else 66 log_write(sm->log, LOG_ WARNING, "modules search path undefined !");66 log_write(sm->log, LOG_NOTICE, "modules search path undefined, using deafult: "LIBRARY_DIR); 67 67 68 68 celem = nad_find_elem(sm->config->nad, celem, -1, "chain", 1); … … 173 173 #ifndef WIN32 174 174 if (modules_path != NULL) 175 snprintf(mod_fullpath, 512, "%s/mod_%s.so", modules_path, name);175 snprintf(mod_fullpath, PATH_MAX, "%s/mod_%s.so", modules_path, name); 176 176 else 177 snprintf(mod_fullpath, 512, "%s/mod_%s.so", LIBRARY_DIR, name);177 snprintf(mod_fullpath, PATH_MAX, "%s/mod_%s.so", LIBRARY_DIR, name); 178 178 mod->handle = dlopen(mod_fullpath, RTLD_LAZY); 179 179 if (mod->handle != NULL) … … 181 181 #else 182 182 if (modules_path != NULL) 183 snprintf(mod_fullpath, 512, "%smod_%s.dll", modules_path, name);183 snprintf(mod_fullpath, PATH_MAX, "%s\\mod_%s.dll", modules_path, name); 184 184 else 185 snprintf(mod_fullpath, 512, "mod_%s.dll", name);185 snprintf(mod_fullpath, PATH_MAX, "mod_%s.dll", name); 186 186 mod->handle = (void*) LoadLibrary(mod_fullpath); 187 187 if (mod->handle != NULL) -
trunk/sm/storage.c
r156 r180 26 26 */ 27 27 28 /* these functions implement a multiplexor to get calls to the correct driver29 * for the given type */30 31 28 #include "sm.h" 32 33 29 #include <ctype.h> 34 35 /* if you add a driver, you'll need to update these arrays */ 36 #ifdef STORAGE_DB 37 extern st_ret_t st_db_init(st_driver_t); 38 #endif 39 #ifdef STORAGE_FS 40 extern st_ret_t st_fs_init(st_driver_t); 41 #endif 42 #ifdef STORAGE_MYSQL 43 extern st_ret_t st_mysql_init(st_driver_t); 44 #endif 45 #ifdef STORAGE_PGSQL 46 extern st_ret_t st_pgsql_init(st_driver_t); 47 #endif 48 #ifdef STORAGE_ORACLE 49 extern st_ret_t st_oracle_init(st_driver_t); 50 #endif 51 #ifdef STORAGE_SQLITE 52 extern st_ret_t st_sqlite_init(st_driver_t); 53 #endif 54 55 static const char *st_driver_names[] = { 56 #ifdef STORAGE_DB 57 "db", 58 #endif 59 #ifdef STORAGE_FS 60 "fs", 61 #endif 62 #ifdef STORAGE_MYSQL 63 "mysql", 64 #endif 65 #ifdef STORAGE_PGSQL 66 "pgsql", 67 #endif 68 #ifdef STORAGE_ORACLE 69 "oracle", 70 #endif 71 #ifdef STORAGE_SQLITE 72 "sqlite", 73 #endif 74 NULL 75 }; 76 77 static st_driver_init_fn st_driver_inits[] = { 78 #ifdef STORAGE_DB 79 st_db_init, 80 #endif 81 #ifdef STORAGE_FS 82 st_fs_init, 83 #endif 84 #ifdef STORAGE_MYSQL 85 st_mysql_init, 86 #endif 87 #ifdef STORAGE_PGSQL 88 st_pgsql_init, 89 #endif 90 #ifdef STORAGE_ORACLE 91 st_oracle_init, 92 #endif 93 #ifdef STORAGE_SQLITE 94 st_sqlite_init, 95 #endif 96 NULL 97 }; 30 #include <dlfcn.h> 98 31 99 32 100 33 storage_t storage_new(sm_t sm) { 101 34 storage_t st; 102 int i , j;35 int i; 103 36 config_elem_t elem; 104 37 char *type; … … 117 50 for(i = 0; i < elem->nvalues; i++) { 118 51 type = j_attr((const char **) elem->attrs[i], "type"); 119 for(j = 0; st_driver_names[j] != NULL; j++) { 120 if(strcmp(elem->values[i], st_driver_names[j]) == 0) { 121 if(type == NULL) 122 ret = storage_add_type(st, st_driver_names[j], NULL); 123 else 124 ret = storage_add_type(st, st_driver_names[j], type); 125 /* Initialisation of storage type failed */ 126 if (ret != st_SUCCESS) { 127 free(st); 128 return NULL; 129 } 130 } 52 ret = storage_add_type(st, elem->values[i], type); 53 /* Initialisation of storage type failed */ 54 if (ret != st_SUCCESS) { 55 free(st); 56 return NULL; 131 57 } 132 58 } … … 155 81 st_ret_t storage_add_type(storage_t st, const char *driver, const char *type) { 156 82 st_driver_t drv; 157 st_driver_init_fn init = NULL; 83 st_driver_init_fn init_fn = NULL; 84 char mod_fullpath[PATH_MAX], *modules_path; 158 85 int i; 159 86 st_ret_t ret; 87 void *handle; 160 88 161 89 /* startup, see if we've already registered this type */ … … 178 106 } 179 107 108 /* set modules path */ 109 modules_path = config_get_one(st->sm->config, "storage.path", 0); 110 180 111 /* get the driver */ 181 112 drv = xhash_get(st->drivers, driver); … … 183 114 log_debug(ZONE, "driver not loaded, trying to init"); 184 115 185 /* find the init function */ 186 for(i = 0; st_driver_names[i] != NULL; i++) { 187 if(strcmp(driver, st_driver_names[i]) == 0) { 188 init = st_driver_inits[i]; 189 break; 190 } 191 } 192 193 /* d'oh */ 194 if(init == NULL) { 195 log_debug(ZONE, "no init function for driver '%s'", driver); 196 116 log_write(st->sm->log, LOG_INFO, "loading '%s' storage module", driver); 117 #ifndef WIN32