summaryrefslogtreecommitdiffstats
path: root/conf.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-02-22 07:24:15 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-02-22 07:24:15 +0000
commit51bb02e3cdb7ddf8d19120804d2c13c7acebe9ce (patch)
tree93ee9b5bd1ecacc1120cbc24592d035cd9b0c520 /conf.c
parent2c5712f6ac066d197d1255685368af93c9143c7d (diff)
downloadrsyslog-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.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/conf.c b/conf.c
index 7140a98c..56ceb686 100644
--- a/conf.c
+++ b/conf.c
@@ -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;
}