diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2007-09-07 09:17:53 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2007-09-07 09:17:53 +0000 |
commit | 0bb0bc6b750e7dab67911655ea056f3b31a05412 (patch) | |
tree | bbf09836b5fb2879afcf20aed5de0e82ce5c82ec | |
parent | 68bf15ba7c43c2130d8267b6ebe5275cd3c84d22 (diff) | |
download | rsyslog-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.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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()); |