diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-02-22 07:24:15 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-02-22 07:24:15 +0000 |
commit | 51bb02e3cdb7ddf8d19120804d2c13c7acebe9ce (patch) | |
tree | 93ee9b5bd1ecacc1120cbc24592d035cd9b0c520 /conf.c | |
parent | 2c5712f6ac066d197d1255685368af93c9143c7d (diff) | |
download | rsyslog-51bb02e3cdb7ddf8d19120804d2c13c7acebe9ce.tar.gz rsyslog-51bb02e3cdb7ddf8d19120804d2c13c7acebe9ce.tar.xz rsyslog-51bb02e3cdb7ddf8d19120804d2c13c7acebe9ce.zip |
applied patch by varmojfekoj to allow gssapi functionality to be build as a
separate plugin (so that gssapi and plain tcp functionality can be
individually distributed). Also inclulded some other enhancements, most
importantly initial compatibility mode system
Diffstat (limited to 'conf.c')
-rw-r--r-- | conf.c | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -214,8 +214,9 @@ doModLoad(uchar **pp, __attribute__((unused)) void* pVal) uchar szName[512]; uchar szPath[512]; uchar errMsg[1024]; - uchar *pModName; + uchar *pModName, *pModNameBase; void *pModHdlr, *pModInit; + modInfo_t *pModInfo; ASSERT(pp != NULL); ASSERT(*pp != NULL); @@ -224,6 +225,7 @@ doModLoad(uchar **pp, __attribute__((unused)) void* pVal) logerror("could not extract module name"); ABORT_FINALIZE(RS_RET_NOT_FOUND); } + skipWhiteSpace(pp); /* skip over any whitespace */ /* this below is a quick and dirty hack to provide compatibility with the * $ModLoad MySQL forward compatibility statement. TODO: clean this up @@ -239,6 +241,17 @@ doModLoad(uchar **pp, __attribute__((unused)) void* pVal) dbgprintf("Requested to load module '%s'\n", szName); + pModNameBase = (uchar *) basename(strdup((char *) pModName)); + pModInfo = modGetNxt(NULL); + while(pModInfo != NULL) { + if(!strcmp((char *) pModNameBase, (char *) modGetName(pModInfo))) { + dbgprintf("Module '%s' already loaded\n", szName); + ABORT_FINALIZE(RS_RET_OK); + } + pModInfo = modGetNxt(pModInfo); + } + free(pModNameBase); + if(*pModName == '/') { *szPath = '\0'; /* we do not need to append the path - its already in the module name */ } else { @@ -266,8 +279,6 @@ doModLoad(uchar **pp, __attribute__((unused)) void* pVal) ABORT_FINALIZE(RS_RET_ERR); } - skipWhiteSpace(pp); /* skip over any whitespace */ - finalize_it: RETiRet; } |