This commit is contained in:
commit
bf60d858bb
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
## Default LFS
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.osc
|
52
logrotate.syslog
Normal file
52
logrotate.syslog
Normal file
@ -0,0 +1,52 @@
|
||||
#
|
||||
# Please note, that changing of log file permissions in this
|
||||
# file is not sufficient if syslog-ng is used as log daemon.
|
||||
# It is required to specify the permissions in the syslog-ng
|
||||
# configuration /etc/syslog-ng/syslog-ng.conf.in as well.
|
||||
#
|
||||
|
||||
/var/log/warn /var/log/messages /var/log/allmessages /var/log/localmessages /var/log/firewall {
|
||||
compress
|
||||
dateext
|
||||
maxage 365
|
||||
rotate 99
|
||||
missingok
|
||||
notifempty
|
||||
size +4096k
|
||||
create 640 root root
|
||||
sharedscripts
|
||||
postrotate
|
||||
/etc/init.d/syslog reload
|
||||
endscript
|
||||
}
|
||||
|
||||
/var/log/mail /var/log/mail.info /var/log/mail.warn /var/log/mail.err {
|
||||
compress
|
||||
dateext
|
||||
maxage 365
|
||||
rotate 99
|
||||
missingok
|
||||
notifempty
|
||||
size +4096k
|
||||
create 640 root root
|
||||
sharedscripts
|
||||
postrotate
|
||||
/etc/init.d/syslog reload
|
||||
endscript
|
||||
}
|
||||
|
||||
/var/log/news/news.crit /var/log/news/news.err /var/log/news/news.notice {
|
||||
compress
|
||||
dateext
|
||||
maxage 365
|
||||
rotate 99
|
||||
missingok
|
||||
notifempty
|
||||
size +4096k
|
||||
create 640 news news
|
||||
sharedscripts
|
||||
postrotate
|
||||
/etc/init.d/syslog reload
|
||||
endscript
|
||||
}
|
||||
|
69
rc.earlysyslog
Normal file
69
rc.earlysyslog
Normal file
@ -0,0 +1,69 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Copyright (c) 1996-2001 SuSE GmbH Nuernberg, Germany.
|
||||
# Copyright (c) 2002-2003 SuSE Linux AG, Nuernberg, Germany.
|
||||
#
|
||||
# Author: Florian La Roche <florian@suse.de>, 1996
|
||||
# Werner Fink <werner@suse.de>, 1998-2001
|
||||
#
|
||||
# /etc/init.d/syslog
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: earlysyslog
|
||||
# Required-Start:
|
||||
# Required-Stop:
|
||||
# Default-Start: 5
|
||||
# Default-Stop:
|
||||
# Description: Start the system logging daemons
|
||||
### END INIT INFO
|
||||
|
||||
. /etc/sysconfig/syslog
|
||||
|
||||
BINDIR=/sbin
|
||||
|
||||
case "$SYSLOG_DAEMON" in
|
||||
syslog-ng)
|
||||
syslog=syslog-ng
|
||||
config=/etc/syslog-ng/syslog-ng.conf
|
||||
;;
|
||||
*)
|
||||
syslog=syslogd
|
||||
config=/etc/syslog.conf
|
||||
;;
|
||||
esac
|
||||
syslog_bin=${BINDIR}/$syslog
|
||||
klog_bin=${BINDIR}/klogd
|
||||
|
||||
# check config and programs
|
||||
test -s ${config} || {
|
||||
echo 1>&2 "${config} does not exist"
|
||||
if test "$1" == "stop" ; then exit 0 ; else exit 6 ; fi
|
||||
}
|
||||
test -x ${syslog_bin} || {
|
||||
echo 1>&2 "${syslog_bin} is not installed"
|
||||
if test "$1" == "stop" ; then exit 0 ; else exit 5 ; fi
|
||||
}
|
||||
test -x ${klog_bin} || {
|
||||
echo 1>&2 "${klog_bin} is not installed"
|
||||
if test "$1" == "stop" ; then exit 0 ; else exit 5 ; fi
|
||||
}
|
||||
|
||||
case "$SYSLOG_DAEMON" in
|
||||
syslog-ng)
|
||||
while read line ; do
|
||||
case "$line" in
|
||||
\#*|"") continue ;;
|
||||
*udp\ *|*udp\(*) exit 0 ;;
|
||||
*tcp\ *|*tcp\(*) exit 0 ;;
|
||||
esac
|
||||
done < ${config}
|
||||
;;
|
||||
*)
|
||||
while read select action ; do
|
||||
case "$select" in \#*|"") continue ;; esac
|
||||
case "$action" in *@*) exit 0 ;; esac
|
||||
done < ${config}
|
||||
;;
|
||||
esac
|
||||
|
||||
exec /etc/init.d/syslog $1 early
|
164
rc.syslog
Normal file
164
rc.syslog
Normal file
@ -0,0 +1,164 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Copyright (c) 1996-2001 SuSE GmbH Nuernberg, Germany.
|
||||
# Copyright (c) 2002-2003 SuSE Linux AG, Nuernberg, Germany.
|
||||
#
|
||||
# Author: Florian La Roche <florian@suse.de>, 1996
|
||||
# Werner Fink <werner@suse.de>, 1998-2001
|
||||
#
|
||||
# /etc/init.d/syslog
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: syslog
|
||||
# Required-Start: network
|
||||
# Should-Start: earlysyslog
|
||||
# Required-Stop: network
|
||||
# Default-Start: 2 3 5
|
||||
# Default-Stop:
|
||||
# Description: Start the system logging daemons
|
||||
### END INIT INFO
|
||||
|
||||
. /etc/sysconfig/syslog
|
||||
|
||||
BINDIR=/sbin
|
||||
|
||||
case "$SYSLOG_DAEMON" in
|
||||
syslog-ng)
|
||||
syslog=syslog-ng
|
||||
config=/etc/syslog-ng/syslog-ng.conf
|
||||
params="$SYSLOG_NG_PARAMS"
|
||||
;;
|
||||
*)
|
||||
syslog=syslogd
|
||||
config=/etc/syslog.conf
|
||||
params="$SYSLOGD_PARAMS"
|
||||
;;
|
||||
esac
|
||||
# add additional sockets to params
|
||||
for variable in ${!SYSLOGD_ADDITIONAL_SOCKET*}; do
|
||||
eval value=\$$variable
|
||||
test -n "${value}" && test -d ${value%/*} && \
|
||||
params="$params -a $value"
|
||||
done
|
||||
|
||||
syslog_pid="/var/run/${syslog}.pid"
|
||||
syslog_bin=${BINDIR}/$syslog
|
||||
klog_bin=${BINDIR}/klogd
|
||||
syslog_use=""
|
||||
|
||||
# check config and programs
|
||||
test -s ${config} || {
|
||||
echo 1>&2 "${config} does not exist"
|
||||
if test "$1" == "stop" ; then exit 0 ; else exit 6 ; fi
|
||||
}
|
||||
test -x ${syslog_bin} || {
|
||||
echo 1>&2 "${syslog_bin} is not installed"
|
||||
if test "$1" == "stop" ; then exit 0 ; else exit 5 ; fi
|
||||
}
|
||||
test -x ${klog_bin} || {
|
||||
echo 1>&2 "${klog_bin} is not installed"
|
||||
if test "$1" == "stop" ; then exit 0 ; else exit 5 ; fi
|
||||
}
|
||||
test -s /var/lock/subsys/syslogd && {
|
||||
read -t 5 syslog_use < /var/lock/subsys/syslogd
|
||||
}
|
||||
test -z "$syslog_use" && syslog_use=${syslog_bin}
|
||||
|
||||
#
|
||||
# Do not translate symbol addresses for 2.6 kernel
|
||||
#
|
||||
case `uname -r` in
|
||||
0.*|1.*|2.[0-4].*)
|
||||
;;
|
||||
*)
|
||||
KLOGD_PARAMS="${KLOGD_PARAMS:+$KLOGD_PARAMS }-x"
|
||||
;;
|
||||
esac
|
||||
|
||||
. /etc/rc.status
|
||||
rc_reset
|
||||
case "$1" in
|
||||
start)
|
||||
if test -f /var/lock/subsys/earlysyslog ; then
|
||||
# Syslog service already done
|
||||
rm -f /var/lock/subsys/earlysyslog
|
||||
exit 0
|
||||
fi
|
||||
if test "$2" = "early" ; then
|
||||
# Start syslog service early
|
||||
touch /var/lock/subsys/earlysyslog
|
||||
fi
|
||||
|
||||
if ! test -e /dev/xconsole ; then
|
||||
mkfifo -m 0600 /dev/xconsole
|
||||
chown root:tty /dev/xconsole
|
||||
fi
|
||||
if test -s /var/run/klogd.pid ; then
|
||||
killproc ${klog_bin}
|
||||
fi
|
||||
if test -s ${syslog_pid} ; then
|
||||
killproc -p ${syslog_pid} ${syslog_use}
|
||||
echo -n "Re-"
|
||||
fi
|
||||
echo -n "Starting syslog services"
|
||||
test -z "$KERNEL_LOGLEVEL" && KERNEL_LOGLEVEL=1
|
||||
|
||||
startproc -p ${syslog_pid} ${syslog_bin} ${params}
|
||||
rc_status
|
||||
|
||||
# Remember the currently used syslog daemon
|
||||
echo ${syslog_bin} > /var/lock/subsys/syslogd
|
||||
|
||||
if test $? -eq 0 ; then
|
||||
startproc ${klog_bin} -c $KERNEL_LOGLEVEL $KLOGD_PARAMS
|
||||
rc_status
|
||||
fi
|
||||
rc_status -v
|
||||
;;
|
||||
stop)
|
||||
rm -f /var/lock/subsys/earlysyslog
|
||||
test "$2" = "early" && exit 0
|
||||
|
||||
echo -n "Shutting down syslog services"
|
||||
killproc -TERM ${klog_bin} ; rc_status
|
||||
killproc -p ${syslog_pid} -TERM ${syslog_use} ; rc_status -v
|
||||
rm -f /var/lock/subsys/syslogd
|
||||
;;
|
||||
try-restart|condrestart)
|
||||
if test "$1" = "condrestart"; then
|
||||
echo "${attn} Use try-restart ${done}(LSB)${attn} instead${norm}"
|
||||
fi
|
||||
$0 status
|
||||
if test $? = 0; then
|
||||
$0 restart
|
||||
else
|
||||
rc_reset # Not running is not a failure.
|
||||
fi
|
||||
rc_status
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
rc_status
|
||||
;;
|
||||
reload|force-reload)
|
||||
echo -n "Reload syslog service"
|
||||
killproc -TSTP ${klog_bin} ; rc_status
|
||||
killproc -p ${syslog_pid} -HUP ${syslog_use} ; rc_status
|
||||
killproc -CONT ${klog_bin} ; rc_status
|
||||
killproc -USR2 ${klog_bin} ; rc_status -v
|
||||
;;
|
||||
status)
|
||||
echo -n "Checking for service syslog:"
|
||||
checkproc ${klog_bin} ; rc_status
|
||||
checkproc -p ${syslog_pid} ${syslog_use} ; rc_status -v
|
||||
;;
|
||||
probe)
|
||||
test ${config} -nt ${syslog_pid} && echo reload
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
rc_exit
|
41
sysconfig.syslog
Normal file
41
sysconfig.syslog
Normal file
@ -0,0 +1,41 @@
|
||||
## Path: System/Logging
|
||||
## Description: System logging
|
||||
## Type: list(0,1,2,3,4,5,6,7)
|
||||
## Default: 1
|
||||
## Config: ""
|
||||
## ServiceRestart: syslog
|
||||
#
|
||||
# Default loglevel for klogd
|
||||
#
|
||||
KERNEL_LOGLEVEL=1
|
||||
|
||||
## Type: string
|
||||
## Default: ""
|
||||
## Config: ""
|
||||
## ServiceRestart: syslog
|
||||
#
|
||||
# if not empty: parameters for syslogd
|
||||
# for example SYSLOGD_PARAMS="-r -s my.dom.ain"
|
||||
#
|
||||
SYSLOGD_PARAMS=""
|
||||
|
||||
## Type: string
|
||||
## Default: -x
|
||||
## Config: ""
|
||||
## ServiceRestart: syslog
|
||||
#
|
||||
# if not empty: parameters for klogd
|
||||
# for example KLOGD_PARAMS="-x" to avoid (duplicate) symbol resolution
|
||||
#
|
||||
KLOGD_PARAMS="-x"
|
||||
|
||||
## Type: list(syslogd,syslog-ng)
|
||||
## Default: syslogd
|
||||
## Config: syslog-ng
|
||||
## Command: /sbin/rcsyslog restart
|
||||
## PreSaveCommand: /sbin/rcsyslog status && /sbin/rcsyslog stop
|
||||
#
|
||||
# The name of the syslog daemon used as
|
||||
# syslog service: "syslogd", "syslog-ng"
|
||||
#
|
||||
SYSLOG_DAEMON="syslogd"
|
14
sysklogd-1.4.1-dgram.patch
Normal file
14
sysklogd-1.4.1-dgram.patch
Normal file
@ -0,0 +1,14 @@
|
||||
--- syslog.c
|
||||
+++ syslog.c Wed May 23 18:48:13 2001
|
||||
@@ -211,8 +211,9 @@
|
||||
strncpy(SyslogAddr.sa_data, _PATH_LOGNAME,
|
||||
sizeof(SyslogAddr.sa_data));
|
||||
if (LogStat & LOG_NDELAY) {
|
||||
- LogFile = socket(AF_UNIX, SOCK_DGRAM, 0);
|
||||
-/* fcntl(LogFile, F_SETFD, 1); */
|
||||
+ if ((LogFile = socket(AF_UNIX, SOCK_DGRAM, 0)) < 0)
|
||||
+ return;
|
||||
+ fcntl(LogFile, F_SETFD, 1);
|
||||
}
|
||||
}
|
||||
if (LogFile != -1 && !connected &&
|
459
sysklogd-1.4.1-dns.patch
Normal file
459
sysklogd-1.4.1-dns.patch
Normal file
@ -0,0 +1,459 @@
|
||||
--- sysklogd-1.4.1/Makefile.resolve 2003-06-02 14:30:18.000000000 +0200
|
||||
+++ sysklogd-1.4.1/Makefile 2003-06-02 14:30:18.000000000 +0200
|
||||
@@ -62,8 +62,8 @@
|
||||
|
||||
install: install_man install_exec
|
||||
|
||||
-syslogd: syslogd.o pidfile.o
|
||||
- ${CC} ${LDFLAGS} -o syslogd syslogd.o pidfile.o ${LIBS}
|
||||
+syslogd: syslogd.o pidfile.o resolve.o
|
||||
+ ${CC} ${LDFLAGS} -o syslogd syslogd.o pidfile.o resolve.o ${LIBS}
|
||||
|
||||
klogd: klogd.o syslog.o pidfile.o ksym.o ksym_mod.o
|
||||
${CC} ${LDFLAGS} -o klogd klogd.o syslog.o pidfile.o ksym.o \
|
||||
--- sysklogd-1.4.1/resolve.c.resolve 2003-06-02 14:30:18.000000000 +0200
|
||||
+++ sysklogd-1.4.1/resolve.c 2003-06-02 14:30:33.000000000 +0200
|
||||
@@ -0,0 +1,249 @@
|
||||
+/*
|
||||
+ * Resolve a hostname
|
||||
+ *
|
||||
+ * Copyright (C) 2003, SuSE Linux AG
|
||||
+ * Written by okir@suse.de
|
||||
+ */
|
||||
+
|
||||
+#include <sys/poll.h>
|
||||
+#include <netdb.h>
|
||||
+#include <string.h>
|
||||
+#include <time.h>
|
||||
+#include <malloc.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <signal.h>
|
||||
+#include <unistd.h>
|
||||
+
|
||||
+#if defined(__GLIBC__)
|
||||
+#define dprintf mydprintf
|
||||
+#endif /* __GLIBC__ */
|
||||
+
|
||||
+/* Number of times we retry resolving a name */
|
||||
+#define RESOLVER_RETRIES 10
|
||||
+/* Timeout between retries to resolve a name */
|
||||
+#define RESOLVER_RETRY_TIME (3 * 60)
|
||||
+/* Time to wait for the sub-process comes up with an
|
||||
+ * answer, before we suspend the entry */
|
||||
+#define RESOLVER_WAIT_TIME 5
|
||||
+
|
||||
+struct res_name {
|
||||
+ struct res_name * next;
|
||||
+ char * name;
|
||||
+ unsigned int retries;
|
||||
+ time_t retry_time;
|
||||
+ time_t wait_time;
|
||||
+ pid_t process;
|
||||
+ int pipe;
|
||||
+ struct sockaddr_storage address;
|
||||
+};
|
||||
+
|
||||
+extern void dprintf(char *fmt, ...);
|
||||
+static int do_result(struct res_name *res);
|
||||
+static void do_query(int, int, const char *);
|
||||
+
|
||||
+static struct res_name *resolve;
|
||||
+
|
||||
+int
|
||||
+resolve_name(const char *name, int family, struct sockaddr_storage *addr)
|
||||
+{
|
||||
+ struct res_name *res;
|
||||
+ int fd[2];
|
||||
+ pid_t pid;
|
||||
+ time_t now;
|
||||
+
|
||||
+ time(&now);
|
||||
+ for (res = resolve; res; res = res->next) {
|
||||
+ if (!strcmp(res->name, name)) {
|
||||
+ /* If there's still a sub-process
|
||||
+ * attached, see if it came up with an
|
||||
+ * answer in the meantime */
|
||||
+ if (res->pipe >= 0)
|
||||
+ do_result(res);
|
||||
+ goto check_result;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ res = (struct res_name *) calloc(1, sizeof(*res));
|
||||
+ res->name = strdup(name);
|
||||
+ res->retries = RESOLVER_RETRIES;
|
||||
+ res->retry_time = now + RESOLVER_RETRY_TIME;
|
||||
+ res->pipe = -1;
|
||||
+ res->next = resolve;
|
||||
+ resolve = res;
|
||||
+
|
||||
+retry: res->retries -= 1;
|
||||
+
|
||||
+ dprintf("Trying to resolve \"%s\", attempt #%u\n",
|
||||
+ res->name, RESOLVER_RETRIES - res->retries);
|
||||
+
|
||||
+ if (res->pipe >= 0) {
|
||||
+ /* Make sure resolver subprocess is dead */
|
||||
+ kill(res->process, SIGKILL);
|
||||
+ close(res->pipe);
|
||||
+ res->pipe = -1;
|
||||
+ }
|
||||
+
|
||||
+ signal(SIGCHLD, SIG_IGN);
|
||||
+ if (pipe(fd) < 0) {
|
||||
+ /* log error? */
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if ((pid = fork()) < 0) {
|
||||
+ /* log error? */
|
||||
+ close(fd[0]);
|
||||
+ close(fd[1]);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (pid == 0) {
|
||||
+ close(fd[0]);
|
||||
+ do_query(fd[1], family, res->name);
|
||||
+ /* shouldn't return */
|
||||
+ exit(1);
|
||||
+ }
|
||||
+
|
||||
+ res->wait_time = now + RESOLVER_WAIT_TIME;
|
||||
+ res->process = pid;
|
||||
+ res->pipe = fd[0];
|
||||
+ close(fd[1]);
|
||||
+
|
||||
+ /* Try to collect result within the next couple
|
||||
+ * of seconds */
|
||||
+ do_result(res);
|
||||
+
|
||||
+check_result:
|
||||
+ if (res->pipe >= 0) {
|
||||
+ dprintf("%s: name resolution not complete, "
|
||||
+ "waiting for resolver sub-process\n",
|
||||
+ res->name);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ if (res->address.ss_family != AF_UNSPEC) {
|
||||
+ *addr = res->address;
|
||||
+ return 1;
|
||||
+ }
|
||||
+ if (res->retries == 0) {
|
||||
+ dprintf("%s: too many failed attempts to resolve hostname, "
|
||||
+ "given up.\n", res->name);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if (res->retry_time > now) {
|
||||
+ dprintf("%s: name resolution failed, "
|
||||
+ "will retry in %d seconds\n",
|
||||
+ res->name, res->retry_time - now);
|
||||
+ return 0;
|
||||
+ }
|
||||
+ goto retry;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * This function clears the resolver's internal state
|
||||
+ * when syslogd received a SIGHUP
|
||||
+ */
|
||||
+void
|
||||
+init_resolver(void)
|
||||
+{
|
||||
+ struct res_name *res;
|
||||
+
|
||||
+ for (res = resolve; res; res = res->next) {
|
||||
+ res->address.ss_family = AF_UNSPEC;
|
||||
+ res->retries = RESOLVER_RETRIES;
|
||||
+ res->retry_time = 0;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * Collect result from sub-process
|
||||
+ */
|
||||
+int
|
||||
+do_result(struct res_name *res)
|
||||
+{
|
||||
+ struct sockaddr_storage addr;
|
||||
+ struct pollfd _poll;
|
||||
+ long wait;
|
||||
+ int n;
|
||||
+
|
||||
+ if (res->pipe < 0)
|
||||
+ return 0;
|
||||
+
|
||||
+ /* See if we should wait for the subprocess to come
|
||||
+ * up with an answer (the initial call to do_result
|
||||
+ * after starting the sub-process will always wait for
|
||||
+ * a few seconds to avoid losing messages) */
|
||||
+ if ((wait = res->wait_time - time(NULL)) < 0)
|
||||
+ wait = 0;
|
||||
+
|
||||
+ /* See if we get the resolver's result within the
|
||||
+ * next "wait" seconds. If not, let it continue in the
|
||||
+ * background */
|
||||
+ _poll.fd = res->pipe;
|
||||
+ _poll.events = POLLIN;
|
||||
+ if (poll(&_poll, 1, wait * 1000) < 1)
|
||||
+ return 0;
|
||||
+
|
||||
+ n = read(res->pipe, &addr, sizeof(addr));
|
||||
+
|
||||
+ /* child process has done its duty. */
|
||||
+ kill(res->process, SIGKILL);
|
||||
+ close(res->pipe);
|
||||
+ res->process = 0;
|
||||
+ res->pipe = -1;
|
||||
+
|
||||
+ if (n != sizeof(addr))
|
||||
+ return -1;
|
||||
+
|
||||
+ res->address = addr;
|
||||
+ if (addr.ss_family != AF_UNSPEC)
|
||||
+ return 1;
|
||||
+ return -1;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * Sub-process performing lookup
|
||||
+ */
|
||||
+void
|
||||
+do_query(int fd, int family, const char *name)
|
||||
+{
|
||||
+ struct sockaddr_storage ss;
|
||||
+ struct addrinfo hints, *res;
|
||||
+ int r;
|
||||
+
|
||||
+ memset(&hints, 0, sizeof(hints));
|
||||
+ hints.ai_socktype = SOCK_DGRAM;
|
||||
+#ifdef notyet
|
||||
+ /* XXX - specify AI_whatever for automatic v4-v6 mapping */
|
||||
+#else
|
||||
+ hints.ai_family = (family == AF_INET)? family : AF_UNSPEC;
|
||||
+#endif
|
||||
+
|
||||
+ r = getaddrinfo(name, "syslog", &hints, &res);
|
||||
+ if (r != 0) {
|
||||
+ dprintf("failed to resolve \"%s\": %s\n",
|
||||
+ name, gai_strerror(r));
|
||||
+ exit(1);
|
||||
+ }
|
||||
+
|
||||
+ memset(&ss, 0, sizeof(ss));
|
||||
+
|
||||
+ /* Do v4mapped v6 address (supported by recent glibcs
|
||||
+ * only) */
|
||||
+ if (family == AF_INET6 && res->ai_family == AF_INET) {
|
||||
+ struct sockaddr_in6 *six = (struct sockaddr_in6 *) &ss;
|
||||
+ struct sockaddr_in *sin = (struct sockaddr_in *) res->ai_addr;
|
||||
+
|
||||
+ six->sin6_family = AF_INET6;
|
||||
+ six->sin6_port = sin->sin_port;
|
||||
+ six->sin6_addr.s6_addr16[5] = 0xffff;
|
||||
+ six->sin6_addr.s6_addr32[3] = sin->sin_addr.s_addr;
|
||||
+ } else if (res->ai_addrlen > sizeof(ss)) {
|
||||
+ dprintf("failed to resolve \"%s\": address too large\n",
|
||||
+ name);
|
||||
+ exit(1);
|
||||
+ } else {
|
||||
+ memcpy(&ss, res->ai_addr, res->ai_addrlen);
|
||||
+ }
|
||||
+ write(fd, &ss, sizeof(ss));
|
||||
+ exit(0);
|
||||
+}
|
||||
--- sysklogd-1.4.1/syslogd.c.resolve 2003-06-02 14:30:18.000000000 +0200
|
||||
+++ sysklogd-1.4.1/syslogd.c 2003-06-02 14:30:26.000000000 +0200
|
||||
@@ -633,14 +633,7 @@
|
||||
struct {
|
||||
char f_hname[MAXHOSTNAMELEN+1];
|
||||
#ifdef INET6
|
||||
- union {
|
||||
- struct sockaddr sa;
|
||||
- struct sockaddr_in sin;
|
||||
- struct sockaddr_in6 sin6;
|
||||
- } f_sa;
|
||||
-#define f_addr f_sa.sa
|
||||
-#define f_addr4 f_sa.sin
|
||||
-#define f_addr6 f_sa.sin6
|
||||
+ struct sockaddr_storage f_addr;
|
||||
#else
|
||||
struct sockaddr_in f_addr;
|
||||
#endif
|
||||
@@ -795,7 +788,7 @@
|
||||
#if defined(__GLIBC__)
|
||||
#define dprintf mydprintf
|
||||
#endif /* __GLIBC__ */
|
||||
-static void dprintf(char *, ...);
|
||||
+void dprintf(char *, ...);
|
||||
static void allocate_log(void);
|
||||
void sighup_handler();
|
||||
|
||||
@@ -804,10 +797,8 @@
|
||||
#endif
|
||||
#ifdef SYSLOG_INET
|
||||
static int create_inet_socket();
|
||||
-#ifdef INET6
|
||||
-static void setup_inetaddr_all();
|
||||
-static const char *setup_inetaddr(struct filed *f);
|
||||
-#endif
|
||||
+extern int resolve_name(const char *, int, struct sockaddr_storage *);
|
||||
+extern void init_resolver(void);
|
||||
#endif
|
||||
|
||||
int main(argc, argv)
|
||||
@@ -1342,63 +1333,6 @@
|
||||
return fd;
|
||||
}
|
||||
|
||||
-#ifdef INET6
|
||||
-
|
||||
-static void setup_inetaddr_all()
|
||||
-{
|
||||
- struct filed *f;
|
||||
-#ifdef SYSV
|
||||
- int lognum;
|
||||
-
|
||||
- for (lognum = 0; lognum <= nlogs; lognum++) {
|
||||
- f = &Files[lognum];
|
||||
-#else
|
||||
- for (f = Files; f; f = f->f_next) {
|
||||
-#endif
|
||||
- if (f->f_type == F_FORW_UNKN) {
|
||||
- if (setup_inetaddr(f)) {
|
||||
- f->f_prevcount = INET_RETRY_MAX;
|
||||
- f->f_time = time( (time_t *)0 );
|
||||
- } else {
|
||||
- f->f_type = F_FORW;
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-static const char *setup_inetaddr(struct filed *f)
|
||||
-{
|
||||
- struct addrinfo hints, *res;
|
||||
- int error;
|
||||
-
|
||||
- memset(&hints, 0, sizeof(hints));
|
||||
- hints.ai_family = family == AF_INET6 ? AF_UNSPEC : AF_INET;
|
||||
- hints.ai_socktype = SOCK_DGRAM;
|
||||
- error = getaddrinfo(f->f_un.f_forw.f_hname, "syslog", &hints, &res);
|
||||
- if (error) {
|
||||
- return gai_strerror(error);
|
||||
- }
|
||||
- if (res->ai_addrlen > sizeof(f->f_un.f_forw.f_sa)) {
|
||||
- freeaddrinfo(res);
|
||||
- return "addrlen too large";
|
||||
- }
|
||||
- if (family == AF_INET6 && res->ai_family == AF_INET) {
|
||||
- /* v4mapped addr */
|
||||
- f->f_un.f_forw.f_addr.sa_family = AF_INET6;
|
||||
- f->f_un.f_forw.f_addr6.sin6_port =
|
||||
- ((struct sockaddr_in *)res->ai_addr)->sin_port;
|
||||
- f->f_un.f_forw.f_addr6.sin6_addr.s6_addr16[5] = 0xffff;
|
||||
- memcpy(&f->f_un.f_forw.f_addr6.sin6_addr.s6_addr32[3],
|
||||
- &((struct sockaddr_in *)res->ai_addr)->sin_addr,
|
||||
- sizeof(struct in_addr));
|
||||
- } else {
|
||||
- memcpy(&f->f_un.f_forw.f_addr, res->ai_addr, res->ai_addrlen);
|
||||
- }
|
||||
- freeaddrinfo(res);
|
||||
-
|
||||
- return NULL;
|
||||
-}
|
||||
-#endif /* end of INET6 */
|
||||
#endif
|
||||
|
||||
char **
|
||||
@@ -1821,7 +1755,7 @@
|
||||
char line[MAXLINE + 1];
|
||||
time_t fwd_suspend;
|
||||
#ifdef INET6
|
||||
- const char *errmsg;
|
||||
+ int reserr;
|
||||
#else
|
||||
struct hostent *hp;
|
||||
#endif
|
||||
@@ -1890,38 +1824,21 @@
|
||||
*/
|
||||
case F_FORW_UNKN:
|
||||
dprintf(" %s\n", f->f_un.f_forw.f_hname);
|
||||
- fwd_suspend = time((time_t *) 0) - f->f_time;
|
||||
- if ( fwd_suspend >= INET_SUSPEND_TIME ) {
|
||||
- dprintf("Forwarding suspension to unknown over, retrying\n");
|
||||
-#ifdef INET6
|
||||
- if ((errmsg = setup_inetaddr(f))) {
|
||||
- dprintf("Failure: %s\n", errmsg);
|
||||
-#else
|
||||
- if ( (hp = gethostbyname(f->f_un.f_forw.f_hname)) == NULL ) {
|
||||
- dprintf("Failure: %s\n", sys_h_errlist[h_errno]);
|
||||
-#endif
|
||||
- dprintf("Retries: %d\n", f->f_prevcount);
|
||||
- if ( --f->f_prevcount < 0 ) {
|
||||
- dprintf("Giving up.\n");
|
||||
- f->f_type = F_UNUSED;
|
||||
- }
|
||||
- else
|
||||
- dprintf("Left retries: %d\n", f->f_prevcount);
|
||||
- }
|
||||
- else {
|
||||
- dprintf("%s found, resuming.\n", f->f_un.f_forw.f_hname);
|
||||
-#ifndef INET6 /* not */
|
||||
- memcpy((char *) &f->f_un.f_forw.f_addr.sin_addr, hp->h_addr, hp->h_length);
|
||||
-#endif
|
||||
- f->f_prevcount = 0;
|
||||
- f->f_type = F_FORW;
|
||||
- goto f_forw;
|
||||
- }
|
||||
+ reserr = resolve_name(f->f_un.f_forw.f_hname,
|
||||
+ family,
|
||||
+ &f->f_un.f_forw.f_addr);
|
||||
+ if (reserr > 0) {
|
||||
+ dprintf("Successfully resolved hostname \"%s\"\n", f->f_un.f_forw.f_hname);
|
||||
+ f->f_type = F_FORW;
|
||||
+ } else if (reserr < 0) {
|
||||
+ dprintf("Giving up on hostname \"%s\"\n", f->f_un.f_forw.f_hname);
|
||||
+ f->f_type = F_UNUSED;
|
||||
+ break;
|
||||
+ } else {
|
||||
+ /* Not yet - query in progress, or suspended */
|
||||
+ break;
|
||||
}
|
||||
- else
|
||||
- dprintf("Forwarding suspension not over, time " \
|
||||
- "left: %d\n", INET_SUSPEND_TIME - fwd_suspend);
|
||||
- break;
|
||||
+ /* fallthrough */
|
||||
|
||||
case F_FORW:
|
||||
/*
|
||||
@@ -2553,6 +2470,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef SYSLOG_INET
|
||||
+ init_resolver();
|
||||
if (Forwarding || AcceptRemote) {
|
||||
if (finet < 0) {
|
||||
finet = create_inet_socket();
|
||||
@@ -2569,10 +2487,6 @@
|
||||
InetInuse = 0;
|
||||
}
|
||||
inetm = finet;
|
||||
-#ifdef INET6
|
||||
- if (finet >= 0)
|
||||
- setup_inetaddr_all();
|
||||
-#endif
|
||||
#endif
|
||||
|
||||
Initialized = 1;
|
||||
@@ -2932,7 +2846,7 @@
|
||||
return (-1);
|
||||
}
|
||||
|
||||
-static void dprintf(char *fmt, ...)
|
||||
+void dprintf(char *fmt, ...)
|
||||
|
||||
{
|
||||
va_list ap;
|
18
sysklogd-1.4.1-fileleak.patch
Normal file
18
sysklogd-1.4.1-fileleak.patch
Normal file
@ -0,0 +1,18 @@
|
||||
--- ksym.c
|
||||
+++ ksym.c Wed May 23 18:54:18 2001
|
||||
@@ -344,6 +344,7 @@
|
||||
if ( (sym_file = fopen(symfile, "r")) != (FILE *) 0 ) {
|
||||
if (CheckMapVersion(symfile) == 1)
|
||||
file = symfile;
|
||||
+ fclose(sym_file);
|
||||
}
|
||||
if (sym_file == (FILE *) 0 || file == (char *) 0) {
|
||||
sprintf (symfile, "%s", *mf);
|
||||
@@ -352,6 +353,7 @@
|
||||
if ( (sym_file = fopen(symfile, "r")) != (FILE *) 0 ) {
|
||||
if (CheckMapVersion(symfile) == 1)
|
||||
file = symfile;
|
||||
+ fclose(sym_file);
|
||||
}
|
||||
}
|
||||
|
88
sysklogd-1.4.1-forw.patch
Normal file
88
sysklogd-1.4.1-forw.patch
Normal file
@ -0,0 +1,88 @@
|
||||
--- sysklogd.8
|
||||
+++ sysklogd.8 Wed May 23 18:59:26 2001
|
||||
@@ -29,6 +29,7 @@
|
||||
.RB [ " \-s "
|
||||
.I domainlist
|
||||
]
|
||||
+.RB [ " \-t " ]
|
||||
.RB [ " \-v " ]
|
||||
.LP
|
||||
.SH DESCRIPTION
|
||||
@@ -149,6 +150,11 @@
|
||||
is specified and the host logging resolves to satu.infodrom.north.de
|
||||
no domain would be cut, you will have to specify two domains like:
|
||||
.BR "\-s north.de:infodrom.north.de" .
|
||||
+.TP
|
||||
+.B "\-t"
|
||||
+Tag forwarded messages with the sending hosts name as seen by the forwarder.
|
||||
+Useful for relaying syslog from DMZs through the firwall to an internal
|
||||
+loghost.
|
||||
.TP
|
||||
.B "\-v"
|
||||
Print version and exit.
|
||||
--- syslogd.c
|
||||
+++ syslogd.c Wed May 23 19:01:21 2001
|
||||
@@ -417,6 +417,13 @@
|
||||
* file is defined in the used libc and should not be hardcoded
|
||||
* into the syslogd binary referring the system it was compiled on.
|
||||
*
|
||||
+ * Mon Oct 18 19:23:00 CEST 1999: Andreas Siegert <afx@suse.de>
|
||||
+ * Added -t flag that triggers tagging of forwarded messages with
|
||||
+ * the sending hosts name as seen by the forwarder.
|
||||
+ * Useful for relaying syslog from DMZs through the firwall to an
|
||||
+ * internal loghost.
|
||||
+ * Format is "<""hostname"
|
||||
+ *
|
||||
* Sun Sep 17 20:45:33 CEST 2000: Martin Schulze <joey@infodrom.ffis.de>
|
||||
* Fixed some bugs in printline() code that did not escape
|
||||
* control characters '\177' through '\237' and contained a
|
||||
@@ -731,6 +738,7 @@
|
||||
int MarkSeq = 0; /* mark sequence number */
|
||||
int NoFork = 0; /* don't fork - don't run in daemon mode */
|
||||
int AcceptRemote = 0; /* receive messages that come via UDP */
|
||||
+int TagForward = 0; /* afx: tag remote messages with the hostname they came from */
|
||||
char **StripDomains = NULL; /* these domains may be stripped before writing logs */
|
||||
char **LocalHosts = NULL; /* these hosts are logged with their hostname */
|
||||
int NoHops = 1; /* Can we bounce syslog messages through an
|
||||
@@ -829,7 +837,7 @@
|
||||
funix[i] = -1;
|
||||
}
|
||||
|
||||
- while ((ch = getopt(argc, argv, "a:dhf:l:m:np:rs:v")) != EOF)
|
||||
+ while ((ch = getopt(argc, argv, "a:dhf:l:m:np:rs:tv")) != EOF)
|
||||
switch((char)ch) {
|
||||
case 'a':
|
||||
if (nfunix < MAXFUNIX)
|
||||
@@ -874,6 +882,10 @@
|
||||
}
|
||||
StripDomains = crunch_list(optarg);
|
||||
break;
|
||||
+/* afx add -t for hostname tagging */
|
||||
+ case 't':
|
||||
+ TagForward = 1;
|
||||
+ break;
|
||||
case 'v':
|
||||
printf("syslogd %s.%s\n", VERSION, PATCHLEVEL);
|
||||
exit (0);
|
||||
@@ -1771,8 +1783,19 @@
|
||||
dprintf("Not sending message to remote.\n");
|
||||
else {
|
||||
f->f_time = now;
|
||||
- (void) snprintf(line, sizeof(line), "<%d>%s\n", f->f_prevpri, \
|
||||
- (char *) iov[4].iov_base);
|
||||
+/* afx: add <sourcehost
|
||||
+ */
|
||||
+ if ((TagForward == 1) &&
|
||||
+ strncmp(f->f_prevhost,LocalHostName,MAXHOSTNAMELEN+1)) {
|
||||
+ (void) snprintf(line, sizeof(line), "<%d><%s: %s\n",
|
||||
+ f->f_prevpri, f->f_prevhost,
|
||||
+ (char *) iov[4].iov_base);
|
||||
+ } else {
|
||||
+ (void) snprintf(line, sizeof(line), "<%d>%s\n",
|
||||
+ f->f_prevpri,
|
||||
+ (char *) iov[4].iov_base);
|
||||
+ }
|
||||
+/* end afx */
|
||||
l = strlen(line);
|
||||
if (l > MAXLINE)
|
||||
l = MAXLINE;
|
494
sysklogd-1.4.1-klogd24.dif
Normal file
494
sysklogd-1.4.1-klogd24.dif
Normal file
@ -0,0 +1,494 @@
|
||||
--- klogd.c
|
||||
+++ klogd.c Tue Sep 9 14:15:47 2003
|
||||
@@ -879,7 +879,7 @@
|
||||
{
|
||||
auto int sym_space;
|
||||
|
||||
- unsigned long value;
|
||||
+ uintptr_t value;
|
||||
auto struct symbol sym;
|
||||
auto char *symbol;
|
||||
|
||||
@@ -904,7 +904,7 @@
|
||||
break;
|
||||
}
|
||||
|
||||
- delta = sprintf( sym_start, "%s+%d/%d]",
|
||||
+ delta = sprintf( sym_start, "%s+%llu/%zu]",
|
||||
symbol, sym.offset, sym.size );
|
||||
|
||||
space = sym_space + delta;
|
||||
--- ksym.c
|
||||
+++ ksym.c Tue Sep 9 14:15:47 2003
|
||||
@@ -122,7 +122,7 @@
|
||||
/* Variables static to this module. */
|
||||
struct sym_table
|
||||
{
|
||||
- unsigned long value;
|
||||
+ uintptr_t value;
|
||||
char *name;
|
||||
};
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
|
||||
/* Function prototypes. */
|
||||
static char * FindSymbolFile(void);
|
||||
-static int AddSymbol(unsigned long, char*);
|
||||
+static int AddSymbol(uintptr_t, char*);
|
||||
static void FreeSymbols(void);
|
||||
static int CheckVersion(char *);
|
||||
static int CheckMapVersion(char *);
|
||||
@@ -185,7 +185,7 @@
|
||||
|
||||
auto int version = 0;
|
||||
|
||||
- auto unsigned long int address;
|
||||
+ auto uintptr_t address;
|
||||
|
||||
auto FILE *sym_file;
|
||||
|
||||
@@ -237,16 +237,24 @@
|
||||
*/
|
||||
while ( !feof(sym_file) )
|
||||
{
|
||||
- if ( fscanf(sym_file, "%lx %c %s\n", &address, &type, sym)
|
||||
- != 3 )
|
||||
+#if __WORDSIZE == 64
|
||||
+ if ( fscanf(sym_file, "%lx %c %s\n", &address, &type, sym) != 3 )
|
||||
+#else
|
||||
+ if ( fscanf(sym_file, "%x %c %s\n", &address, &type, sym) != 3 )
|
||||
+#endif
|
||||
{
|
||||
Syslog(LOG_ERR, "Error in symbol table input (#1).");
|
||||
fclose(sym_file);
|
||||
return(0);
|
||||
}
|
||||
if ( VERBOSE_DEBUGGING && debugging )
|
||||
+#if __WORDSIZE == 64
|
||||
fprintf(stderr, "Address: %lx, Type: %c, Symbol: %s\n",
|
||||
address, type, sym);
|
||||
+#else
|
||||
+ fprintf(stderr, "Address: %x, Type: %c, Symbol: %s\n",
|
||||
+ address, type, sym);
|
||||
+#endif
|
||||
|
||||
if ( AddSymbol(address, sym) == 0 )
|
||||
{
|
||||
@@ -521,7 +529,7 @@
|
||||
{
|
||||
int version;
|
||||
FILE *sym_file;
|
||||
- auto unsigned long int address;
|
||||
+ auto uintptr_t address;
|
||||
auto char type,
|
||||
sym[512];
|
||||
|
||||
@@ -536,16 +544,24 @@
|
||||
version = 0;
|
||||
while ( !feof(sym_file) && (version == 0) )
|
||||
{
|
||||
- if ( fscanf(sym_file, "%lx %c %s\n", &address, \
|
||||
- &type, sym) != 3 )
|
||||
+#if __WORDSIZE == 64
|
||||
+ if ( fscanf(sym_file, "%lx %c %s\n", &address, &type, sym) != 3 )
|
||||
+#else
|
||||
+ if ( fscanf(sym_file, "%x %c %s\n", &address, &type, sym) != 3 )
|
||||
+#endif
|
||||
{
|
||||
Syslog(LOG_ERR, "Error in symbol table input (#2).");
|
||||
fclose(sym_file);
|
||||
return(0);
|
||||
}
|
||||
if ( VERBOSE_DEBUGGING && debugging )
|
||||
+#if __WORDSIZE == 64
|
||||
fprintf(stderr, "Address: %lx, Type: %c, " \
|
||||
"Symbol: %s\n", address, type, sym);
|
||||
+#else
|
||||
+ fprintf(stderr, "Address: %x, Type: %c, " \
|
||||
+ "Symbol: %s\n", address, type, sym);
|
||||
+#endif
|
||||
|
||||
version = CheckVersion(sym);
|
||||
}
|
||||
@@ -583,7 +599,7 @@
|
||||
* Purpose: This function is responsible for adding a symbol name
|
||||
* and its address to the symbol table.
|
||||
*
|
||||
- * Arguements: (unsigned long) address, (char *) symbol
|
||||
+ * Arguements: (uintptr_t) address, (char *) symbol
|
||||
*
|
||||
* Return: int
|
||||
*
|
||||
@@ -593,7 +609,7 @@
|
||||
|
||||
static int AddSymbol(address, symbol)
|
||||
|
||||
- unsigned long address;
|
||||
+ uintptr_t address;
|
||||
|
||||
char *symbol;
|
||||
|
||||
@@ -639,7 +655,7 @@
|
||||
|
||||
char * LookupSymbol(value, sym)
|
||||
|
||||
- unsigned long value;
|
||||
+ uintptr_t value;
|
||||
|
||||
struct symbol *sym;
|
||||
|
||||
@@ -739,7 +755,7 @@
|
||||
*symbol;
|
||||
|
||||
char num[15];
|
||||
- auto unsigned long int value;
|
||||
+ auto uintptr_t value;
|
||||
|
||||
auto struct symbol sym;
|
||||
|
||||
@@ -821,7 +837,7 @@
|
||||
value = strtol(kp2, (char **) 0, 16);
|
||||
if ( (symbol = LookupSymbol(value, &sym)) ) {
|
||||
if (sym.size)
|
||||
- elp += sprintf(elp, " (%s+%d/%d)", symbol, sym.offset, sym.size);
|
||||
+ elp += sprintf(elp, " (%s+%ll/%zu)", symbol, sym.offset, sym.size);
|
||||
else
|
||||
elp += sprintf(elp, " (%s)", symbol);
|
||||
}
|
||||
@@ -830,7 +846,7 @@
|
||||
value = strtol(kp3, (char **) 0, 16);
|
||||
if ( (symbol = LookupSymbol(value, &sym)) ) {
|
||||
if (sym.size)
|
||||
- elp += sprintf(elp, " (%s+%d/%d)", symbol, sym.offset, sym.size);
|
||||
+ elp += sprintf(elp, " (%s+%ll/%zu)", symbol, sym.offset, sym.size);
|
||||
else
|
||||
elp += sprintf(elp, " (%s)", symbol);
|
||||
}
|
||||
@@ -841,7 +857,7 @@
|
||||
value = strtol(kp2, (char **) 0, 16);
|
||||
if ( (symbol = LookupSymbol(value, &sym)) ) {
|
||||
if (sym.size)
|
||||
- elp += sprintf(elp, " (%s+%d/%d)", symbol, sym.offset, sym.size);
|
||||
+ elp += sprintf(elp, " (%s+%ll/%zu)", symbol, sym.offset, sym.size);
|
||||
else
|
||||
elp += sprintf(elp, " (%s)", symbol);
|
||||
}
|
||||
@@ -877,17 +893,24 @@
|
||||
strcat(elp, symbol);
|
||||
elp += strlen(symbol);
|
||||
if ( debugging )
|
||||
- fprintf(stderr, "Symbol: %s = %lx = %s, %x/%d\n", \
|
||||
+#if __WORDSIZE == 64
|
||||
+ fprintf(stderr, "Symbol: %s = %lx = %s, %llx/%zu\n", \
|
||||
sl+1, value, \
|
||||
(sym.size==0) ? symbol+1 : symbol, \
|
||||
sym.offset, sym.size);
|
||||
+#else
|
||||
+ fprintf(stderr, "Symbol: %s = %x = %s, %llx/%zu\n", \
|
||||
+ sl+1, value, \
|
||||
+ (sym.size==0) ? symbol+1 : symbol, \
|
||||
+ sym.offset, sym.size);
|
||||
+#endif
|
||||
|
||||
value = 2;
|
||||
if ( sym.size != 0 )
|
||||
{
|
||||
--value;
|
||||
++kp;
|
||||
- elp += sprintf(elp, "+%x/%d", sym.offset, sym.size);
|
||||
+ elp += sprintf(elp, "+%llx/%zu", sym.offset, sym.size);
|
||||
}
|
||||
strncat(elp, kp, value);
|
||||
elp += value;
|
||||
--- ksym_mod.c
|
||||
+++ ksym_mod.c Tue Sep 9 16:51:08 2003
|
||||
@@ -89,43 +89,101 @@
|
||||
#include <errno.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
-#if !defined(__GLIBC__)
|
||||
-#include <linux/time.h>
|
||||
-#include <linux/module.h>
|
||||
-#else /* __GLIBC__ */
|
||||
-#include <linux/module.h>
|
||||
-extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence));
|
||||
-extern int get_kernel_syms __P ((struct kernel_sym *__table));
|
||||
-#endif /* __GLIBC__ */
|
||||
#include <stdarg.h>
|
||||
#include <paths.h>
|
||||
-#include <linux/version.h>
|
||||
+#include <asm/atomic.h>
|
||||
+#include <limits.h>
|
||||
+/* #include <linux/version.h> */
|
||||
|
||||
#include "klogd.h"
|
||||
#include "ksyms.h"
|
||||
|
||||
+/* Used by get_kernel_syms, which is obsolete. */
|
||||
+struct kernel_sym
|
||||
+{
|
||||
+ uintptr_t value;
|
||||
+ char name[60]; /* should have been 64-sizeof(long); oh well */
|
||||
+};
|
||||
+
|
||||
+extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence));
|
||||
+extern int get_kernel_syms __P ((struct kernel_sym *__table));
|
||||
+
|
||||
+static inline __off64_t seek64(int fd, uintptr_t address)
|
||||
+{
|
||||
+ __off64_t off = (__off64_t)address;
|
||||
+ __off64_t ret = (__off64_t)-1;
|
||||
+
|
||||
+ if (off < 0) {
|
||||
+ __off64_t rel;
|
||||
+ if (lseek64(fd, LONG_MAX, SEEK_SET) != LONG_MAX && errno)
|
||||
+ goto err;
|
||||
+ rel = (__off64_t)(address - LONG_MAX);
|
||||
+ if ((ret = lseek64(fd, rel, SEEK_CUR)) != off && errno)
|
||||
+ goto err;
|
||||
+ ret = -ret; /* Relative to LONG_MAX */
|
||||
+ } else
|
||||
+ ret = lseek64(fd, off, SEEK_SET);
|
||||
+err:
|
||||
+ return ret;
|
||||
+}
|
||||
|
||||
-#if !defined(__GLIBC__)
|
||||
-/*
|
||||
- * The following bit uses some kernel/library magic to product what
|
||||
- * looks like a function call to user level code. This function is
|
||||
- * actually a system call in disguise. The purpose of the getsyms
|
||||
- * call is to return a current copy of the in-kernel symbol table.
|
||||
- */
|
||||
-#define __LIBRARY__
|
||||
-#include <linux/unistd.h>
|
||||
-#define __NR_getsyms __NR_get_kernel_syms
|
||||
-_syscall1(int, getsyms, struct kernel_sym *, syms);
|
||||
-#undef __LIBRARY__
|
||||
-extern int getsyms(struct kernel_sym *);
|
||||
-#else /* __GLIBC__ */
|
||||
#define getsyms get_kernel_syms
|
||||
-#endif /* __GLIBC__ */
|
||||
+
|
||||
+struct module
|
||||
+{
|
||||
+ size_t size_of_struct; /* == sizeof(module) */
|
||||
+ struct module *next;
|
||||
+ const char *name;
|
||||
+ size_t size;
|
||||
+
|
||||
+ union
|
||||
+ {
|
||||
+ atomic_t usecount;
|
||||
+ long pad;
|
||||
+ } uc; /* Needs to keep its size - so says rth */
|
||||
+
|
||||
+ unsigned long flags; /* AUTOCLEAN et al */
|
||||
+
|
||||
+ unsigned nsyms;
|
||||
+ unsigned ndeps;
|
||||
+
|
||||
+ struct module_symbol *syms;
|
||||
+ struct module_ref *deps;
|
||||
+ struct module_ref *refs;
|
||||
+ int (*init)(void);
|
||||
+ void (*cleanup)(void);
|
||||
+ const struct exception_table_entry *ex_table_start;
|
||||
+ const struct exception_table_entry *ex_table_end;
|
||||
+#ifdef __alpha__
|
||||
+ unsigned long gp;
|
||||
+#endif
|
||||
+ /* Members past this point are extensions to the basic
|
||||
+ module support and are optional. Use mod_member_present()
|
||||
+ to examine them. */
|
||||
+ const struct module_persist *persist_start;
|
||||
+ const struct module_persist *persist_end;
|
||||
+ int (*can_unload)(void);
|
||||
+ int runsize; /* In modutils, not currently used */
|
||||
+ const char *kallsyms_start; /* All symbols for kernel debugging */
|
||||
+ const char *kallsyms_end;
|
||||
+ const char *archdata_start; /* arch specific data for module */
|
||||
+ const char *archdata_end;
|
||||
+ const char *kernel_data; /* Reserved for kernel internal use */
|
||||
+};
|
||||
+
|
||||
+struct module_info
|
||||
+{
|
||||
+ uintptr_t addr;
|
||||
+ size_t size;
|
||||
+ unsigned long flags;
|
||||
+ long usecount;
|
||||
+};
|
||||
+
|
||||
|
||||
/* Variables static to this module. */
|
||||
struct sym_table
|
||||
{
|
||||
- unsigned long value;
|
||||
+ uintptr_t value;
|
||||
char *name;
|
||||
};
|
||||
|
||||
@@ -136,9 +194,7 @@
|
||||
|
||||
char *name;
|
||||
struct module module;
|
||||
-#if LINUX_VERSION_CODE >= 0x20112
|
||||
struct module_info module_info;
|
||||
-#endif
|
||||
};
|
||||
|
||||
static int num_modules = 0;
|
||||
@@ -155,8 +211,8 @@
|
||||
|
||||
/* Function prototypes. */
|
||||
static void FreeModules(void);
|
||||
-static int AddSymbol(struct Module *mp, unsigned long, char *);
|
||||
-static int AddModule(unsigned long, char *);
|
||||
+static int AddSymbol(struct Module *mp, uintptr_t, char *);
|
||||
+static int AddModule(uintptr_t, char *);
|
||||
static int symsort(const void *, const void *);
|
||||
|
||||
|
||||
@@ -344,7 +400,7 @@
|
||||
* Purpose: This function is responsible for adding a module to
|
||||
* the list of currently loaded modules.
|
||||
*
|
||||
- * Arguements: (unsigned long) address, (char *) symbol
|
||||
+ * Arguements: (uintptr_t) address, (char *) symbol
|
||||
*
|
||||
* address:-> The address of the module.
|
||||
*
|
||||
@@ -355,7 +411,7 @@
|
||||
|
||||
static int AddModule(address, symbol)
|
||||
|
||||
- unsigned long address;
|
||||
+ uintptr_t address;
|
||||
|
||||
char *symbol;
|
||||
|
||||
@@ -403,10 +459,14 @@
|
||||
Syslog(LOG_WARNING, "Error opening /dev/kmem\n");
|
||||
return(0);
|
||||
}
|
||||
- if ( lseek64(memfd, address, SEEK_SET) < 0 )
|
||||
+ if ( seek64(memfd, address) < 0 )
|
||||
{
|
||||
Syslog(LOG_WARNING, "Error seeking in /dev/kmem\n");
|
||||
+#if __WORDSIZE == 64
|
||||
+ Syslog(LOG_WARNING, "Symbol %s, value %16lx\n", symbol, address);
|
||||
+#else
|
||||
Syslog(LOG_WARNING, "Symbol %s, value %08x\n", symbol, address);
|
||||
+#endif
|
||||
return(0);
|
||||
}
|
||||
if ( read(memfd, \
|
||||
@@ -450,7 +510,7 @@
|
||||
* Purpose: This function is responsible for adding a symbol name
|
||||
* and its address to the symbol table.
|
||||
*
|
||||
- * Arguements: (struct Module *) mp, (unsigned long) address, (char *) symbol
|
||||
+ * Arguements: (struct Module *) mp, (uintptr_t) address, (char *) symbol
|
||||
*
|
||||
* mp:-> A pointer to the module which the symbol is
|
||||
* to be added to.
|
||||
@@ -469,7 +529,7 @@
|
||||
|
||||
struct Module *mp;
|
||||
|
||||
- unsigned long address;
|
||||
+ uintptr_t address;
|
||||
|
||||
char *symbol;
|
||||
|
||||
@@ -508,7 +568,7 @@
|
||||
* Purpose: Find the symbol which is related to the given address from
|
||||
* a kernel module.
|
||||
*
|
||||
- * Arguements: (long int) value, (struct symbol *) sym
|
||||
+ * Arguements: (uintptr_t) value, (struct symbol *) sym
|
||||
*
|
||||
* value:-> The address to be located.
|
||||
*
|
||||
@@ -524,7 +584,7 @@
|
||||
|
||||
extern char * LookupModuleSymbol(value, sym)
|
||||
|
||||
- unsigned long value;
|
||||
+ uintptr_t value;
|
||||
|
||||
struct symbol *sym;
|
||||
|
||||
@@ -574,15 +634,9 @@
|
||||
* If it is in this range we can at least return the
|
||||
* name of the module.
|
||||
*/
|
||||
-#if LINUX_VERSION_CODE < 0x20112
|
||||
- if ( (void *) value >= mp->module.addr &&
|
||||
- (void *) value <= (mp->module.addr + \
|
||||
- mp->module.size * 4096) )
|
||||
-#else
|
||||
if ( value >= mp->module_info.addr &&
|
||||
value <= (mp->module_info.addr + \
|
||||
- mp->module.size * 4096) )
|
||||
-#endif
|
||||
+ mp->module.size * getpagesize()) )
|
||||
{
|
||||
/*
|
||||
* A special case needs to be checked for. The above
|
||||
@@ -601,13 +655,8 @@
|
||||
if ( mp->num_syms > 0 )
|
||||
{
|
||||
last = &mp->sym_array[mp->num_syms - 1];
|
||||
-#if LINUX_VERSION_CODE < 0x20112
|
||||
- sym->size = (int) mp->module.addr + \
|
||||
- (mp->module.size * 4096) - value;
|
||||
-#else
|
||||
sym->size = (int) mp->module_info.addr + \
|
||||
- (mp->module.size * 4096) - value;
|
||||
-#endif
|
||||
+ (mp->module.size * getpagesize()) - value;
|
||||
sym->offset = value - last->value;
|
||||
return(last->name);
|
||||
}
|
||||
@@ -617,12 +666,8 @@
|
||||
* Return the module name and the offset of the
|
||||
* faulting address in the module.
|
||||
*/
|
||||
- sym->size = mp->module.size * 4096;
|
||||
-#if LINUX_VERSION_CODE < 0x20112
|
||||
- sym->offset = (void *) value - mp->module.addr;
|
||||
-#else
|
||||
+ sym->size = mp->module.size * getpagesize();
|
||||
sym->offset = value - mp->module_info.addr;
|
||||
-#endif
|
||||
return(mp->name);
|
||||
}
|
||||
}
|
||||
--- ksyms.h
|
||||
+++ ksyms.h Tue Sep 9 14:15:47 2003
|
||||
@@ -20,16 +20,19 @@
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
+#include <sys/types.h>
|
||||
+#include <stdint.h>
|
||||
+
|
||||
/* Variables, structures and type definitions static to this module. */
|
||||
|
||||
struct symbol
|
||||
{
|
||||
char *name;
|
||||
- int size;
|
||||
- int offset;
|
||||
+ size_t size;
|
||||
+ __off64_t offset;
|
||||
};
|
||||
|
||||
|
||||
/* Function prototypes. */
|
||||
-extern char * LookupSymbol(unsigned long, struct symbol *);
|
||||
-extern char * LookupModuleSymbol(unsigned long int, struct symbol *);
|
||||
+extern char * LookupSymbol(uintptr_t, struct symbol *);
|
||||
+extern char * LookupModuleSymbol(uintptr_t, struct symbol *);
|
10
sysklogd-1.4.1-ksym.patch
Normal file
10
sysklogd-1.4.1-ksym.patch
Normal file
@ -0,0 +1,10 @@
|
||||
--- ksym_mod.c
|
||||
+++ ksym_mod.c
|
||||
@@ -91,6 +91,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <stdarg.h>
|
||||
#include <paths.h>
|
||||
+#include <linux/bitops.h>
|
||||
#include <asm/atomic.h>
|
||||
#include <limits.h>
|
||||
/* #include <linux/version.h> */
|
90
sysklogd-1.4.1-ksyslogsize.diff
Normal file
90
sysklogd-1.4.1-ksyslogsize.diff
Normal file
@ -0,0 +1,90 @@
|
||||
--- sysklogd-1.4.1/klogd.c 2004-07-27 13:45:33.000000000 +0200
|
||||
+++ sysklogd-1.4.1/klogd.c 2004-07-27 13:53:48.985727118 +0200
|
||||
@@ -299,8 +299,10 @@
|
||||
no_fork = 0; /* don't fork - don't run in daemon mode */
|
||||
|
||||
static char *symfile = (char *) 0,
|
||||
- log_buffer[LOG_BUFFER_SIZE];
|
||||
+ *log_buffer = (char *) 0;
|
||||
|
||||
+static int log_buf_size = 0;
|
||||
+
|
||||
static FILE *output_file = (FILE *) 0;
|
||||
|
||||
static enum LOGSRC {none, proc, kernel} logsrc;
|
||||
@@ -937,8 +939,8 @@
|
||||
* which will contain old messages. Then read the kernel log
|
||||
* messages into this fresh buffer.
|
||||
*/
|
||||
- memset(log_buffer, '\0', sizeof(log_buffer));
|
||||
- if ( (rdcnt = ksyslog(2, log_buffer, sizeof(log_buffer))) < 0 )
|
||||
+ memset(log_buffer, '\0', log_buf_size);
|
||||
+ if ( (rdcnt = ksyslog(2, log_buffer, log_buf_size-1)) < 0 )
|
||||
{
|
||||
if ( errno == EINTR )
|
||||
return;
|
||||
@@ -962,8 +964,8 @@
|
||||
* which will contain old messages. Then read the kernel messages
|
||||
* from the message pseudo-file into this fresh buffer.
|
||||
*/
|
||||
- memset(log_buffer, '\0', sizeof(log_buffer));
|
||||
- if ( (rdcnt = read(kmsg, log_buffer, sizeof(log_buffer)-1)) < 0 )
|
||||
+ memset(log_buffer, '\0', log_buf_size);
|
||||
+ if ( (rdcnt = read(kmsg, log_buffer, log_buf_size-1)) < 0 )
|
||||
{
|
||||
if ( errno == EINTR )
|
||||
return;
|
||||
@@ -976,6 +978,44 @@
|
||||
return;
|
||||
}
|
||||
|
||||
+static void SetBufSize(void)
|
||||
+
|
||||
+{
|
||||
+ auto int n, sz;
|
||||
+
|
||||
+ n = ksyslog(10, NULL, 0); /* read ringbuffer size */
|
||||
+ if (n > 0) {
|
||||
+ log_buf_size = n;
|
||||
+ log_buffer = (char *) malloc(log_buf_size);
|
||||
+ if (!log_buffer) {
|
||||
+ perror("ksyslog");
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (!log_buf_size) {
|
||||
+ sz = LOG_BUFFER_SIZE;
|
||||
+ while (1) {
|
||||
+ log_buffer = (char *) malloc(sz+8);
|
||||
+ if (!log_buffer) {
|
||||
+ perror("ksyslog");
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ n = ksyslog(3, log_buffer, sz+8);
|
||||
+ if (n < sz+8 || sz >= (1<<22))
|
||||
+ break;
|
||||
+ free(log_buffer);
|
||||
+ sz <<= 1;
|
||||
+ }
|
||||
+ log_buf_size = sz;
|
||||
+ }
|
||||
+
|
||||
+ if (n < 0) {
|
||||
+ perror("ksyslog");
|
||||
+ exit(1);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
|
||||
int main(argc, argv)
|
||||
|
||||
@@ -1053,6 +1093,8 @@
|
||||
console_log_level = *log_level - '0';
|
||||
}
|
||||
|
||||
+ /* get/probe for the kernel ring buffer size */
|
||||
+ SetBufSize();
|
||||
|
||||
#ifndef TESTING
|
||||
/*
|
30
sysklogd-1.4.1-large.patch
Normal file
30
sysklogd-1.4.1-large.patch
Normal file
@ -0,0 +1,30 @@
|
||||
--- Makefile
|
||||
+++ Makefile Tue May 20 13:15:53 2003
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
# The following define determines whether the package adheres to the
|
||||
# file system standard.
|
||||
-FSSTND = -DFSSTND
|
||||
+FSSTND = -DFSSTND -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
|
||||
|
||||
# The following define establishes ownership for the man pages.
|
||||
# Avery tells me that there is a difference between Debian and
|
||||
--- syslogd.c
|
||||
+++ syslogd.c Tue May 20 13:12:35 2003
|
||||
@@ -992,6 +992,7 @@
|
||||
(void) signal(SIGCHLD, reapchild);
|
||||
(void) signal(SIGALRM, domark);
|
||||
(void) signal(SIGUSR1, Debug ? debug_switch : SIG_IGN);
|
||||
+ (void) signal(SIGXFSZ, SIG_IGN);
|
||||
(void) alarm(TIMERINTVL);
|
||||
|
||||
/* Create a partial message table for all file descriptors. */
|
||||
@@ -1852,7 +1853,7 @@
|
||||
errno = e;
|
||||
logerror(f->f_un.f_fname);
|
||||
}
|
||||
- } else if (f->f_flags & SYNC_FILE)
|
||||
+ } else if (f->f_type == F_FILE && (f->f_flags & SYNC_FILE))
|
||||
(void) fsync(f->f_file);
|
||||
break;
|
||||
|
18
sysklogd-1.4.1-no_SO_BSDCOMPAT.diff
Normal file
18
sysklogd-1.4.1-no_SO_BSDCOMPAT.diff
Normal file
@ -0,0 +1,18 @@
|
||||
--- syslogd.c 2003/09/29 08:49:24 1.1
|
||||
+++ syslogd.c 2003/09/29 08:50:05
|
||||
@@ -1311,6 +1311,7 @@
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
+#ifdef SO_BSDCOMPAT
|
||||
/* We need to enable BSD compatibility. Otherwise an attacker
|
||||
* could flood our log files by sending us tons of ICMP errors.
|
||||
*/
|
||||
@@ -1320,6 +1321,7 @@
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
+#endif
|
||||
#ifdef INET6
|
||||
error = bind(fd, res->ai_addr, res->ai_addrlen);
|
||||
freeaddrinfo(res);
|
87
sysklogd-1.4.1-owl-crunch_list.diff
Normal file
87
sysklogd-1.4.1-owl-crunch_list.diff
Normal file
@ -0,0 +1,87 @@
|
||||
diff -ur sysklogd-1.4.1.orig/syslogd.c sysklogd-1.4.1/syslogd.c
|
||||
--- sysklogd-1.4.1.orig/syslogd.c Sun Mar 11 19:40:10 2001
|
||||
+++ sysklogd-1.4.1/syslogd.c Sun Apr 18 01:42:21 2004
|
||||
@@ -1254,30 +1254,26 @@
|
||||
crunch_list(list)
|
||||
char *list;
|
||||
{
|
||||
- int count, i;
|
||||
+ int i, m, n;
|
||||
char *p, *q;
|
||||
char **result = NULL;
|
||||
|
||||
p = list;
|
||||
|
||||
/* strip off trailing delimiters */
|
||||
- while (p[strlen(p)-1] == LIST_DELIMITER) {
|
||||
- count--;
|
||||
+ while (*p && p[strlen(p)-1] == LIST_DELIMITER)
|
||||
p[strlen(p)-1] = '\0';
|
||||
- }
|
||||
/* cut off leading delimiters */
|
||||
- while (p[0] == LIST_DELIMITER) {
|
||||
- count--;
|
||||
+ while (p[0] == LIST_DELIMITER)
|
||||
p++;
|
||||
- }
|
||||
|
||||
- /* count delimiters to calculate elements */
|
||||
- for (count=i=0; p[i]; i++)
|
||||
- if (p[i] == LIST_DELIMITER) count++;
|
||||
+ /* count delimiters to calculate the number of elements */
|
||||
+ for (n = i = 0; p[i]; i++)
|
||||
+ if (p[i] == LIST_DELIMITER) n++;
|
||||
|
||||
- if ((result = (char **)malloc(sizeof(char *) * count+2)) == NULL) {
|
||||
+ if ((result = (char **)malloc(sizeof(char *) * (n + 2))) == NULL) {
|
||||
printf ("Sorry, can't get enough memory, exiting.\n");
|
||||
- exit(0);
|
||||
+ exit(1);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1285,30 +1281,28 @@
|
||||
* characters are different from any delimiters,
|
||||
* so we don't have to care about this.
|
||||
*/
|
||||
- count = 0;
|
||||
- while ((q=strchr(p, LIST_DELIMITER))) {
|
||||
- result[count] = (char *) malloc((q - p + 1) * sizeof(char));
|
||||
- if (result[count] == NULL) {
|
||||
+ m = 0;
|
||||
+ while ((q = strchr(p, LIST_DELIMITER)) && m < n) {
|
||||
+ result[m] = (char *) malloc((q - p + 1) * sizeof(char));
|
||||
+ if (result[m] == NULL) {
|
||||
printf ("Sorry, can't get enough memory, exiting.\n");
|
||||
- exit(0);
|
||||
+ exit(1);
|
||||
}
|
||||
- strncpy(result[count], p, q - p);
|
||||
- result[count][q - p] = '\0';
|
||||
+ memcpy(result[m], p, q - p);
|
||||
+ result[m][q - p] = '\0';
|
||||
p = q; p++;
|
||||
- count++;
|
||||
+ m++;
|
||||
}
|
||||
- if ((result[count] = \
|
||||
- (char *)malloc(sizeof(char) * strlen(p) + 1)) == NULL) {
|
||||
+ if ((result[m] = strdup(p)) == NULL) {
|
||||
printf ("Sorry, can't get enough memory, exiting.\n");
|
||||
- exit(0);
|
||||
+ exit(1);
|
||||
}
|
||||
- strcpy(result[count],p);
|
||||
- result[++count] = NULL;
|
||||
+ result[++m] = NULL;
|
||||
|
||||
#if 0
|
||||
- count=0;
|
||||
- while (result[count])
|
||||
- dprintf ("#%d: %s\n", count, StripDomains[count++]);
|
||||
+ m = 0;
|
||||
+ while (result[m])
|
||||
+ dprintf ("#%d: %s\n", m, result[m++]);
|
||||
#endif
|
||||
return result;
|
||||
}
|
45
sysklogd-1.4.1-preserve_percents.patch
Normal file
45
sysklogd-1.4.1-preserve_percents.patch
Normal file
@ -0,0 +1,45 @@
|
||||
--- sysklogd-1.4.1rh/klogd.c.preserve_percents 2002-04-17 10:49:34.000000000 -0400
|
||||
+++ sysklogd-1.4.1rh/klogd.c 2004-12-02 15:58:17.026614000 -0500
|
||||
@@ -741,7 +741,7 @@
|
||||
switch( parse_state )
|
||||
{
|
||||
case PARSING_TEXT:
|
||||
- delta = copyin( line, space, ptr, len, "\n[%" );
|
||||
+ delta = copyin( line, space, ptr, len, "\n[" );
|
||||
line += delta;
|
||||
ptr += delta;
|
||||
space -= delta;
|
||||
@@ -797,30 +797,9 @@
|
||||
parse_state = PARSING_SYMSTART; /* at < */
|
||||
break;
|
||||
}
|
||||
- if( *ptr == '%' ) /* dangerous printf marker */
|
||||
- {
|
||||
- delta = 0;
|
||||
- while (len && *ptr == '%')
|
||||
- {
|
||||
- *line++ = *ptr++; /* copy it in */
|
||||
- space -= 1;
|
||||
- len -= 1;
|
||||
- delta++;
|
||||
- }
|
||||
- if (delta % 2) /* odd amount of %'s */
|
||||
- {
|
||||
- if (space)
|
||||
- {
|
||||
- *line++ = '%'; /* so simply add one */
|
||||
- space -= 1;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- *line++ = '\0'; /* remove the last one / terminate the string */
|
||||
- }
|
||||
-
|
||||
- }
|
||||
- }
|
||||
+ /* Now that line_buff is no longer fed to *printf as format
|
||||
+ * string, '%'s are no longer "dangerous".
|
||||
+ */
|
||||
break;
|
||||
|
||||
case PARSING_SYMSTART:
|
40
sysklogd-1.4.1-reopen.patch
Normal file
40
sysklogd-1.4.1-reopen.patch
Normal file
@ -0,0 +1,40 @@
|
||||
#
|
||||
# Description: reconnects to log socket if a write fails with
|
||||
# ECONNREFUSED or ENOTCONN -- similar to reopen
|
||||
# in syslog routines provided by glibc.
|
||||
# Happens if the log socket (provided by syslog
|
||||
# daemon) has been reopened. Can be triggered by
|
||||
# "rcsyslog reload" while syslog-ng is used.
|
||||
# See also Bugzilla Bug #27971.
|
||||
#
|
||||
# Author: mt@suse.de
|
||||
#
|
||||
--- syslog.c
|
||||
+++ syslog.c 2003/08/26 11:34:34
|
||||
@@ -102,7 +102,7 @@
|
||||
register int cnt;
|
||||
register char *p;
|
||||
time_t now;
|
||||
- int fd, saved_errno;
|
||||
+ int fd, saved_errno, rc;
|
||||
char tbuf[2048], fmt_cpy[1024], *stdp = (char *) 0;
|
||||
|
||||
saved_errno = errno;
|
||||
@@ -172,7 +172,16 @@
|
||||
}
|
||||
|
||||
/* output the message to the local logger */
|
||||
- if (write(LogFile, tbuf, cnt + 1) >= 0 || !(LogStat&LOG_CONS))
|
||||
+ rc = write(LogFile, tbuf, cnt + 1);
|
||||
+ if(rc == -1 && connected && (ECONNREFUSED == errno ||
|
||||
+ ENOTCONN == errno)) {
|
||||
+ /* try to reopen and write again */
|
||||
+ closelog();
|
||||
+ openlog(LogTag, LogStat | LOG_NDELAY, LogFacility);
|
||||
+ if(connected)
|
||||
+ rc = write(LogFile, tbuf, cnt + 1);
|
||||
+ }
|
||||
+ if(rc >= 0 || !(LogStat&LOG_CONS))
|
||||
return;
|
||||
|
||||
/*
|
185
sysklogd-1.4.1-showpri.patch
Normal file
185
sysklogd-1.4.1-showpri.patch
Normal file
@ -0,0 +1,185 @@
|
||||
--- sysklogd.8.orig 2005-05-23 09:48:29.030220794 -0500
|
||||
+++ sysklogd.8 2005-05-23 09:48:34.564338699 -0500
|
||||
@@ -31,6 +31,7 @@ sysklogd \- Linux system logging utiliti
|
||||
]
|
||||
.RB [ " \-t " ]
|
||||
.RB [ " \-v " ]
|
||||
+.RB [ " \-S " ]
|
||||
.LP
|
||||
.SH DESCRIPTION
|
||||
.B Sysklogd
|
||||
@@ -158,6 +159,28 @@ loghost.
|
||||
.TP
|
||||
.B "\-v"
|
||||
Print version and exit.
|
||||
+.TP
|
||||
+.B "\-S"
|
||||
+Insert a special code before the hostname in each message to indicate the
|
||||
+message's priority and facility. Having the priority and facility encoded in
|
||||
+each message allows a log analyzer program to monitor a single file
|
||||
+containing all logged messages. The analyzer program can parse the
|
||||
+priority/facility code for each logged message to determine if it is
|
||||
+of interest.
|
||||
+
|
||||
+The priority/facility code takes the form of a priority number
|
||||
+followed by a letter that indicates the facility. The priority number
|
||||
+can range from 0 to 7. The facility letter can range from 'A' to 'Y',
|
||||
+where 'A' corresponds to facility number zero (LOG_KERN), 'B'
|
||||
+corresponds to facility 1 (LOG_USER), etc.
|
||||
+See /usr/include/sys/syslog.h for a list of priority and LOG_xxx codes.
|
||||
+
|
||||
+Example:
|
||||
+
|
||||
+ Jun 27 19:22:20 5Q:silence test[1966]: testing
|
||||
+
|
||||
+The above message contains a priority/facility code of '5Q', which breaks
|
||||
+down to a priority of 5 (LOG_NOTICE) and a facility of 16 (LOG_LOCAL0).
|
||||
.LP
|
||||
.SH SIGNALS
|
||||
.B Syslogd
|
||||
--- syslogd.c 2005-05-23 09:48:29.031197346 -0500
|
||||
+++ syslogd.c.orig 2005-05-23 09:48:55.354145686 -0500
|
||||
@@ -594,6 +594,9 @@ int funix[MAXFUNIX] = { -1, };
|
||||
#define SYNC_FILE 0x002 /* do fsync on file after printing */
|
||||
#define ADDDATE 0x004 /* add a date to the message */
|
||||
#define MARK 0x008 /* this message is a mark */
|
||||
+#define SHOWPRI 0x010 /* Will craft priFac before hostname */
|
||||
+
|
||||
+int showpri = 0; /* Are we showing priority in message ? Default: no */
|
||||
|
||||
/*
|
||||
* This table contains plain text for h_errno errors used by the
|
||||
@@ -772,7 +775,7 @@ void printchopped(const char *hname, cha
|
||||
void printline(const char *hname, char *msg);
|
||||
void printsys(char *msg);
|
||||
void logmsg(int pri, char *msg, const char *from, int flags);
|
||||
-void fprintlog(register struct filed *f, char *from, int flags, char *msg);
|
||||
+void fprintlog(register struct filed *f, char *from, int flags, char *msg, ...);
|
||||
void endtty();
|
||||
void wallmsg(register struct filed *f, struct iovec *iov);
|
||||
void reapchild();
|
||||
@@ -861,7 +864,7 @@ int main(argc, argv)
|
||||
funix[i] = -1;
|
||||
}
|
||||
|
||||
- while ((ch = getopt(argc, argv, "a:dhf:l:m:np:rs:tv")) != EOF)
|
||||
+ while ((ch = getopt(argc, argv, "a:dhf:l:m:np:rs:tvS")) != EOF)
|
||||
switch((char)ch) {
|
||||
case 'a':
|
||||
if (nfunix < MAXFUNIX)
|
||||
@@ -913,6 +916,9 @@ int main(argc, argv)
|
||||
case 'v':
|
||||
printf("syslogd %s.%s\n", VERSION, PATCHLEVEL);
|
||||
exit (0);
|
||||
+ case 'S':
|
||||
+ showpri++;
|
||||
+ break;
|
||||
case '?':
|
||||
default:
|
||||
usage();
|
||||
@@ -1151,9 +1157,9 @@ int main(argc, argv)
|
||||
dprintf("UNIX socket error: %d = %s.\n", \
|
||||
errno, strerror(errno));
|
||||
logerror("recvfrom UNIX");
|
||||
- }
|
||||
- }
|
||||
}
|
||||
+ }
|
||||
+ }
|
||||
#endif
|
||||
|
||||
#ifdef SYSLOG_INET
|
||||
@@ -1221,7 +1227,7 @@ int main(argc, argv)
|
||||
|
||||
int usage()
|
||||
{
|
||||
- fprintf(stderr, "usage: syslogd [-drvh] [-l hostlist] [-m markinterval] [-n] [-p path]\n" \
|
||||
+ fprintf(stderr, "usage: syslogd [-drvSh] [-l hostlist] [-m markinterval] [-n] [-p path]\n" \
|
||||
" [-s domainlist] [-f conffile]\n");
|
||||
exit(1);
|
||||
}
|
||||
@@ -1660,7 +1666,7 @@ void logmsg(pri, msg, from, flags)
|
||||
|
||||
if (f->f_file >= 0) {
|
||||
untty();
|
||||
- fprintlog(f, (char *)from, flags, msg);
|
||||
+ fprintlog(f, (char *)from, flags|SHOWPRI, msg, prilev, fac);
|
||||
(void) close(f->f_file);
|
||||
f->f_file = -1;
|
||||
}
|
||||
@@ -1706,13 +1712,13 @@ void logmsg(pri, msg, from, flags)
|
||||
* in the future.
|
||||
*/
|
||||
if (now > REPEATTIME(f)) {
|
||||
- fprintlog(f, (char *)from, flags, (char *)NULL);
|
||||
+ fprintlog(f, (char *)from, flags|SHOWPRI, (char *)NULL, prilev, fac);
|
||||
BACKOFF(f);
|
||||
}
|
||||
} else {
|
||||
/* new line, save it */
|
||||
if (f->f_prevcount)
|
||||
- fprintlog(f, (char *)from, 0, (char *)NULL);
|
||||
+ fprintlog(f, (char *)from, 0|SHOWPRI, (char *)NULL, prilev, fac);
|
||||
f->f_prevpri = pri;
|
||||
f->f_repeatcount = 0;
|
||||
(void) strncpy(f->f_lasttime, timestamp, 15);
|
||||
@@ -1721,11 +1727,11 @@ void logmsg(pri, msg, from, flags)
|
||||
if (msglen < MAXSVLINE) {
|
||||
f->f_prevlen = msglen;
|
||||
(void) strcpy(f->f_prevline, msg);
|
||||
- fprintlog(f, (char *)from, flags, (char *)NULL);
|
||||
+ fprintlog(f, (char *)from, flags|SHOWPRI, (char *)NULL, prilev, fac);
|
||||
} else {
|
||||
f->f_prevline[0] = 0;
|
||||
f->f_prevlen = 0;
|
||||
- fprintlog(f, (char *)from, flags, msg);
|
||||
+ fprintlog(f, (char *)from, flags|SHOWPRI, msg, prilev, fac);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1737,11 +1743,7 @@ void logmsg(pri, msg, from, flags)
|
||||
} /* balance parentheses for emacs */
|
||||
#endif
|
||||
|
||||
-void fprintlog(f, from, flags, msg)
|
||||
- register struct filed *f;
|
||||
- char *from;
|
||||
- int flags;
|
||||
- char *msg;
|
||||
+void fprintlog(register struct filed *f, char *from, int flags,char *msg, ...)
|
||||
{
|
||||
struct iovec iov[6];
|
||||
register struct iovec *v = iov;
|
||||
@@ -1762,9 +1764,29 @@ void fprintlog(f, from, flags, msg)
|
||||
v->iov_base = f->f_lasttime;
|
||||
v->iov_len = 15;
|
||||
v++;
|
||||
- v->iov_base = " ";
|
||||
- v->iov_len = 1;
|
||||
- v++;
|
||||
+
|
||||
+ if(showpri && (flags & SHOWPRI) ) {
|
||||
+ va_list ap;
|
||||
+ int prilev;
|
||||
+ int fac;
|
||||
+ char prilev_char[5];
|
||||
+ const char fac_string[LOG_NFACILITIES+1]="ABCDEFGHIJKLMNOPQRSTUVWXY";
|
||||
+
|
||||
+ va_start(ap,msg);
|
||||
+ prilev=va_arg(ap,int);
|
||||
+ fac=va_arg(ap,int);
|
||||
+ va_end(ap);
|
||||
+ sprintf(prilev_char, " %1d%c:", prilev, fac_string[fac]);
|
||||
+ v->iov_base = prilev_char;
|
||||
+ v->iov_len = 4;
|
||||
+ v++;
|
||||
+ }
|
||||
+ else {
|
||||
+ v->iov_base = " ";
|
||||
+ v->iov_len = 1;
|
||||
+ v++;
|
||||
+ }
|
||||
+
|
||||
v->iov_base = f->f_prevhost;
|
||||
v->iov_len = strlen(v->iov_base);
|
||||
v++;
|
95
sysklogd-1.4.1-sparc.patch
Normal file
95
sysklogd-1.4.1-sparc.patch
Normal file
@ -0,0 +1,95 @@
|
||||
--- ksym.c
|
||||
+++ ksym.c Wed May 23 18:50:36 2001
|
||||
@@ -112,6 +112,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include <sys/utsname.h>
|
||||
+#include <ctype.h>
|
||||
#include "klogd.h"
|
||||
#include "ksyms.h"
|
||||
|
||||
@@ -770,6 +771,84 @@
|
||||
if ( (num_syms == 0) ||
|
||||
(kp = strstr(line, "[<")) == (char *) 0 )
|
||||
{
|
||||
+#ifdef __sparc__
|
||||
+ if (num_syms) {
|
||||
+ /*
|
||||
+ * On SPARC, register dumps do not have the [< >] characters in it.
|
||||
+ */
|
||||
+ static struct sparc_tests {
|
||||
+ char *str;
|
||||
+ int len;
|
||||
+ } tests[] = { { "PC: ", 4 },
|
||||
+ { " o7: ", 5 },
|
||||
+ { " ret_pc: ", 9 },
|
||||
+ { " i7: ", 5 },
|
||||
+ { "Caller[", 7 }
|
||||
+ };
|
||||
+ int i, j, ndigits;
|
||||
+ char *kp2;
|
||||
+ for (i = 0; i < 5; i++) {
|
||||
+ kp = strstr(line, tests[i].str);
|
||||
+ if (!kp) continue;
|
||||
+ kp2 = kp + tests[i].len;
|
||||
+ if (!isxdigit(*kp2)) continue;
|
||||
+ for (ndigits = 1; isxdigit(kp2[ndigits]); ndigits++);
|
||||
+ if (ndigits != 8 && ndigits != 16) continue;
|
||||
+ /* On sparc64, all kernel addresses are in first 4GB */
|
||||
+ if (ndigits == 16) {
|
||||
+ if (strncmp (kp2, "00000000", 8)) continue;
|
||||
+ kp2 += 8;
|
||||
+ }
|
||||
+ if (!i) {
|
||||
+ char *kp3;
|
||||
+ if (ndigits == 16 && kp > line && kp[-1L] != 'T') continue;
|
||||
+ kp3 = kp2 + 8;
|
||||
+ if (ndigits == 16) {
|
||||
+ if (strncmp (kp3, " TNPC: 00000000", 15) || !isxdigit(kp3[15]))
|
||||
+ continue;
|
||||
+ kp3 += 15;
|
||||
+ } else {
|
||||
+ if (strncmp (kp3, " NPC: ", 6) || !isxdigit(kp3[6]))
|
||||
+ continue;
|
||||
+ kp3 += 6;
|
||||
+ }
|
||||
+ for (j = 0; isxdigit(kp3[j]); j++);
|
||||
+ if (j != 8) continue;
|
||||
+ strncpy(elp, line, kp2 + 8 - line);
|
||||
+ elp += kp2 + 8 - line;
|
||||
+ value = strtol(kp2, (char **) 0, 16);
|
||||
+ if ( (symbol = LookupSymbol(value, &sym)) ) {
|
||||
+ if (sym.size)
|
||||
+ elp += sprintf(elp, " (%s+%d/%d)", symbol, sym.offset, sym.size);
|
||||
+ else
|
||||
+ elp += sprintf(elp, " (%s)", symbol);
|
||||
+ }
|
||||
+ strncpy(elp, kp2 + 8, kp3 - kp2);
|
||||
+ elp += kp3 - kp2;
|
||||
+ value = strtol(kp3, (char **) 0, 16);
|
||||
+ if ( (symbol = LookupSymbol(value, &sym)) ) {
|
||||
+ if (sym.size)
|
||||
+ elp += sprintf(elp, " (%s+%d/%d)", symbol, sym.offset, sym.size);
|
||||
+ else
|
||||
+ elp += sprintf(elp, " (%s)", symbol);
|
||||
+ }
|
||||
+ strcpy(elp, kp3 + 8);
|
||||
+ } else {
|
||||
+ strncpy(elp, line, kp2 + 8 - line);
|
||||
+ elp += kp2 + 8 - line;
|
||||
+ value = strtol(kp2, (char **) 0, 16);
|
||||
+ if ( (symbol = LookupSymbol(value, &sym)) ) {
|
||||
+ if (sym.size)
|
||||
+ elp += sprintf(elp, " (%s+%d/%d)", symbol, sym.offset, sym.size);
|
||||
+ else
|
||||
+ elp += sprintf(elp, " (%s)", symbol);
|
||||
+ }
|
||||
+ strcpy(elp, kp2 + 8);
|
||||
+ }
|
||||
+ return el;
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
strcpy(el, line);
|
||||
return(el);
|
||||
}
|
147
sysklogd-1.4.1-unix_sockets.patch
Normal file
147
sysklogd-1.4.1-unix_sockets.patch
Normal file
@ -0,0 +1,147 @@
|
||||
--- syslog.conf.5
|
||||
+++ syslog.conf.5 2004-09-16 13:21:07.144284248 -0700
|
||||
@@ -159,6 +159,16 @@
|
||||
.BR syslogd (8)
|
||||
is started.
|
||||
|
||||
+.SS Unix Socket (UDP)
|
||||
+This version of
|
||||
+.BR syslogd (8)
|
||||
+has support for logging output to named sockets (UDP UNIX domain sockets).
|
||||
+A named socket can be used as a destination for log messages by prepending
|
||||
+a double at-sign symbol (``@@'') to the pathname of the socket file. This
|
||||
+feature is useful for applications that need to process all logged messages.
|
||||
+All they need to do is open the named socket for reading and then process
|
||||
+the messages as they are received.
|
||||
+
|
||||
.SS Terminal and Console
|
||||
If the file you specified is a tty, special tty-handling is done, same
|
||||
with
|
||||
--- syslogd.c
|
||||
+++ syslogd.c 2004-09-16 13:21:07.150143661 -0700
|
||||
@@ -638,6 +638,10 @@
|
||||
struct sockaddr_in f_addr;
|
||||
#endif
|
||||
} f_forw; /* forwarding address */
|
||||
+ struct {
|
||||
+ struct sockaddr_un su_addr; /* destination address */
|
||||
+ int su_addrlen; /* address len */
|
||||
+ } f_usock; /* UNIX domain socket address */
|
||||
char f_fname[MAXFNAME];
|
||||
} f_un;
|
||||
char f_prevline[MAXSVLINE]; /* last message logged */
|
||||
@@ -649,6 +653,8 @@
|
||||
int f_repeatcount; /* number of "repeated" msgs */
|
||||
int f_flags; /* store some additional flags */
|
||||
};
|
||||
+#define fus_su f_un.f_usock.su_addr
|
||||
+#define fus_sal f_un.f_usock.su_addrlen
|
||||
|
||||
/*
|
||||
* Intervals at which we flush out "message repeated" messages,
|
||||
@@ -679,10 +685,11 @@
|
||||
#define F_FORW_SUSP 7 /* suspended host forwarding */
|
||||
#define F_FORW_UNKN 8 /* unknown host forwarding */
|
||||
#define F_PIPE 9 /* named pipe */
|
||||
+#define F_USOCK 10 /* UNIX domain UDP socket */
|
||||
char *TypeNames[] = {
|
||||
"UNUSED", "FILE", "TTY", "CONSOLE",
|
||||
"FORW", "USERS", "WALL", "FORW(SUSPENDED)",
|
||||
- "FORW(UNKNOWN)", "PIPE"
|
||||
+ "FORW(UNKNOWN)", "PIPE", "USOCK"
|
||||
};
|
||||
|
||||
struct filed *Files = (struct filed *) 0;
|
||||
@@ -1949,6 +1956,32 @@
|
||||
(void) fsync(f->f_file);
|
||||
break;
|
||||
|
||||
+ case F_USOCK:
|
||||
+ f->f_time = now;
|
||||
+ dprintf(" %s\n", f->fus_su.sun_path[0] ? f->fus_su.sun_path : "<undefined>");
|
||||
+ if (f->f_file != -1) {
|
||||
+ int l;
|
||||
+ char line[MAXLINE +1];
|
||||
+
|
||||
+ int chunk_len,dstbuf_size = 0;
|
||||
+ for (l = 0;l < 5;l++) {
|
||||
+ if( (chunk_len = iov[l].iov_len) > (sizeof(line) - dstbuf_size))
|
||||
+ chunk_len = sizeof(line) - dstbuf_size;
|
||||
+ if(chunk_len > 0) {
|
||||
+ memcpy(&line[dstbuf_size],iov[l].iov_base,chunk_len);
|
||||
+ dstbuf_size += chunk_len;
|
||||
+ }
|
||||
+ }
|
||||
+ if ((l = dstbuf_size) > MAXLINE) l = MAXLINE;
|
||||
+ line[l] = 0;
|
||||
+ if (sendto(f->f_file, line, l, MSG_DONTWAIT,
|
||||
+ (struct sockaddr*) &f->fus_su, f->fus_sal) != l) {
|
||||
+ dprintf("sendto error - \"%s\"\n",strerror(errno));
|
||||
+ /* sendto error must be ignored */
|
||||
+ }
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
case F_USERS:
|
||||
case F_WALL:
|
||||
f->f_time = now;
|
||||
@@ -2357,6 +2390,7 @@
|
||||
case F_PIPE:
|
||||
case F_TTY:
|
||||
case F_CONSOLE:
|
||||
+ case F_USOCK:
|
||||
(void) close(f->f_file);
|
||||
break;
|
||||
}
|
||||
@@ -2509,7 +2543,11 @@
|
||||
case F_PIPE:
|
||||
case F_TTY:
|
||||
case F_CONSOLE:
|
||||
- printf("%s", f->f_un.f_fname);
|
||||
+ case F_USOCK:
|
||||
+ if(f->f_type == F_USOCK)
|
||||
+ printf("%s", f->fus_su.sun_path[0] ? f->fus_su.sun_path : "<undefined>");
|
||||
+ else
|
||||
+ printf("%s", f->f_un.f_fname);
|
||||
if (f->f_file == -1)
|
||||
printf(" (unused)");
|
||||
break;
|
||||
@@ -2727,8 +2765,37 @@
|
||||
switch (*p)
|
||||
{
|
||||
case '@':
|
||||
+ if(*(++p) == '@') {
|
||||
+ /* We need to set up for output to a named socket...
|
||||
+ */
|
||||
+ memset((char *)&f->fus_su, 0, sizeof(f->fus_su));
|
||||
+ (void)strncpy(f->fus_su.sun_path, ++p,
|
||||
+ sizeof(f->fus_su.sun_path)-1);
|
||||
+ f->fus_su.sun_path[sizeof(f->fus_su.sun_path)-1] = 0;
|
||||
+ dprintf ("unix socket filename: %s\n",
|
||||
+ f->fus_su.sun_path);
|
||||
+ f->fus_su.sun_family = AF_UNIX;
|
||||
+ if( (f->f_file = socket(PF_UNIX, SOCK_DGRAM, 0)) < 0) {
|
||||
+ dprintf("Can't create unix socket\n");
|
||||
+ logerror("Can't create unix socket");
|
||||
+ break;
|
||||
+ }
|
||||
+ f->fus_sal = strlen(f->fus_su.sun_path) +
|
||||
+ sizeof(f->fus_su.sun_family);
|
||||
+ f->f_type = F_USOCK;
|
||||
+
|
||||
+ /* Make sure that pathname exists...
|
||||
+ */
|
||||
+ if (bind(f->f_file, (struct sockaddr *)&f->fus_su, f->fus_sal) < 0 ||
|
||||
+ (chmod(f->fus_su.sun_path, 0666) < 0)) {
|
||||
+ dprintf("Can't bind unix socket to name\n");
|
||||
+ logerror("Can't bind unix unix socket to name");
|
||||
+ break;
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
#ifdef SYSLOG_INET
|
||||
- (void) strcpy(f->f_un.f_forw.f_hname, ++p);
|
||||
+ (void) strcpy(f->f_un.f_forw.f_hname, p);
|
||||
dprintf("forwarding host: %s\n", p); /*ASP*/
|
||||
#ifdef INET6
|
||||
f->f_type = F_FORW_UNKN;
|
11
sysklogd-1.4.1-utf8.patch
Normal file
11
sysklogd-1.4.1-utf8.patch
Normal file
@ -0,0 +1,11 @@
|
||||
--- sysklogd-1.4.1/syslogd.c 2004-09-26 11:33:01.771437000 +0900
|
||||
+++ sysklogd-1.4.1/syslogd.c 2004-09-26 11:41:27.136610056 +0900
|
||||
@@ -1539,7 +1539,7 @@
|
||||
else if (c < 040) {
|
||||
*q++ = '^';
|
||||
*q++ = c ^ 0100;
|
||||
- } else if (c == 0177 || (c & 0177) < 040) {
|
||||
+ } else if (c == 0177 || c >= 0376) {
|
||||
*q++ = '\\';
|
||||
*q++ = '0' + ((c & 0300) >> 6);
|
||||
*q++ = '0' + ((c & 0070) >> 3);
|
631
sysklogd-1.4.1.dif
Normal file
631
sysklogd-1.4.1.dif
Normal file
@ -0,0 +1,631 @@
|
||||
--- .pkgextract
|
||||
+++ .pkgextract 2006-02-08 17:29:50.000000000 +0100
|
||||
@@ -0,0 +1,16 @@
|
||||
+patch -p0 --suffix=.dgram -s < ../sysklogd-1.4.1-dgram.patch
|
||||
+patch -p0 --suffix=.sparc -s < ../sysklogd-1.4.1-sparc.patch
|
||||
+patch -p0 --suffix=.forw -s < ../sysklogd-1.4.1-forw.patch
|
||||
+patch -p0 --suffix=.fileleak -s < ../sysklogd-1.4.1-fileleak.patch
|
||||
+patch -p0 --suffix=.ipv6 -s < ../sysklogd-ipv6.diff
|
||||
+patch -p0 --suffix=.klogd24 -s < ../sysklogd-1.4.1-klogd24.dif
|
||||
+patch -p0 --suffix=.large -s < ../sysklogd-1.4.1-large.patch
|
||||
+patch -p1 --suffix=.dns -s < ../sysklogd-1.4.1-dns.patch
|
||||
+patch -p0 --suffix=.reopen -s < ../sysklogd-1.4.1-reopen.patch
|
||||
+patch -p0 --suffix=.sobsd -s < ../sysklogd-1.4.1-no_SO_BSDCOMPAT.diff
|
||||
+patch -p1 --suffix=.owlcr -s < ../sysklogd-1.4.1-owl-crunch_list.diff
|
||||
+patch -p1 --suffix=.klsize -s < ../sysklogd-1.4.1-ksyslogsize.diff
|
||||
+patch -p0 --suffix=.usock -s < ../sysklogd-1.4.1-unix_sockets.patch
|
||||
+patch -p0 --suffix=.shprio -s < ../sysklogd-1.4.1-showpri.patch
|
||||
+patch -p1 --suffix=.presperc -s < ../sysklogd-1.4.1-preserve_percents.patch
|
||||
+patch -p1 --suffix=.utf8 -s < ../sysklogd-1.4.1-utf8.patch
|
||||
--- Makefile
|
||||
+++ Makefile 2006-02-08 17:29:50.000000000 +0100
|
||||
@@ -1,14 +1,17 @@
|
||||
# Makefile for syslogd and klogd daemons.
|
||||
|
||||
+# For newer Kernel we have 16k buffer size
|
||||
+LOG_BUFFER_SIZE = -DLOG_BUFFER_SIZE=16384
|
||||
+
|
||||
CC= gcc
|
||||
-#CFLAGS= -g -DSYSV -Wall
|
||||
+#CFLAGS= -g -DSYSV -Wall $(LOG_BUFFER_SIZE)
|
||||
#LDFLAGS= -g
|
||||
-CFLAGS= $(RPM_OPT_FLAGS) -DINET6 -O3 -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce
|
||||
-LDFLAGS= -s
|
||||
+CFLAGS= $(RPM_OPT_FLAGS) -D_GNU_SOURCE -DINET6 -DSYSV -Wall -pipe $(LOG_BUFFER_SIZE) -funroll-loops -fpie
|
||||
+LDFLAGS= -pie
|
||||
|
||||
# Look where your install program is.
|
||||
INSTALL = /usr/bin/install
|
||||
-BINDIR = /usr/sbin
|
||||
+BINDIR = /sbin
|
||||
MANDIR = /usr/man
|
||||
|
||||
# There is one report that under an all ELF system there may be a need to
|
||||
@@ -25,7 +28,7 @@
|
||||
|
||||
# Define the following to impart start-up delay in klogd. This is
|
||||
# useful if klogd is started simultaneously or in close-proximity to syslogd.
|
||||
-# KLOGD_START_DELAY = -DKLOGD_DELAY=5
|
||||
+KLOGD_START_DELAY = -DKLOGD_DELAY=5
|
||||
|
||||
# The following define determines whether the package adheres to the
|
||||
# file system standard.
|
||||
@@ -112,11 +115,12 @@
|
||||
rm -f syslogd klogd ksym syslog_tst oops_test TAGS tsyslogd tklogd
|
||||
|
||||
install_exec: syslogd klogd
|
||||
- ${INSTALL} -m 500 -s syslogd ${BINDIR}/syslogd
|
||||
- ${INSTALL} -m 500 -s klogd ${BINDIR}/klogd
|
||||
+ ${INSTALL} syslogd ${DESTDIR}${BINDIR}/syslogd
|
||||
+ ${INSTALL} klogd ${DESTDIR}${BINDIR}/klogd
|
||||
+ ${INSTALL} -m 644 sample.conf ${DESTDIR}/etc/syslog.conf
|
||||
|
||||
install_man:
|
||||
- ${INSTALL} -o ${MAN_OWNER} -g ${MAN_OWNER} -m 644 sysklogd.8 ${MANDIR}/man8/sysklogd.8
|
||||
- ${INSTALL} -o ${MAN_OWNER} -g ${MAN_OWNER} -m 644 syslogd.8 ${MANDIR}/man8/syslogd.8
|
||||
- ${INSTALL} -o ${MAN_OWNER} -g ${MAN_OWNER} -m 644 syslog.conf.5 ${MANDIR}/man5/syslog.conf.5
|
||||
- ${INSTALL} -o ${MAN_OWNER} -g ${MAN_OWNER} -m 644 klogd.8 ${MANDIR}/man8/klogd.8
|
||||
+ ${INSTALL} -m 644 sysklogd.8 ${DESTDIR}${MANDIR}/man8/sysklogd.8
|
||||
+ ${INSTALL} -m 644 syslogd.8 ${DESTDIR}${MANDIR}/man8/syslogd.8
|
||||
+ ${INSTALL} -m 644 syslog.conf.5 ${DESTDIR}${MANDIR}/man5/syslog.conf.5
|
||||
+ ${INSTALL} -m 644 klogd.8 ${DESTDIR}${MANDIR}/man8/klogd.8
|
||||
--- klogd.c
|
||||
+++ klogd.c 2006-02-08 17:38:21.000000000 +0100
|
||||
@@ -275,15 +275,29 @@
|
||||
#define ksyslog klogctl
|
||||
#endif
|
||||
|
||||
-#define LOG_BUFFER_SIZE 4096
|
||||
+#ifndef _PATH_KLOG
|
||||
+# define _PATH_KLOG "/proc/kmsg"
|
||||
+#endif
|
||||
+
|
||||
+#ifndef LOG_BUFFER_SIZE
|
||||
+# define LOG_BUFFER_SIZE 4096
|
||||
+#endif
|
||||
#define LOG_LINE_LENGTH 1000
|
||||
|
||||
#ifndef TESTING
|
||||
-#if defined(FSSTND)
|
||||
+# if defined(FSSTND)
|
||||
static char *PidFile = _PATH_VARRUN "klogd.pid";
|
||||
-#else
|
||||
+# else
|
||||
static char *PidFile = "/etc/klogd.pid";
|
||||
+# endif
|
||||
#endif
|
||||
+
|
||||
+#if defined(__USE_FORTIFY_LEVEL)
|
||||
+# undef syslog
|
||||
+# undef vsyslog
|
||||
+# undef openlog
|
||||
+# undef closelog
|
||||
+# undef setlogmask
|
||||
#endif
|
||||
|
||||
static int kmsg,
|
||||
@@ -295,6 +309,8 @@
|
||||
|
||||
static int use_syscall = 0,
|
||||
one_shot = 0,
|
||||
+ ring_buf = 0,
|
||||
+ ring_buf_clear = 0,
|
||||
symbol_lookup = 1,
|
||||
no_fork = 0; /* don't fork - don't run in daemon mode */
|
||||
|
||||
@@ -868,8 +884,7 @@
|
||||
value = strtoul(sym_start+1, (char **) 0, 16);
|
||||
*(line-1) = '>'; /* put back delim */
|
||||
|
||||
- symbol = LookupSymbol(value, &sym);
|
||||
- if ( !symbol_lookup || symbol == (char *) 0 )
|
||||
+ if ( !symbol_lookup || (symbol = LookupSymbol(value, &sym)) == (char *) 0 )
|
||||
{
|
||||
parse_state = PARSING_TEXT;
|
||||
break;
|
||||
@@ -910,7 +925,7 @@
|
||||
static void LogKernelLine(void)
|
||||
|
||||
{
|
||||
- auto int rdcnt;
|
||||
+ auto int rdcnt, lvl;
|
||||
|
||||
/*
|
||||
* Zero-fill the log buffer. This should cure a multitude of
|
||||
@@ -919,6 +934,11 @@
|
||||
* messages into this fresh buffer.
|
||||
*/
|
||||
memset(log_buffer, '\0', log_buf_size);
|
||||
+ lvl = 2;
|
||||
+ if (one_shot) {
|
||||
+ if (ring_buf) lvl = 3;
|
||||
+ if (ring_buf_clear) lvl = 4;
|
||||
+ }
|
||||
if ( (rdcnt = ksyslog(2, log_buffer, log_buf_size-1)) < 0 )
|
||||
{
|
||||
if ( errno == EINTR )
|
||||
@@ -1010,10 +1030,15 @@
|
||||
*output = (char *) 0;
|
||||
|
||||
#ifndef TESTING
|
||||
- chdir ("/");
|
||||
+ if (chdir("/") < 0) {
|
||||
+ fprintf(stderr,
|
||||
+ "klogd: Can not change to root directory: %s\n",
|
||||
+ strerror(errno));
|
||||
+ exit(1);
|
||||
+ }
|
||||
#endif
|
||||
/* Parse the command-line. */
|
||||
- while ((ch = getopt(argc, argv, "c:df:iIk:nopsvx2")) != EOF)
|
||||
+ while ((ch = getopt(argc, argv, "c:df:iIk:nopsvx2rR")) != EOF)
|
||||
switch((char)ch)
|
||||
{
|
||||
case '2': /* Print lines with symbols twice. */
|
||||
@@ -1044,6 +1069,14 @@
|
||||
case 'o': /* One-shot mode. */
|
||||
one_shot = 1;
|
||||
break;
|
||||
+ case 'r': /* One-shot mode. */
|
||||
+ one_shot = 1;
|
||||
+ ring_buf = 1;
|
||||
+ break;
|
||||
+ case 'R': /* One-shot mode. */
|
||||
+ one_shot = 1;
|
||||
+ ring_buf_clear = 1;
|
||||
+ break;
|
||||
case 'p':
|
||||
SetParanoiaLevel(1); /* Load symbols on oops. */
|
||||
break;
|
||||
@@ -1164,8 +1197,11 @@
|
||||
if ( one_shot )
|
||||
{
|
||||
if (symbol_lookup) {
|
||||
- InitKsyms(symfile);
|
||||
- InitMsyms();
|
||||
+ /* Both functions return 1 at success and 0 otherwise */
|
||||
+ symbol_lookup = InitKsyms(symfile);
|
||||
+ symbol_lookup |= InitMsyms();
|
||||
+ if (!symbol_lookup)
|
||||
+ Syslog(LOG_WARNING, "Cannot build symbol table - disabling symbol lookups");
|
||||
}
|
||||
if ( (logsrc = GetKernelLogSrc()) == kernel )
|
||||
LogKernelLine();
|
||||
@@ -1180,8 +1216,11 @@
|
||||
#endif
|
||||
logsrc = GetKernelLogSrc();
|
||||
if (symbol_lookup) {
|
||||
- InitKsyms(symfile);
|
||||
- InitMsyms();
|
||||
+ /* Both functions return 1 at success and 0 otherwise */
|
||||
+ symbol_lookup = InitKsyms(symfile);
|
||||
+ symbol_lookup |= InitMsyms();
|
||||
+ if (!symbol_lookup)
|
||||
+ Syslog(LOG_WARNING, "Cannot build symbol table - disabling symbol lookups");
|
||||
}
|
||||
|
||||
/* The main loop. */
|
||||
--- pidfile.c
|
||||
+++ pidfile.c 2006-02-08 17:29:50.000000000 +0100
|
||||
@@ -41,11 +41,11 @@
|
||||
int read_pid (char *pidfile)
|
||||
{
|
||||
FILE *f;
|
||||
- int pid;
|
||||
+ int pid = 0;
|
||||
|
||||
if (!(f=fopen(pidfile,"r")))
|
||||
return 0;
|
||||
- fscanf(f,"%d", &pid);
|
||||
+ (void)fscanf(f,"%d", &pid);
|
||||
fclose(f);
|
||||
return pid;
|
||||
}
|
||||
@@ -85,7 +85,7 @@
|
||||
{
|
||||
FILE *f;
|
||||
int fd;
|
||||
- int pid;
|
||||
+ int pid = 0;
|
||||
|
||||
if ( ((fd = open(pidfile, O_RDWR|O_CREAT, 0644)) == -1)
|
||||
|| ((f = fdopen(fd, "r+")) == NULL) ) {
|
||||
@@ -94,7 +94,7 @@
|
||||
}
|
||||
|
||||
if (flock(fd, LOCK_EX|LOCK_NB) == -1) {
|
||||
- fscanf(f, "%d", &pid);
|
||||
+ (void)fscanf(f, "%d", &pid);
|
||||
fclose(f);
|
||||
printf("Can't lock, lock is held by pid %d.\n", pid);
|
||||
return 0;
|
||||
--- resolve.c
|
||||
+++ resolve.c 2006-02-08 17:29:50.000000000 +0100
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
+#include <errno.h>
|
||||
|
||||
#if defined(__GLIBC__)
|
||||
#define dprintf mydprintf
|
||||
@@ -208,7 +209,7 @@
|
||||
{
|
||||
struct sockaddr_storage ss;
|
||||
struct addrinfo hints, *res;
|
||||
- int r;
|
||||
+ int r, c;
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_socktype = SOCK_DGRAM;
|
||||
@@ -244,6 +245,20 @@
|
||||
} else {
|
||||
memcpy(&ss, res->ai_addr, res->ai_addrlen);
|
||||
}
|
||||
- write(fd, &ss, sizeof(ss));
|
||||
- exit(0);
|
||||
+
|
||||
+ c = 100;
|
||||
+ do {
|
||||
+ if ((r = write(fd, &ss, sizeof(ss))) < 0) {
|
||||
+ if ((errno != EAGAIN) && (errno != EINTR)) {
|
||||
+ dprintf("failed to write: %s\n", strerror(errno));
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ usleep(50000);
|
||||
+ }
|
||||
+ } while ((r < 0) && (c-- > 0));
|
||||
+
|
||||
+ if (r >= 0)
|
||||
+ exit(0);
|
||||
+ dprintf("failed to write: %s\n", strerror(errno));
|
||||
+ exit(1);
|
||||
}
|
||||
--- sample-s390.conf
|
||||
+++ sample-s390.conf 2006-02-08 17:29:50.000000000 +0100
|
||||
@@ -0,0 +1,60 @@
|
||||
+# /etc/syslog.conf - Configuration file for syslogd(8)
|
||||
+#
|
||||
+# For info about the format of this file, see "man syslog.conf".
|
||||
+#
|
||||
+
|
||||
+#
|
||||
+#
|
||||
+# print most on /dev/console and on the xconsole pipe
|
||||
+#
|
||||
+kern.*;*.warning;news.emerg;mail.alert;authpriv.none /dev/console
|
||||
+kern.*;*.warning;news.err;mail.err;authpriv.none |/dev/xconsole
|
||||
+*.emerg *
|
||||
+
|
||||
+# enable this, if you want that root is informed
|
||||
+# immediately, e.g. of logins
|
||||
+#*.alert root
|
||||
+
|
||||
+
|
||||
+#
|
||||
+# all email-messages in one file
|
||||
+#
|
||||
+mail.* -/var/log/mail
|
||||
+mail.info -/var/log/mail.info
|
||||
+mail.warning -/var/log/mail.warn
|
||||
+mail.err /var/log/mail.err
|
||||
+
|
||||
+#
|
||||
+# all news-messages
|
||||
+#
|
||||
+# these files are rotated and examined by "news.daily"
|
||||
+news.crit -/var/log/news/news.crit
|
||||
+news.err -/var/log/news/news.err
|
||||
+news.notice -/var/log/news/news.notice
|
||||
+# enable this, if you want to keep all news messages
|
||||
+# in one file
|
||||
+#news.* -/var/log/news.all
|
||||
+
|
||||
+#
|
||||
+# Warnings in one file
|
||||
+#
|
||||
+*.=warning;*.=err -/var/log/warn
|
||||
+*.crit /var/log/warn
|
||||
+
|
||||
+#
|
||||
+# save the rest in one file
|
||||
+#
|
||||
+*.*;mail.none;news.none -/var/log/messages
|
||||
+
|
||||
+#
|
||||
+# enable this, if you want to keep all messages
|
||||
+# in one file
|
||||
+#*.* -/var/log/allmessages
|
||||
+
|
||||
+#
|
||||
+# Some foreign boot scripts require local7
|
||||
+#
|
||||
+local0,local1.* -/var/log/localmessages
|
||||
+local2,local3.* -/var/log/localmessages
|
||||
+local4,local5.* -/var/log/localmessages
|
||||
+local6,local7.* -/var/log/localmessages
|
||||
--- sample.conf
|
||||
+++ sample.conf 2006-02-08 17:29:50.000000000 +0100
|
||||
@@ -0,0 +1,60 @@
|
||||
+# /etc/syslog.conf - Configuration file for syslogd(8)
|
||||
+#
|
||||
+# For info about the format of this file, see "man syslog.conf".
|
||||
+#
|
||||
+
|
||||
+#
|
||||
+#
|
||||
+# print most on tty10 and on the xconsole pipe
|
||||
+#
|
||||
+kern.warning;*.err;authpriv.none /dev/tty10
|
||||
+kern.warning;*.err;authpriv.none |/dev/xconsole
|
||||
+*.emerg *
|
||||
+
|
||||
+# enable this, if you want that root is informed
|
||||
+# immediately, e.g. of logins
|
||||
+#*.alert root
|
||||
+
|
||||
+
|
||||
+#
|
||||
+# all email-messages in one file
|
||||
+#
|
||||
+mail.* -/var/log/mail
|
||||
+mail.info -/var/log/mail.info
|
||||
+mail.warning -/var/log/mail.warn
|
||||
+mail.err /var/log/mail.err
|
||||
+
|
||||
+#
|
||||
+# all news-messages
|
||||
+#
|
||||
+# these files are rotated and examined by "news.daily"
|
||||
+news.crit -/var/log/news/news.crit
|
||||
+news.err -/var/log/news/news.err
|
||||
+news.notice -/var/log/news/news.notice
|
||||
+# enable this, if you want to keep all news messages
|
||||
+# in one file
|
||||
+#news.* -/var/log/news.all
|
||||
+
|
||||
+#
|
||||
+# Warnings in one file
|
||||
+#
|
||||
+*.=warning;*.=err -/var/log/warn
|
||||
+*.crit /var/log/warn
|
||||
+
|
||||
+#
|
||||
+# save the rest in one file
|
||||
+#
|
||||
+*.*;mail.none;news.none -/var/log/messages
|
||||
+
|
||||
+#
|
||||
+# enable this, if you want to keep all messages
|
||||
+# in one file
|
||||
+#*.* -/var/log/allmessages
|
||||
+
|
||||
+#
|
||||
+# Some foreign boot scripts require local7
|
||||
+#
|
||||
+local0,local1.* -/var/log/localmessages
|
||||
+local2,local3.* -/var/log/localmessages
|
||||
+local4,local5.* -/var/log/localmessages
|
||||
+local6,local7.* -/var/log/localmessages
|
||||
--- syslog.c
|
||||
+++ syslog.c 2006-02-08 17:29:50.000000000 +0100
|
||||
@@ -70,7 +70,20 @@
|
||||
#include <paths.h>
|
||||
#include <stdio.h>
|
||||
|
||||
-#define _PATH_LOGNAME "/dev/log"
|
||||
+#ifdef _PATH_LOG
|
||||
+# define _PATH_LOGNAME _PATH_LOG
|
||||
+#endif
|
||||
+#ifndef _PATH_LOGNAME
|
||||
+# define _PATH_LOGNAME "/dev/log"
|
||||
+#endif
|
||||
+
|
||||
+#if defined(__USE_FORTIFY_LEVEL)
|
||||
+# undef syslog
|
||||
+# undef vsyslog
|
||||
+# undef openlog
|
||||
+# undef closelog
|
||||
+# undef setlogmask
|
||||
+#endif
|
||||
|
||||
static int LogFile = -1; /* fd for log */
|
||||
static int connected; /* have done connect */
|
||||
--- syslogd.c
|
||||
+++ syslogd.c 2006-02-08 17:29:50.000000000 +0100
|
||||
@@ -466,6 +466,7 @@
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#include <utmp.h>
|
||||
+#include <limits.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <setjmp.h>
|
||||
@@ -579,7 +580,11 @@
|
||||
# define UNAMESZ 8 /* length of a login name */
|
||||
#endif
|
||||
#define MAXUNAMES 20 /* maximum number of user names */
|
||||
-#define MAXFNAME 200 /* max file pathname length */
|
||||
+#ifdef _POSIX_PATH_MAX
|
||||
+# define MAXFNAME _POSIX_PATH_MAX
|
||||
+#else
|
||||
+# define MAXFNAME 200 /* max file pathname length */
|
||||
+#endif
|
||||
|
||||
#define INTERNAL_NOPRI 0x10 /* the "no priority" priority */
|
||||
#define TABLE_NOPRI 0 /* Value to indicate no priority in f_pmask */
|
||||
@@ -659,8 +664,8 @@
|
||||
* in seconds after previous message is logged. After each flush,
|
||||
* we move to the next interval until we reach the largest.
|
||||
*/
|
||||
-int repeatinterval[] = { 30, 60 }; /* # of secs before flush */
|
||||
-#define MAXREPEAT ((sizeof(repeatinterval) / sizeof(repeatinterval[0])) - 1)
|
||||
+time_t repeatinterval[] = { 30, 60 }; /* # of secs before flush */
|
||||
+#define MAXREPEAT ((int)((sizeof(repeatinterval) / sizeof(repeatinterval[0])) - 1))
|
||||
#define REPEATTIME(f) ((f)->f_time + repeatinterval[(f)->f_repeatcount])
|
||||
#define BACKOFF(f) { if (++(f)->f_repeatcount > MAXREPEAT) \
|
||||
(f)->f_repeatcount = MAXREPEAT; \
|
||||
@@ -771,7 +776,7 @@
|
||||
char **crunch_list(char *list);
|
||||
int usage(void);
|
||||
void untty(void);
|
||||
-void printchopped(const char *hname, char *msg, int len, int fd);
|
||||
+void printchopped(const char *hname, char *msg, size_t len, int fd);
|
||||
void printline(const char *hname, char *msg);
|
||||
void printsys(char *msg);
|
||||
void logmsg(int pri, char *msg, const char *from, int flags);
|
||||
@@ -816,7 +821,7 @@
|
||||
int len, num_fds;
|
||||
#else /* __GLIBC__ */
|
||||
#ifndef TESTING
|
||||
- size_t len;
|
||||
+ socklen_t len;
|
||||
#endif
|
||||
int num_fds;
|
||||
#endif /* __GLIBC__ */
|
||||
@@ -857,7 +862,12 @@
|
||||
int maxfds;
|
||||
|
||||
#ifndef TESTING
|
||||
- chdir ("/");
|
||||
+ if (chdir("/") < 0) {
|
||||
+ fprintf(stderr,
|
||||
+ "syslogd: Can not change to root directory: %s\n",
|
||||
+ strerror(errno));
|
||||
+ exit(1);
|
||||
+ }
|
||||
#endif
|
||||
for (i = 1; i < MAXFUNIX; i++) {
|
||||
funixn[i] = "";
|
||||
@@ -1029,13 +1039,15 @@
|
||||
*p = tolower(*p);
|
||||
|
||||
(void) signal(SIGTERM, die);
|
||||
+ (void) siginterrupt(SIGTERM,1); /* Make recvfrom() be able to receive EINTR */
|
||||
(void) signal(SIGINT, Debug ? die : SIG_IGN);
|
||||
(void) signal(SIGQUIT, Debug ? die : SIG_IGN);
|
||||
(void) signal(SIGCHLD, reapchild);
|
||||
- (void) signal(SIGALRM, domark);
|
||||
(void) signal(SIGUSR1, Debug ? debug_switch : SIG_IGN);
|
||||
(void) signal(SIGXFSZ, SIG_IGN);
|
||||
+ (void) signal(SIGALRM, domark);
|
||||
(void) alarm(TIMERINTVL);
|
||||
+ (void) siginterrupt(SIGALRM,1); /* Make recvfrom() be able to receive EINTR */
|
||||
|
||||
/* Create a partial message table for all file descriptors. */
|
||||
num_fds = getdtablesize();
|
||||
@@ -1193,7 +1205,7 @@
|
||||
* -Joey
|
||||
*/
|
||||
printchopped(from, line, \
|
||||
- i + 2, finet);
|
||||
+ (size_t)(i + 2), finet);
|
||||
} else if (i < 0 && errno != EINTR) {
|
||||
dprintf("INET socket error: %d = %s.\n", \
|
||||
errno, strerror(errno));
|
||||
@@ -1212,7 +1224,7 @@
|
||||
parts[fileno(stdin)] = (char *) 0;
|
||||
i = read(fileno(stdin), line, MAXLINE);
|
||||
if (i > 0) {
|
||||
- printchopped(LocalHostName, line, i+1, fileno(stdin));
|
||||
+ printchopped(LocalHostName, line, (size_t)(i+1), fileno(stdin));
|
||||
} else if (i < 0) {
|
||||
if (errno != EINTR) {
|
||||
logerror("stdin");
|
||||
@@ -1257,8 +1269,9 @@
|
||||
close(fd);
|
||||
#ifndef SYSV
|
||||
die(0);
|
||||
-#endif
|
||||
+#else
|
||||
return -1;
|
||||
+#endif
|
||||
}
|
||||
return fd;
|
||||
}
|
||||
@@ -1435,7 +1448,7 @@
|
||||
void printchopped(hname, msg, len, fd)
|
||||
const char *hname;
|
||||
char *msg;
|
||||
- int len;
|
||||
+ size_t len;
|
||||
int fd;
|
||||
{
|
||||
auto int ptlngth;
|
||||
@@ -1535,6 +1548,8 @@
|
||||
while ((c = *p++) && q < &line[sizeof(line) - 4]) {
|
||||
if (c == '\n')
|
||||
*q++ = ' ';
|
||||
+ else if (c == '\t')
|
||||
+ *q++ = c;
|
||||
else if (c < 040) {
|
||||
*q++ = '^';
|
||||
*q++ = c ^ 0100;
|
||||
@@ -1702,7 +1717,7 @@
|
||||
!strcmp(from, f->f_prevhost)) {
|
||||
(void) strncpy(f->f_lasttime, timestamp, 15);
|
||||
f->f_prevcount++;
|
||||
- dprintf("msg repeated %d times, %ld sec of %d.\n",
|
||||
+ dprintf("msg repeated %d times, %ld sec of %ld.\n",
|
||||
f->f_prevcount, now - f->f_time,
|
||||
repeatinterval[f->f_repeatcount]);
|
||||
/*
|
||||
@@ -2031,13 +2046,7 @@
|
||||
register struct filed *f;
|
||||
struct iovec *iov;
|
||||
{
|
||||
- char p[6 + UNAMESZ];
|
||||
- register int i;
|
||||
- int ttyf, len;
|
||||
static int reenter = 0;
|
||||
- struct utmp ut;
|
||||
- struct utmp *uptr;
|
||||
- char greetings[200];
|
||||
|
||||
if (reenter++)
|
||||
return;
|
||||
@@ -2051,9 +2060,18 @@
|
||||
* and doing notty().
|
||||
*/
|
||||
if (fork() == 0) {
|
||||
+ char p[6 + UNAMESZ];
|
||||
+ register int i;
|
||||
+ int ttyf;
|
||||
+ static int len = 0;
|
||||
+ struct utmp ut;
|
||||
+ struct utmp *uptr;
|
||||
+ static char greetings[200];
|
||||
+
|
||||
(void) signal(SIGTERM, SIG_DFL);
|
||||
(void) alarm(0);
|
||||
(void) signal(SIGALRM, endtty);
|
||||
+ (void) siginterrupt(SIGALRM,1); /* Make recvfrom() be able to receive EINTR */
|
||||
#ifndef SYSV
|
||||
(void) signal(SIGTTOU, SIG_IGN);
|
||||
(void) sigsetmask(0);
|
||||
@@ -2069,7 +2087,7 @@
|
||||
/* is this slot used? */
|
||||
if (ut.ut_name[0] == '\0')
|
||||
continue;
|
||||
- if (ut.ut_type == LOGIN_PROCESS)
|
||||
+ if (ut.ut_type != USER_PROCESS)
|
||||
continue;
|
||||
if (!(strcmp (ut.ut_name,"LOGIN"))) /* paranoia */
|
||||
continue;
|
||||
@@ -2249,7 +2267,7 @@
|
||||
for (f = Files; f; f = f->f_next) {
|
||||
#endif
|
||||
if (f->f_prevcount && now >= REPEATTIME(f)) {
|
||||
- dprintf("flush %s: repeated %d times, %d sec.\n",
|
||||
+ dprintf("flush %s: repeated %d times, %ld sec.\n",
|
||||
TypeNames[f->f_type], f->f_prevcount,
|
||||
repeatinterval[f->f_repeatcount]);
|
||||
fprintlog(f, LocalHostName, 0, (char *)NULL);
|
||||
@@ -2259,6 +2277,7 @@
|
||||
}
|
||||
(void) signal(SIGALRM, domark);
|
||||
(void) alarm(TIMERINTVL);
|
||||
+ (void) siginterrupt(SIGALRM,1); /* Make recvfrom() be able to receive EINTR */
|
||||
}
|
||||
|
||||
void debug_switch()
|
3
sysklogd-1.4.1.tar.bz2
Normal file
3
sysklogd-1.4.1.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e62600f2c93b9da14ef7c27c7cf1b8a546284295904e2554388bb6af836cfb50
|
||||
size 68572
|
520
sysklogd-ipv6.diff
Normal file
520
sysklogd-ipv6.diff
Normal file
@ -0,0 +1,520 @@
|
||||
--- CHANGES Sun Mar 11 20:35:51 2001
|
||||
+++ CHANGES Fri Aug 2 11:28:10 2002
|
||||
@@ -1,3 +1,7 @@
|
||||
+Version 1.4.1-usagi (2001/03/21)
|
||||
+ - syslogd IPv6 support
|
||||
+ (based on patch from Hiroyuki YAMAMORI <h-yamamo@db3.so-net.ne.jp>)
|
||||
+
|
||||
Version 1.4.1
|
||||
|
||||
. klogd will set the console log level only if `-c' is given on the
|
||||
--- Makefile Fri Aug 2 12:11:24 2002
|
||||
+++ Makefile Fri Aug 2 11:58:42 2002
|
||||
@@ -6,7 +6,7 @@
|
||||
CC= gcc
|
||||
#CFLAGS= -g -DSYSV -Wall
|
||||
#LDFLAGS= -g
|
||||
-CFLAGS= $(RPM_OPT_FLAGS) -O3 -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce
|
||||
+CFLAGS= $(RPM_OPT_FLAGS) -DINET6 -O3 -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce
|
||||
LDFLAGS= -s
|
||||
|
||||
# Look where your install program is.
|
||||
--- syslogd.c Fri Aug 2 12:11:25 2002
|
||||
+++ syslogd.c Fri Aug 2 12:00:16 2002
|
||||
@@ -604,6 +604,7 @@
|
||||
* This table contains plain text for h_errno errors used by the
|
||||
* net subsystem.
|
||||
*/
|
||||
+#ifndef INET6 /* not */
|
||||
const char *sys_h_errlist[] = {
|
||||
"No problem", /* NETDB_SUCCESS */
|
||||
"Authoritative answer: host not found", /* HOST_NOT_FOUND */
|
||||
@@ -612,6 +613,7 @@
|
||||
"Valid name, no data record of requested type", /* NO_DATA */
|
||||
"no address, look for MX record" /* NO_ADDRESS */
|
||||
};
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* This structure represents the files that will have log
|
||||
@@ -630,7 +632,18 @@
|
||||
char f_uname[MAXUNAMES][UNAMESZ+1];
|
||||
struct {
|
||||
char f_hname[MAXHOSTNAMELEN+1];
|
||||
+#ifdef INET6
|
||||
+ union {
|
||||
+ struct sockaddr sa;
|
||||
+ struct sockaddr_in sin;
|
||||
+ struct sockaddr_in6 sin6;
|
||||
+ } f_sa;
|
||||
+#define f_addr f_sa.sa
|
||||
+#define f_addr4 f_sa.sin
|
||||
+#define f_addr6 f_sa.sin6
|
||||
+#else
|
||||
struct sockaddr_in f_addr;
|
||||
+#endif
|
||||
} f_forw; /* forwarding address */
|
||||
char f_fname[MAXFNAME];
|
||||
} f_un;
|
||||
@@ -737,7 +750,11 @@
|
||||
char *LocalDomain; /* our local domain name */
|
||||
int InetInuse = 0; /* non-zero if INET sockets are being used */
|
||||
int finet = -1; /* Internet datagram socket */
|
||||
+#ifdef INET6
|
||||
+sa_family_t family; /* socket address family */
|
||||
+#else
|
||||
int LogPort; /* port number for INET connections */
|
||||
+#endif
|
||||
int Initialized = 0; /* set when we have initialized ourselves */
|
||||
int MarkInterval = 20 * 60; /* interval between marks in seconds */
|
||||
int MarkSeq = 0; /* mark sequence number */
|
||||
@@ -764,10 +781,10 @@
|
||||
void endtty();
|
||||
void wallmsg(register struct filed *f, struct iovec *iov);
|
||||
void reapchild();
|
||||
-const char *cvthname(struct sockaddr_in *f);
|
||||
+const char *cvthname(struct sockaddr *f);
|
||||
void domark();
|
||||
void debug_switch();
|
||||
-void logerror(char *type);
|
||||
+void logerror(const char *type);
|
||||
void die(int sig);
|
||||
#ifndef TESTING
|
||||
void doexit(int sig);
|
||||
@@ -787,6 +804,10 @@
|
||||
#endif
|
||||
#ifdef SYSLOG_INET
|
||||
static int create_inet_socket();
|
||||
+#ifdef INET6
|
||||
+static void setup_inetaddr_all();
|
||||
+static const char *setup_inetaddr(struct filed *f);
|
||||
+#endif
|
||||
#endif
|
||||
|
||||
int main(argc, argv)
|
||||
@@ -821,7 +842,12 @@
|
||||
#ifndef TESTING
|
||||
int fd;
|
||||
#ifdef SYSLOG_INET
|
||||
+#ifdef INET6
|
||||
+ struct sockaddr_storage frominet;
|
||||
+ char hbuf[INET6_ADDRSTRLEN];
|
||||
+#else
|
||||
struct sockaddr_in frominet;
|
||||
+#endif
|
||||
char *from;
|
||||
#endif
|
||||
pid_t ppid = getpid();
|
||||
@@ -1142,11 +1168,21 @@
|
||||
memset(line, '\0', sizeof(line));
|
||||
i = recvfrom(finet, line, MAXLINE - 2, 0, \
|
||||
(struct sockaddr *) &frominet, &len);
|
||||
+#ifdef INET6
|
||||
+ if (getnameinfo((struct sockaddr *)&frominet, len,
|
||||
+ hbuf, sizeof(hbuf), NULL, 0,
|
||||
+ NI_NUMERICHOST)) {
|
||||
+ strcpy(hbuf, "???");
|
||||
+ }
|
||||
+ dprintf("Message from inetd socket: #%d, host: %s\n",
|
||||
+ inetm, hbuf);
|
||||
+#else
|
||||
dprintf("Message from inetd socket: #%d, host: %s\n",
|
||||
inetm, inet_ntoa(frominet.sin_addr));
|
||||
+#endif
|
||||
if (i > 0) {
|
||||
line[i] = line[i+1] = '\0';
|
||||
- from = (char *)cvthname(&frominet);
|
||||
+ from = (char *)cvthname((struct sockaddr*)&frominet);
|
||||
/*
|
||||
* Here we could check if the host is permitted
|
||||
* to send us syslog messages. We just have to
|
||||
@@ -1233,17 +1269,50 @@
|
||||
static int create_inet_socket()
|
||||
{
|
||||
int fd, on = 1;
|
||||
+#ifdef INET6
|
||||
+ struct addrinfo hints, *res;
|
||||
+ int error;
|
||||
+#else
|
||||
struct sockaddr_in sin;
|
||||
+#endif
|
||||
|
||||
+#ifdef INET6
|
||||
+ fd = socket(AF_INET6, SOCK_DGRAM, 0);
|
||||
+ if (fd >= 0) {
|
||||
+ family = AF_INET6;
|
||||
+ } else {
|
||||
+ family = AF_INET;
|
||||
+ dprintf("cannot create INET6 socket.\n");
|
||||
+ fd = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
+ }
|
||||
+#else
|
||||
fd = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
+#endif
|
||||
if (fd < 0) {
|
||||
logerror("syslog: Unknown protocol, suspending inet service.");
|
||||
return fd;
|
||||
}
|
||||
|
||||
+#ifdef NO_BIND_AT_FORWARD_ONLY
|
||||
+ if (AcceptRemote == 0)
|
||||
+ return fd;
|
||||
+#endif
|
||||
+#ifdef INET6
|
||||
+ memset(&hints, 0, sizeof(hints));
|
||||
+ hints.ai_flags = AI_PASSIVE;
|
||||
+ hints.ai_family = family;
|
||||
+ hints.ai_socktype = SOCK_DGRAM;
|
||||
+ error = getaddrinfo(NULL, "syslog", &hints, &res);
|
||||
+ if (error) {
|
||||
+ logerror(gai_strerror(error));
|
||||
+ close(fd);
|
||||
+ return -1;
|
||||
+ }
|
||||
+#else
|
||||
memset(&sin, 0, sizeof(sin));
|
||||
sin.sin_family = AF_INET;
|
||||
sin.sin_port = LogPort;
|
||||
+#endif
|
||||
if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, \
|
||||
(char *) &on, sizeof(on)) < 0 ) {
|
||||
logerror("setsockopt(REUSEADDR), suspending inet");
|
||||
@@ -1259,13 +1328,77 @@
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
+#ifdef INET6
|
||||
+ error = bind(fd, res->ai_addr, res->ai_addrlen);
|
||||
+ freeaddrinfo(res);
|
||||
+ if (error < 0) {
|
||||
+#else
|
||||
if (bind(fd, (struct sockaddr *) &sin, sizeof(sin)) < 0) {
|
||||
+#endif
|
||||
logerror("bind, suspending inet");
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
return fd;
|
||||
}
|
||||
+
|
||||
+#ifdef INET6
|
||||
+
|
||||
+static void setup_inetaddr_all()
|
||||
+{
|
||||
+ struct filed *f;
|
||||
+#ifdef SYSV
|
||||
+ int lognum;
|
||||
+
|
||||
+ for (lognum = 0; lognum <= nlogs; lognum++) {
|
||||
+ f = &Files[lognum];
|
||||
+#else
|
||||
+ for (f = Files; f; f = f->f_next) {
|
||||
+#endif
|
||||
+ if (f->f_type == F_FORW_UNKN) {
|
||||
+ if (setup_inetaddr(f)) {
|
||||
+ f->f_prevcount = INET_RETRY_MAX;
|
||||
+ f->f_time = time( (time_t *)0 );
|
||||
+ } else {
|
||||
+ f->f_type = F_FORW;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static const char *setup_inetaddr(struct filed *f)
|
||||
+{
|
||||
+ struct addrinfo hints, *res;
|
||||
+ int error;
|
||||
+
|
||||
+ memset(&hints, 0, sizeof(hints));
|
||||
+ hints.ai_family = family == AF_INET6 ? AF_UNSPEC : AF_INET;
|
||||
+ hints.ai_socktype = SOCK_DGRAM;
|
||||
+ error = getaddrinfo(f->f_un.f_forw.f_hname, "syslog", &hints, &res);
|
||||
+ if (error) {
|
||||
+ return gai_strerror(error);
|
||||
+ }
|
||||
+ if (res->ai_addrlen > sizeof(f->f_un.f_forw.f_sa)) {
|
||||
+ freeaddrinfo(res);
|
||||
+ return "addrlen too large";
|
||||
+ }
|
||||
+ if (family == AF_INET6 && res->ai_family == AF_INET) {
|
||||
+ /* v4mapped addr */
|
||||
+ f->f_un.f_forw.f_addr.sa_family = AF_INET6;
|
||||
+ f->f_un.f_forw.f_addr6.sin6_port =
|
||||
+ ((struct sockaddr_in *)res->ai_addr)->sin_port;
|
||||
+ f->f_un.f_forw.f_addr6.sin6_addr.s6_addr16[5] = 0xffff;
|
||||
+ memcpy(&f->f_un.f_forw.f_addr6.sin6_addr.s6_addr32[3],
|
||||
+ &((struct sockaddr_in *)res->ai_addr)->sin_addr,
|
||||
+ sizeof(struct in_addr));
|
||||
+ } else {
|
||||
+ memcpy(&f->f_un.f_forw.f_addr, res->ai_addr, res->ai_addrlen);
|
||||
+ }
|
||||
+ freeaddrinfo(res);
|
||||
+
|
||||
+ return NULL;
|
||||
+}
|
||||
+#endif /* end of INET6 */
|
||||
#endif
|
||||
|
||||
char **
|
||||
@@ -1687,8 +1820,12 @@
|
||||
register int l;
|
||||
char line[MAXLINE + 1];
|
||||
time_t fwd_suspend;
|
||||
+#ifdef INET6
|
||||
+ const char *errmsg;
|
||||
+#else
|
||||
struct hostent *hp;
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
dprintf("Called fprintlog, ");
|
||||
|
||||
@@ -1742,22 +1879,27 @@
|
||||
fwd_suspend);
|
||||
}
|
||||
break;
|
||||
-
|
||||
+
|
||||
/*
|
||||
* The trick is to wait some time, then retry to get the
|
||||
* address. If that fails retry x times and then give up.
|
||||
*
|
||||
* You'll run into this problem mostly if the name server you
|
||||
* need for resolving the address is on the same machine, but
|
||||
- * is started after syslogd.
|
||||
+ * is started after syslogd.
|
||||
*/
|
||||
case F_FORW_UNKN:
|
||||
dprintf(" %s\n", f->f_un.f_forw.f_hname);
|
||||
fwd_suspend = time((time_t *) 0) - f->f_time;
|
||||
if ( fwd_suspend >= INET_SUSPEND_TIME ) {
|
||||
dprintf("Forwarding suspension to unknown over, retrying\n");
|
||||
+#ifdef INET6
|
||||
+ if ((errmsg = setup_inetaddr(f))) {
|
||||
+ dprintf("Failure: %s\n", errmsg);
|
||||
+#else
|
||||
if ( (hp = gethostbyname(f->f_un.f_forw.f_hname)) == NULL ) {
|
||||
dprintf("Failure: %s\n", sys_h_errlist[h_errno]);
|
||||
+#endif
|
||||
dprintf("Retries: %d\n", f->f_prevcount);
|
||||
if ( --f->f_prevcount < 0 ) {
|
||||
dprintf("Giving up.\n");
|
||||
@@ -1768,7 +1910,9 @@
|
||||
}
|
||||
else {
|
||||
dprintf("%s found, resuming.\n", f->f_un.f_forw.f_hname);
|
||||
+#ifndef INET6 /* not */
|
||||
memcpy((char *) &f->f_un.f_forw.f_addr.sin_addr, hp->h_addr, hp->h_length);
|
||||
+#endif
|
||||
f->f_prevcount = 0;
|
||||
f->f_type = F_FORW;
|
||||
goto f_forw;
|
||||
@@ -1791,27 +1935,31 @@
|
||||
dprintf("Not sending message to remote.\n");
|
||||
else {
|
||||
f->f_time = now;
|
||||
-/* afx: add <sourcehost
|
||||
+/* afx: add <sourcehost
|
||||
*/
|
||||
- if ((TagForward == 1) &&
|
||||
+ if ((TagForward == 1) &&
|
||||
strncmp(f->f_prevhost,LocalHostName,MAXHOSTNAMELEN+1)) {
|
||||
- (void) snprintf(line, sizeof(line), "<%d><%s: %s\n",
|
||||
- f->f_prevpri, f->f_prevhost,
|
||||
+ (void) snprintf(line, sizeof(line), "<%d><%s: %s\n",
|
||||
+ f->f_prevpri, f->f_prevhost,
|
||||
(char *) iov[4].iov_base);
|
||||
} else {
|
||||
(void) snprintf(line, sizeof(line), "<%d>%s\n",
|
||||
- f->f_prevpri,
|
||||
+ f->f_prevpri,
|
||||
(char *) iov[4].iov_base);
|
||||
}
|
||||
-/* end afx */
|
||||
+/* end afx */
|
||||
l = strlen(line);
|
||||
if (l > MAXLINE)
|
||||
l = MAXLINE;
|
||||
if (sendto(finet, line, l, 0, \
|
||||
(struct sockaddr *) &f->f_un.f_forw.f_addr,
|
||||
- sizeof(f->f_un.f_forw.f_addr)) != l) {
|
||||
+#ifdef INET6
|
||||
+ family == AF_INET6 ?
|
||||
+ sizeof(struct sockaddr_in6) :
|
||||
+#endif
|
||||
+ sizeof(struct sockaddr_in)) != l) {
|
||||
int e = errno;
|
||||
- dprintf("INET sendto error: %d = %s.\n",
|
||||
+ dprintf("INET sendto error: %d = %s.\n",
|
||||
e, strerror(e));
|
||||
f->f_type = F_FORW_SUSP;
|
||||
errno = e;
|
||||
@@ -2035,28 +2183,53 @@
|
||||
/*
|
||||
* Return a printable representation of a host address.
|
||||
*/
|
||||
-const char *cvthname(f)
|
||||
- struct sockaddr_in *f;
|
||||
+const char *cvthname(struct sockaddr *f)
|
||||
{
|
||||
+#ifdef INET6
|
||||
+ static char hname[NI_MAXHOST];
|
||||
+ int error;
|
||||
+#else
|
||||
struct hostent *hp;
|
||||
+ char *hname;
|
||||
+#endif
|
||||
register char *p;
|
||||
int count;
|
||||
|
||||
- if (f->sin_family != AF_INET) {
|
||||
+#ifdef INET6
|
||||
+ if (((struct sockaddr *)f)->sa_family == AF_INET6 &&
|
||||
+ IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)f)->sin6_addr)) {
|
||||
+ ((struct sockaddr *)f)->sa_family = AF_INET;
|
||||
+ ((struct sockaddr_in *)f)->sin_addr.s_addr =
|
||||
+ ((struct sockaddr_in6 *)f)->sin6_addr.s6_addr32[3];
|
||||
+ }
|
||||
+ error = getnameinfo((struct sockaddr *)f,
|
||||
+ ((struct sockaddr *)f)->sa_family == AF_INET6 ?
|
||||
+ sizeof(struct sockaddr_in6)
|
||||
+ : sizeof(struct sockaddr_in),
|
||||
+ hname, sizeof(hname), NULL, 0, 0);
|
||||
+ if (error) {
|
||||
+ dprintf("Malformed from address %s\n", gai_strerror(error));
|
||||
+ return ("???");
|
||||
+ }
|
||||
+#else
|
||||
+ if (((struct sockaddr_in *)f)->sin_family != AF_INET) {
|
||||
dprintf("Malformed from address.\n");
|
||||
return ("???");
|
||||
}
|
||||
- hp = gethostbyaddr((char *) &f->sin_addr, sizeof(struct in_addr), \
|
||||
- f->sin_family);
|
||||
+ hp = gethostbyaddr((char *) &(((struct sockaddr_in *)&f)->sin_addr),
|
||||
+ sizeof(struct in_addr),
|
||||
+ ((struct sockaddr_in *)f)->sin_family);
|
||||
if (hp == 0) {
|
||||
dprintf("Host name for your address (%s) unknown.\n",
|
||||
- inet_ntoa(f->sin_addr));
|
||||
- return (inet_ntoa(f->sin_addr));
|
||||
+ inet_ntoa(((struct sockaddr_in *)f)->sin_addr));
|
||||
+ return (inet_ntoa(((struct sockaddr_in *)f)->sin_addr));
|
||||
}
|
||||
+ hname = hp->h_name;
|
||||
+#endif
|
||||
/*
|
||||
* Convert to lower case, just like LocalDomain above
|
||||
*/
|
||||
- for (p = (char *)hp->h_name; *p ; p++)
|
||||
+ for (p = hname; *p ; p++)
|
||||
if (isupper(*p))
|
||||
*p = tolower(*p);
|
||||
|
||||
@@ -2064,17 +2237,17 @@
|
||||
* Notice that the string still contains the fqdn, but your
|
||||
* hostname and domain are separated by a '\0'.
|
||||
*/
|
||||
- if ((p = strchr(hp->h_name, '.'))) {
|
||||
+ if ((p = strchr(hname, '.'))) {
|
||||
if (strcmp(p + 1, LocalDomain) == 0) {
|
||||
*p = '\0';
|
||||
- return (hp->h_name);
|
||||
+ return (hname);
|
||||
} else {
|
||||
if (StripDomains) {
|
||||
count=0;
|
||||
while (StripDomains[count]) {
|
||||
if (strcmp(p + 1, StripDomains[count]) == 0) {
|
||||
*p = '\0';
|
||||
- return (hp->h_name);
|
||||
+ return (hname);
|
||||
}
|
||||
count++;
|
||||
}
|
||||
@@ -2082,9 +2255,9 @@
|
||||
if (LocalHosts) {
|
||||
count=0;
|
||||
while (LocalHosts[count]) {
|
||||
- if (!strcmp(hp->h_name, LocalHosts[count])) {
|
||||
+ if (!strcmp(hname, LocalHosts[count])) {
|
||||
*p = '\0';
|
||||
- return (hp->h_name);
|
||||
+ return (hname);
|
||||
}
|
||||
count++;
|
||||
}
|
||||
@@ -2092,7 +2265,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- return (hp->h_name);
|
||||
+ return (hname);
|
||||
}
|
||||
|
||||
void domark()
|
||||
@@ -2142,7 +2315,7 @@
|
||||
* Print syslogd errors some place.
|
||||
*/
|
||||
void logerror(type)
|
||||
- char *type;
|
||||
+ const char *type;
|
||||
{
|
||||
char buf[100];
|
||||
|
||||
@@ -2236,6 +2409,7 @@
|
||||
#else
|
||||
char cline[BUFSIZ];
|
||||
#endif
|
||||
+#ifndef INET6 /* not */
|
||||
struct servent *sp;
|
||||
|
||||
sp = getservbyname("syslog", "udp");
|
||||
@@ -2246,6 +2420,7 @@
|
||||
return;
|
||||
}
|
||||
LogPort = sp->s_port;
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* Close all open log files and free log descriptor array.
|
||||
@@ -2394,6 +2569,10 @@
|
||||
InetInuse = 0;
|
||||
}
|
||||
inetm = finet;
|
||||
+#ifdef INET6
|
||||
+ if (finet >= 0)
|
||||
+ setup_inetaddr_all();
|
||||
+#endif
|
||||
#endif
|
||||
|
||||
Initialized = 1;
|
||||
@@ -2481,7 +2660,7 @@
|
||||
int singlpri = 0;
|
||||
int ignorepri = 0;
|
||||
int syncfile;
|
||||
-#ifdef SYSLOG_INET
|
||||
+#if defined(SYSLOG_INET) && !defined(INET6)
|
||||
struct hostent *hp;
|
||||
#endif
|
||||
char buf[MAXLINE];
|
||||
@@ -2640,6 +2819,9 @@
|
||||
#ifdef SYSLOG_INET
|
||||
(void) strcpy(f->f_un.f_forw.f_hname, ++p);
|
||||
dprintf("forwarding host: %s\n", p); /*ASP*/
|
||||
+#ifdef INET6
|
||||
+ f->f_type = F_FORW_UNKN;
|
||||
+#else
|
||||
if ( (hp = gethostbyname(p)) == NULL ) {
|
||||
f->f_type = F_FORW_UNKN;
|
||||
f->f_prevcount = INET_RETRY_MAX;
|
||||
@@ -2654,6 +2836,7 @@
|
||||
f->f_un.f_forw.f_addr.sin_port = LogPort;
|
||||
if ( f->f_type == F_FORW )
|
||||
memcpy((char *) &f->f_un.f_forw.f_addr.sin_addr, hp->h_addr, hp->h_length);
|
||||
+#endif
|
||||
/*
|
||||
* Otherwise the host might be unknown due to an
|
||||
* inaccessible nameserver (perhaps on the same
|
||||
|
88
syslog.xml
Normal file
88
syslog.xml
Normal file
@ -0,0 +1,88 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Copyright (c) 2006 Novell, Inc. All rights reserved.
|
||||
|
||||
|
||||
Service Description XML Document for syslog.
|
||||
|
||||
This file should be placed in /etc/omc/svcinfo.d
|
||||
|
||||
Note: The name of the service is the name of this file without the .xml
|
||||
file extension.
|
||||
-->
|
||||
|
||||
<serviceDescription version="1.0">
|
||||
|
||||
<!-- Caption for display purposes -->
|
||||
<caption>Syslog Serivce</caption>
|
||||
|
||||
<!-- Description of this service -->
|
||||
<description>
|
||||
Syslog daemon Service
|
||||
</description>
|
||||
|
||||
|
||||
<!--
|
||||
The startCommand tag specifies the command line that will be
|
||||
invoked to start the service. The return code from this command
|
||||
must be as follows:
|
||||
0 - success
|
||||
1 - generic or unspecified error
|
||||
2 - invalid or excess argument(s)
|
||||
3 - unimplemented feature (e.g. "reload")
|
||||
4 - user had insufficient privileges
|
||||
5 - program is not installed
|
||||
6 - program is not configured
|
||||
7 - program is not running
|
||||
-->
|
||||
<startCommand>/sbin/rcsyslog start</startCommand>
|
||||
|
||||
<!--
|
||||
The reStartCommand tag specifies the command line that will be
|
||||
invoked to restart the service. The return code from this command
|
||||
must be as specified in the startCommand tag.
|
||||
-->
|
||||
<reStartCommand>/sbin/rcsyslog restart</reStartCommand>
|
||||
|
||||
<!--
|
||||
The stopCommand tag specifies the command line that will be
|
||||
invoked to stop the service. The return code from this command
|
||||
must be as specified in the startCommand tag.
|
||||
-->
|
||||
<stopCommand>/sbin/rcsyslog stop</stopCommand>
|
||||
|
||||
<!--
|
||||
The statusCommand specifies the command line that can be run
|
||||
that will report on the status of the service. The return code
|
||||
from this command line should be as follows:
|
||||
0 - service up and running
|
||||
1 - service dead, but /var/run/ pid file exists
|
||||
2 - service dead, but /var/lock/ lock file exists
|
||||
3 - service not running (unused)
|
||||
4 - service status unknown :-(
|
||||
-->
|
||||
<statusCommand>/sbin/rcsyslog status</statusCommand>
|
||||
<!--
|
||||
The processInformation tag allows the XML Service provider to
|
||||
identify the processes that belong to the service. This allows
|
||||
the ServiceProcess associations to be instrumented.
|
||||
If the process_information tag is not specifed, the will be no
|
||||
ServiceProcess association for the service.
|
||||
-->
|
||||
|
||||
<processInformation>
|
||||
<name>syslog-ng</name>
|
||||
<modulePath>/sbin/syslog-ng</modulePath>
|
||||
</processInformation>
|
||||
|
||||
<!--
|
||||
Define the services that this service has a dependency on.
|
||||
There must be a corresponding Service Description XML file
|
||||
for the antecedent service in the /etc/omc/svcinfo.d directory.
|
||||
-->
|
||||
<dependsOn>
|
||||
<serviceName>network</serviceName>
|
||||
</dependsOn>
|
||||
|
||||
|
||||
</serviceDescription>
|
698
syslogd.changes
Normal file
698
syslogd.changes
Normal file
@ -0,0 +1,698 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Dec 11 14:04:50 CET 2006 - mskibbe@suse.de
|
||||
|
||||
- add service xml file
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Nov 15 14:19:14 CET 2006 - werner@suse.de
|
||||
|
||||
- Require rcnetwork due rcsyslog script does it (bug #214297)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Sep 13 13:10:09 CEST 2006 - mt@suse.de
|
||||
|
||||
- Feature #300891: Remove SuSEconfig dependency of syslog-ng
|
||||
* Adopted /etc/init.d/syslog script to append additional
|
||||
sockets using -a options for syslog-ng as well.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 24 12:00:13 CEST 2006 - werner@suse.de
|
||||
|
||||
- Just use <linux/bitops.h> to to the same
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Aug 18 15:12:58 CEST 2006 - aj@suse.de
|
||||
|
||||
- Fix build.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 11 16:37:58 CEST 2006 - werner@suse.de
|
||||
|
||||
- Enable run-time switch from syslogd to syslog-ng (bug #166933)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon May 22 20:52:39 CEST 2006 - schwab@suse.de
|
||||
|
||||
- Don't strip binaries.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Feb 15 13:49:55 CET 2006 - mt@suse.de
|
||||
|
||||
- Added log rotation for /var/log/news/news.* files
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Feb 8 18:24:12 CET 2006 - werner@suse.de
|
||||
|
||||
- Prevent directly the fortified cpp macros of the system syslog
|
||||
function and revert the skip of _FORTIFY_SOURCE.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Feb 8 15:08:35 CET 2006 - werner@suse.de
|
||||
|
||||
- Skip _FORTIFY_SOURCE for klogd/syslogd to be able to use
|
||||
our own functions without any filter (bug #147363)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jan 25 21:30:59 CET 2006 - mls@suse.de
|
||||
|
||||
- converted neededforbuild to BuildRequires
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Dec 20 16:55:25 CET 2005 - ro@suse.de
|
||||
|
||||
- remove explicit requires for devs
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Oct 5 11:09:44 CEST 2005 - werner@suse.de
|
||||
|
||||
- Enable 64 bit file interface
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 29 03:15:27 CEST 2005 - dmueller@suse.de
|
||||
|
||||
- add norootforbuild
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Sep 20 14:56:54 CEST 2005 - werner@suse.de
|
||||
|
||||
- Avoid broken function implementation by fortified header
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jul 25 17:49:56 CEST 2005 - mt@suse.de
|
||||
|
||||
- Bug #94743: Added note to the logrotate.syslog file about
|
||||
changing log file permissions in case syslog-ng is used.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jun 17 14:15:40 CEST 2005 - werner@suse.de
|
||||
|
||||
- Use -fpie/-pie
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue May 24 11:36:47 CEST 2005 - werner@suse.de
|
||||
|
||||
- Fix of the priority and facility patch: do not pass SHOWPRI flag
|
||||
if no no facility and priority values are used (bug #85453).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Apr 19 09:05:38 CEST 2005 - aj@suse.de
|
||||
|
||||
- Fix messages.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Mar 9 11:43:50 CET 2005 - ro@suse.de
|
||||
|
||||
- added split-provides for klogd
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Mar 8 18:25:27 CET 2005 - mt@suse.de
|
||||
|
||||
- Bug #71264: added stop_on_removal/restart_on_removal to
|
||||
the spec file, fixed try-restart action in the init script
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Mar 7 18:04:40 CET 2005 - mt@suse.de
|
||||
|
||||
- Bug #71085: removed syslog requirement from klogd sub-package
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Feb 11 18:41:03 CET 2005 - mt@suse.de
|
||||
|
||||
- fixed rpm post-install script to switch SYSLOG_DAEMON to
|
||||
ourself if it is set to a daemon that is not installed
|
||||
(happens if we replace a syslog-ng installed before)
|
||||
- fixed init scripts to not to report failures on stop
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Feb 11 15:53:41 CET 2005 - ro@suse.de
|
||||
|
||||
- split off klogd package
|
||||
- provide "syslog"
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jan 27 12:56:45 CET 2005 - werner@suse.de
|
||||
|
||||
- Add UTF8 compatibility (bug #49980)
|
||||
- Make early syslog more smooth for e.g. rcsyslog restart
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jan 25 01:56:57 CET 2005 - ro@suse.de
|
||||
|
||||
- change klogd params from "-2" to "-x" by default
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jan 20 17:23:55 CET 2005 - coolo@suse.de
|
||||
|
||||
- only skip syslog start when booting into init 5
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jan 10 18:00:20 CET 2005 - coolo@suse.de
|
||||
|
||||
- add an early syslog that is started before network and checks
|
||||
for hostnames in syslog.conf
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Dec 16 17:10:39 CET 2004 - werner@suse.de
|
||||
|
||||
- Add preserve percents patch to fix bug #49228
|
||||
- Be sure that recvfrom() is awaken by SIGALRM and SIGTERM
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Nov 16 15:10:08 CET 2004 - werner@suse.de
|
||||
|
||||
- Quieten the build
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Oct 15 15:39:51 CEST 2004 - werner@suse.de
|
||||
|
||||
- Add two patches from sgi (bug #46783)
|
||||
* Add logging on UNIX sockets
|
||||
* Add priority and facility marks in the log messages
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 19 17:50:32 CEST 2004 - od@suse.de
|
||||
|
||||
- removed creation of unused /dev/:[0-5]; GetDevices of
|
||||
xorg-x11.rpm uses /dev/tty0 to find the virtual terminal of a
|
||||
local X-server (#43931)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jul 29 17:28:36 CEST 2004 - od@suse.de
|
||||
|
||||
- klogd now reads log buffer size from kernel. Falls back to
|
||||
probing as in dmesg (#39761).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue May 18 14:21:16 CEST 2004 - werner@suse.de
|
||||
|
||||
- Correct last change
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon May 17 13:46:04 CEST 2004 - werner@suse.de
|
||||
|
||||
- No more symbol and EIP translation for 2.6 kernels (#40651)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Apr 19 13:59:14 CEST 2004 - werner@suse.de
|
||||
|
||||
- Fix syslogd argument list handling (fix from Solar Designer)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Mar 24 18:14:30 CET 2004 - werner@suse.de
|
||||
|
||||
- Be prepared for udev (bug #36671)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jan 29 13:06:38 CET 2004 - werner@suse.de
|
||||
|
||||
- Enable sample-s390.conf also for s390x (aka zSeries?, bug #34153)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Sep 29 10:57:24 CEST 2003 - kukuk@suse.de
|
||||
|
||||
- Use SO_BSDCOMPAT only if defined
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Sep 16 17:13:40 CEST 2003 - werner@suse.de
|
||||
|
||||
- Clean last klogd24.dif
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Sep 9 18:54:37 CEST 2003 - werner@suse.de
|
||||
|
||||
- Is there a 128bit lseek around? Use some workarounds to get lseek
|
||||
working above LONG_MAX on x86_64 on /dev/kmem (kernel bug?)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Sep 8 21:30:54 CEST 2003 - werner@suse.de
|
||||
|
||||
- Use special seek routine for signless addresses, fixes
|
||||
crash on i386.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Sep 3 12:21:06 CEST 2003 - werner@suse.de
|
||||
|
||||
- Change symbol addresses to __off64_t and sizes to size_t (#28639)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Aug 26 15:36:25 CEST 2003 - mt@suse.de
|
||||
|
||||
- bug #28949: added new 'Config' meta data to sysconfig file
|
||||
- bug #27971: reconnect to log socket if a write fails with
|
||||
ECONNREFUSED or ENOTCONN, e.g. if the log socket has been
|
||||
reopened by "rcsyslog reload" while syslog-ng is used.
|
||||
new patch file: sysklogd-1.4.1-reopen.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Aug 15 15:26:15 CEST 2003 - kukuk@suse.de
|
||||
|
||||
- Add devs to PreReq and don't create xconsole device itself
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 7 12:56:48 CEST 2003 - werner@suse.de
|
||||
|
||||
- Change permissions of mail log files (bug #28561)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jul 28 14:55:54 CEST 2003 - werner@suse.de
|
||||
|
||||
- Fix trivial bug #27072: use warning instead of warn
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jul 25 09:44:36 CEST 2003 - schwab@suse.de
|
||||
|
||||
- Fix uses of chown in %post script.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jul 18 17:49:30 CEST 2003 - werner@suse.de
|
||||
|
||||
- Add DNS timeout patch from Olaf Kirch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue May 20 15:43:49 CEST 2003 - werner@suse.de
|
||||
|
||||
- Use large file support, gnore signal SIGXFSZ (bug #26960)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed May 14 14:35:38 CEST 2003 - kukuk@suse.de
|
||||
|
||||
- Fix klogd to build independend of installed kernel headers. klogd
|
||||
still does not work with 2.5.xx correct.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Apr 16 10:59:07 CEST 2003 - coolo@suse.de
|
||||
|
||||
- fixing s390 build
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Apr 16 09:36:28 CEST 2003 - coolo@suse.de
|
||||
|
||||
- use BuildRoot
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Feb 24 18:06:09 CET 2003 - schwab@suse.de
|
||||
|
||||
- Add workaround for use of kernel headers.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 31 12:37:46 CET 2003 - werner@suse.de
|
||||
|
||||
- Add some code for supporting syslog-ng
|
||||
- Split off boot script and sysconfig file from patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jan 8 13:13:46 CET 2003 - werner@suse.de
|
||||
|
||||
- bug #22695: add missed meta data within sysconfig file
|
||||
- bug #22551: do not let read any user /var/log/messages
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Dec 11 15:39:58 CET 2002 - werner@suse.de
|
||||
|
||||
- New log files for sorting priorities of mail messages (# 22394)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Nov 5 14:12:02 CET 2002 - ro@suse.de
|
||||
|
||||
- fillup/sysconfig.syslog: set kernel loglevel to 7 on s390/s390x
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 14 11:22:53 CEST 2002 - ro@suse.de
|
||||
|
||||
- moved logrotate config for syslog's files to this package
|
||||
- changed create to 640 for /var/log/mail (#20816)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 7 15:21:57 CEST 2002 - olh@suse.de
|
||||
|
||||
- honor the increased LOG_BUF_LEN in kernel/printk.c (#19888)
|
||||
LOG_BUFFER_SIZE=131072
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Sep 10 09:18:32 CEST 2002 - olh@suse.de
|
||||
|
||||
- provides syslog for hotplug
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Aug 28 05:52:53 CEST 2002 - nashif@suse.de
|
||||
|
||||
- fixed PreReq to use macros
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Aug 23 15:02:41 CEST 2002 - werner@suse.de
|
||||
|
||||
- Enable the `-2' of klogd option for clean and untraced oops.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Aug 16 14:16:53 CEST 2002 - werner@suse.de
|
||||
|
||||
- Add PreReq (bug #18004)
|
||||
- Change order of main and ipv6 patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Aug 2 13:08:40 CEST 2002 - kukuk@suse.de
|
||||
|
||||
- Add patch to enable IPv6 support (based on the USAGI version
|
||||
plus some fixes for IPv4 only).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jul 17 17:52:03 CEST 2002 - poeml@suse.de
|
||||
|
||||
- run with additional sockets from SYSLOGD_ADDITIONAL_SOCKET_* that
|
||||
other packages can fill up into /etc/sysconfig/syslog
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Mar 4 18:12:58 CET 2002 - zoz@suse.de
|
||||
|
||||
- Change Required from $network to network
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Mar 4 10:51:59 CET 2002 - ro@suse.de
|
||||
|
||||
- postinstall-script: disable perl-hack (-p for fillup_and_insserv)
|
||||
- no extra insserv call
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Feb 14 16:29:42 CET 2002 - werner@suse.de
|
||||
|
||||
- Fix the bug fix
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Feb 14 14:24:53 CET 2002 - werner@suse.de
|
||||
|
||||
- Fix bug #12747: move to fillup_and_insserv and sysconfig scheme
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Sep 19 23:32:38 CEST 2001 - ro@suse.de
|
||||
|
||||
- fixed typo in rc_script SYSLOGD_PARAM -> SYSLOGD_PARAMS (#10950)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 30 14:13:03 CEST 2001 - werner@suse.de
|
||||
|
||||
- Fix bug #9096
|
||||
- Make TAB a printable character
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jun 15 18:17:19 CEST 2001 - schwab@suse.de
|
||||
|
||||
- Don't define __KERNEL__.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue May 29 13:41:43 CEST 2001 - werner@suse.de
|
||||
|
||||
- Update to version 1.4.1
|
||||
- Porting our patches to this version
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Apr 27 16:35:07 MEST 2001 - mt@suse.de
|
||||
|
||||
- added syslog-ng hook in init script
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Apr 17 13:54:31 CEST 2001 - werner@suse.de
|
||||
|
||||
- Avoid zero bytes from kernel messages
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jan 11 13:01:54 CET 2001 - werner@suse.de
|
||||
|
||||
- Correct deep or relative symlink rcsyslog
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jan 11 12:29:39 CET 2001 - werner@suse.de
|
||||
|
||||
- Move syslogd and klogd to /sbin
|
||||
- Change Required from $remote_fs to $network
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Dec 7 15:09:21 CET 2000 - werner@suse.de
|
||||
|
||||
- Change boot.log to localmessages and add local0 upto local7
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Dec 4 01:15:13 CET 2000 - ro@suse.de
|
||||
|
||||
- added var/log/boot.log
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Nov 28 18:08:50 CET 2000 - ro@suse.de
|
||||
|
||||
- fixed startscript
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Nov 13 10:01:09 CET 2000 - ro@suse.de
|
||||
|
||||
- fixed to compile on 2.4 kernel header
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Oct 17 23:28:08 GMT 2000 - bk@suse.de
|
||||
|
||||
- add sample-s390.conf for s390.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 14 12:42:23 CEST 2000 - werner@suse.de
|
||||
|
||||
- Fix format handling within Syslog()
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Sep 13 19:11:56 CEST 2000 - werner@suse.de
|
||||
|
||||
- Fix the two printline bugs in syslogd.c
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Sep 12 20:00:25 CEST 2000 - werner@suse.de
|
||||
|
||||
- Fix missed format
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed May 24 18:59:09 CEST 2000 - schwab@suse.de
|
||||
|
||||
- Fix resource leak.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Feb 29 16:25:48 CET 2000 - schwab@suse.de
|
||||
|
||||
- Fix type of last arg to recvfrom
|
||||
- Add group tag.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Feb 27 16:06:31 CET 2000 - kukuk@suse.de
|
||||
|
||||
- Move /usr/man -> /usr/share/man
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Feb 11 22:47:05 CET 2000 - werner@suse.de
|
||||
|
||||
- The pid file is /var/run/syslogd.pid not /var/run/syslogd.conf
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Nov 17 17:33:11 MET 1999 - kukuk@suse.de
|
||||
|
||||
- Add fix to syslogd for SIGHUP race condition
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Nov 4 18:06:17 CET 1999 - werner@suse.de
|
||||
|
||||
- next typo fix in comment in /etc/syslogd.conf
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Nov 4 14:49:18 CET 1999 - bs@suse.de
|
||||
|
||||
- typo fix in comment in /etc/syslogd.conf
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Oct 26 15:44:21 MEST 1999 - mge@suse.de
|
||||
|
||||
- (sysklogd-1.3-forw.patch) Andreas Siegert <afx@suse.de>
|
||||
Added -t flag that triggers tagging of forwarded messages with
|
||||
the sending hosts name as seen by the forwarder. Useful for
|
||||
relaying syslog from DMZs through the firwall to an internal
|
||||
loghost. Format is "<""hostname"
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Oct 8 19:33:39 CEST 1999 - werner@suse.de
|
||||
|
||||
- New version 1.3.33
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Oct 1 00:04:39 CEST 1999 - werner@suse.de
|
||||
|
||||
- Udatet version of nodos patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Sep 24 20:25:12 CEST 1999 - werner@suse.de
|
||||
|
||||
- Disable *.alert message on root tty's
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Sep 13 17:23:57 CEST 1999 - bs@suse.de
|
||||
|
||||
- ran old prepare_spec on spec file to switch to new prepare_spec.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Sep 10 12:38:54 CEST 1999 - ro@suse.de
|
||||
|
||||
- fixed nodos patch
|
||||
|
||||
------------------------------------------------------------------
|
||||
Mon Sep 6 23:59:48 CEST 1999 - werner@suse.de
|
||||
|
||||
- Avoid possible crash if no kernel symbols are available.
|
||||
|
||||
------------------------------------------------------------------
|
||||
Fri Sep 3 23:47:54 CEST 1999 - werner@suse.de
|
||||
|
||||
- Update to new version 1.3.32
|
||||
- Add sparc patch
|
||||
- Add security patch (DOS)
|
||||
- Make it work with alpha (time_t and size_t)
|
||||
- wallmsg() only for user processes marked in utmp
|
||||
- The last character of al kernel log is ascii null
|
||||
- Lock fd of the socket to the syslogd
|
||||
|
||||
------------------------------------------------------------------
|
||||
Thu Sep 2 20:56:28 CEST 1999 - werner@suse.de
|
||||
|
||||
- Use RPM_OPT_FLAGS
|
||||
- Use a pipe to redirect console message to xconsole
|
||||
- Make reading of ring buffer an (undocumented) option (-r
|
||||
reading, -R reading and clearing, both one shot)
|
||||
|
||||
------------------------------------------------------------------
|
||||
Tue Aug 31 22:07:43 CEST 1999 - werner@suse.de
|
||||
|
||||
- Use 16k buffer because newer kernels do have such a big log
|
||||
- Avoid trouble due longjmp and fork with a few variables
|
||||
|
||||
------------------------------------------------------------------
|
||||
Tue Aug 31 18:37:38 CEST 1999 - werner@suse.de
|
||||
|
||||
- Use sysctl argument 3 (Read up to the last 4k of messages in the
|
||||
ring buffer) instead of 2 (Read from the log) if one shot method
|
||||
for klogd is used.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Aug 21 14:36:16 CEST 1999 - garloff@suse.de
|
||||
|
||||
- syslog.conf: Only write *.crit synchronously
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 8 12:15:35 MET 1999 - florian@suse.de
|
||||
|
||||
- /var/log/news should be owned by news.news
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jan 7 11:54:34 MET 1999 - bs@suse.de
|
||||
|
||||
- fixed comment in syslog.conf
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Dec 14 23:02:34 MET 1998 - ro@suse.de
|
||||
|
||||
- removed noreplace from syslogd.conf: necessary change for news-logs
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Dec 11 15:41:32 MET 1998 - ro@suse.de
|
||||
|
||||
- split up news logs
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Dec 9 15:40:56 MET 1998 - ro@suse.de
|
||||
|
||||
- changed syslog.conf to back to suse-defaults
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Dec 8 18:06:02 MET 1998 - ro@suse.de
|
||||
|
||||
- updated init script and added link rcsyslog
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Dec 7 10:29:41 MET 1998 - ro@suse.de
|
||||
|
||||
- update to 1.3-30
|
||||
- syslog.conf marked as config(noreplace)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Dec 4 19:38:07 MET 1998 - ro@suse.de
|
||||
|
||||
- bootscript: silently restart if already running on "start"
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Dec 2 21:36:47 MET 1998 - werner@suse.de
|
||||
|
||||
- New boot script syslog
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jun 22 16:07:39 MEST 1998 - ro@suse.de
|
||||
|
||||
- used patches from trevor@jpj.net to build for glibc:
|
||||
- renamed syslogd's dprintf to syslog_dprintf
|
||||
- don't declare sys_errlist
|
||||
- use sys/time.h instead of linux/time.h
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Mar 10 15:54:17 MET 1998 - ro@suse.de
|
||||
|
||||
- react if KERNEL_LOGLEVEL=""
|
||||
- added SYSLOGD_PARAMS
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Mar 10 13:17:56 MET 1998 - ro@suse.de
|
||||
|
||||
- added KERNEL_LOGLEVEL to fillup for rc.config and rcfile
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Feb 27 14:45:49 MET 1998 - florian@suse.de
|
||||
|
||||
- removed duplicate entry for news messages in syslog.conf
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Oct 22 16:54:10 MEST 1997 - ro@suse.de
|
||||
|
||||
- removed doinst.sh from specfile-filelist
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Sun Jun 1 17:06:19 CEST 1997 - bs@suse.de
|
||||
|
||||
- don't include log files under var/log but touch them in doinst.sh
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Thu May 29 14:13:25 CEST 1997 - bs@suse.de
|
||||
|
||||
- cleared var/log/warn
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Wed Apr 30 15:57:14 CEST 1997 - florian@suse.de
|
||||
|
||||
|
||||
- add lots of fixes from debian and other places
|
||||
|
||||
- new /etc/syslog.conf: mail/news messages are in separate files
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Wed Apr 30 11:51:45 CEST 1997 - bs@suse.de
|
||||
|
||||
added & when starting syslogd.
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Sat Nov 16 13:50:50 CET 1996 - bs@suse.de
|
||||
|
||||
|
||||
runlevel value changed to S09 and K35
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Thu Oct 17 16:05:09 CEST 1996 - florian@suse.de
|
||||
|
||||
|
||||
- klogd liest jetzt wieder die System.map ein.
|
||||
|
||||
- Neue Option "-x", mit der man das Lesen der System.map
|
||||
abschalten kann.
|
||||
|
||||
- Start- und Stop-Scripte sind jetzt im Paket und nicht mehr in
|
||||
aaa_base.tgz.
|
526
syslogd.spec
Normal file
526
syslogd.spec
Normal file
@ -0,0 +1,526 @@
|
||||
#
|
||||
# spec file for package syslogd (Version 1.4.1)
|
||||
#
|
||||
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# This file and all modifications and additions to the pristine
|
||||
# package are under the same license as the package itself.
|
||||
#
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
|
||||
Name: syslogd
|
||||
License: GNU General Public License (GPL)
|
||||
Group: System/Daemons
|
||||
PreReq: klogd
|
||||
Provides: syslog
|
||||
Autoreqprov: on
|
||||
Version: 1.4.1
|
||||
Release: 585
|
||||
Summary: The Syslog daemon
|
||||
Source: sysklogd-1.4.1.tar.bz2
|
||||
Source1: logrotate.syslog
|
||||
Source2: sysconfig.syslog
|
||||
Source3: rc.syslog
|
||||
Source4: rc.earlysyslog
|
||||
Source5: syslog.xml
|
||||
Patch0: sysklogd-1.4.1.dif
|
||||
Patch1: sysklogd-1.4.1-dgram.patch
|
||||
Patch2: sysklogd-1.4.1-sparc.patch
|
||||
Patch3: sysklogd-1.4.1-forw.patch
|
||||
Patch4: sysklogd-1.4.1-fileleak.patch
|
||||
Patch5: sysklogd-ipv6.diff
|
||||
Patch6: sysklogd-1.4.1-klogd24.dif
|
||||
Patch7: sysklogd-1.4.1-large.patch
|
||||
Patch8: sysklogd-1.4.1-dns.patch
|
||||
Patch9: sysklogd-1.4.1-reopen.patch
|
||||
Patch10: sysklogd-1.4.1-no_SO_BSDCOMPAT.diff
|
||||
Patch11: sysklogd-1.4.1-owl-crunch_list.diff
|
||||
Patch12: sysklogd-1.4.1-ksyslogsize.diff
|
||||
Patch13: sysklogd-1.4.1-unix_sockets.patch
|
||||
Patch14: sysklogd-1.4.1-showpri.patch
|
||||
Patch15: sysklogd-1.4.1-preserve_percents.patch
|
||||
Patch16: sysklogd-1.4.1-utf8.patch
|
||||
Patch17: sysklogd-1.4.1-ksym.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
%description
|
||||
The syslogd daemon is the general system logging daemon, which is
|
||||
responsible for handling requests for syslog services.
|
||||
|
||||
This version of syslogd is similar to the standard Berkeley product,
|
||||
but with a number of compatible extensions.
|
||||
|
||||
|
||||
|
||||
Authors:
|
||||
--------
|
||||
Dr. Greg Wettstein <greg@wind.rmcc.com>
|
||||
Stephen Tweedie <sct@dcs.ed.ac.uk>
|
||||
Juha Virtanen <jiivee@hut.fi>
|
||||
Shane Alderton <shane@scs.apana.org.au>
|
||||
|
||||
%package -n klogd
|
||||
PreReq: %insserv_prereq %fillup_prereq
|
||||
Provides: sysklogd
|
||||
Provides: syslogd:/sbin/klogd
|
||||
Requires: /etc/init.d/network
|
||||
Summary: The kernel log daemon
|
||||
Group: System/Daemons
|
||||
|
||||
%description -n klogd
|
||||
The klogd daemon 'listens' to kernel log messages, prioritizes them,
|
||||
and routes them to either output files or to syslog daemon.
|
||||
|
||||
This version of klogd will optionally translate kernel addresses to
|
||||
their symbolic equivalents if provided with a system map.
|
||||
|
||||
|
||||
|
||||
Authors:
|
||||
--------
|
||||
Dr. Greg Wettstein <greg@wind.rmcc.com>
|
||||
Stephen Tweedie <sct@dcs.ed.ac.uk>
|
||||
Juha Virtanen <jiivee@hut.fi>
|
||||
Shane Alderton <shane@scs.apana.org.au>
|
||||
|
||||
%prep
|
||||
%setup -n sysklogd-1.4.1
|
||||
%patch1 -p0 -b .dgram
|
||||
%patch2 -p0 -b .sparc
|
||||
%patch3 -p0 -b .forw
|
||||
%patch4 -p0 -b .fileleak
|
||||
%patch5 -p0 -b .ipv6
|
||||
%patch6 -p0 -b .klogd24
|
||||
%patch7 -p0 -b .large
|
||||
%patch8 -p1 -b .dns
|
||||
%patch9 -p0 -b .reopen
|
||||
%patch10 -p0 -b .sobsd
|
||||
%patch11 -p1 -b .owlcr
|
||||
%patch12 -p1 -b .klsize
|
||||
%patch13 -p0 -b .usock
|
||||
%patch14 -p0 -b .shprio
|
||||
%patch15 -p1 -b .presperc
|
||||
%patch16 -p1 -b .utf8
|
||||
%patch17 -p0 -b .ksym
|
||||
%patch0 -p0
|
||||
%ifarch s390 s390x
|
||||
mv sample-s390.conf sample.conf
|
||||
%endif
|
||||
|
||||
%build
|
||||
# honor the increased LOG_BUF_LEN in kernel/printk.c
|
||||
make LOG_BUFFER_SIZE=-DLOG_BUFFER_SIZE=131072
|
||||
|
||||
%install
|
||||
mkdir -p $RPM_BUILD_ROOT/{sbin,etc}
|
||||
mkdir -p $RPM_BUILD_ROOT/etc/init.d
|
||||
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
|
||||
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man{5,8}
|
||||
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
|
||||
make install MANDIR=%{_mandir} DESTDIR=$RPM_BUILD_ROOT
|
||||
ln -sf ../etc/init.d/syslog $RPM_BUILD_ROOT/sbin/rcsyslog
|
||||
install -m 644 %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/syslog
|
||||
install -m 644 %{SOURCE2} $RPM_BUILD_ROOT/var/adm/fillup-templates
|
||||
install -m 754 %{SOURCE3} $RPM_BUILD_ROOT/etc/init.d/syslog
|
||||
install -m 754 %{SOURCE4} $RPM_BUILD_ROOT/etc/init.d/earlysyslog
|
||||
install -d $RPM_BUILD_ROOT/etc/omc/srvinfo.d/
|
||||
install -m 600 %{SOURCE5} $RPM_BUILD_ROOT/etc/omc/srvinfo.d/
|
||||
%ifarch s390 s390x
|
||||
sed 's/^KERNEL_LOGLEVEL=1/KERNEL_LOGLEVEL=7/' %{SOURCE2} \
|
||||
> $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.syslog
|
||||
%endif
|
||||
|
||||
%post
|
||||
#
|
||||
# add syslog variables provided by klogd if needed
|
||||
#
|
||||
%{fillup_and_insserv -npy syslog syslog}
|
||||
%{fillup_and_insserv -npY syslog earlysyslog}
|
||||
#
|
||||
# check if daemon configured in SYSLOG_DAEMON is
|
||||
# installed and switch to ourself if it's missed
|
||||
#
|
||||
source etc/sysconfig/syslog
|
||||
replace_syslog=no
|
||||
if test "$SYSLOG_DAEMON" != "syslogd" ; then
|
||||
if test -z "$SYSLOG_DAEMON" || \
|
||||
test ! -x sbin/${SYSLOG_DAEMON} ; then
|
||||
replace_syslog=yes
|
||||
fi
|
||||
fi
|
||||
if test "$replace_syslog" == "yes" ; then
|
||||
sed -i -e 's/^SYSLOG_DAEMON=.*/SYSLOG_DAEMON="syslogd"/g' \
|
||||
etc/sysconfig/syslog
|
||||
fi
|
||||
#
|
||||
# create dirs, touch log default files
|
||||
#
|
||||
mkdir -p var/log
|
||||
touch var/log/messages; chmod 640 var/log/messages
|
||||
touch var/log/boot.log; chmod 640 var/log/boot.log
|
||||
touch var/log/mail; chmod 640 var/log/mail
|
||||
touch var/log/mail.info; chmod 640 var/log/mail.info
|
||||
touch var/log/mail.warn; chmod 640 var/log/mail.warn
|
||||
touch var/log/mail.err; chmod 640 var/log/mail.err
|
||||
test -f var/log/news && mv var/log/news var/log/news.bak
|
||||
mkdir -p -m 0750 var/log/news
|
||||
chown news:news var/log/news
|
||||
touch var/log/news/news.crit; chmod 640 var/log/news/news.crit
|
||||
chown news:news var/log/news/news.crit
|
||||
touch var/log/news/news.err; chmod 640 var/log/news/news.err
|
||||
chown news:news var/log/news/news.err
|
||||
touch var/log/news/news.notice; chmod 640 var/log/news/news.notice
|
||||
chown news:news var/log/news/news.notice
|
||||
|
||||
%preun
|
||||
%stop_on_removal syslog
|
||||
|
||||
%postun
|
||||
%restart_on_update syslog
|
||||
%{insserv_cleanup}
|
||||
|
||||
%preun -n klogd
|
||||
%stop_on_removal syslog
|
||||
|
||||
%postun -n klogd
|
||||
%restart_on_update syslog
|
||||
%{insserv_cleanup}
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%config %verify(not mode) /etc/syslog.conf
|
||||
%doc %{_mandir}/man5/syslog.conf.5.gz
|
||||
%doc %{_mandir}/man8/syslogd.8.gz
|
||||
/sbin/syslogd
|
||||
%dir /etc/omc/
|
||||
%dir /etc/omc/srvinfo.d/
|
||||
/etc/omc/srvinfo.d/syslog.xml
|
||||
|
||||
%files -n klogd
|
||||
%defattr(-,root,root)
|
||||
/var/adm/fillup-templates/sysconfig.syslog
|
||||
%config(noreplace) /etc/logrotate.d/syslog
|
||||
%config /etc/init.d/syslog
|
||||
%config /etc/init.d/earlysyslog
|
||||
%doc %{_mandir}/man8/klogd.8.gz
|
||||
%doc %{_mandir}/man8/sysklogd.8.gz
|
||||
/sbin/rcsyslog
|
||||
/sbin/klogd
|
||||
|
||||
%changelog -n syslogd
|
||||
* Mon Dec 11 2006 - mskibbe@suse.de
|
||||
- add service xml file
|
||||
* Wed Nov 15 2006 - werner@suse.de
|
||||
- Require rcnetwork due rcsyslog script does it (bug #214297)
|
||||
* Wed Sep 13 2006 - mt@suse.de
|
||||
- Feature #300891: Remove SuSEconfig dependency of syslog-ng
|
||||
* Adopted /etc/init.d/syslog script to append additional
|
||||
sockets using -a options for syslog-ng as well.
|
||||
* Thu Aug 24 2006 - werner@suse.de
|
||||
- Just use <linux/bitops.h> to to the same
|
||||
* Fri Aug 18 2006 - aj@suse.de
|
||||
- Fix build.
|
||||
* Tue Jul 11 2006 - werner@suse.de
|
||||
- Enable run-time switch from syslogd to syslog-ng (bug #166933)
|
||||
* Mon May 22 2006 - schwab@suse.de
|
||||
- Don't strip binaries.
|
||||
* Wed Feb 15 2006 - mt@suse.de
|
||||
- Added log rotation for /var/log/news/news.* files
|
||||
* Wed Feb 08 2006 - werner@suse.de
|
||||
- Prevent directly the fortified cpp macros of the system syslog
|
||||
function and revert the skip of _FORTIFY_SOURCE.
|
||||
* Wed Feb 08 2006 - werner@suse.de
|
||||
- Skip _FORTIFY_SOURCE for klogd/syslogd to be able to use
|
||||
our own functions without any filter (bug #147363)
|
||||
* Wed Jan 25 2006 - mls@suse.de
|
||||
- converted neededforbuild to BuildRequires
|
||||
* Tue Dec 20 2005 - ro@suse.de
|
||||
- remove explicit requires for devs
|
||||
* Wed Oct 05 2005 - werner@suse.de
|
||||
- Enable 64 bit file interface
|
||||
* Thu Sep 29 2005 - dmueller@suse.de
|
||||
- add norootforbuild
|
||||
* Tue Sep 20 2005 - werner@suse.de
|
||||
- Avoid broken function implementation by fortified header
|
||||
* Mon Jul 25 2005 - mt@suse.de
|
||||
- Bug #94743: Added note to the logrotate.syslog file about
|
||||
changing log file permissions in case syslog-ng is used.
|
||||
* Fri Jun 17 2005 - werner@suse.de
|
||||
- Use -fpie/-pie
|
||||
* Tue May 24 2005 - werner@suse.de
|
||||
- Fix of the priority and facility patch: do not pass SHOWPRI flag
|
||||
if no no facility and priority values are used (bug #85453).
|
||||
* Tue Apr 19 2005 - aj@suse.de
|
||||
- Fix messages.
|
||||
* Wed Mar 09 2005 - ro@suse.de
|
||||
- added split-provides for klogd
|
||||
* Tue Mar 08 2005 - mt@suse.de
|
||||
- Bug #71264: added stop_on_removal/restart_on_removal to
|
||||
the spec file, fixed try-restart action in the init script
|
||||
* Mon Mar 07 2005 - mt@suse.de
|
||||
- Bug #71085: removed syslog requirement from klogd sub-package
|
||||
* Fri Feb 11 2005 - mt@suse.de
|
||||
- fixed rpm post-install script to switch SYSLOG_DAEMON to
|
||||
ourself if it is set to a daemon that is not installed
|
||||
(happens if we replace a syslog-ng installed before)
|
||||
- fixed init scripts to not to report failures on stop
|
||||
* Fri Feb 11 2005 - ro@suse.de
|
||||
- split off klogd package
|
||||
- provide "syslog"
|
||||
* Thu Jan 27 2005 - werner@suse.de
|
||||
- Add UTF8 compatibility (bug #49980)
|
||||
- Make early syslog more smooth for e.g. rcsyslog restart
|
||||
* Tue Jan 25 2005 - ro@suse.de
|
||||
- change klogd params from "-2" to "-x" by default
|
||||
* Thu Jan 20 2005 - coolo@suse.de
|
||||
- only skip syslog start when booting into init 5
|
||||
* Mon Jan 10 2005 - coolo@suse.de
|
||||
- add an early syslog that is started before network and checks
|
||||
for hostnames in syslog.conf
|
||||
* Thu Dec 16 2004 - werner@suse.de
|
||||
- Add preserve percents patch to fix bug #49228
|
||||
- Be sure that recvfrom() is awaken by SIGALRM and SIGTERM
|
||||
* Tue Nov 16 2004 - werner@suse.de
|
||||
- Quieten the build
|
||||
* Fri Oct 15 2004 - werner@suse.de
|
||||
- Add two patches from sgi (bug #46783)
|
||||
* Add logging on UNIX sockets
|
||||
* Add priority and facility marks in the log messages
|
||||
* Thu Aug 19 2004 - od@suse.de
|
||||
- removed creation of unused /dev/:[0-5]; GetDevices of
|
||||
xorg-x11.rpm uses /dev/tty0 to find the virtual terminal of a
|
||||
local X-server (#43931)
|
||||
* Thu Jul 29 2004 - od@suse.de
|
||||
- klogd now reads log buffer size from kernel. Falls back to
|
||||
probing as in dmesg (#39761).
|
||||
* Tue May 18 2004 - werner@suse.de
|
||||
- Correct last change
|
||||
* Mon May 17 2004 - werner@suse.de
|
||||
- No more symbol and EIP translation for 2.6 kernels (#40651)
|
||||
* Mon Apr 19 2004 - werner@suse.de
|
||||
- Fix syslogd argument list handling (fix from Solar Designer)
|
||||
* Wed Mar 24 2004 - werner@suse.de
|
||||
- Be prepared for udev (bug #36671)
|
||||
* Thu Jan 29 2004 - werner@suse.de
|
||||
- Enable sample-s390.conf also for s390x (aka zSeries?, bug #34153)
|
||||
* Mon Sep 29 2003 - kukuk@suse.de
|
||||
- Use SO_BSDCOMPAT only if defined
|
||||
* Tue Sep 16 2003 - werner@suse.de
|
||||
- Clean last klogd24.dif
|
||||
* Tue Sep 09 2003 - werner@suse.de
|
||||
- Is there a 128bit lseek around? Use some workarounds to get lseek
|
||||
working above LONG_MAX on x86_64 on /dev/kmem (kernel bug?)
|
||||
* Mon Sep 08 2003 - werner@suse.de
|
||||
- Use special seek routine for signless addresses, fixes
|
||||
crash on i386.
|
||||
* Wed Sep 03 2003 - werner@suse.de
|
||||
- Change symbol addresses to __off64_t and sizes to size_t (#28639)
|
||||
* Tue Aug 26 2003 - mt@suse.de
|
||||
- bug #28949: added new 'Config' meta data to sysconfig file
|
||||
- bug #27971: reconnect to log socket if a write fails with
|
||||
ECONNREFUSED or ENOTCONN, e.g. if the log socket has been
|
||||
reopened by "rcsyslog reload" while syslog-ng is used.
|
||||
new patch file: sysklogd-1.4.1-reopen.patch
|
||||
* Fri Aug 15 2003 - kukuk@suse.de
|
||||
- Add devs to PreReq and don't create xconsole device itself
|
||||
* Thu Aug 07 2003 - werner@suse.de
|
||||
- Change permissions of mail log files (bug #28561)
|
||||
* Mon Jul 28 2003 - werner@suse.de
|
||||
- Fix trivial bug #27072: use warning instead of warn
|
||||
* Fri Jul 25 2003 - schwab@suse.de
|
||||
- Fix uses of chown in %%post script.
|
||||
* Fri Jul 18 2003 - werner@suse.de
|
||||
- Add DNS timeout patch from Olaf Kirch
|
||||
* Tue May 20 2003 - werner@suse.de
|
||||
- Use large file support, gnore signal SIGXFSZ (bug #26960)
|
||||
* Wed May 14 2003 - kukuk@suse.de
|
||||
- Fix klogd to build independend of installed kernel headers. klogd
|
||||
still does not work with 2.5.xx correct.
|
||||
* Wed Apr 16 2003 - coolo@suse.de
|
||||
- fixing s390 build
|
||||
* Wed Apr 16 2003 - coolo@suse.de
|
||||
- use BuildRoot
|
||||
* Mon Feb 24 2003 - schwab@suse.de
|
||||
- Add workaround for use of kernel headers.
|
||||
* Fri Jan 31 2003 - werner@suse.de
|
||||
- Add some code for supporting syslog-ng
|
||||
- Split off boot script and sysconfig file from patch
|
||||
* Wed Jan 08 2003 - werner@suse.de
|
||||
- bug #22695: add missed meta data within sysconfig file
|
||||
- bug #22551: do not let read any user /var/log/messages
|
||||
* Wed Dec 11 2002 - werner@suse.de
|
||||
- New log files for sorting priorities of mail messages (# 22394)
|
||||
* Tue Nov 05 2002 - ro@suse.de
|
||||
- fillup/sysconfig.syslog: set kernel loglevel to 7 on s390/s390x
|
||||
* Mon Oct 14 2002 - ro@suse.de
|
||||
- moved logrotate config for syslog's files to this package
|
||||
- changed create to 640 for /var/log/mail (#20816)
|
||||
* Mon Oct 07 2002 - olh@suse.de
|
||||
- honor the increased LOG_BUF_LEN in kernel/printk.c (#19888)
|
||||
LOG_BUFFER_SIZE=131072
|
||||
* Tue Sep 10 2002 - olh@suse.de
|
||||
- provides syslog for hotplug
|
||||
* Wed Aug 28 2002 - nashif@suse.de
|
||||
- fixed PreReq to use macros
|
||||
* Fri Aug 23 2002 - werner@suse.de
|
||||
- Enable the `-2' of klogd option for clean and untraced oops.
|
||||
* Fri Aug 16 2002 - werner@suse.de
|
||||
- Add PreReq (bug #18004)
|
||||
- Change order of main and ipv6 patch
|
||||
* Fri Aug 02 2002 - kukuk@suse.de
|
||||
- Add patch to enable IPv6 support (based on the USAGI version
|
||||
plus some fixes for IPv4 only).
|
||||
* Wed Jul 17 2002 - poeml@suse.de
|
||||
- run with additional sockets from SYSLOGD_ADDITIONAL_SOCKET_* that
|
||||
other packages can fill up into /etc/sysconfig/syslog
|
||||
* Mon Mar 04 2002 - zoz@suse.de
|
||||
- Change Required from $network to network
|
||||
* Mon Mar 04 2002 - ro@suse.de
|
||||
- postinstall-script: disable perl-hack (-p for fillup_and_insserv)
|
||||
- no extra insserv call
|
||||
* Thu Feb 14 2002 - werner@suse.de
|
||||
- Fix the bug fix
|
||||
* Thu Feb 14 2002 - werner@suse.de
|
||||
- Fix bug #12747: move to fillup_and_insserv and sysconfig scheme
|
||||
* Wed Sep 19 2001 - ro@suse.de
|
||||
- fixed typo in rc_script SYSLOGD_PARAM -> SYSLOGD_PARAMS (#10950)
|
||||
* Thu Aug 30 2001 - werner@suse.de
|
||||
- Fix bug #9096
|
||||
- Make TAB a printable character
|
||||
* Fri Jun 15 2001 - schwab@suse.de
|
||||
- Don't define __KERNEL__.
|
||||
* Tue May 29 2001 - werner@suse.de
|
||||
- Update to version 1.4.1
|
||||
- Porting our patches to this version
|
||||
* Fri Apr 27 2001 - mt@suse.de
|
||||
- added syslog-ng hook in init script
|
||||
* Tue Apr 17 2001 - werner@suse.de
|
||||
- Avoid zero bytes from kernel messages
|
||||
* Thu Jan 11 2001 - werner@suse.de
|
||||
- Correct deep or relative symlink rcsyslog
|
||||
* Thu Jan 11 2001 - werner@suse.de
|
||||
- Move syslogd and klogd to /sbin
|
||||
- Change Required from $remote_fs to $network
|
||||
* Thu Dec 07 2000 - werner@suse.de
|
||||
- Change boot.log to localmessages and add local0 upto local7
|
||||
* Mon Dec 04 2000 - ro@suse.de
|
||||
- added var/log/boot.log
|
||||
* Tue Nov 28 2000 - ro@suse.de
|
||||
- fixed startscript
|
||||
* Mon Nov 13 2000 - ro@suse.de
|
||||
- fixed to compile on 2.4 kernel header
|
||||
* Tue Oct 17 2000 - bk@suse.de
|
||||
- add sample-s390.conf for s390.
|
||||
* Thu Sep 14 2000 - werner@suse.de
|
||||
- Fix format handling within Syslog()
|
||||
* Wed Sep 13 2000 - werner@suse.de
|
||||
- Fix the two printline bugs in syslogd.c
|
||||
* Tue Sep 12 2000 - werner@suse.de
|
||||
- Fix missed format
|
||||
* Wed May 24 2000 - schwab@suse.de
|
||||
- Fix resource leak.
|
||||
* Tue Feb 29 2000 - schwab@suse.de
|
||||
- Fix type of last arg to recvfrom
|
||||
- Add group tag.
|
||||
* Sun Feb 27 2000 - kukuk@suse.de
|
||||
- Move /usr/man -> /usr/share/man
|
||||
* Fri Feb 11 2000 - werner@suse.de
|
||||
- The pid file is /var/run/syslogd.pid not /var/run/syslogd.conf
|
||||
* Wed Nov 17 1999 - kukuk@suse.de
|
||||
- Add fix to syslogd for SIGHUP race condition
|
||||
* Thu Nov 04 1999 - werner@suse.de
|
||||
- next typo fix in comment in /etc/syslogd.conf
|
||||
* Thu Nov 04 1999 - bs@suse.de
|
||||
- typo fix in comment in /etc/syslogd.conf
|
||||
* Tue Oct 26 1999 - mge@suse.de
|
||||
- (sysklogd-1.3-forw.patch) Andreas Siegert <afx@suse.de>
|
||||
Added -t flag that triggers tagging of forwarded messages with
|
||||
the sending hosts name as seen by the forwarder. Useful for
|
||||
relaying syslog from DMZs through the firwall to an internal
|
||||
loghost. Format is "<""hostname"
|
||||
* Fri Oct 08 1999 - werner@suse.de
|
||||
- New version 1.3.33
|
||||
* Fri Oct 01 1999 - werner@suse.de
|
||||
- Udatet version of nodos patch
|
||||
* Fri Sep 24 1999 - werner@suse.de
|
||||
- Disable *.alert message on root tty's
|
||||
* Mon Sep 13 1999 - bs@suse.de
|
||||
- ran old prepare_spec on spec file to switch to new prepare_spec.
|
||||
* Fri Sep 10 1999 - ro@suse.de
|
||||
- fixed nodos patch
|
||||
* Mon Sep 06 1999 - werner@suse.de
|
||||
- Avoid possible crash if no kernel symbols are available.
|
||||
* Fri Sep 03 1999 - werner@suse.de
|
||||
- Update to new version 1.3.32
|
||||
- Add sparc patch
|
||||
- Add security patch (DOS)
|
||||
- Make it work with alpha (time_t and size_t)
|
||||
- wallmsg() only for user processes marked in utmp
|
||||
- The last character of al kernel log is ascii null
|
||||
- Lock fd of the socket to the syslogd
|
||||
* Thu Sep 02 1999 - werner@suse.de
|
||||
- Use RPM_OPT_FLAGS
|
||||
- Use a pipe to redirect console message to xconsole
|
||||
- Make reading of ring buffer an (undocumented) option (-r
|
||||
reading, -R reading and clearing, both one shot)
|
||||
* Tue Aug 31 1999 - werner@suse.de
|
||||
- Use 16k buffer because newer kernels do have such a big log
|
||||
- Avoid trouble due longjmp and fork with a few variables
|
||||
* Tue Aug 31 1999 - werner@suse.de
|
||||
- Use sysctl argument 3 (Read up to the last 4k of messages in the
|
||||
ring buffer) instead of 2 (Read from the log) if one shot method
|
||||
for klogd is used.
|
||||
* Sat Aug 21 1999 - garloff@suse.de
|
||||
- syslog.conf: Only write *.crit synchronously
|
||||
* Fri Jan 08 1999 - florian@suse.de
|
||||
- /var/log/news should be owned by news.news
|
||||
* Thu Jan 07 1999 - bs@suse.de
|
||||
- fixed comment in syslog.conf
|
||||
* Mon Dec 14 1998 - ro@suse.de
|
||||
- removed noreplace from syslogd.conf: necessary change for news-logs
|
||||
* Fri Dec 11 1998 - ro@suse.de
|
||||
- split up news logs
|
||||
* Wed Dec 09 1998 - ro@suse.de
|
||||
- changed syslog.conf to back to suse-defaults
|
||||
* Tue Dec 08 1998 - ro@suse.de
|
||||
- updated init script and added link rcsyslog
|
||||
* Mon Dec 07 1998 - ro@suse.de
|
||||
- update to 1.3-30
|
||||
- syslog.conf marked as config(noreplace)
|
||||
* Fri Dec 04 1998 - ro@suse.de
|
||||
- bootscript: silently restart if already running on "start"
|
||||
* Wed Dec 02 1998 - werner@suse.de
|
||||
- New boot script syslog
|
||||
* Mon Jun 22 1998 - ro@suse.de
|
||||
- used patches from trevor@jpj.net to build for glibc:
|
||||
- renamed syslogd's dprintf to syslog_dprintf
|
||||
- don't declare sys_errlist
|
||||
- use sys/time.h instead of linux/time.h
|
||||
* Tue Mar 10 1998 - ro@suse.de
|
||||
- react if KERNEL_LOGLEVEL=""
|
||||
- added SYSLOGD_PARAMS
|
||||
* Tue Mar 10 1998 - ro@suse.de
|
||||
- added KERNEL_LOGLEVEL to fillup for rc.config and rcfile
|
||||
* Fri Feb 27 1998 - florian@suse.de
|
||||
- removed duplicate entry for news messages in syslog.conf
|
||||
* Wed Oct 22 1997 - ro@suse.de
|
||||
- removed doinst.sh from specfile-filelist
|
||||
* Sun Jun 01 1997 - bs@suse.de
|
||||
- don't include log files under var/log but touch them in doinst.sh
|
||||
* Thu May 29 1997 - bs@suse.de
|
||||
- cleared var/log/warn
|
||||
* Wed Apr 30 1997 - florian@suse.de
|
||||
- add lots of fixes from debian and other places
|
||||
- new /etc/syslog.conf: mail/news messages are in separate files
|
||||
* Wed Apr 30 1997 - bs@suse.de
|
||||
added & when starting syslogd.
|
||||
* Thu Jan 02 1997 - bs@suse.de
|
||||
runlevel value changed to S09 and K35
|
||||
* Thu Jan 02 1997 - florian@suse.de
|
||||
- klogd liest jetzt wieder die System.map ein.
|
||||
- Neue Option "-x", mit der man das Lesen der System.map
|
||||
abschalten kann.
|
||||
- Start- und Stop-Scripte sind jetzt im Paket und nicht mehr in
|
||||
aaa_base.tgz.
|
Loading…
Reference in New Issue
Block a user