summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-09-07 09:17:53 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-09-07 09:17:53 +0000
commit0bb0bc6b750e7dab67911655ea056f3b31a05412 (patch)
treebbf09836b5fb2879afcf20aed5de0e82ce5c82ec
parent68bf15ba7c43c2130d8267b6ebe5275cd3c84d22 (diff)
downloadrsyslog-0bb0bc6b750e7dab67911655ea056f3b31a05412.tar.gz
rsyslog-0bb0bc6b750e7dab67911655ea056f3b31a05412.tar.xz
rsyslog-0bb0bc6b750e7dab67911655ea056f3b31a05412.zip
modified $ModLoad so that an absolute path may be specified as module name
(e.g. /rsyslog/ommysql.so)
-rw-r--r--syslogd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/syslogd.c b/syslogd.c
index b0a54051..176d3149 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -3820,7 +3820,11 @@ static rsRetVal doModLoad(uchar **pp, __attribute__((unused)) void* pVal)
dbgprintf("Requested to load module '%s'\n", szName);
- strncpy((char *) szPath, (pModDir == NULL) ? _PATH_MODDIR : (char*) pModDir, sizeof(szPath));
+ if(*pModName == '/') {
+ *szPath = '\0'; /* we do not need to append the path - its already in the module name */
+ } else {
+ strncpy((char *) szPath, (pModDir == NULL) ? _PATH_MODDIR : (char*) pModDir, sizeof(szPath));
+ }
strncat((char *) szPath, (char *) pModName, sizeof(szPath) - strlen((char*) szPath) - 1);
if(!(pModHdlr = dlopen((char *) szPath, RTLD_NOW))) {
snprintf((char *) errMsg, sizeof(errMsg), "could not load module '%s', dlopen: %s\n", szPath, dlerror());