summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-01-27 16:58:30 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2009-01-27 16:58:30 +0100
commit4c7ab3bcc6db2aaddd0515944f282e3dd6ab056a (patch)
tree2b60a6d27a7bae4125876bb3782194c45830c27d /tools
parentd5360aa57436bb931c513677bc2cbdb1733a4c6b (diff)
parentce11f7bdb8db977a8b00b28d9b84d1b1c924f3c3 (diff)
downloadrsyslog-4c7ab3bcc6db2aaddd0515944f282e3dd6ab056a.tar.gz
rsyslog-4c7ab3bcc6db2aaddd0515944f282e3dd6ab056a.tar.xz
rsyslog-4c7ab3bcc6db2aaddd0515944f282e3dd6ab056a.zip
Merge branch 'beta'
Conflicts: tools/omfile.c
Diffstat (limited to 'tools')
-rw-r--r--tools/omfile.c41
-rw-r--r--tools/rsyslogd.818
-rw-r--r--tools/syslogd.c6
3 files changed, 36 insertions, 29 deletions
diff --git a/tools/omfile.c b/tools/omfile.c
index 00a82933..1539ae19 100644
--- a/tools/omfile.c
+++ b/tools/omfile.c
@@ -405,25 +405,30 @@ static void prepareFile(instanceData *pData, uchar *newFileName)
*/
if(makeFileParentDirs(newFileName, strlen((char*)newFileName),
pData->fDirCreateMode, pData->dirUID,
- pData->dirGID, pData->bFailOnChown) == 0) {
- pData->fd = open((char*) newFileName, O_WRONLY|O_APPEND|O_CREAT|O_NOCTTY,
- pData->fCreateMode);
- if(pData->fd != -1) {
- /* check and set uid/gid */
- if(pData->fileUID != (uid_t)-1 || pData->fileGID != (gid_t) -1) {
- /* we need to set owner/group */
- if(fchown(pData->fd, pData->fileUID, pData->fileGID) != 0) {
- if(pData->bFailOnChown) {
- int eSave = errno;
- close(pData->fd);
- pData->fd = -1;
- errno = eSave;
- }
- /* we will silently ignore the chown() failure
- * if configured to do so.
- */
- }
+ pData->dirGID, pData->bFailOnChown) != 0) {
+ return; /* we give up */
+ }
+ }
+ /* no matter if we needed to create directories or not, we now try to create
+ * the file. -- rgerhards, 2008-12-18 (based on patch from William Tisater)
+ */
+ pData->fd = open((char*) newFileName, O_WRONLY|O_APPEND|O_CREAT|O_NOCTTY,
+ pData->fCreateMode);
+ if(pData->fd != -1) {
+ /* check and set uid/gid */
+ if(pData->fileUID != (uid_t)-1 || pData->fileGID != (gid_t) -1) {
+ /* we need to set owner/group */
+ if(fchown(pData->fd, pData->fileUID,
+ pData->fileGID) != 0) {
+ if(pData->bFailOnChown) {
+ int eSave = errno;
+ close(pData->fd);
+ pData->fd = -1;
+ errno = eSave;
}
+ /* we will silently ignore the chown() failure
+ * if configured to do so.
+ */
}
}
}
diff --git a/tools/rsyslogd.8 b/tools/rsyslogd.8
index 86c4bf66..7abcf97a 100644
--- a/tools/rsyslogd.8
+++ b/tools/rsyslogd.8
@@ -74,7 +74,7 @@ are in order. First of all there has been a systematic attempt to
ensure that rsyslogd follows its default, standard BSD behavior. Of course,
some configuration file changes are necessary in order to support the
template system. However, rsyslogd should be able to use a standard
-syslog.conf and act like the orginal syslogd. However, an original syslogd
+syslog.conf and act like the original syslogd. However, an original syslogd
will not work correctly with a rsyslog-enhanced configuration file. At
best, it will generate funny looking file names.
The second important concept to note is that this version of rsyslogd
@@ -98,13 +98,13 @@ the error element is ignored. It is tried to parse the rest of the line.
.B -c option controls the backward compatibility mode in use.
.TP
.BI "\-A"
-When sending UDP messages, there are potentially multiple pathes to
+When sending UDP messages, there are potentially multiple paths to
the target destination. By default,
.B rsyslogd
only sends to the first target it can successfully send to. If -A
is given, messages are sent to all targets. This may improve
-reliability, but may also cause message duplicaton. This option
-should enabled only if it is fully understood.
+reliability, but may also cause message duplication. This option
+should be enabled only if it is fully understood.
.TP
.BI "\-4"
Causes
@@ -135,7 +135,7 @@ to sysklogd, which is the default if -c is not given.
.B Please note that rsyslogd issues warning messages if the -c3
.B command line option is not given.
This is to alert you that your are running in compatibility
-mode. Compatibility mode interfers with you rsyslog.conf commands and
+mode. Compatibility mode interferes with your rsyslog.conf commands and
may cause some undesired side-effects. It is meant to be used with a
plain old rsyslog.conf - if you use new features, things become
messy. So the best advice is to work through this document, convert
@@ -186,7 +186,7 @@ is started and controlled by
.BR init (8).
.TP
.BI "\-q " "add hostname if DNS fails during ACL processing"
-During ACL processing, hostnames are resolved to IP addreses for
+During ACL processing, hostnames are resolved to IP addresses for
performance reasons. If DNS fails during that process, the hostname
is added as wildcard text, which results in proper, but somewhat
slower operation once DNS is up again.
@@ -221,7 +221,7 @@ an -u option, make sure you really understand what you do and why you do it.
Print version and exit.
.TP
.B "\-w"
-Supress warnings issued when messages are received from non-authorized
+Suppress warnings issued when messages are received from non-authorized
machines (those, that are in no AllowedSender list).
.TP
.B "\-x"
@@ -375,7 +375,7 @@ you can't access the documentation...
.TP
.B RSYSLOG_DEBUGLOG
-If set, writes (allmost) all debug message to the specified log file
+If set, writes (almost) all debug message to the specified log file
in addition to stdout.
.TP
.B RSYSLOG_MODDIR
@@ -383,7 +383,7 @@ Provides the default directory in which loadable modules reside.
.PD
.SH BUGS
Please review the file BUGS for up-to-date information on known
-bugs and annouyances.
+bugs and annoyances.
.SH Further Information
Please visit
.BR http://www.rsyslog.com/doc
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 2cac8fe4..76b107e8 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -1903,9 +1903,11 @@ static void doDie(int sig)
# define MSG1 "DoDie called.\n"
# define MSG2 "DoDie called 5 times - unconditional exit\n"
static int iRetries = 0; /* debug aid */
- write(1, MSG1, sizeof(MSG1));
+ if(Debug || NoFork)
+ write(1, MSG1, sizeof(MSG1) - 1);
if(iRetries++ == 4) {
- write(1, MSG2, sizeof(MSG2));
+ if(Debug || NoFork)
+ write(1, MSG2, sizeof(MSG2) - 1);
abort();
}
bFinished = sig;