From 0bb0bc6b750e7dab67911655ea056f3b31a05412 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 7 Sep 2007 09:17:53 +0000 Subject: modified $ModLoad so that an absolute path may be specified as module name (e.g. /rsyslog/ommysql.so) --- syslogd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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()); -- cgit v1.2.3