summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-04-09 18:10:56 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-04-09 18:10:56 +0200
commit38f875c582eacce25594daf0b41655f2ee677f24 (patch)
tree541f6c5cc84015ef42ecf97cd15d5803cffe2124
parent79e5decff290722f3e8de742f82ef6fe8bb63eb4 (diff)
parent0f3dbecb867bc8ed852389ae9642be5d0f3636aa (diff)
downloadrsyslog-38f875c582eacce25594daf0b41655f2ee677f24.tar.gz
rsyslog-38f875c582eacce25594daf0b41655f2ee677f24.tar.xz
rsyslog-38f875c582eacce25594daf0b41655f2ee677f24.zip
Merge branch 'beta'
-rw-r--r--ChangeLog2
-rw-r--r--doc/manual.html10
-rw-r--r--doc/v3compatibility.html4
-rw-r--r--modules.c27
4 files changed, 21 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index e9fadf12..bf6a169f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -70,6 +70,8 @@ Version 3.14.2 (rgerhards), 2008-04-??
* misspelled directive name in code processing legacy options
- bugfix: some legacy options not correctly interpreted - thanks to
varmojfekoj for the patch
+- improved detection of modules being loaded more than once
+ thanks to varmojfekoj for the patch
---------------------------------------------------------------------------
Version 3.14.1 (rgerhards), 2008-04-04
- bugfix: some messages were emited without hostname
diff --git a/doc/manual.html b/doc/manual.html
index 135d2fa0..9d4dbefd 100644
--- a/doc/manual.html
+++ b/doc/manual.html
@@ -1,6 +1,5 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>rsyslog documentation</title>
-
</head>
<body>
<h1>RSyslog - Documentation</h1>
@@ -18,9 +17,10 @@ relay chains while at the same time being very easy to setup for the
novice user. And as we know what enterprise users really need, there is
also <a href="professional_support.html">professional
rsyslog support</a> available directly from the source!</p>
-<p><b>Visit the <i> <a href="status.html">rsyslog
-status page</a></i></b> to obtain current
-version information and ports. <b>If you like rsyslog, you might
+<p><b>This documentation is for version 3.14.2 of rsyslog.</b>
+Visit the <i> <a href="http://www.rsyslog.com/doc-status.html">rsyslog status page</a></i></b> to obtain current
+version information and project status.
+<p><b>If you like rsyslog, you might
want to lend us a helping hand. </b>It doesn't require a lot of
time - even a single mouse click helps. Learn <a href="how2help.html">how to help the rsyslog project</a>.
Due to popular demand, there is now a <a href="rsyslog_ng_comparison.html">side-by-side comparison
@@ -100,4 +100,4 @@ may find
<a href="http://www.gerhards.net/rainer">Rainer</a>'s
<a href="http://rgerhards.blogspot.com/">blog</a> an
interesting read (filter on syslog and rsyslog tags).</p>
-</body></html> \ No newline at end of file
+</body></html>
diff --git a/doc/v3compatibility.html b/doc/v3compatibility.html
index c6e4fec2..f4eef3a1 100644
--- a/doc/v3compatibility.html
+++ b/doc/v3compatibility.html
@@ -3,7 +3,7 @@
<meta name="KEYWORDS" content="syslog, mysql, syslog to mysql, howto"></head>
<body>
-<h1>Compatibility Notes for rsyslog v4</h1>
+<h1>Compatibility Notes for rsyslog v3</h1>
<p><small><i>Written by <a href="http://www.gerhards.net/rainer">Rainer Gerhards</a>
(2008-03-28)</i></small></p>
<p>Rsyslog aims to be a drop-in replacement for sysklogd.
@@ -193,4 +193,4 @@ format with care. </p><h2>Queue Modes for the Main Message Queue</h2>
is available, but should not be used except for a very good reason
("Direct" disables queueing and will potentially lead to message loss
on the input side).</p>
-</body></html> \ No newline at end of file
+</body></html>
diff --git a/modules.c b/modules.c
index 623a2f10..3f952f0e 100644
--- a/modules.c
+++ b/modules.c
@@ -554,26 +554,28 @@ Load(uchar *pModName)
{
DEFiRet;
- size_t iPathLen;
+ size_t iPathLen, iModNameLen;
uchar szPath[PATH_MAX];
- uchar *pModNameBase;
- uchar *pModNameDup;
- uchar *pExtension;
+ uchar *pModNameCmp;
+ int bHasExtension;
void *pModHdlr, *pModInit;
modInfo_t *pModInfo;
assert(pModName != NULL);
dbgprintf("Requested to load module '%s'\n", pModName);
- if((pModNameDup = (uchar *) strdup((char *) pModName)) == NULL)
- ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);
+ iModNameLen = strlen((char *) pModName);
+ if(iModNameLen > 3 && !strcmp((char *) pModName + iModNameLen - 3, ".so")) {
+ iModNameLen -= 3;
+ bHasExtension = TRUE;
+ } else
+ bHasExtension = FALSE;
- pModNameBase = (uchar *) basename((char*)pModNameDup);
pModInfo = GetNxt(NULL);
while(pModInfo != NULL) {
- if(!strcmp((char *) pModNameBase, (char *) modGetName(pModInfo))) {
+ if(!strncmp((char *) pModName, (char *) (pModNameCmp = modGetName(pModInfo)), iModNameLen) &&
+ (!*(pModNameCmp + iModNameLen) || !strcmp((char *) pModNameCmp + iModNameLen, ".so"))) {
dbgprintf("Module '%s' already loaded\n", pModName);
- free(pModNameDup);
ABORT_FINALIZE(RS_RET_OK);
}
pModInfo = GetNxt(pModInfo);
@@ -593,7 +595,6 @@ Load(uchar *pModName)
szPath[iPathLen] = '\0';
} else {
errmsg.LogError(NO_ERRCODE, "could not load module '%s', path too long\n", pModName);
- free(pModNameDup);
ABORT_FINALIZE(RS_RET_MODULE_LOAD_ERR_PATHLEN);
}
}
@@ -603,10 +604,7 @@ Load(uchar *pModName)
strncat((char *) szPath, (char *) pModName, sizeof(szPath) - iPathLen - 1);
/* now see if we have an extension and, if not, append ".so" */
- for(pExtension = pModNameBase ; *pExtension && *pExtension != '.' ; ++pExtension)
- /*DO NOTHING*/;
-
- if(*pExtension != '.') {
+ if(!bHasExtension) {
/* we do not have an extension and so need to add ".so"
* TODO: I guess this is highly importable, so we should change the
* algo over time... -- rgerhards, 2008-03-05
@@ -615,7 +613,6 @@ Load(uchar *pModName)
strncat((char *) szPath, ".so", sizeof(szPath) - strlen((char*) szPath) - 1);
iPathLen += 3;
}
- free(pModNameDup);
if(iPathLen + strlen((char*) pModName) >= sizeof(szPath)) {
errmsg.LogError(NO_ERRCODE, "could not load module '%s', path too long\n", pModName);