You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(23) |
Oct
(2) |
Nov
(1) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(4) |
Feb
(11) |
Mar
(1) |
Apr
(104) |
May
(18) |
Jun
(42) |
Jul
|
Aug
(4) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: <al...@us...> - 2003-04-11 19:04:24
|
Update of /cvsroot/msyslog/syslog/src/modules In directory sc8-pr-cvs1:/tmp/cvs-serv4238/src/modules Modified Files: Tag: v1_08g im_bsd.c Log Message: damn, missed termination... grrr. Index: im_bsd.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/im_bsd.c,v retrieving revision 1.82.2.4 retrieving revision 1.82.2.4.2.1 diff -u -d -r1.82.2.4 -r1.82.2.4.2.1 --- im_bsd.c 11 Apr 2003 18:55:20 -0000 1.82.2.4 +++ im_bsd.c 11 Apr 2003 19:04:17 -0000 1.82.2.4.2.1 @@ -94,6 +94,8 @@ int i, c; strncpy(ret->im_msg, _PATH_UNIX, sizeof(ret->im_msg) - 1); + ret->im_msg[sizeof (ret->im_msg) - 1] = '\0'; + strncat(ret->im_msg, ": ", sizeof (ret->im_msg) -1 - strlen(ret->im_msg); |
From: <al...@us...> - 2003-04-11 18:55:53
|
Update of /cvsroot/msyslog/syslog/src In directory sc8-pr-cvs1:/tmp/cvs-serv747/src Modified Files: Tag: v1_08 syslogd.c Log Message: string fixes Index: syslogd.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/syslogd.c,v retrieving revision 1.219.2.1 retrieving revision 1.219.2.2 diff -u -d -r1.219.2.1 -r1.219.2.2 --- syslogd.c 11 Apr 2003 16:36:29 -0000 1.219.2.1 +++ syslogd.c 11 Apr 2003 18:55:19 -0000 1.219.2.2 @@ -1163,7 +1163,9 @@ * Foreach line in the conf table, open that file. */ f = NULL; - strncpy(prog, "*", 2); + strncpy(prog, "*", sizeof (prog) - 1); + prog[sizeof (prog) - 1] = '\0'; + while (fgets(cline, sizeof(cline), cf) != NULL) { int clen; @@ -1197,7 +1199,8 @@ while (isspace((int)*p)) p++; if (!*p) { - strncpy(prog, "*", 2); + strncpy(prog, "*", sizeof (prog) - 1); + prog[sizeof (prog) - 1] = '\0'; continue; } for (i = 0; i < NAME_MAX; i++) { |
Update of /cvsroot/msyslog/syslog/src/modules In directory sc8-pr-cvs1:/tmp/cvs-serv747/src/modules Modified Files: Tag: v1_08 im_bsd.c im_file.c im_tcp.c im_udp.c im_unix.c ip_misc.c om_classic.c Log Message: string fixes Index: im_bsd.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/im_bsd.c,v retrieving revision 1.82.2.3 retrieving revision 1.82.2.4 diff -u -d -r1.82.2.3 -r1.82.2.4 --- im_bsd.c 11 Apr 2003 16:36:36 -0000 1.82.2.3 +++ im_bsd.c 11 Apr 2003 18:55:20 -0000 1.82.2.4 @@ -93,8 +93,10 @@ char *p, *q, *lp; int i, c; - strncpy(ret->im_msg, _PATH_UNIX, sizeof(ret->im_msg) - 4); - strncat(ret->im_msg, ": ", 2); + strncpy(ret->im_msg, _PATH_UNIX, sizeof(ret->im_msg) - 1); + strncat(ret->im_msg, ": ", sizeof (ret->im_msg) -1 + - strlen(ret->im_msg); + lp = ret->im_msg + strlen(ret->im_msg); i = read(im->im_fd, im->im_buf, sizeof(im->im_buf) - 1); Index: im_file.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/im_file.c,v retrieving revision 1.10.2.1 retrieving revision 1.10.2.2 diff -u -d -r1.10.2.1 -r1.10.2.2 --- im_file.c 11 Apr 2003 16:36:37 -0000 1.10.2.1 +++ im_file.c 11 Apr 2003 18:55:20 -0000 1.10.2.2 @@ -207,10 +207,11 @@ ++p; } - strncat(ret->im_msg, im->im_path, strlen(ret->im_msg) - - sizeof(ret->im_msg) - 1); - strncat(ret->im_msg, ":", strlen(ret->im_msg) - - sizeof(ret->im_msg) - 1); + strncat(ret->im_msg, im->im_path, sizeof (ret->im_msg) - 1 + - strlen(ret->im_msg)); + strncat(ret->im_msg, ":", sizeof (ret->im_msg) - 1 + - strlen(ret->im_msg)); + dprintf(MSYSLOG_INFORMATIVE, "im_file_read: Entering " "with header %s\n", ret->im_msg); Index: im_tcp.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/im_tcp.c,v retrieving revision 1.31.2.1 retrieving revision 1.31.2.2 diff -u -d -r1.31.2.1 -r1.31.2.2 --- im_tcp.c 11 Apr 2003 16:36:38 -0000 1.31.2.1 +++ im_tcp.c 11 Apr 2003 18:55:20 -0000 1.31.2.2 @@ -322,8 +322,8 @@ } else { /* save this partial line and return */ strncat(con->saveline, p, - sizeof(con->saveline) - 1); - con->saveline[sizeof(con->saveline) - 1] = '\0'; + sizeof(con->saveline) - 1 + - strlen(con->saveline)); } /* remove trailing carriage returns */ @@ -344,9 +344,8 @@ if (con->saveline[0] != '\0') { strncat(con->saveline, p, - sizeof(con->saveline) - 1); - con->saveline[sizeof(con->saveline) - 1] - = '\0'; + sizeof(con->saveline) - 1 + - strlen(con->saveline)); msg = con->saveline; } else { msg = p; Index: im_udp.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/im_udp.c,v retrieving revision 1.69.2.2 retrieving revision 1.69.2.3 diff -u -d -r1.69.2.2 -r1.69.2.3 --- im_udp.c 11 Apr 2003 16:36:38 -0000 1.69.2.2 +++ im_udp.c 11 Apr 2003 18:55:20 -0000 1.69.2.3 @@ -142,7 +142,7 @@ ret->im_msg[n1++] = ret->im_msg[n2++]; ret->im_msg[n1] = '\0'; - strncat(ret->im_host, host, sizeof(ret->im_host)); + strncpy(ret->im_host, host, sizeof(ret->im_host) - 1); ret->im_host[sizeof(ret->im_host) - 1] = '\0'; } else { @@ -152,10 +152,10 @@ sizeof(frominet.sin_addr), frominet.sin_family); if (hent) { strncpy(ret->im_host, hent->h_name, - sizeof(ret->im_host)); + sizeof(ret->im_host) - 1); } else { strncpy(ret->im_host, inet_ntoa(frominet.sin_addr), - sizeof(ret->im_host)); + sizeof(ret->im_host) - 1); } } Index: im_unix.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/im_unix.c,v retrieving revision 1.52.2.1 retrieving revision 1.52.2.2 diff -u -d -r1.52.2.1 -r1.52.2.2 --- im_unix.c 11 Apr 2003 16:36:38 -0000 1.52.2.1 +++ im_unix.c 11 Apr 2003 18:55:20 -0000 1.52.2.2 @@ -128,7 +128,10 @@ memset(&sunx, 0, sizeof(sunx)); sunx.sun_family = AF_UNIX; - (void)strncpy(sunx.sun_path, logger, sizeof(sunx.sun_path)); + + strncpy(sunx.sun_path, logger, sizeof (sunx.sun_path) - 1); + sunx.sun_path[sizeof (sunx.sun_path) - 1] = '\0'; + I->im_fd = socket(AF_UNIX, SOCK_DGRAM, 0); if (I->im_fd < 0 || bind(I->im_fd, (struct sockaddr *)&sunx, SUN_LEN(&sunx)) < 0 || Index: ip_misc.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/ip_misc.c,v retrieving revision 1.23.2.1 retrieving revision 1.23.2.2 diff -u -d -r1.23.2.1 -r1.23.2.2 --- ip_misc.c 11 Apr 2003 16:36:38 -0000 1.23.2.1 +++ ip_misc.c 11 Apr 2003 18:55:21 -0000 1.23.2.2 @@ -107,7 +107,7 @@ if (hp) { strncpy(host, hp->h_name, (unsigned) hlen - 1); - host[hlen] = '\0'; + host[hlen - 1] = '\0'; if (port) snprintf(port, (unsigned) plen, "%u", ntohs(sin4->sin_port)); return (1); Index: om_classic.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/om_classic.c,v retrieving revision 1.87.2.1 retrieving revision 1.87.2.2 diff -u -d -r1.87.2.1 -r1.87.2.2 --- om_classic.c 11 Apr 2003 16:36:39 -0000 1.87.2.1 +++ om_classic.c 11 Apr 2003 18:55:22 -0000 1.87.2.2 @@ -357,8 +357,9 @@ p++; case '|': /* from sysklogd */ case '/': - strncpy(c->f_un.f_fname, p, sizeof c->f_un.f_fname); + strncpy(c->f_un.f_fname, p, sizeof (c->f_un.f_fname) - 1); c->f_un.f_fname[sizeof (c->f_un.f_fname) - 1] = 0; + if ( *p == '|' ) { c->fd = open(++p, O_RDWR|O_NONBLOCK); c->f_type = F_PIPE; @@ -479,8 +480,8 @@ #endif continue; - strncpy(line, ut.ut_line, sizeof(ut.ut_line)); - line[sizeof(ut.ut_line)] = '\0'; + strncpy(line, ut.ut_line, sizeof(line) - 1); + line[sizeof(line) - 1] = '\0'; if (c->f_type == F_WALL) { if ((p = ttymsg(iov, 6, line, TTYMSGTIME)) != NULL) { errno = 0; /* already in msg */ |
From: <al...@us...> - 2003-04-11 17:03:27
|
Update of /cvsroot/msyslog/syslog/src/modules In directory sc8-pr-cvs1:/tmp/cvs-serv13511/src/modules Removed Files: Tag: v1_08 om_directory.c om_queue.c om_refract.c Log Message: remove (for now) newer modules, to make this look like 1.08e --- om_directory.c DELETED --- --- om_queue.c DELETED --- --- om_refract.c DELETED --- |
From: <al...@us...> - 2003-04-11 17:03:25
|
Update of /cvsroot/msyslog/syslog/src/man In directory sc8-pr-cvs1:/tmp/cvs-serv13511/src/man Removed Files: Tag: v1_08 om_refract.8 Log Message: remove (for now) newer modules, to make this look like 1.08e --- om_refract.8 DELETED --- |
From: <al...@us...> - 2003-04-11 16:43:00
|
Update of /cvsroot/msyslog/syslog/packaging/rpm In directory sc8-pr-cvs1:/tmp/cvs-serv3779/packaging/rpm Added Files: Tag: v1_08 msyslog.init msyslog.spec msyslog.spec.in msyslog.sysconfig Log Message: add packaging directory from 1.08e too --- NEW FILE: msyslog.init --- #!/bin/sh # # msyslog Starts msyslogd. # # # chkconfig: 2345 12 88 # description: msyslog is a daemon for the syslog system log interface. It # is based on OpenBSD's syslog daemon implementation, with many improvements # (ie. log hash protection). # It was created by Core-SDI http://www.corest.com # Source function library. . /etc/rc.d/init.d/functions [ -f /sbin/msyslogd ] || exit 0 # Source config if [ -f /etc/sysconfig/msyslog ]; then . /etc/sysconfig/msyslog else CONFIG="" DEBUG="" MARK="" INPUTS="-i linux -i unix:/dev/log" fi RETVAL=0 umask 077 start() { echo -n "Starting msyslogd: " daemon msyslogd $CONFIG $DEBUG $MARK RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/msyslog return $RETVAL } stop() { echo -n "Shutting down msyslogd: " killproc msyslogd RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/msyslog return $RETVAL } rhstatus() { status msyslogd } restart() { stop start } case "$1" in start) start ;; stop) stop ;; status) rhstatus ;; restart|reload) restart ;; condrestart) [ -f /var/lock/subsys/msyslog ] && restart || : ;; *) echo "Usage: $0 {start|stop|status|restart|condrestart}" exit 1 esac exit $? --- NEW FILE: msyslog.spec --- Summary: A daemon for the syslog system log interface Name: msyslog Version: pre_1.08c Release: 1 Serial: 1 Group: System Environment/Daemons License: BSD URL: http://www.core-sdi.com/english/freesoft.html Packager: Florin Andrei <fl...@sg...> Source: %{name}-%{version}.tgz Source2: msyslog.init Source3: msyslog.sysconfig Buildroot: %{_tmppath}/%{name}-%{version}-root Provides: msyslog sysklogd %description This project is intended as a whole revision of previous Secure Syslogd project (wich is unsupported by now). It has all functionalities and some more. The remaining things are Solaris support and Audit compatibility (on the works). The whole internal structure was redesigned to work with input and output modules, standarizing interfaces to facilitate development for using special devices and flexible configurations. Current available output modules are classic, mysql, peo, pgsql, regex and tcp. Available input modules are bsd, linux, unix, tcp and udp. %prep %setup -n %{name}-%{version} %build ./configure --prefix=/ make clean; make gzip src/man/*.5 gzip src/man/*.8 %install if [ -d $RPM_BUILD_ROOT ]; then rm -r $RPM_BUILD_ROOT; fi mkdir -p $RPM_BUILD_ROOT/sbin mkdir -p $RPM_BUILD_ROOT/lib/alat mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man5 mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man8 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d mkdir -p $RPM_BUILD_ROOT/etc/sysconfig # binary files install -m 755 $RPM_BUILD_DIR/%{name}-%{version}/src/syslogd $RPM_BUILD_ROOT/sbin/msyslogd # # FIX THIS!!! # #install -m 755 $RPM_BUILD_DIR/%{name}-%{version}/src/modules/libmsyslog.so.%{version} $RPM_BUILD_ROOT/lib/alat install -m 755 $RPM_BUILD_DIR/%{name}-%{version}/src/modules/libmsyslog.so.1.08 $RPM_BUILD_ROOT/lib/alat # # # install -m 755 $RPM_BUILD_DIR/%{name}-%{version}/src/peo/peochk $RPM_BUILD_ROOT/sbin # initialization and configuration files install -m 755 $RPM_SOURCE_DIR/msyslog.init $RPM_BUILD_ROOT/etc/rc.d/init.d/msyslog install -m 644 $RPM_SOURCE_DIR/msyslog.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/msyslog install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/syslog.conf.5.gz $RPM_BUILD_ROOT/%{_mandir}/man5/msyslogd.conf.5.gz # man pages install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/im_bsd.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/im_doors.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/im_linux.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/im_streams.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/im_tcp.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/im_udp.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/im_unix.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/om_classic.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/om_mysql.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/om_peo.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/om_pgsql.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/om_regex.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/om_tcp.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/peochk.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/syslogd.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8/msyslogd.8.gz %clean if [ -d $RPM_BUILD_ROOT ]; then rm -rf $RPM_BUILD_ROOT; fi if [ -d $RPM_BUILD_DIR/%{name}-%{version} ]; then rm -rf $RPM_BUILD_DIR/%{name}-%{version}; fi %files %defattr(-,root,root) %doc $RPM_BUILD_DIR/%{name}-%{version}/doc/* %doc $RPM_BUILD_DIR/%{name}-%{version}/AUTHORS %doc $RPM_BUILD_DIR/%{name}-%{version}/ChangeLog %doc $RPM_BUILD_DIR/%{name}-%{version}/COPYING %doc $RPM_BUILD_DIR/%{name}-%{version}/INSTALL %doc $RPM_BUILD_DIR/%{name}-%{version}/NEWS %doc $RPM_BUILD_DIR/%{name}-%{version}/README /sbin /lib/alat /etc/rc.d/init.d /etc/sysconfig %{_mandir}/man5 %{_mandir}/man8 %changelog * Fri Oct 19 2001 Florin Andrei <fl...@sg...> - fixed a buglet related to permissions of /etc/sysconfig/msyslog (chmod 644) * Thu Aug 09 2001 Florin Andrei <fl...@sg...> - modified msyslog.init to source functions from the right directory - (as suggested by Hugh Bragg <hb...@ep...>) * Tue Jul 31 2001 Florin Andrei <fl...@sg...> - version 1.07-1 * Thu Jul 26 2001 Florin Andrei <fl...@sg...> - version 1.06-2 - modified "Provides" so that now sysklogd can be removed without trouble - fixed some bugs in specfile that prevented src.rpm to include some files - removed RPM-CONFIGURE from the documentation directory (pointless) - now src.rpm can be rebuilt without failing :-) * Wed Jul 25 2001 Florin Andrei <fl...@sg...> - first version of the package (1.06-1) --- NEW FILE: msyslog.spec.in --- Summary: A daemon for the syslog system log interface Name: msyslog Version: @MSYSLOG_VERSION@ Release: 1 Serial: 1 Group: System Environment/Daemons License: BSD URL: http://www.core-sdi.com/english/freesoft.html Packager: Florin Andrei <fl...@sg...> Source: %{name}-%{version}.tgz Source2: msyslog.init Source3: msyslog.sysconfig Buildroot: %{_tmppath}/%{name}-%{version}-root Provides: msyslog sysklogd %description This project is intended as a whole revision of previous Secure Syslogd project (wich is unsupported by now). It has all functionalities and some more. The remaining things are Solaris support and Audit compatibility (on the works). The whole internal structure was redesigned to work with input and output modules, standarizing interfaces to facilitate development for using special devices and flexible configurations. Current available output modules are classic, mysql, peo, pgsql, regex and tcp. Available input modules are bsd, linux, unix, tcp and udp. %prep %setup -n %{name}-%{version} %build ./configure --prefix=/ make clean; make gzip src/man/*.5 gzip src/man/*.8 %install if [ -d $RPM_BUILD_ROOT ]; then rm -r $RPM_BUILD_ROOT; fi mkdir -p $RPM_BUILD_ROOT/sbin mkdir -p $RPM_BUILD_ROOT/lib/alat mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man5 mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man8 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d mkdir -p $RPM_BUILD_ROOT/etc/sysconfig # binary files install -m 755 $RPM_BUILD_DIR/%{name}-%{version}/src/syslogd $RPM_BUILD_ROOT/sbin/msyslogd # # FIX THIS!!! # #install -m 755 $RPM_BUILD_DIR/%{name}-%{version}/src/modules/libmsyslog.so.%{version} $RPM_BUILD_ROOT/lib/alat install -m 755 $RPM_BUILD_DIR/%{name}-%{version}/src/modules/libmsyslog.so.1.08 $RPM_BUILD_ROOT/lib/alat # # # install -m 755 $RPM_BUILD_DIR/%{name}-%{version}/src/peo/peochk $RPM_BUILD_ROOT/sbin # initialization and configuration files install -m 755 $RPM_SOURCE_DIR/msyslog.init $RPM_BUILD_ROOT/etc/rc.d/init.d/msyslog install -m 644 $RPM_SOURCE_DIR/msyslog.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/msyslog install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/syslog.conf.5.gz $RPM_BUILD_ROOT/%{_mandir}/man5/msyslogd.conf.5.gz # man pages install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/im_bsd.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/im_doors.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/im_linux.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/im_streams.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/im_tcp.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/im_udp.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/im_unix.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/om_classic.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/om_mysql.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/om_peo.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/om_pgsql.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/om_regex.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/om_tcp.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/peochk.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8 install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/src/man/syslogd.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8/msyslogd.8.gz %clean if [ -d $RPM_BUILD_ROOT ]; then rm -rf $RPM_BUILD_ROOT; fi if [ -d $RPM_BUILD_DIR/%{name}-%{version} ]; then rm -rf $RPM_BUILD_DIR/%{name}-%{version}; fi %files %defattr(-,root,root) %doc $RPM_BUILD_DIR/%{name}-%{version}/doc/* %doc $RPM_BUILD_DIR/%{name}-%{version}/AUTHORS %doc $RPM_BUILD_DIR/%{name}-%{version}/ChangeLog %doc $RPM_BUILD_DIR/%{name}-%{version}/COPYING %doc $RPM_BUILD_DIR/%{name}-%{version}/INSTALL %doc $RPM_BUILD_DIR/%{name}-%{version}/NEWS %doc $RPM_BUILD_DIR/%{name}-%{version}/README /sbin /lib/alat /etc/rc.d/init.d /etc/sysconfig %{_mandir}/man5 %{_mandir}/man8 %changelog * Fri Oct 19 2001 Florin Andrei <fl...@sg...> - fixed a buglet related to permissions of /etc/sysconfig/msyslog (chmod 644) * Thu Aug 09 2001 Florin Andrei <fl...@sg...> - modified msyslog.init to source functions from the right directory - (as suggested by Hugh Bragg <hb...@ep...>) * Tue Jul 31 2001 Florin Andrei <fl...@sg...> - version 1.07-1 * Thu Jul 26 2001 Florin Andrei <fl...@sg...> - version 1.06-2 - modified "Provides" so that now sysklogd can be removed without trouble - fixed some bugs in specfile that prevented src.rpm to include some files - removed RPM-CONFIGURE from the documentation directory (pointless) - now src.rpm can be rebuilt without failing :-) * Wed Jul 25 2001 Florin Andrei <fl...@sg...> - first version of the package (1.06-1) --- NEW FILE: msyslog.sysconfig --- CONFIG="" # example: "-f /etc/syslog.conf" DEBUG="" # example: "-d 20" MARK="" # example: "-m 20" IM_BSD="" # example: "-i bsd" IM_DOORS="" # example: "-i doors" IM_LINUX="-i linux" # example: "-i linux" IM_STREAMS="" # example: "-i streams" IM_TCP="" # example: "-i tcp accepted.host.com 514" IM_UDP="" # example: "-i udp:514" IM_UNIX="-i unix" # example: "-i unix" # Look in the im_*.8 man pages for more details on these options |
From: <al...@us...> - 2003-04-11 16:42:58
|
Update of /cvsroot/msyslog/syslog/packaging/OpenBSD-devel/pkg In directory sc8-pr-cvs1:/tmp/cvs-serv3779/packaging/OpenBSD-devel/pkg Added Files: Tag: v1_08 DESCR PLIST Log Message: add packaging directory from 1.08e too --- NEW FILE: DESCR --- Modular syslog daemon reads and logs messages to the system console, log files, other machines and/or users as specified by its configuration file. Several input and output modules are provided (with features like log integrity checking -peo protocol-, output to postgresql, mysql, etc). It is based on the OpenBSD's syslog daemon. This package is intended for developers who want to build msyslog modules. WWW: ${HOMEPAGE} --- NEW FILE: PLIST --- @comment $CoreSDI: PLIST,v 1.1 2002/02/06 19:42:53 claudio Exp $ include/msyslog/config.h include/msyslog/modules.h include/msyslog/syslogd.h share/doc/msyslog/COPYING share/doc/msyslog/HOW_TO_WRITE_A_MODULE share/doc/msyslog/im_mymodule.c share/doc/msyslog/om_mymodule.c share/doc/msyslog/syslog.conf.classic share/doc/msyslog/syslog.conf.mysql share/doc/msyslog/syslog.conf.peo share/doc/msyslog/syslog.conf.pgsql share/doc/msyslog/syslog.conf.regex @dirrm share/doc/msyslog @dirrm include/msyslog |
From: <al...@us...> - 2003-04-11 16:42:57
|
Update of /cvsroot/msyslog/syslog/packaging/OpenBSD-devel In directory sc8-pr-cvs1:/tmp/cvs-serv3779/packaging/OpenBSD-devel Added Files: Tag: v1_08 Makefile.in Log Message: add packaging directory from 1.08e too --- NEW FILE: Makefile.in --- # $CoreSDI: Makefile.in,v 1.2 2002/02/06 23:03:35 claudio Exp $ # # Copyright (c) 2001, 2002, Core SDI S.A., Argentina # All rights reserved # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. Neither name of the Core SDI S.A. nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # COMMENT= "modular syslog modules developer files" VERSION= @MSYSLOG_VERSION@ DISTNAME= msyslog-v${VERSION} DISTFILES= ${DISTNAME}-src.tar.gz PKGNAME= msyslog-devel-${VERSION} CATEGORIES= devel security sysutils NEED_VERSION= 1.264 MASTER_SITES= ftp://openbsd.org.ar/pub/msyslog/ HOMEPAGE= http://www.corest.com/solutions/products.html MAINTAINER= cor...@co... # BSD PERMIT_PACKAGE_CDROM= Yes PERMIT_PACKAGE_FTP= Yes PERMIT_DISTFILES_CDROM= Yes PERMIT_DISTFILES_FTP= Yes CONFIGURE_STYLE= gnu do-build: do-install: ${INSTALL_DATA_DIR} ${PREFIX}/include/msyslog ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/msyslog ${INSTALL_DATA} ${WRKSRC}/src/*.h ${PREFIX}/include/msyslog ${INSTALL_DATA} ${WRKSRC}/src/examples/* ${WRKSRC}/COPYING \ ${WRKSRC}/doc/HOW_TO_WRITE_A_MODULE ${PREFIX}/share/doc/msyslog .include <bsd.port.mk> |
From: <al...@us...> - 2003-04-11 16:42:57
|
Update of /cvsroot/msyslog/syslog/packaging/OpenBSD/pkg In directory sc8-pr-cvs1:/tmp/cvs-serv3779/packaging/OpenBSD/pkg Added Files: Tag: v1_08 DESCR PLIST PLIST.in Log Message: add packaging directory from 1.08e too --- NEW FILE: DESCR --- Modular syslog daemon reads and logs messages to the system console, log files, other machines and/or users as specified by its configuration file. Several input and output modules are provided (with features like log integrity checking -peo protocol-, output to postgresql, mysql, etc). It is based on the OpenBSD's syslog daemon. WWW: ${HOMEPAGE} --- NEW FILE: PLIST --- @comment $CoreSDI: PLIST.in,v 1.1 2002/02/06 20:17:14 claudio Exp $ lib/alat/libmsyslog.so.1.08e man/cat5/syslog.conf.cat5 man/cat8/im_bsd.cat8 man/cat8/im_file.cat8 man/cat8/im_tcp.cat8 man/cat8/im_udp.cat8 man/cat8/im_unix.cat8 man/cat8/msyslogd.cat8 man/cat8/om_classic.cat8 man/cat8/om_mysql.cat8 man/cat8/om_peo.cat8 man/cat8/om_pgsql.cat8 man/cat8/om_regex.cat8 man/cat8/om_tcp.cat8 man/cat8/om_udp.cat8 man/cat8/peochk.cat8 sbin/msyslogd sbin/peochk @dirrm lib/alat --- NEW FILE: PLIST.in --- @comment $CoreSDI: PLIST.in,v 1.1 2002/02/06 20:17:14 claudio Exp $ lib/alat/libmsyslog.so.@MSYSLOG_VERSION@ man/cat5/syslog.conf.cat5 man/cat8/im_bsd.cat8 man/cat8/im_file.cat8 man/cat8/im_tcp.cat8 man/cat8/im_udp.cat8 man/cat8/im_unix.cat8 man/cat8/msyslogd.cat8 man/cat8/om_classic.cat8 man/cat8/om_mysql.cat8 man/cat8/om_peo.cat8 man/cat8/om_pgsql.cat8 man/cat8/om_regex.cat8 man/cat8/om_tcp.cat8 man/cat8/om_udp.cat8 man/cat8/peochk.cat8 sbin/msyslogd sbin/peochk @dirrm lib/alat |
From: <al...@us...> - 2003-04-11 16:42:52
|
Update of /cvsroot/msyslog/syslog/packaging/OpenBSD In directory sc8-pr-cvs1:/tmp/cvs-serv3779/packaging/OpenBSD Added Files: Tag: v1_08 Makefile.in Log Message: add packaging directory from 1.08e too --- NEW FILE: Makefile.in --- # $CoreSDI: Makefile.in,v 1.3 2002/02/06 23:03:34 claudio Exp $ # # Copyright (c) 2001, 2002, Core SDI S.A., Argentina # All rights reserved # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. Neither name of the Core SDI S.A. nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # COMMENT= "modular syslog daemon" VERSION= @MSYSLOG_VERSION@ DISTNAME= msyslog-v${VERSION} DISTFILES= ${DISTNAME}-src.tar.gz PKGNAME= msyslog-${VERSION} CATEGORIES= security sysutils NEED_VERSION= 1.264 MASTER_SITES= ftp://openbsd.org.ar/pub/msyslog/ HOMEPAGE= http://www.corest.com/solutions/products.html MAINTAINER= cor...@co... # BSD PERMIT_PACKAGE_CDROM= Yes PERMIT_PACKAGE_FTP= Yes PERMIT_DISTFILES_CDROM= Yes PERMIT_DISTFILES_FTP= Yes CONFIGURE_STYLE= gnu do-install: ${INSTALL_PROGRAM} ${WRKSRC}/src/syslogd ${PREFIX}/sbin/msyslogd ${INSTALL_MAN_DIR} ${PREFIX}/man/cat5 ${PREFIX}/man/cat8 ${INSTALL_PROGRAM} ${WRKSRC}/src/peo/peochk ${PREFIX}/sbin ${INSTALL_MAN} ${WRKSRC}/src/man/*cat5 ${PREFIX}/man/cat5 ${INSTALL_MAN} ${WRKSRC}/src/man/syslogd.cat8 \ ${PREFIX}/man/cat8/msyslogd.cat8 ${INSTALL_MAN} ${WRKSRC}/src/man/peochk.cat8 ${PREFIX}/man/cat8/ ${INSTALL_MAN} ${WRKSRC}/src/man/im*cat8 ${WRKSRC}/src/man/om*cat8 \ ${PREFIX}/man/cat8/ ${INSTALL_DATA_DIR} ${PREFIX}/lib/alat ${INSTALL_DATA} ${WRKSRC}/src/modules/libmsyslog.so.${VERSION} \ ${PREFIX}/lib/alat .include <bsd.port.mk> |
From: <al...@us...> - 2003-04-11 16:42:51
|
Update of /cvsroot/msyslog/syslog/packaging In directory sc8-pr-cvs1:/tmp/cvs-serv3779/packaging Added Files: Tag: v1_08 Makefile.in Log Message: add packaging directory from 1.08e too --- NEW FILE: Makefile.in --- # $CoreSDI: Makefile.in,v 1.9 2002/02/19 22:40:58 alejo Exp $ # # Copyright (c) 2001, 2002, Core SDI S.A., Argentina # All rights reserved # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. Neither name of the Core SDI S.A. nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # SUBDIRS= OpenBSD OpenBSD-devel MSYSLOG_VERSION= @MSYSLOG_VERSION@ PORT_PREFIX= msyslog_port all: ports port ports: checkports .for i in ${SUBDIRS} @cd ${i} && make clean && ${MAKE} DISTDIR=../.. makesum && \ cd - && tar -z -c -s \ '/${i}/${PORT_PREFIX}${i:S/OpenBSD//}-${MSYSLOG_VERSION}/' \ -f ../${PORT_PREFIX}${i:S/OpenBSD//}-${MSYSLOG_VERSION}.tgz \ `find ${i}/ -type f | egrep -v "Makefile.in|CVS|PLIST.in"` && \ echo ${i} port tarball created at ${PORT_PREFIX}${i:S/OpenBSD//}-${MSYSLOG_VERSION}.tgz .endfor checkports: @if ! test -e /usr/ports/infrastructure/mk/bsd.port.mk; \ then echo "Missing OpenBSD ports tree."; exit 1; fi port-clean clean: .for i in ${SUBDIRS} @-cd ${i} && make clean -rm -rf ../${PORT_PREFIX}${i:S/OpenBSD//}-${MSYSLOG_VERSION}.tgz .endfor port-distclean distclean: clean -rm -rf Makefile OpenBSD/pkg/PLIST .for i in ${SUBDIRS} -rm -rf ${i}/Makefile ${i}/files .endfor |
Update of /cvsroot/msyslog/syslog/src/man In directory sc8-pr-cvs1:/tmp/cvs-serv30672/src/man Modified Files: Tag: v1_08 BSDmakefile.in GNUmakefile.in Makefile.in im_bsd.8 im_doors.8 im_linux.8 im_streams.8 im_tcp.8 im_udp.8 im_unix.8 om_classic.8 om_mysql.8 om_peo.8 om_pgsql.8 om_regex.8 om_tcp.8 om_udp.8 peochk.8 syslog.conf.5 syslogd.8 Added Files: Tag: v1_08 im_file.8 Log Message: start to fix the mess. 1.08e was not tagged. 1.08 did not contain 1.08e's changes so now 1.08 should be == to 1.08e 1.08f tag is BUSTED now shoud fix BO and some stuff, and tag 1.08g another lesson to self, always be thorogh w/ dealing w/ cvs --- NEW FILE: im_file.8 --- .\" $CoreSDI: im_file.8,v 1.1 2001/11/06 22:59:18 alejo Exp $ .\" .\" Copyright (c) 2000, 2001 .\" Core-SDI SA. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. Neither the name of Core-SDI SA nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .Dd Nov 06, 2001 .Dt IM_FILE 8 .Os Core-SDI .Sh NAME .Nm FILE input module .Nd .Xr syslogd 8 input module for reading files and pipes .Sh SYNOPSIS .Nm file .Op Fl f Ar path .Op Fl p Ar path .Op Fl n Ar program .Sh DESCRIPTION Reads the log messages from a file/pipe writen by another program for processing by the .Xr syslogd 8 daemon. It's options are: .Bl -tag -width Ds .It Ar log_socket Socket to use, default is /dev/log. .Sh EXAMPLES .Bl -bullet .It The following command installs .Xr syslogd 8 daemon reading from file /some/path: .Pp .Dl syslogd -i 'file -f /some/path' .El .Bl -bullet .It Same as above, but sets the name to 'myapp': .Pp .Dl syslogd -i 'file -n myapp -f /some/path' .El .Bl -bullet .It Same as above, but on /some/named/pipe pipe instead of the file: .Pp .Dl syslogd -i 'file -n myapp -p /some/named/pipe' .El .Sh SEE ALSO .Xr syslog 3 , .Xr im_bsd 8 , .Xr im_doors 8 , .Xr im_linux 8 , .Xr im_streams 8 , .Xr im_tcp 8 , .Xr im_udp 8 , .Xr syslogd 8 .Sh BUGS .Bl -bullet .It Submit bugs at this project's Sourceforge Bug reporting system at: http://sourceforge.net/tracker/?func=add&group_id=25741&atid=385117 You may also report them directly to the authors; send an email to cor...@co..., describing the problem the most you can, containing also machine description, hardware description, the configuration file (/etc/syslog.conf), the OS description, and the invoking command line. The more you describe the bug, the faster we can fix it. .El Index: BSDmakefile.in =================================================================== RCS file: /cvsroot/msyslog/syslog/src/man/BSDmakefile.in,v retrieving revision 1.10 retrieving revision 1.10.2.1 diff -u -d -r1.10 -r1.10.2.1 --- BSDmakefile.in 7 Mar 2001 21:35:13 -0000 1.10 +++ BSDmakefile.in 11 Apr 2003 16:36:31 -0000 1.10.2.1 @@ -1,4 +1,4 @@ -# $CoreSDI: BSDmakefile.in,v 1.9 2000/11/15 18:44:27 alejo Exp $ +# $CoreSDI: BSDmakefile.in,v 1.10 2001/03/07 21:35:13 alejo Exp $ # # Copyright (c) 2001, Core SDI S.A., Argentina # All rights reserved Index: GNUmakefile.in =================================================================== RCS file: /cvsroot/msyslog/syslog/src/man/GNUmakefile.in,v retrieving revision 1.19 retrieving revision 1.19.2.1 diff -u -d -r1.19 -r1.19.2.1 --- GNUmakefile.in 20 Sep 2001 01:04:54 -0000 1.19 +++ GNUmakefile.in 11 Apr 2003 16:36:31 -0000 1.19.2.1 @@ -1,4 +1,4 @@ -# $CoreSDI: GNUmakefile.in,v 1.18 2001/09/20 00:12:38 alejo Exp $ +# $CoreSDI: GNUmakefile.in,v 1.20 2001/11/20 00:48:41 alejo Exp $ # # Copyright (c) 2001, Core SDI S.A., Argentina # All rights reserved @@ -41,7 +41,7 @@ $(OMAN): @if [ ! -d $(MANDIR)/man$(subst .,,$(suffix $(@:%.gz=%)))/ ]; then \ - $(INSTALL) -d $(MANDIR)/man$(subst .,,$(suffix $(@:%.gz=%)))/ ;\ + mkdir -p $(MANDIR)/man$(subst .,,$(suffix $(@:%.gz=%)))/ ;\ fi -gzip -cf $(@:%.gz=%) > $(MANDIR)/man$(subst .,,$(suffix $(@:%.gz=%)))/$@ Index: Makefile.in =================================================================== RCS file: /cvsroot/msyslog/syslog/src/man/Makefile.in,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -u -d -r1.8 -r1.8.2.1 --- Makefile.in 24 May 2001 01:46:23 -0000 1.8 +++ Makefile.in 11 Apr 2003 16:36:31 -0000 1.8.2.1 @@ -1,4 +1,4 @@ -# $CoreSDI: Makefile.in,v 1.7 2001/05/24 01:38:13 alejo Exp $ +# $CoreSDI: Makefile.in,v 1.9 2001/11/20 00:48:41 alejo Exp $ # # Copyright (c) 2001, Core SDI S.A., Argentina # All rights reserved @@ -40,8 +40,8 @@ install maninstall: $(OMAN) $(OMAN): - @if [ ! -d $(MANDIR) ]; then \ - $(INSTALL) -d $(MANDIR); \ + @if [ ! -d $(MANDIR)/man$(subst .,,$(suffix $(@:%.gz=%))) ]; then \ + mkdir -p $(MANDIR)/man$(subst .,,$(suffix $(@:%.gz=%))); \ fi -gzip -cf $(@:%.gz=%) > $(MANDIR)/man$(subst .,,$(suffix $(@:%.gz=%)))/$@ Index: im_bsd.8 =================================================================== RCS file: /cvsroot/msyslog/syslog/src/man/im_bsd.8,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- im_bsd.8 18 Oct 2001 21:19:12 -0000 1.3 +++ im_bsd.8 11 Apr 2003 16:36:32 -0000 1.3.2.1 @@ -1,4 +1,4 @@ -.\" $CoreSDI: im_bsd.8,v 1.2 2001/10/18 20:32:35 alejo Exp $ +.\" $CoreSDI: im_bsd.8,v 1.4 2001/11/06 23:08:52 alejo Exp $ .\" .\" Copyright (c) 2000, 2001 .\" Core-SDI SA. All rights reserved. @@ -53,14 +53,14 @@ .Pp .Sh SEE ALSO .Xr syslog 3 , -.Xr syslog.conf.5 , -.Xr im_doors.8 , -.Xr im_linux.8 , -.Xr im_streams.8 , -.Xr im_tcp.8 , -.Xr im_unix.8 , -.Xr im_udp.8 , -.Xr syslogd.8 +.Xr syslog.conf 5 , +.Xr im_doors 8 , +.Xr im_linux 8 , +.Xr im_streams 8 , +.Xr im_tcp 8 , +.Xr im_unix 8 , +.Xr im_udp 8 , +.Xr syslogd 8 .Sh BUGS .Bl -bullet .It Index: im_doors.8 =================================================================== RCS file: /cvsroot/msyslog/syslog/src/man/im_doors.8,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- im_doors.8 18 Oct 2001 21:19:12 -0000 1.3 +++ im_doors.8 11 Apr 2003 16:36:32 -0000 1.3.2.1 @@ -1,4 +1,4 @@ -.\" $CoreSDI: im_doors.8,v 1.2 2001/03/07 21:35:13 alejo Exp $ +.\" $CoreSDI: im_doors.8,v 1.3 2001/10/18 21:19:12 alejo Exp $ .\" .\" Copyright (c) 2001 .\" Core-SDI SA. All rights reserved. Index: im_linux.8 =================================================================== RCS file: /cvsroot/msyslog/syslog/src/man/im_linux.8,v retrieving revision 1.15 retrieving revision 1.15.2.1 diff -u -d -r1.15 -r1.15.2.1 --- im_linux.8 18 Oct 2001 21:19:12 -0000 1.15 +++ im_linux.8 11 Apr 2003 16:36:32 -0000 1.15.2.1 @@ -1,4 +1,4 @@ -.\" $CoreSDI: im_linux.8,v 1.14 2001/10/18 20:32:35 alejo Exp $ +.\" $CoreSDI: im_linux.8,v 1.16 2001/11/06 23:08:52 alejo Exp $ .\" .\" Copyright (c) 2001 .\" Core-SDI SA. All rights reserved. @@ -86,13 +86,13 @@ .Pp .Sh SEE ALSO .Xr syslog 3 , -.Xr im_bsd.8 , -.Xr im_doors.8 , -.Xr im_streams.8 , -.Xr im_tcp.8 , -.Xr im_unix.8 , -.Xr im_udp.8 , -.Xr syslogd.8 +.Xr im_bsd 8 , +.Xr im_doors 8 , +.Xr im_streams 8 , +.Xr im_tcp 8 , +.Xr im_unix 8 , +.Xr im_udp 8 , +.Xr syslogd 8 .Sh BUGS .Bl -bullet .It Index: im_streams.8 =================================================================== RCS file: /cvsroot/msyslog/syslog/src/man/im_streams.8,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- im_streams.8 18 Oct 2001 21:19:12 -0000 1.3 +++ im_streams.8 11 Apr 2003 16:36:32 -0000 1.3.2.1 @@ -1,4 +1,4 @@ -.\" $CoreSDI: im_streams.8,v 1.2 2001/03/07 21:35:13 alejo Exp $ +.\" $CoreSDI: im_streams.8,v 1.4 2001/11/06 23:08:52 alejo Exp $ .\" .\" Copyright (c) 2001 .\" Core-SDI SA. All rights reserved. @@ -60,13 +60,13 @@ .Pp .Sh SEE ALSO .Xr syslog 3 , -.Xr im_bsd.8 , -.Xr im_doors.8 , -.Xr im_linux.8 , -.Xr im_tcp.8 , -.Xr im_unix.8 , -.Xr im_udp.8 , -.Xr syslogd.8 +.Xr im_bsd 8 , +.Xr im_doors 8 , +.Xr im_linux 8 , +.Xr im_tcp 8 , +.Xr im_unix 8 , +.Xr im_udp 8 , +.Xr syslogd 8 .Sh BUGS .Bl -bullet .It Index: im_tcp.8 =================================================================== RCS file: /cvsroot/msyslog/syslog/src/man/im_tcp.8,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -u -d -r1.9 -r1.9.2.1 --- im_tcp.8 18 Oct 2001 21:35:35 -0000 1.9 +++ im_tcp.8 11 Apr 2003 16:36:32 -0000 1.9.2.1 @@ -1,4 +1,4 @@ -.\" $CoreSDI: im_tcp.8,v 1.8 2001/10/18 21:19:12 alejo Exp $ +.\" $CoreSDI: im_tcp.8,v 1.10 2001/11/06 23:08:52 alejo Exp $ .\" .\" Copyright (c) 2001 .\" Core-SDI SA. All rights reserved. @@ -93,11 +93,11 @@ .El .Sh SEE ALSO .Xr syslog 3 , -.Xr im_bsd.8 , -.Xr im_doors.8 , -.Xr im_linux.8 , -.Xr im_streams.8 , -.Xr im_unix.8 , -.Xr im_udp.8 , -.Xr om_tcp.8 , -.Xr syslogd.8 +.Xr im_bsd 8 , +.Xr im_doors 8 , +.Xr im_linux 8 , +.Xr im_streams 8 , +.Xr im_unix 8 , +.Xr im_udp 8 , +.Xr om_tcp 8 , +.Xr syslogd 8 Index: im_udp.8 =================================================================== RCS file: /cvsroot/msyslog/syslog/src/man/im_udp.8,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -d -r1.4 -r1.4.2.1 --- im_udp.8 18 Oct 2001 21:19:12 -0000 1.4 +++ im_udp.8 11 Apr 2003 16:36:32 -0000 1.4.2.1 @@ -1,4 +1,4 @@ -.\" $CoreSDI: im_udp.8,v 1.3 2001/10/18 20:32:35 alejo Exp $ +.\" $CoreSDI: im_udp.8,v 1.6 2001/11/06 23:08:53 alejo Exp $ .\" .\" Copyright (c) 2000, 2001 .\" Core-SDI SA. All rights reserved. @@ -38,6 +38,7 @@ .Sh SYNOPSIS .Nm udp .Op Fl a +.Op Fl q .Op Fl h Ar host .Op Fl p Ar port .Sh DESCRIPTION @@ -57,25 +58,30 @@ This does the same as above, but listens on address local.example.com port 1777 instead: .Pp -.Dl syslogd -h local.example.com -i udp:1777 +.Dl syslogd -i udp '-h local.example.com -p 1777' .El .Pp .Bl -bullet .It This does the same as above, but gets host name from message: .Pp -.Dl syslogd -i udp:1777 +.Dl syslogd -i udp '-a -h local.example.com -p 1777' .El +.Bl -bullet +.It +The following is the same, but avoids adding full fomain (FQDN): +.Pp +.Dl syslogd -i 'udp -q -a -h local.example.com -p 1777' .Pp .Sh SEE ALSO .Xr syslog 3 , -.Xr im_bsd.8 , -.Xr im_doors.8 , -.Xr im_linux.8 , -.Xr im_streams.8 , -.Xr im_tcp.8 , -.Xr im_unix.8 , -.Xr syslogd.8 +.Xr im_bsd 8 , +.Xr im_doors 8 , +.Xr im_linux 8 , +.Xr im_streams 8 , +.Xr im_tcp 8 , +.Xr im_unix 8 , +.Xr syslogd 8 .Sh BUGS .Bl -bullet .It Index: im_unix.8 =================================================================== RCS file: /cvsroot/msyslog/syslog/src/man/im_unix.8,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- im_unix.8 18 Oct 2001 21:19:12 -0000 1.3 +++ im_unix.8 11 Apr 2003 16:36:32 -0000 1.3.2.1 @@ -1,4 +1,4 @@ -.\" $CoreSDI: im_unix.8,v 1.2 2001/10/18 20:32:35 alejo Exp $ +.\" $CoreSDI: im_unix.8,v 1.5 2001/12/07 21:12:29 alejo Exp $ .\" .\" Copyright (c) 2000, 2001 .\" Core-SDI SA. All rights reserved. @@ -57,18 +57,18 @@ .Dl syslogd -i unix .It or reading from /some/log_device: -.Dl syslogd -i unix:/some/log_device +.Dl syslogd -i 'unix /some/log_device' .El .Pp .Sh SEE ALSO .Xr syslog 3 , -.Xr im_bsd.8 , -.Xr im_doors.8 , -.Xr im_linux.8 , -.Xr im_streams.8 , -.Xr im_tcp.8 , -.Xr im_udp.8 , -.Xr syslogd.8 +.Xr im_bsd 8 , +.Xr im_doors 8 , +.Xr im_linux 8 , +.Xr im_streams 8 , +.Xr im_tcp 8 , +.Xr im_udp 8 , +.Xr syslogd 8 .Sh BUGS .Bl -bullet .It Index: om_classic.8 =================================================================== RCS file: /cvsroot/msyslog/syslog/src/man/om_classic.8,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- om_classic.8 18 Oct 2001 21:19:12 -0000 1.3 +++ om_classic.8 11 Apr 2003 16:36:32 -0000 1.3.2.1 @@ -1,4 +1,4 @@ -.\" $CoreSDI: om_classic.8,v 1.2 2001/10/18 20:32:35 alejo Exp $ +.\" $CoreSDI: om_classic.8,v 1.4 2001/11/06 23:08:53 alejo Exp $ .\" .\" Copyright (c) 2000, 2001 .\" Core-SDI SA. All rights reserved. @@ -79,15 +79,15 @@ .Pp .Sh SEE ALSO .Xr syslog 3 , -.Xr syslog.conf.5 , -.Xr om_mysql.8 , -.Xr om_peo.8 , -.Xr om_pgsql.8 , -.Xr om_regex.8 , -.Xr om_tcp.8 , -.Xr om_udp.8 , -.Xr peochk.8 , -.Xr syslogd.8 +.Xr syslog.conf 5 , +.Xr om_mysql 8 , +.Xr om_peo 8 , +.Xr om_pgsql 8 , +.Xr om_regex 8 , +.Xr om_tcp 8 , +.Xr om_udp 8 , +.Xr peochk 8 , +.Xr syslogd 8 .Sh BUGS .Bl -bullet .It Index: om_mysql.8 =================================================================== RCS file: /cvsroot/msyslog/syslog/src/man/om_mysql.8,v retrieving revision 1.21 retrieving revision 1.21.2.1 diff -u -d -r1.21 -r1.21.2.1 --- om_mysql.8 26 Oct 2001 01:10:32 -0000 1.21 +++ om_mysql.8 11 Apr 2003 16:36:32 -0000 1.21.2.1 @@ -1,4 +1,4 @@ -.\" $CoreSDI: om_mysql.8,v 1.20 2001/10/22 22:45:55 alejo Exp $ +.\" $CoreSDI: om_mysql.8,v 1.22 2001/11/06 23:08:53 alejo Exp $ .\" .\" Copyright (c) 2001 .\" Core-SDI SA. All rights reserved. @@ -96,15 +96,15 @@ features. .Sh SEE ALSO .Xr syslog 3 , -.Xr syslog.conf.5 , -.Xr om_classic.8 , -.Xr om_peo.8 , -.Xr om_pgsql.8 , -.Xr om_regex.8 , -.Xr om_tcp.8 , -.Xr om_udp.8 , -.Xr peochk.8 , -.Xr syslogd.8 +.Xr syslog.conf 5 , +.Xr om_classic 8 , +.Xr om_peo 8 , +.Xr om_pgsql 8 , +.Xr om_regex 8 , +.Xr om_tcp 8 , +.Xr om_udp 8 , +.Xr peochk 8 , +.Xr syslogd 8 .Sh BUGS .Bl -bullet .It Index: om_peo.8 =================================================================== RCS file: /cvsroot/msyslog/syslog/src/man/om_peo.8,v retrieving revision 1.20 retrieving revision 1.20.2.1 diff -u -d -r1.20 -r1.20.2.1 --- om_peo.8 23 Oct 2001 19:03:31 -0000 1.20 +++ om_peo.8 11 Apr 2003 16:36:32 -0000 1.20.2.1 @@ -1,4 +1,4 @@ -.\" $CoreSDI: om_peo.8,v 1.19 2001/10/18 21:19:12 alejo Exp $ +.\" $CoreSDI: om_peo.8,v 1.22 2001/11/17 00:41:19 alejo Exp $ .\" .\" Copyright (c) 2001 .\" Core-SDI SA. All rights reserved. @@ -46,11 +46,7 @@ .Em hash key based on the last one generated for the previous message; the module removes the last key and writes the new one into -.Ar keyfile -. NOTE: it needs a random device (/dev/srandom or /dev/random); if your -operating system lacks both, you should use some random number generator -device such as "prngd" or some extra package from your os vendor. -.Pp +.Ar keyfile . This module's options are as follows: .Bl -tag -width Ds .It Fl k Ar keyfile @@ -97,15 +93,15 @@ .Sh SEE ALSO .Li Vcr and Peo Revised documentation - http://www.corest.com/papers/peo.ps .Xr syslog 3 , -.Xr syslog.conf.5 , -.Xr om_classic.8 , -.Xr om_mysql.8 , -.Xr om_pgsql.8 , -.Xr om_regex.8 , -.Xr om_tcp.8 , -.Xr om_udp.8 , -.Xr peochk.8 , -.Xr syslogd.8 +.Xr syslog.conf 5 , +.Xr om_classic 8 , +.Xr om_mysql 8 , +.Xr om_pgsql 8 , +.Xr om_regex 8 , +.Xr om_tcp 8 , +.Xr om_udp 8 , +.Xr peochk 8 , +.Xr syslogd 8 .Sh BUGS .Bl -bullet .It Index: om_pgsql.8 =================================================================== RCS file: /cvsroot/msyslog/syslog/src/man/om_pgsql.8,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -u -d -r1.8 -r1.8.2.1 --- om_pgsql.8 18 Oct 2001 21:19:12 -0000 1.8 +++ om_pgsql.8 11 Apr 2003 16:36:32 -0000 1.8.2.1 @@ -1,4 +1,4 @@ -.\" $CoreSDI: om_pgsql.8,v 1.7 2001/10/18 20:32:35 alejo Exp $ +.\" $CoreSDI: om_pgsql.8,v 1.12 2002/03/01 07:31:02 alejo Exp $ .\" .\" Copyright (c) 2001 .\" Core-SDI SA. All rights reserved. @@ -43,7 +43,8 @@ .Op Fl p Ar password .Op Fl d Ar database .Op Fl t Ar table -.Op Fl c +.Op Fl F +.Op Fl P .Sh DESCRIPTION .Nm PostgreSQL output module receives a message as an ascii string and logs it on a PostgreSQL server. For @@ -63,8 +64,10 @@ The database name to use on the specified PostgreSQL server. .It Fl t Ar table The table name to use on the specified PostgreSQL database. -.It Fl c -Create the table. +.It Fl F +Insert the facility level name on the table on a field named "facility" +.It Fl P +Insert the priority level name on the table on a field named "priority" .Sh EXAMPLES Example entry for .Xr syslog.conf 5 @@ -79,11 +82,12 @@ .Pp .Bd -literal CREATE TABLE syslogTB ( - date date, # date of this log message - time time, # time of this message - host varchar(128), # host logging - message text, # message - seq decimal(03) primary key default nextval('serial') # optional sequence number + facility char(10), + priority char(10), + date date, + time time, + host varchar(128), + message text ); .Ed .Pp @@ -94,15 +98,15 @@ can be any text format smaller than 128 and 1024 chars respectively. .Sh SEE ALSO .Xr syslog 3 , -.Xr syslog.conf.5 , -.Xr om_classic.8 , -.Xr om_mysql.8 , -.Xr om_peo.8 , -.Xr om_regex.8 , -.Xr om_tcp.8 , -.Xr om_udp.8 , -.Xr peochk.8 , -.Xr syslogd.8 +.Xr syslog.conf 5 , +.Xr om_classic 8 , +.Xr om_mysql 8 , +.Xr om_peo 8 , +.Xr om_regex 8 , +.Xr om_tcp 8 , +.Xr om_udp 8 , +.Xr peochk 8 , +.Xr syslogd 8 .Sh BUGS .Bl -bullet .It Index: om_regex.8 =================================================================== RCS file: /cvsroot/msyslog/syslog/src/man/om_regex.8,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -u -d -r1.12 -r1.12.2.1 --- om_regex.8 18 Oct 2001 21:19:12 -0000 1.12 +++ om_regex.8 11 Apr 2003 16:36:33 -0000 1.12.2.1 @@ -1,4 +1,4 @@ -.\" $CoreSDI: om_regex.8,v 1.11 2001/10/18 20:32:35 alejo Exp $ +.\" $CoreSDI: om_regex.8,v 1.13 2001/11/06 23:08:53 alejo Exp $ .\" .\" Copyright (c) 2001 .\" Core-SDI SA. All rights reserved. @@ -64,15 +64,15 @@ .Ed .Sh SEE ALSO .Xr syslog 3 , -.Xr syslog.conf.5 , -.Xr om_classic.8 , -.Xr om_mysql.8 , -.Xr om_peo.8 , -.Xr om_pgsql.8 , -.Xr om_tcp.8 , -.Xr om_udp.8 , -.Xr peochk.8 , -.Xr syslogd.8 +.Xr syslog.conf 5 , +.Xr om_classic 8 , +.Xr om_mysql 8 , +.Xr om_peo 8 , +.Xr om_pgsql 8 , +.Xr om_tcp 8 , +.Xr om_udp 8 , +.Xr peochk 8 , +.Xr syslogd 8 .Sh BUGS .Bl -bullet .It Index: om_tcp.8 =================================================================== RCS file: /cvsroot/msyslog/syslog/src/man/om_tcp.8,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -d -r1.7 -r1.7.2.1 --- om_tcp.8 18 Oct 2001 21:35:36 -0000 1.7 +++ om_tcp.8 11 Apr 2003 16:36:34 -0000 1.7.2.1 @@ -1,4 +1,4 @@ -.\" $CoreSDI: om_tcp.8,v 1.6 2001/10/18 21:19:12 alejo Exp $ +.\" $CoreSDI: om_tcp.8,v 1.8 2001/11/06 23:08:53 alejo Exp $ .\" .\" Copyright (c) 2001 .\" Core-SDI SA. All rights reserved. @@ -71,14 +71,14 @@ The more you describe the bug, the faster we can fix it. .El .Sh SEE ALSO -.Xr im_tcp.8 , +.Xr im_tcp 8 , .Xr syslog 3 , -.Xr syslog.conf.5 , -.Xr om_classic.8 , -.Xr om_mysql.8 , -.Xr om_peo.8 , -.Xr om_pgsql.8 , -.Xr om_regex.8 , -.Xr om_udp.8 , -.Xr peochk.8 , -.Xr syslogd.8 +.Xr syslog.conf 5 , +.Xr om_classic 8 , +.Xr om_mysql 8 , +.Xr om_peo 8 , +.Xr om_pgsql 8 , +.Xr om_regex 8 , +.Xr om_udp 8 , +.Xr peochk 8 , +.Xr syslogd 8 Index: om_udp.8 =================================================================== RCS file: /cvsroot/msyslog/syslog/src/man/om_udp.8,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- om_udp.8 18 Oct 2001 21:19:12 -0000 1.3 +++ om_udp.8 11 Apr 2003 16:36:34 -0000 1.3.2.1 @@ -1,4 +1,4 @@ -.\" $CoreSDI: om_udp.8,v 1.2 2001/10/18 20:32:35 alejo Exp $ +.\" $CoreSDI: om_udp.8,v 1.4 2001/11/06 23:08:53 alejo Exp $ .\" .\" Copyright (c) 2001 .\" Core-SDI SA. All rights reserved. @@ -70,12 +70,12 @@ .El .Sh SEE ALSO .Xr syslog 3 , -.Xr syslog.conf.5 , -.Xr om_classic.8 , -.Xr om_mysql.8 , -.Xr om_peo.8 , -.Xr om_pgsql.8 , -.Xr om_regex.8 , -.Xr om_tcp.8 , -.Xr peochk.8 , -.Xr syslogd.8 +.Xr syslog.conf 5 , +.Xr om_classic 8 , +.Xr om_mysql 8 , +.Xr om_peo 8 , +.Xr om_pgsql 8 , +.Xr om_regex 8 , +.Xr om_tcp 8 , +.Xr peochk 8 , +.Xr syslogd 8 Index: peochk.8 =================================================================== RCS file: /cvsroot/msyslog/syslog/src/man/peochk.8,v retrieving revision 1.16 retrieving revision 1.16.2.1 diff -u -d -r1.16 -r1.16.2.1 --- peochk.8 18 Oct 2001 21:19:12 -0000 1.16 +++ peochk.8 11 Apr 2003 16:36:35 -0000 1.16.2.1 @@ -1,4 +1,4 @@ -.\" $CoreSDI: peochk.8,v 1.15 2001/10/18 20:32:35 alejo Exp $ +.\" $CoreSDI: peochk.8,v 1.18 2001/11/20 05:46:42 alejo Exp $ .\" .\" Copyright (c) 2001 .\" Core-SDI SA. All rights reserved. @@ -56,7 +56,7 @@ .It Fl f Ar logfile Specify the pathname of a log file, if .Ar logfile -is not specified using this option, data is readed from standard input +is not specified using this option, data is read from standard input and the pathname is used only to generate reports and/or to obtain the key files pathnames when the .Fl k @@ -180,9 +180,9 @@ ). .El .Sh SEE ALSO -.Xr syslog.conf.5 , -.Xr om_peo.8 , -.Xr syslogd.8 +.Xr syslog.conf 5 , +.Xr om_peo 8 , +.Xr syslogd 8 .Sh BUGS Submit bugs at this project's Sourceforge Bug reporting system at: http://sourceforge.net/tracker/?func=add&group_id=25741&atid=385117 Index: syslog.conf.5 =================================================================== RCS file: /cvsroot/msyslog/syslog/src/man/syslog.conf.5,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -u -d -r1.14 -r1.14.2.1 --- syslog.conf.5 18 Oct 2001 21:19:12 -0000 1.14 +++ syslog.conf.5 11 Apr 2003 16:36:35 -0000 1.14.2.1 @@ -1,4 +1,4 @@ -.\" $CoreSDI: syslog.conf.5,v 1.13 2000/10/31 19:42:13 alejo Exp $ +.\" $CoreSDI: syslog.conf.5,v 1.16 2001/11/14 19:27:27 alejo Exp $ .\" .\" Copyright (c) 1990, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -135,7 +135,12 @@ .Em program , the action specified in the .Em action -field will be taken. +field will be taken. Beware, all rules after it are assigned this program +name, to disable you may add a line with just +.Em #! +or +.Em ! +to make it handle all programs. .Pp Multiple .Em selectors @@ -317,15 +322,15 @@ .El .Sh SEE ALSO .Xr syslog 3 , -.Xr om_classic.8 , -.Xr om_mysql.8 , -.Xr om_peo.8 , -.Xr om_pgsql.8 , -.Xr om_regex.8 , -.Xr om_tcp.8 , -.Xr om_udp.8 , -.Xr peochk.8 , -.Xr syslogd.8 +.Xr om_classic 8 , +.Xr om_mysql 8 , +.Xr om_peo 8 , +.Xr om_pgsql 8 , +.Xr om_regex 8 , +.Xr om_tcp 8 , +.Xr om_udp 8 , +.Xr peochk 8 , +.Xr syslogd 8 .Sh HISTORY The .Nm Index: syslogd.8 =================================================================== RCS file: /cvsroot/msyslog/syslog/src/man/syslogd.8,v retrieving revision 1.20 retrieving revision 1.20.2.1 diff -u -d -r1.20 -r1.20.2.1 --- syslogd.8 24 Oct 2001 03:02:18 -0000 1.20 +++ syslogd.8 11 Apr 2003 16:36:35 -0000 1.20.2.1 @@ -1,4 +1,4 @@ -.\" $CoreSDI: syslogd.8,v 1.19 2001/10/24 02:52:39 alejo Exp $ +.\" $CoreSDI: syslogd.8,v 1.25 2002/01/21 19:26:21 alejo Exp $ .\" .\" Copyright (c) 1983, 1986, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -39,14 +39,17 @@ .Nd log systems messages .Sh SYNOPSIS .Nm syslogd +.Op Fl c .Op Fl u .Op Fl n +.Op Fl A .Op Fl d Ar level .Op Fl f Ar config_file .Op Fl m Ar mark_interval .Op Fl a Ar path .Op Fl p Ar log_socket .Op Fl i Ar input +.Op Fl P Ar pidfile .Sh DESCRIPTION Modular .Nm syslog @@ -63,8 +66,8 @@ is a number used to differentiate error reports. Up to 10 reports all critical errors that stop the daemon from working; up to 20 are the serious errors that stop some input or output; up to 30 are noncritical -errors; up to 100 are warnings and potential errors; up to 100 are informative -messages; and finally up to 200 are all possible reporting on what is going +errors; up to 100 are warnings and potential errors; up to 200 are informative +messages; and finally up to 250 are all possible reporting on what is going on. .It Fl f Ar config_file Specify the pathname of an alternate configuration file; @@ -102,6 +105,10 @@ .Xr im_* 8 . .It Fl n Disables opening default inputs when there aren't given on command line. +.It Fl c +Disables opening console device, useful for non root testing. +.It Fl A +Use local host name with it's domain. .El .Pp .Nm Syslogd @@ -175,23 +182,23 @@ .El .Sh SEE ALSO .Xr syslog 3 , -.Xr syslog.conf.5 , -.Xr im_bsd.8 , -.Xr im_doors.8 , -.Xr im_linux.8 , -.Xr im_streams.8 , -.Xr im_tcp.8 , -.Xr im_unix.8 , -.Xr im_udp.8 , -.Xr om_classic.8 , -.Xr om_mysql.8 , -.Xr om_peo.8 , -.Xr om_pgsql.8 , -.Xr om_regex.8 , -.Xr om_tcp.8 , -.Xr om_udp.8 , -.Xr peochk.8 , -.Xr syslogd.8 +.Xr syslog.conf 5 , +.Xr im_bsd 8 , +.Xr im_doors 8 , +.Xr im_linux 8 , +.Xr im_streams 8 , +.Xr im_tcp 8 , +.Xr im_unix 8 , +.Xr im_udp 8 , +.Xr om_classic 8 , +.Xr om_mysql 8 , +.Xr om_peo 8 , +.Xr om_pgsql 8 , +.Xr om_regex 8 , +.Xr om_tcp 8 , +.Xr om_udp 8 , +.Xr peochk 8 , +.Xr syslogd 8 .Sh HISTORY Modular .Nm |
Update of /cvsroot/msyslog/syslog/src In directory sc8-pr-cvs1:/tmp/cvs-serv30672/src Modified Files: Tag: v1_08 Makefile.in TODO config.h.in modules.c modules.h syslogd.c syslogd.h Added Files: Tag: v1_08 options.c Log Message: start to fix the mess. 1.08e was not tagged. 1.08 did not contain 1.08e's changes so now 1.08 should be == to 1.08e 1.08f tag is BUSTED now shoud fix BO and some stuff, and tag 1.08g another lesson to self, always be thorogh w/ dealing w/ cvs --- NEW FILE: options.c --- /* $CoreSDI: options.c,v 1.4 2002/03/01 08:30:34 alejo Exp $ */ /* Copyright (c) 2001 Core-SDI S.A., all rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by CORE-SDI S.A. and contributors. 4. Neither the name CORE-SDI nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * Modular Syslog generic module configuration functions * * Author: Alejo Sanchez for Core-SDI */ #include "config.h" #include <ctype.h> #include <string.h> /* * getxopt: * ease command line parsing for modules, similar to getopt(3) * use like this * * int cnt = 0; * * while ((ch = getxopt(argc, argv, "p!popt: n:nopt! h!help:", &cnt)) != -1) { * switch (ch): * case 'p': * (void)strlcpy(argpval, argv[cnt], sizeof(argpval)); * break; * case 'n': * ActivateN++; * break; * case 'h': * default: * usage(); * break; * } * cnt++; * } */ int getxopt(int argc, char *argv[], char *opts, int *startarg) { char *a, *s, *e; /* argument, start and end of option */ int argn, len, ch; argn = 0; /* compare all arguments...*/ for (s = opts, argn = *startarg; argn < argc; argn++) { a = argv[argn]; if (*a == '-') { if (*++a == '-') break; } else if (!isalnum((int) *(++a))) break; /* ...with all options */ while (*s) { while (isspace ((int) *s)) s++; if (isalnum((int) *s)) ch = (int) *s; /* new option */ else break; /* no more options */ /* find end of option */ for (e = s; *e && *e != ':' && !isspace((int) *e); e++); do { /* find this name's length */ for (len = 1; s[len] != '!' && &s[len] != e; len++); /* match option length and name */ if (strlen(a) == len && !strncmp(a, s, (size_t) len)) { /* we got a match! */ *startarg = argn; /* needs arg ? */ if (*e == ':') (*startarg)++; return (ch); } if (s[len] == '!') len++; /* start of next name */ s = &s[len]; } while (s != e); /* avance to next option */ if (*s != '\0') s++; } } return (-1); } Index: Makefile.in =================================================================== RCS file: /cvsroot/msyslog/syslog/src/Makefile.in,v retrieving revision 1.54 retrieving revision 1.54.2.1 diff -u -d -r1.54 -r1.54.2.1 --- Makefile.in 24 May 2001 01:38:13 -0000 1.54 +++ Makefile.in 11 Apr 2003 16:36:26 -0000 1.54.2.1 @@ -1,4 +1,4 @@ -# $CoreSDI: Makefile.in,v 1.53 2001/04/28 01:52:18 alejo Exp $ +# $CoreSDI: Makefile.in,v 1.56 2002/03/01 03:38:11 alejo Exp $ # # Copyright (c) 2001, Core SDI S.A., Argentina # All rights reserved @@ -40,7 +40,7 @@ PROG= @MSYSLOG_DAEMON_NAME@ PROG_FLAGS= $(CFLAGS) $(CPPFLAGS) $(LIBS) $(SYSLOGD_LIBS) $(MAIN_CPPFLAGS) -SRCS= modules.c syslogd.c +SRCS= modules.c syslogd.c options.c OBJS= $(SRCS:.c=.o) all: $(PROG) @@ -66,7 +66,7 @@ install-prog: @if [ ! -d $(INSTALL_DIR) ]; then \ - $(INSTALL) -d $(INSTALL_DIR); \ + mkdir -p $(INSTALL_DIR); \ fi @if [ -f "$(INSTALL_DIR)/$(PROG)" ]; then \ mv -f "$(INSTALL_DIR)/$(PROG)" "$(INSTALL_DIR)/$(PROG).old"; \ Index: TODO =================================================================== RCS file: /cvsroot/msyslog/syslog/src/TODO,v retrieving revision 1.85 retrieving revision 1.85.2.1 diff -u -d -r1.85 -r1.85.2.1 --- TODO 27 Apr 2001 20:25:11 -0000 1.85 +++ TODO 11 Apr 2003 16:36:27 -0000 1.85.2.1 @@ -1,4 +1,4 @@ -/* $CoreSDI: TODO,v 1.84 2001/04/27 18:25:08 alejo Exp $ */ +/* $CoreSDI: TODO,v 1.85 2001/04/27 20:25:11 alejo Exp $ */ FOR THIS RELEASE Index: config.h.in =================================================================== RCS file: /cvsroot/msyslog/syslog/src/config.h.in,v retrieving revision 1.33 retrieving revision 1.33.2.1 diff -u -d -r1.33 -r1.33.2.1 --- config.h.in 30 Jul 2001 21:03:06 -0000 1.33 +++ config.h.in 11 Apr 2003 16:36:28 -0000 1.33.2.1 @@ -121,14 +121,13 @@ #undef MLIBNAME -/* #undef MAXHOSTNAMELEN */ -#undef SIZEOF_MAXHOSTNAMELEN - #undef HAVE_SYS_WAIT_H #undef HAVE_GETADDRINFO #undef HAVE_INET_NTOP +#undef HAVE_INET_ATON +#undef HAVE_INET_ADDR #undef HAVE_STREAMS_IMODULE #undef HAVE_LINUX_IMODULE Index: modules.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules.c,v retrieving revision 1.164 retrieving revision 1.164.2.1 diff -u -d -r1.164 -r1.164.2.1 --- modules.c 13 Aug 2002 17:25:12 -0000 1.164 +++ modules.c 11 Apr 2003 16:36:29 -0000 1.164.2.1 @@ -1,4 +1,4 @@ -/* $CoreSDI: modules.c,v 1.162 2001/10/24 08:10:08 alejo Exp $ */ +/* $CoreSDI: modules.c,v 1.167 2002/02/08 18:25:06 claudio Exp $ */ /* * Copyright (c) 2001, Core SDI S.A., Argentina @@ -42,7 +42,9 @@ #include <sys/types.h> #include <sys/uio.h> #include <sys/socket.h> + #include <ctype.h> +#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -51,6 +53,7 @@ #include <dlfcn.h> #include <limits.h> #include <time.h> + #include "modules.h" #include "syslogd.h" @@ -71,106 +74,118 @@ struct omodule *omodules; struct imodule *imodules; -extern char *libdir; -extern int Debug; char err_buf[MAXLINE]; +extern char *libdir; extern void *main_lib; +extern int Debug; /* * Prepare libraries for a module */ - int -prepare_module_libs(const char *modname, void **ret) { +prepare_module_libs(const char *modname, void **ret) +{ #if BUGGY_LIBRARY_OPEN int i; char buf[LIB_PATH_MAX]; - m_dprintf(MSYSLOG_INFORMATIVE, "prepare_module_libs: called for " - "module:%s\n", modname); + dprintf(MSYSLOG_INFORMATIVE, "prepare_module_libs: called for " + "module: %s\n", modname); + /* Try to open LIBDIR/MYSLOG_LIB */ snprintf(buf, sizeof(buf), "%s/" MLIBNAME_STR, - libdir ? libdir : INSTALL_LIBDIR); - - m_dprintf(MSYSLOG_INFORMATIVE, "prepare_module_libs: Going to open %s\n", + (libdir != NULL) ? libdir : INSTALL_LIBDIR); + dprintf(MSYSLOG_INFORMATIVE, "prepare_module_libs: Going to open %s\n", buf); + *ret = dlopen(buf, DLOPEN_FLAGS); /* Try ./ if debugging. We don't care if it is not open */ - if ( Debug && ((*ret = dlopen(buf, DLOPEN_FLAGS)) == NULL) ) { + if (Debug && *ret == NULL) { snprintf(buf, sizeof(buf), "./" MLIBNAME_STR); - m_dprintf(MSYSLOG_INFORMATIVE, "prepare_module_libs: Going" + dprintf(MSYSLOG_INFORMATIVE, "prepare_module_libs: Going" " to open %s\n", buf); *ret = dlopen(buf, DLOPEN_FLAGS); } - - m_dprintf(MSYSLOG_INFORMATIVE, "prepare_module_libs: lib %s was " - "%sopened\n", buf, *ret == NULL? "not " : ""); + dprintf(MSYSLOG_INFORMATIVE, "prepare_module_libs: lib %s was " + "%sopened\n", buf, (*ret == NULL) ? "not " : ""); #endif return (1); } + /* - * This function gets function name from - * the main libalat.so.X.X library or - * if not there try to open this module - * library. (main libname is MLIBNAME_STR ! + * This function gets function name from the main libmsyslog.so.X.X + * library or if not there try to open the external module library + * called libmsyslog_<modulename>.so */ - int -get_symbol(const char *modname, const char *funcname, void *h, void **ret) { +get_symbol(const char *modname, const char *funcname, void **h, void **ret) +{ char buf[LIB_PATH_MAX]; snprintf(buf, sizeof(buf), SYMBOL_PREFIX "%s_%s", modname, funcname); - *ret = NULL; + /* * Search for symbol on main library * and in module libs */ - if (main_lib == NULL || ( (*ret = dlsym(main_lib, buf)) == NULL && - (*ret = dlsym(main_lib, buf + 1)) == NULL ) ) { + if (*h == NULL) { + if (main_lib == NULL || ((*ret = dlsym(main_lib, buf)) == NULL + && (*ret = dlsym(main_lib, buf + 1)) == NULL)) { - m_dprintf(MSYSLOG_INFORMATIVE, "get_symbol: func %s not found " - "on main lib \n", buf); + dprintf(MSYSLOG_INFORMATIVE, "get_symbol: func %s " + "not found on main library\n", buf); - } + /* Try to open libmsyslog_<modulename>.so */ + if (*h == NULL) { + char extlib[LIB_PATH_MAX]; - if (*ret == NULL && h && ( (*ret = dlsym(h, buf)) == NULL && - (*ret = dlsym(h, buf + 1)) == NULL) ) { - m_dprintf(MSYSLOG_SERIOUS, "get_symbol: error linking function " - "%s, %s\n", buf, dlerror()); - return(-1); - } + snprintf(extlib, sizeof(extlib), + "%s/libmsyslog_%s.so", (libdir == NULL) ? + INSTALL_LIBDIR : libdir, modname); - /* not on main lib, not on this module's lib */ - if (*ret == NULL) - return(-1); + dprintf(MSYSLOG_INFORMATIVE, "get_symbol: " + "Trying to open %s... ", extlib); + *h = dlopen(extlib, DLOPEN_FLAGS); + dprintf(MSYSLOG_INFORMATIVE, "%s\n", + (*h == NULL) ? "failed" : "ok"); + } - return(1); + } + } + /* If can't found the symbol on the main library try the external one */ + if (*ret == NULL && *h != NULL) { + *ret = dlsym(*h, buf); + dprintf(MSYSLOG_INFORMATIVE, "get_symbol: func %s %sfound on " + "external lib\n", buf, (*ret == NULL) ? "not " : ""); + } + + return ((*ret == NULL) ? -1 : 1); } + /* * Create a new input module, and assign module functions to generic pointer * * I is a pointer to a list of input modules, where new one will be appended * line is the command line of the input module */ - int imodule_create(struct i_module *I, char *line) { int argc, ret, i; - char *p, **argv = NULL; + char **argv = NULL; struct i_module *im, *im_prev; /* create initial node for Inputs list */ if (I == NULL) { - m_dprintf(MSYSLOG_SERIOUS, "imodule_create: Error from caller\n"); + dprintf(MSYSLOG_SERIOUS, "imodule_create: Error from caller\n"); return (-1); } @@ -180,9 +195,9 @@ if (im_prev == I && im_prev->im_fd == -1) { im = im_prev; } else { - if((im_prev->im_next = (struct i_module *) calloc(1, + if ((im_prev->im_next = (struct i_module *)calloc(1, sizeof(struct i_module))) == NULL) { - m_dprintf(MSYSLOG_SERIOUS, "No memory available for " + dprintf(MSYSLOG_SERIOUS, "No memory available for " "calloc\n"); return (-1); } @@ -190,10 +205,6 @@ im->im_fd = -1; } - for (p = line; *p != '\0'; p++) - if (*p == ':') - *p = ' '; - if ((argc = parseParams(&argv, line)) < 1) { snprintf(err_buf, sizeof(err_buf), "Error initializing module " "%s [%s]\n", argv[0], line); @@ -248,9 +259,9 @@ } return (ret); - } + /* * Create a new input module, and assign module functions to generic pointer * while addinf it to a filed @@ -260,11 +271,11 @@ * prog is the program to match * */ - int omodule_create(char *c, struct filed *f, char *prog) { - char *line, *p, quotes, *argv[20]; +#define OMODULE_ARGV_MAX 20 + char *line, *p, quotes, *argv[OMODULE_ARGV_MAX]; int argc; struct o_module *om, *om_prev; @@ -274,109 +285,106 @@ /* create context and initialize module for logging */ while (*p) { if (f->f_omod == NULL) { - f->f_omod = (struct o_module *) calloc(1, sizeof(*f->f_omod)); + f->f_omod = (struct o_module *) + calloc(1, sizeof(struct o_module)); om = f->f_omod; om_prev = NULL; } else { - for (om_prev = f->f_omod; om_prev->om_next; om_prev = om_prev->om_next); - om_prev->om_next = (struct o_module *) calloc(1, sizeof *f->f_omod); + for (om_prev = f->f_omod; om_prev->om_next; + om_prev = om_prev->om_next); + om_prev->om_next = (struct o_module *) + calloc(1, sizeof(struct o_module)); om = om_prev->om_next; } switch (*p) { - case '%': - /* get this module name */ - argc = 0; - while (isspace((int)*(++p))); - argv[argc++] = p; - while (!isspace((int)*p)) p++; + case '%': + /* get this module name */ + argc = 0; + while (isspace((int)*(++p))); + argv[argc++] = p; + while (!isspace((int)*p)) p++; - *p++ = 0; + *p++ = 0; - /* find for matching module */ - if ((om->om_func = getOmodule(argv[0])) + /* find for matching module */ + if ((om->om_func = getOmodule(argv[0])) == NULL) { + if ((om->om_func = addOmodule(argv[0])) == NULL) { - if ((om->om_func = addOmodule(argv[0])) - == NULL) { - - snprintf(err_buf, - sizeof(err_buf), "Error " - "loading dynamic output " - "module %s [%s]\n", - argv[0], line); - goto omodule_create_bad; - - } + snprintf(err_buf, + sizeof(err_buf), "Error " + "loading dynamic output " + "module %s [%s]\n", + argv[0], line); + goto omodule_create_bad; } + } - m_dprintf(MSYSLOG_INFORMATIVE, "omodule_create: " - "got output module %s\n", argv[0]); + dprintf(MSYSLOG_INFORMATIVE, "omodule_create: " + "got output module %s\n", argv[0]); - /* build argv and argc, modifies input p */ - while (isspace((int)*p)) p++; - while (*p && *p != '%' && *p != '\n' && - *p != '\r' && argc<sizeof(argv) / - sizeof(argv[0])) { - - if (*p == '"' || *p == '\'') - quotes = *p++; + /* build argv and argc, modifies input p */ + while (isspace((int)*p)) p++; +/* XXX + while (*p && *p != '%' && *p != '\n' && *p != '\r' && + argc < sizeof(argv) / sizeof(argv[0])) { +*/ + while (*p && *p != '%' && *p != '\n' && *p != '\r' && + argc < OMODULE_ARGV_MAX) { + + if (*p == '"' || *p == '\'') + quotes = *p++; - argv[argc++] = p; - if (quotes) { - while (*p != '\0' && - *p != quotes) p++; - if (*p == '\0') { - /* not ending, fix */ - quotes = 0; - break; - } else { - /* closing */ - quotes = 0; - } + argv[argc++] = p; + if (quotes) { + while (*p != '\0' && *p != quotes) + p++; + if (*p == '\0') { + /* not ending, fix */ + quotes = 0; + break; } else { - while ( *p != '\0' && - !isspace((int)*p)) - p++; + /* closing */ + quotes = 0; } - if (*p != 0) - *p++ = 0; - while (*p != '\0' && - isspace((int) *p)) + } else { + while ( *p != '\0' && !isspace((int)*p)) p++; } + if (*p != 0) + *p++ = 0; + while (*p != '\0' && isspace((int) *p)) + p++; + } - m_dprintf(MSYSLOG_INFORMATIVE, "omodule_create:" - " successfully made output module " - "%s's argv[]\n", argv[0]); + dprintf(MSYSLOG_INFORMATIVE, "omodule_create:" + " successfully made output module %s's argv[]\n", + argv[0]); + break; - break; - case '@': - case '/': - case '-': - case '|': - case '*': - default: - /* classic style */ - /* prog is already on this filed */ - argc = 0; - argv[argc++] = "classic"; - argv[argc++] = p; - p += strlen(p); - /* find for matching module */ - if ((om->om_func = getOmodule(argv[0])) + case '@': + case '/': + case '-': + case '|': + case '*': + default: + /* classic style */ + /* prog is already on this filed */ + argc = 0; + argv[argc++] = "classic"; + argv[argc++] = p; + p += strlen(p); + /* find for matching module */ + if ((om->om_func = getOmodule(argv[0])) == NULL) { + if ((om->om_func = addOmodule(argv[0])) == NULL) { - if ((om->om_func = addOmodule(argv[0])) - == NULL) { - snprintf(err_buf, - sizeof(err_buf), "Error " - "loading dynamic output " - "module %s [%s]\n", - argv[0], line); - goto omodule_create_bad; - } + snprintf(err_buf, + sizeof(err_buf), "Error loading " + "dynamic output module %s [%s]\n", + argv[0], line); + goto omodule_create_bad; } - - break; + } } if (!om->om_func->om_init || @@ -389,7 +397,7 @@ } } - m_dprintf(MSYSLOG_INFORMATIVE, "omodule_create: all done for output " + dprintf(MSYSLOG_INFORMATIVE, "omodule_create: all done for output " "module %s\n", argv[0]); free(line); @@ -398,7 +406,7 @@ omodule_create_bad: - m_dprintf(MSYSLOG_SERIOUS, err_buf); + dprintf(MSYSLOG_SERIOUS, "%s", err_buf); if (line) free(line); @@ -413,16 +421,15 @@ free(om); return (-1); - } + /* * Parse a line and return argc & argv * * space and tabs are separators * */ - int parseParams(char ***ret, char *c) { @@ -436,14 +443,22 @@ *ret = (char **) calloc(20, sizeof(char *)); argc = 0; - for(q = p; *p != '\0'; p = q) { + for (q = p; *p != '\0'; p = q) { /* skip initial spaces */ - while (isspace((int)*p)) p++; + while (isspace((int)*p)) + p++; if (*p == '\0') break; - if (*p == '\'') { - for(q = ++p; *q != '\'' && *q != '\0'; q++); + if (*p == '\"') { + for (q = ++p; *q != '\"' && *q != '\0'; q++); + + if (*q != '\0') { + *q++ = '\0'; + } + + } else if (*p == '\'') { + for (q = ++p; *q != '\'' && *q != '\0'; q++); if (*q != '\0') { *q++ = '\0'; @@ -451,7 +466,7 @@ } else { /* see how long this word is, alloc, and copy */ - for(q = p; *q != '\0' && !isspace((int)*q); q++); + for (q = p; *q != '\0' && !isspace((int)*q); q++); if (*q != '\0') { *q++ = '\0'; } @@ -459,11 +474,11 @@ } (*ret)[argc++] = strdup(p); - if ((argc % 20) == 18) - if ( (*ret = (char **) realloc(*ret, sizeof(char *) * + if ((argc % OMODULE_ARGV_MAX) == 18) + if ( (*ret = (char **)realloc(*ret, sizeof(char *) * (argc + 20))) == NULL) { free(line); - return(-1); + return (-1); } if (*ret != NULL) (*ret)[argc] = NULL; @@ -473,6 +488,7 @@ return (argc); } + struct imodule * addImodule(char *name) { @@ -483,19 +499,20 @@ return (NULL); if (imodules == NULL) { - imodules = (struct imodule *) calloc(1, sizeof(*im)); + imodules = (struct imodule *)calloc(1, sizeof(struct imodule)); im = imodules; } else { - for(im = imodules; im->im_next; im = im->im_next); - im->im_next = (struct imodule *) calloc(1, sizeof(*im)); + for (im = imodules; im->im_next; im = im->im_next); + im->im_next = (struct imodule *) calloc(1, + sizeof(struct imodule)); im = im->im_next; } snprintf(buf, sizeof(buf), "im_%s", name); if (prepare_module_libs(buf, &im->h) == -1 || - get_symbol(buf, "init", im->h, (void *) &im->im_init) == -1 || - get_symbol(buf, "read", im->h, (void *) &im->im_read) == -1) { + get_symbol(buf, "init", &im->h, (void *) &im->im_init) == -1 || + get_symbol(buf, "read", &im->h, (void *) &im->im_read) == -1) { if (imodules == im) { imodules = NULL; @@ -508,17 +525,17 @@ free(im); - m_dprintf(MSYSLOG_SERIOUS, "addImodule: couldn't config %s input" + dprintf(MSYSLOG_SERIOUS, "addImodule: couldn't config %s input" " module\n", buf); return(NULL); } /* this is not mandatory */ - get_symbol(buf, "close", im->h, (void *) &im->im_close); + get_symbol(buf, "close", &im->h, (void *) &im->im_close); im->im_name = strdup(name); - m_dprintf(MSYSLOG_INFORMATIVE, "addImodule: successfully configured %s " + dprintf(MSYSLOG_INFORMATIVE, "addImodule: successfully configured %s " "input module\n", buf); return (im); @@ -535,48 +552,53 @@ return (NULL); if (omodules == NULL) { - omodules = (struct omodule *) calloc(1, sizeof(*om)); + omodules = (struct omodule *) calloc(1, sizeof(struct omodule)); om = omodules; } else { - for(om = omodules; om->om_next; om = om->om_next); - om->om_next = (struct omodule *) calloc(1, sizeof(*om)); + for (om = omodules; om->om_next != NULL; om = om->om_next); + om->om_next = + (struct omodule *)calloc(1, sizeof(struct omodule)); om = om->om_next; } + if (om == NULL) { + dprintf(MSYSLOG_CRITICAL, "addOmodule: %s\n", strerror(errno)); + return (NULL); + } + snprintf(buf, sizeof(buf), "om_%s", name); if (prepare_module_libs(buf, &om->h) == -1 || - get_symbol(buf, "init", om->h, (void *) &om->om_init) == -1 || - get_symbol(buf, "write", om->h, (void *) &om->om_write) == -1) { + get_symbol(buf, "init", &om->h, (void *) &om->om_init) == -1 || + get_symbol(buf, "write", &om->h, (void *) &om->om_write) == -1) { if (omodules == om) { omodules = NULL; } else { struct omodule *o = omodules; - for (; o && o->om_next == om; o = o->om_next); - if (o) + for (; o != NULL && o->om_next != om; o = o->om_next); + if (o != NULL) o->om_next = NULL; } free(om); - - return(NULL); + return (NULL); } /* this is not mandatory */ - get_symbol(buf, "close", om->h, (void *) &om->om_close); - get_symbol(buf, "flush", om->h, (void *) &om->om_flush); + get_symbol(buf, "close", &om->h, (void *)&om->om_close); + get_symbol(buf, "flush", &om->h, (void *)&om->om_flush); - m_dprintf(MSYSLOG_INFORMATIVE, "addOmodule: successfully configured %s " + dprintf(MSYSLOG_INFORMATIVE, "addOmodule: successfully configured %s " "output module\n", buf); - om->om_name = strdup(name); return (om); } + int omoduleDestroy(struct omodule *om) { @@ -584,7 +606,7 @@ return (-1); if (om->h && dlclose(om->h) < 0) { - m_dprintf(MSYSLOG_SERIOUS, "Error [%s]\n", dlerror()); + dprintf(MSYSLOG_SERIOUS, "Error [%s]\n", dlerror()); return (-1); } @@ -593,6 +615,7 @@ return (1); } + struct imodule * getImodule(char *name) { @@ -609,15 +632,17 @@ return (im); } + struct omodule * -getOmodule(char *name) { +getOmodule(char *name) +{ struct omodule *om; unsigned int len; if (omodules == NULL || name == NULL) return (NULL); - for(om = omodules, len = strlen(name); om; om = om->om_next) + for (om = omodules, len = strlen(name); om; om = om->om_next) if (om->om_name && !strncmp(om->om_name, name, len)) break; @@ -630,7 +655,6 @@ * its dynamic libraries * */ - int imodules_destroy(struct imodule *i) { @@ -667,29 +691,28 @@ * its dynamic libraries * */ - int omodules_destroy(struct omodule *o) { - struct omodule *om, *om_next, *last; + struct omodule *om, *om_next, *last; - for (om = o, last = NULL; om; om = om_next) { + for (om = o, last = NULL; om != NULL; om = om_next) { om_next = om->om_next; - if (!om->h) { + if (om->h == NULL) { last = om; continue; } - if (last) + if (last != NULL) last->om_next = om->om_next; dlclose(om->h); free(om); } - if (last) { + if (last != NULL) { last->om_next = NULL; return (1); /* there are some static modules on */ } Index: modules.h =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules.h,v retrieving revision 1.46 retrieving revision 1.46.2.1 diff -u -d -r1.46 -r1.46.2.1 --- modules.h 6 Apr 2001 00:44:02 -0000 1.46 +++ modules.h 11 Apr 2003 16:36:29 -0000 1.46.2.1 @@ -1,4 +1,4 @@ -/* $CoreSDI: modules.h,v 1.45 2001/03/07 21:35:12 alejo Exp $ */ +/* $CoreSDI: modules.h,v 1.50 2002/03/04 21:38:25 alejo Exp $ */ /* * Copyright (c) 2001, Core SDI S.A., Argentina @@ -32,8 +32,16 @@ #ifndef SYSLOG_MODULES_H #define SYSLOG_MODULES_H +#ifndef MAXHOSTNAMELEN +# include <netdb.h> +# ifndef MAXHOSTNAMELEN +# define MAXHOSTNAMELEN 254 +# endif +#endif + + /* this MUST be the same value as syslogd.h */ -#define MAXLINE 1024 +#define MAXLINE 2048 #define MAX_MODULE_NAME_LEN 255 @@ -58,8 +66,8 @@ struct imodule *im_func; /* where are this puppy's functions? */ int im_fd; /* for use with select() */ int im_flags; /* 1 to 8 are reserved */ -#define IMODULE_FLAG_KERN 0x01 -#define IMODULE_FLAG_CONN 0x02 +#define IMODULE_FLAG_KERN 0x10 +#define IMODULE_FLAG_CONN 0x20 char *im_path; char im_buf[MAXLINE + 1]; void *im_ctx; @@ -78,10 +86,9 @@ int im_flags; #define SYSLOG_IM_PID_CHECKED 0x01 #define SYSLOG_IM_HOST_CHECKED 0x02 - char *im_msg; - size_t im_mlen; /* size of im_msg buffer */ + char im_msg[MAXLINE + 1]; int im_len; /* size of contents of im_msg buffer */ - char im_host[SIZEOF_MAXHOSTNAMELEN + 1]; + char im_host[MAXHOSTNAMELEN + 1]; }; #endif Index: syslogd.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/syslogd.c,v retrieving revision 1.219 retrieving revision 1.219.2.1 diff -u -d -r1.219 -r1.219.2.1 --- syslogd.c 13 Aug 2002 17:25:12 -0000 1.219 +++ syslogd.c 11 Apr 2003 16:36:29 -0000 1.219.2.1 @@ -1,4 +1,4 @@ -/* $CoreSDI: syslogd.c,v 1.217 2001/10/25 23:49:48 alejo Exp $ */ +/* $CoreSDI: syslogd.c,v 1.229 2002/03/01 08:30:47 alejo Exp $ */ /* * Copyright (c) 1983, 1988, 1993, 1994 @@ -41,7 +41,7 @@ #ifndef lint /*static char sccsid[] = "@(#)syslogd.c 8.3 (Berkeley) 4/4/94";*/ -static char rcsid[] = "$CoreSDI: syslogd.c,v 1.217 2001/10/25 23:49:48 alejo Exp $"; +static char rcsid[] = "$CoreSDI: syslogd.c,v 1.229 2002/03/01 08:30:47 alejo Exp $"; #endif /* not lint */ /* @@ -84,6 +84,7 @@ # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif #include <sys/un.h> +#include <sys/utsname.h> #ifdef TIME_WITH_SYS_TIME # include <sys/time.h> @@ -174,13 +175,15 @@ #define MAX_PIDFILE_LOCK_TRIES 5 -char *ctty; /* console path */ +char *ctty = "%classic -t CONSOLE " _PATH_CONSOLE; /* console path */ int UseConsole = 1; -char LocalHostName[SIZEOF_MAXHOSTNAMELEN]; /* our hostname */ -char *LocalDomain = NULL; /* our domain */ -int finet = -1; /* Internet datagram socket */ +char LocalHostName[MAXHOSTNAMELEN]; /* our hostname */ int Debug = 0; /* debug flag */ -int DaemonFlags = 0; +int DaemonFlags = 0; /* running daemon flags */ +#define SYSLOGD_LOCKED_PIDFILE 0x01 /* pidfile is locked */ +#define SYSLOGD_MARK 0x02 /* call domark() */ +#define SYSLOGD_DIE 0x04 /* call die() */ +#define USE_LOCALDOMAIN 0x08 /* use hostname with local domain */ char *libdir = NULL; @@ -216,8 +219,6 @@ int main(int argc, char **argv) { - int ch; - char *p; struct im_msg log; #ifndef SIGALTSTACK_WITH_STACK_T struct sigaltstack alt_stack; @@ -225,7 +226,10 @@ stack_t alt_stack; #endif struct sigaction sa; + int ch; + int argcnt; int default_inputs = 1; /* start default modules? */ + int (*resolv_domain)(char *, int, char *); Inputs.im_next = NULL; Inputs.im_fd = -1; @@ -251,35 +255,46 @@ return(-1); } - /* console config line */ - ctty = (char *) malloc(sizeof(_PATH_CONSOLE) + 19); - strcpy(ctty, "%classic -t CONSOLE " _PATH_CONSOLE); + /* + * Daemon options + * + * -d -debug <level> + * -i -input [input module name and args] + * -f -conf [configuration file] + * -P -pidfile [pid file] + * -m -markinterval [mark interval seconds] + * -c -noconsole + * -A -uselocaldomain + * -n -nodefault + * + * legacy options + * -u -unix + * -p -path -a [additional unix input module in /dev/log] + */ - /* use ':' at start to allow -d to be used without argument */ - opterr = 0; + argcnt = 1; /* skip argv[0] getxopt() */ - while ( (ch = getopt(argc, argv, ":d:f:m:ui:p:a:P:hcn")) != -1) { + while ((ch = getxopt(argc, argv, "d!debug: i!input: f!conf:" + " m!markinterval: P!pidfile: c!console A!localdomain" + " n!nodefault h!help", &argcnt)) != -1) { char buf[512]; switch (ch) { - case ':': /* missing arg, bsd */ - case '?': /* missing arg, sysv */ - break; case 'd': /* debug */ - if (optarg == NULL) { + if (argcnt >= argc || *argv[argcnt] == '-' + || !isdigit((int) *argv[argcnt])) { + /* missing level */ Debug = 20; - } else if (isdigit((int) *optarg)) { - Debug = atoi(optarg); - } else { - Debug++; - optind--; + argcnt--; /* no arg specified */ + } else if (isdigit((int) *argv[argcnt])) { + Debug = strtol(argv[argcnt], NULL, 10); } break; case 'f': /* configuration file */ - ConfFile = optarg; + ConfFile = argv[argcnt]; break; case 'm': /* mark interval */ - MarkInterval = atoi(optarg) * 60; + MarkInterval = strtol(argv[argcnt], NULL, 10) * 60; break; case 'u': /* allow udp input port */ if (imodule_create(&Inputs, "udp") < 0) { @@ -288,17 +303,17 @@ } break; case 'i': /* inputs */ - if (imodule_create(&Inputs, optarg) < 0) { + if (imodule_create(&Inputs, argv[argcnt]) < 0) { fprintf(stderr, "syslogd: WARNING error on " - "input module, ignoring %s\n", optarg); + "input module, ignoring %s\n", argv[argcnt]); } break; case 'p': /* path */ case 'a': /* additional im_unix socket */ - snprintf(buf, sizeof(buf), "unix %s", optarg); + snprintf(buf, sizeof(buf), "unix %s", argv[argcnt]); if (imodule_create(&Inputs, buf) < 0) { fprintf(stderr, "syslogd: WARNING out of " - "descriptors, ignoring %s\n", optarg); + "descriptors, %s ignored\n", argv[argcnt]); } break; case 'c': /* don't use console */ @@ -308,12 +323,16 @@ default_inputs = 0; break; case 'P': /* alternate pidfile */ - pidfile = optarg; + pidfile = argv[argcnt]; + break; + case 'A': /* use local domain name too */ + DaemonFlags |= USE_LOCALDOMAIN; break; case 'h': default: usage(); } + argcnt++; } if ( default_inputs && Inputs.im_fd < 0 && Inputs.im_next == NULL ) { @@ -349,12 +368,12 @@ } if ( Inputs.im_fd < 0 && Inputs.im_next == NULL ) { - m_dprintf(MSYSLOG_SERIOUS, "syslogd: no inputs active\n"); + dprintf(MSYSLOG_SERIOUS, "syslogd: no inputs active\n"); usage(); } - if ( (argc -= optind) != 0 ) - m_dprintf(MSYSLOG_SERIOUS, "syslogd: remaining command" + if (argc != argcnt) + dprintf(MSYSLOG_SERIOUS, "syslogd: remaining command" " line not parsed!\n"); if (!Debug) { @@ -399,11 +418,11 @@ } gethostname(LocalHostName, sizeof(LocalHostName)); - if ((p = strchr(LocalHostName, '.')) != NULL) { - *p++ = '\0'; - LocalDomain = p; - } else - LocalDomain = ""; + if ((DaemonFlags & USE_LOCALDOMAIN) && + (resolv_domain = dlsym(main_lib, SYMBOL_PREFIX "resolv_domain")) + != NULL && resolv_domain(LocalHostName, sizeof(LocalHostName) - 1, + LocalHostName) == -1) + gethostname(LocalHostName, sizeof(LocalHostName)); /* again */ /* Set signal handlers */ /* XXX: use one signal handler for all signals other than HUP */ @@ -416,7 +435,7 @@ place_signal(SIGPIPE, SIG_IGN); if ( (alt_stack.ss_sp = malloc(SIGSTKSZ)) == NULL) { - m_dprintf(MSYSLOG_CRITICAL, "malloc altstack struct"); + dprintf(MSYSLOG_CRITICAL, "malloc altstack struct"); exit(-1); } #if 0 /* should we do this on some OSs (ie. Aix)? */ @@ -532,20 +551,11 @@ } } - m_dprintf(MSYSLOG_INFORMATIVE, "off & running....\n"); + dprintf(MSYSLOG_INFORMATIVE, "off & running....\n"); init(0); place_signal(SIGHUP, init); - log.im_mlen = getmsgbufsize(); - if (log.im_mlen < MAXLINE) - log.im_mlen = MAXLINE; - log.im_mlen++; - if ( (log.im_msg = malloc(log.im_mlen)) == NULL) { - m_dprintf(MSYSLOG_CRITICAL, "malloc log struct"); - exit(-1); - } - for (;;) { int count, i, done; @@ -555,21 +565,17 @@ die(WantDie); if (fd_inputs == NULL) { - m_dprintf(MSYSLOG_CRITICAL, "no input struct"); + dprintf(MSYSLOG_CRITICAL, "no input struct"); exit(-1); } - /* this may not be on inputs */ - if (finet != -1 && !(DaemonFlags & SYSLOGD_INET_READ)) - add_fd_input(finet, NULL); - /* count will always be less than fd_in_count */ switch (count = poll(fd_inputs, fd_in_count, -1)) { case 0: - m_dprintf(MSYSLOG_INFORMATIVE, "main: poll returned 0\n"); + dprintf(MSYSLOG_INFORMATIVE, "main: poll returned 0\n"); continue; case -1: - m_dprintf(MSYSLOG_INFORMATIVE, "main: poll returned " + dprintf(MSYSLOG_INFORMATIVE, "main: poll returned " "-1\n"); if (errno != EINTR) logerror("poll"); @@ -580,7 +586,7 @@ if (fd_inputs[i].revents & POLLIN) { char *mname; int fd; - int val = -1; + int val = -1; log.im_pid = 0; log.im_pri = 0; @@ -589,24 +595,13 @@ mname = fd_inputs_mod[i]->im_func->im_name; fd = fd_inputs[i].fd; - if (!fd_inputs_mod[i]) { - /* silently DROP what comes */ - if (fd == finet) { - struct sockaddr_in frominet; - socklen_t len; - char line[MAXLINE]; - - len = sizeof(frominet); - recvfrom(finet, line, MAXLINE, - 0, (struct sockaddr *) - &frominet, &len); - } - } else if (!fd_inputs_mod[i]->im_func || + if (!fd_inputs_mod[i] || + !fd_inputs_mod[i]->im_func || !fd_inputs_mod[i]->im_func->im_read || (val = (*fd_inputs_mod[i]->im_func->im_read) (fd_inputs_mod[i], fd_inputs[i].fd, &log)) < 0) { - m_dprintf(MSYSLOG_SERIOUS, "syslogd: " + dprintf(MSYSLOG_SERIOUS, "syslogd: " "Error calling input module %s, " "for fd %i\n", mname, fd); @@ -709,7 +704,10 @@ time_t now; struct tm timestamp; - m_dprintf(MSYSLOG_INFORMATIVE2, "logmsg: pri 0%o, flags 0x%x, from %s," + if (from == NULL || *from == '\0') + from = LocalHostName; + + dprintf(MSYSLOG_INFORMATIVE2, "logmsg: pri 0%o, flags 0x%x, from %s," " msg %s\n", pri, flags, from, msg); sigemptyset(&mask); @@ -784,7 +782,7 @@ /* log the message to the particular outputs */ if (!Initialized) { - if (UseConsole && ctty && omodule_create(ctty, &consfile, + if (UseConsole && omodule_create(ctty, &consfile, NULL) != -1) { doLog(&consfile, flags, msg, prilev, fac); if (consfile.f_omod && consfile.f_omod->om_func @@ -832,7 +830,7 @@ !strcmp(from, f->f_prevhost)) { memcpy(&f->f_tm, ×tamp, sizeof(f->f_tm)); f->f_prevcount++; - m_dprintf(MSYSLOG_INFORMATIVE, "msg repeated %d times," + dprintf(MSYSLOG_INFORMATIVE, "msg repeated %d times," " %ld sec of %d\n", f->f_prevcount, (long)(now - f->f_time), repeatinterval[f->f_repeatcount]); @@ -902,7 +900,7 @@ time(&f->f_time); for (om = f->f_omod; om; om = om->om_next) { if (!om->om_func || !om->om_func->om_write) { - m_dprintf(MSYSLOG_SERIOUS, "doLog: error, no write " + dprintf(MSYSLOG_SERIOUS, "doLog: error, no write " "function in output module [%s], message [%s]\n", om->om_func->om_name, m.msg); continue; @@ -911,7 +909,7 @@ /* call this module write */ ret = (*(om->om_func->om_write))(f, flags, &m, om->ctx); if (ret < 0) { - m_dprintf(MSYSLOG_SERIOUS, "doLog: error with output " + dprintf(MSYSLOG_SERIOUS, "doLog: error with output " "module [%s] for message [%s]\n", om->om_func->om_name, m.msg); } else if (ret == 0) @@ -962,7 +960,7 @@ for (f = Files; f; f = f->f_next) { if (f->f_prevcount && now >= REPEATTIME(f)) { /* we should report this based on module */ - m_dprintf(MSYSLOG_INFORMATIVE, "flush: repeated %d " + dprintf(MSYSLOG_INFORMATIVE, "flush: repeated %d " "times, %d sec.\n", f->f_prevcount, repeatinterval[f->f_repeatcount]); doLog(f, 0, NULL, 0, 0); @@ -990,7 +988,7 @@ else (void)snprintf(buf, sizeof(buf), "syslogd: %s", type); errno = 0; - m_dprintf(MSYSLOG_INFORMATIVE, "%s\n", buf); + dprintf(MSYSLOG_INFORMATIVE, "%s\n", buf); logmsg(LOG_SYSLOG|LOG_ERR, buf, LocalHostName, ADDDATE); } @@ -1014,7 +1012,7 @@ Initialized = was_initialized; if (signo) { - m_dprintf(MSYSLOG_SERIOUS, "syslogd: exiting on signal %d\n", + dprintf(MSYSLOG_SERIOUS, "syslogd: exiting on signal %d\n", signo); (void)sprintf(buf, "exiting on signal %d", signo); errno = 0; @@ -1061,7 +1059,7 @@ char prog[NAME_MAX+1]; struct o_module *om, *om_next; - m_dprintf(MSYSLOG_INFORMATIVE, "init\n"); + dprintf(MSYSLOG_INFORMATIVE, "init\n"); /* * Close all open log files. @@ -1116,7 +1114,7 @@ if ( (main_lib = dlopen(INSTALL_LIBDIR "/" MLIBNAME_STR, DLOPEN_FLAGS)) == NULL && (Debug && (main_lib = dlopen("./" MLIBNAME_STR, DLOPEN_FLAGS)) == NULL) ) { - m_dprintf(MSYSLOG_CRITICAL, "init: Error opening main library, [%s] " + dprintf(MSYSLOG_CRITICAL, "init: Error opening main library, [%s] " "file [%s]\n", dlerror(), INSTALL_LIBDIR "/" MLIBNAME_STR); exit(-1); } @@ -1138,23 +1136,23 @@ /* open the configuration file */ if ((cf = fopen(ConfFile, "r")) == NULL) { - m_dprintf(MSYSLOG_SERIOUS, "cannot open %s\n", ConfFile); + dprintf(MSYSLOG_SERIOUS, "cannot open %s\n", ConfFile); if ( (*nextp = (struct filed *) calloc(1, sizeof(*f))) == NULL) { - m_dprintf(MSYSLOG_CRITICAL, "calloc struct filed"); + dprintf(MSYSLOG_CRITICAL, "calloc struct filed"); exit(-1); } if (cfline("*.ERR\t/dev/console", *nextp, "*") == -1) { - m_dprintf(MSYSLOG_CRITICAL, "can't write to console"); + dprintf(MSYSLOG_CRITICAL, "can't write to console"); exit(-1); } if ( ((*nextp)->f_next = (struct filed *) calloc(1, sizeof(*f))) == NULL) { - m_dprintf(MSYSLOG_CRITICAL, "calloc struct filed"); + dprintf(MSYSLOG_CRITICAL, "calloc struct filed"); exit(-1); } if (cfline("*.PANIC\t*", (*nextp)->f_next, "*") == -1) { - m_dprintf(MSYSLOG_CRITICAL, "can't write to console"); + dprintf(MSYSLOG_CRITICAL, "can't write to console"); exit(-1); } Initialized = 1; @@ -1184,7 +1182,7 @@ if (fgets(&cline[clen - 2], sizeof(cline) - clen, cf) == NULL) { cline[clen - 2] = '\0'; - m_dprintf(MSYSLOG_INFORMATIVE, "syslogd: error " + dprintf(MSYSLOG_INFORMATIVE, "syslogd: error " "merging line [%s]\n", cline); break; } @@ -1218,7 +1216,7 @@ } *p = '\0'; if ( (f = (struct filed *)calloc(1, sizeof(*f))) == NULL) { - m_dprintf(MSYSLOG_CRITICAL, "calloc struct filed"); + dprintf(MSYSLOG_CRITICAL, "calloc struct filed"); exit(-1); } if (cfline(cline, f, prog) == 1) { @@ -1234,7 +1232,7 @@ fclose(cf); if (Files == NULL) { - m_dprintf(MSYSLOG_CRITICAL, "syslogd: WARNING NO OUTPUT MODULES" + dprintf(MSYSLOG_CRITICAL, "syslogd: WARNING NO OUTPUT MODULES" " ACTIVE, GIVING UP!\n"); exit(-1); } @@ -1264,7 +1262,7 @@ } logmsg(LOG_SYSLOG|LOG_INFO, "syslogd: restart", LocalHostName, ADDDATE); - m_dprintf(MSYSLOG_INFORMATIVE, "syslogd: restarted\n"); + dprintf(MSYSLOG_INFORMATIVE, "syslogd: restarted\n"); } /* @@ -1278,7 +1276,7 @@ char *bp; char buf[MAXLINE], ebuf[240]; - m_dprintf(MSYSLOG_INFORMATIVE, "cfline(\"%s\", f, \"%s\")\n", line, + dprintf(MSYSLOG_INFORMATIVE, "cfline(\"%s\", f, \"%s\")\n", line, prog); errno = 0; /* keep strerror() stuff out of logerror messages */ @@ -1445,11 +1443,11 @@ p++; if (omodule_create(p, f, NULL) == -1) { - m_dprintf(MSYSLOG_SERIOUS, "cfline: error initializing modules!\n"); + dprintf(MSYSLOG_SERIOUS, "cfline: error initializing modules!\n"); return (-1); } - m_dprintf(MSYSLOG_INFORMATIVE, "cfline: all ok\n"); + dprintf(MSYSLOG_INFORMATIVE, "cfline: all ok\n"); return (1); } @@ -1469,7 +1467,7 @@ mib[1] = KERN_MSGBUFSIZE; size = sizeof msgbufsize; if (sysctl(mib, 2, &msgbufsize, &size, NULL, 0) == -1) { - m_dprintf(MSYSLOG_INFORMATIVE, "couldn't get kern.msgbufsize\n"); + dprintf(MSYSLOG_INFORMATIVE, "couldn't get kern.msgbufsize\n"); return (0); } @@ -1512,10 +1510,17 @@ * decode_name a numeric value to a symbolic name */ char * -decode_val(int val, CODE *codetab) { +decode_val(int val, int codetab) { CODE *c; - for (c = codetab; c->c_name; c++) + if (codetab == CODE_FACILITY) + c = facilitynames; + else if (codetab == CODE_PRIORITY) + c = prioritynames; + else + return (NULL); + + for (; c->c_name; c++) if (val == c->c_val) return (c->c_name); @@ -1537,12 +1542,12 @@ { if (fd < 0 || im == NULL) { - m_dprintf(MSYSLOG_INFORMATIVE, "add_fd_input: error on params" + dprintf(MSYSLOG_INFORMATIVE, "add_fd_input: error on params" " %d%s\n", fd, im ? "" : " null im"); return (-1); } - m_dprintf(MSYSLOG_INFORMATIVE, "add_fd_input: adding fd %d " + dprintf(MSYSLOG_INFORMATIVE, "add_fd_input: adding fd %d " "for module %s\n", fd, im->im_func->im_name ? im->im_func->im_name : "unknown"); @@ -1552,7 +1557,7 @@ if ( (fd_inputs = (struct pollfd *) realloc(fd_inputs, (size_t) (fd_in_count + 50) * sizeof(struct pollfd))) == NULL) { - m_dprintf(MSYSLOG_CRITICAL, "realloc inputs"); + dprintf(MSYSLOG_CRITICAL, "realloc inputs"); exit(-1); } @@ -1560,7 +1565,7 @@ realloc(fd_inputs_mod, (size_t) (fd_in_count + 50) * sizeof(struct i_module *))) == NULL) { - m_dprintf(MSYSLOG_CRITICAL, "realloc inputs"); + dprintf(MSYSLOG_CRITICAL, "realloc inputs"); exit(-1); } @@ -1579,7 +1584,7 @@ { int i; - m_dprintf(MSYSLOG_INFORMATIVE, "remove_fd_input: remove fd %d\n", + dprintf(MSYSLOG_INFORMATIVE, "remove_fd_input: remove fd %d\n", fd); for (i = 0; i < fd_in_count && fd_inputs[i].fd != fd; i++); @@ -1637,7 +1642,7 @@ */ int -m_dprintf(const int level, char const *fmt, ...) +dprintf(const int level, char const *fmt, ...) { int ret; va_list var; Index: syslogd.h =================================================================== RCS file: /cvsroot/msyslog/syslog/src/syslogd.h,v retrieving revision 1.104 retrieving revision 1.104.2.1 diff -u -d -r1.104 -r1.104.2.1 --- syslogd.h 13 Aug 2002 17:25:12 -0000 1.104 +++ syslogd.h 11 Apr 2003 16:36:30 -0000 1.104.2.1 @@ -1,4 +1,4 @@ -/* $CoreSDI: syslogd.h,v 1.102 2001/10/22 22:49:42 alejo Exp $ */ +/* $CoreSDI: syslogd.h,v 1.111 2002/03/01 04:05:20 alejo Exp $ */ /* * Copyright (c) 1983, 1988, 1993, 1994 @@ -36,7 +36,14 @@ #ifndef SYSLOGD_H #define SYSLOGD_H -#define MAXLINE 1024 /* maximum line length */ +#ifndef MAXHOSTNAMELEN +# include <netdb.h> +# ifndef MAXHOSTNAMELEN +# define MAXHOSTNAMELEN 254 +# endif +#endif + +#define MAXLINE 2048 /* maximum line length */ #define MAXSVLINE 120 /* maximum saved line length */ #define DEFUPRI (LOG_USER|LOG_NOTICE) #define DEFSPRI (LOG_KERN|LOG_CRIT) @@ -69,7 +76,13 @@ * */ -int m_dprintf(int, char const *, ...); /* level, format, ... */ +#ifdef dprintf +#undef dprintf +#endif + +int dprintf(int, char const *, ...); /* level, format, ... */ +int getxopt(int, char *[], char *, int *); /* argc, argv, opts, startarg */ + #define MSYSLOG_CRITICAL 10 #define MSYSLOG_SERIOUS 20 @@ -101,6 +114,15 @@ #endif /* + * Decode function + */ +#define CODE_FACILITY 0x01 +#define CODE_PRIORITY 0x02 +char *decode_val(int, int); + + + +/* * This structure has the message and facility * of it. It is the struct to pass to om_write */ @@ -125,7 +147,7 @@ char *f_program; /* program this applies to */ struct tm f_tm; /* date of message */ char f_prevline[MAXSVLINE]; /* last message logged */ - char f_prevhost[SIZEOF_MAXHOSTNAMELEN]; /* host from which recd. */ + char f_prevhost[MAXHOSTNAMELEN]; /* host from which recd. */ int f_prevpri; /* pri of f_prevline */ int f_prevlen; /* length of f_prevline */ int f_prevcount; /* repetition cnt of prevline */ @@ -133,15 +155,6 @@ struct o_module *f_omod; /* module details */ }; -extern char LocalHostName[SIZEOF_MAXHOSTNAMELEN]; /* our hostname */ -extern int finet; /* Internet datagram socket */ -extern int Debug; /* debug flag */ -extern int DaemonFlags; /* running daemon flags */ -#define SYSLOGD_LOCKED_PIDFILE 0x01 /* pidfile is locked */ -#define SYSLOGD_INET_IN_USE 0x02 /* INET sockets are open */ -#define SYSLOGD_INET_READ 0x04 /* we read */ -#define SYSLOGD_MARK 0x08 /* call domark() */ -#define SYSLOGD_DIE 0x10 /* call die() */ void logerror(char *); void logmsg(int, char *, char *, int); |
From: <al...@us...> - 2003-04-11 16:37:05
|
Update of /cvsroot/msyslog/syslog/src/examples In directory sc8-pr-cvs1:/tmp/cvs-serv30672/src/examples Modified Files: Tag: v1_08 im_mymodule.c om_mymodule.c Log Message: start to fix the mess. 1.08e was not tagged. 1.08 did not contain 1.08e's changes so now 1.08 should be == to 1.08e 1.08f tag is BUSTED now shoud fix BO and some stuff, and tag 1.08g another lesson to self, always be thorogh w/ dealing w/ cvs Index: im_mymodule.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/examples/im_mymodule.c,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -u -d -r1.12 -r1.12.2.1 --- im_mymodule.c 13 Aug 2002 17:25:13 -0000 1.12 +++ im_mymodule.c 11 Apr 2003 16:36:30 -0000 1.12.2.1 @@ -1,4 +1,4 @@ -/* $CoreSDI: im_mymodule.c,v 1.10 2001/03/07 21:35:13 alejo Exp $ */ +/* $CoreSDI: im_mymodule.c,v 1.11 2001/03/23 00:12:29 alejo Exp $ */ /* * Copyright (c) 2001, Core SDI S.A., Argentina @@ -54,11 +54,11 @@ im_mymodule_read(struct i_module *im, int index, struct im_msg *ret) { - m_dprintf(MSYSLOG_INFORMATIVE, "om_mymodule_read: Entering\n"); + dprintf(MSYSLOG_INFORMATIVE, "om_mymodule_read: Entering\n"); /* read from input */ - m_dprintf(MSYSLOG_INFORMATIVE, "om_mymodule_read: Leaving\n"); + dprintf(MSYSLOG_INFORMATIVE, "om_mymodule_read: Leaving\n"); return (1); } @@ -71,11 +71,11 @@ int im_mymodule_init (struct i_module *I, char **argv, int argc) { - m_dprintf(MSYSLOG_INFORMATIVE, "om_mymodule_init: Entering\n"); + dprintf(MSYSLOG_INFORMATIVE, "om_mymodule_init: Entering\n"); /* initialize */ - m_dprintf(MSYSLOG_INFORMATIVE, "om_mymodule_init: Leaving\n"); + dprintf(MSYSLOG_INFORMATIVE, "om_mymodule_init: Leaving\n"); add_fd_input(I->im_fd , I, 0); @@ -89,11 +89,11 @@ int im_mymodule_close (struct i_module *im) { - m_dprintf(MSYSLOG_INFORMATIVE, "om_mymodule_close: Entering\n"); + dprintf(MSYSLOG_INFORMATIVE, "om_mymodule_close: Entering\n"); /* close */ - m_dprintf(MSYSLOG_INFORMATIVE, "om_mymodule_close: Leaving\n"); + dprintf(MSYSLOG_INFORMATIVE, "om_mymodule_close: Leaving\n"); return (1); } Index: om_mymodule.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/examples/om_mymodule.c,v retrieving revision 1.15 retrieving revision 1.15.2.1 diff -u -d -r1.15 -r1.15.2.1 --- om_mymodule.c 13 Aug 2002 17:25:13 -0000 1.15 +++ om_mymodule.c 11 Apr 2003 16:36:31 -0000 1.15.2.1 @@ -1,4 +1,4 @@ -/* $CoreSDI: om_mymodule.c,v 1.13 2001/03/22 20:16:09 alejo Exp $ */ +/* $CoreSDI: om_mymodule.c,v 1.15 2002/03/01 07:31:02 alejo Exp $ */ /* * Copyright (c) 2001, Core SDI S.A., Argentina @@ -106,33 +106,33 @@ * char *prog; Program name doing this log * void **context; Our context */ - char *myArg; + char *myArg; + int argcnt; /* for debugging purposes */ - m_dprintf(MSYSLOG_INFORMATIVE, "om_mymodule_init: Entering\n"); + dprintf(MSYSLOG_INFORMATIVE, "om_mymodule_init: Entering\n"); /* - * Parse your options with getopt(3) + * Parse your options with getxopt() * * we give an example for a -s argument * * */ - optind = 1; -#ifdef HAVE_OPTRESET - optreset = 1; -#endif - while ((ch = getopt(argc, argv, "s:")) != -1) { + argcnt = 1; /* skip module name */ + + while ((ch = getxopt(argc, argv, "s!myargname:", &argcnt)) != -1) { switch (ch) { case 's': - myArg = optarg; + myArg = argv[argcnt]; break; - default : - m_dprintf(MSYSLOG_INFORMATIVE, "om_mymodule: " + default: + dprintf(MSYSLOG_INFORMATIVE, "om_mymodule: " "error on arguments\n"); return (-1); } + argcnt++; } @@ -145,7 +145,7 @@ -1 something went wrong */ - m_dprintf(MSYSLOG_INFORMATIVE, "om_mymodule_init: Leaving ok\n"); + dprintf(MSYSLOG_INFORMATIVE, "om_mymodule_init: Leaving ok\n"); return (1); } @@ -156,7 +156,7 @@ int om_mymodule_close (struct filed *f, void *ctx) { - m_dprintf(MSYSLOG_INFORMATIVE, "om_mymodule_close: Entering\n"); + dprintf(MSYSLOG_INFORMATIVE, "om_mymodule_close: Entering\n"); /* flush any buffered data and close this output */ @@ -165,7 +165,7 @@ -1 BAD */ - m_dprintf(MSYSLOG_INFORMATIVE, "om_mymodule_close: Leaving ok\n"); + dprintf(MSYSLOG_INFORMATIVE, "om_mymodule_close: Leaving ok\n"); return (ret); } @@ -173,7 +173,7 @@ int om_mymodule_flush (struct filed *f, void *context) { - m_dprintf(MSYSLOG_INFORMATIVE, "om_mymodule_flush: Entering\n"); + dprintf(MSYSLOG_INFORMATIVE, "om_mymodule_flush: Entering\n"); /* flush any pending output */ /* return: @@ -181,7 +181,7 @@ -1 BAD */ - m_dprintf(MSYSLOG_INFORMATIVE, "om_mymodule_flush: Leaving ok\n"); + dprintf(MSYSLOG_INFORMATIVE, "om_mymodule_flush: Leaving ok\n"); return (1); } |
Update of /cvsroot/msyslog/syslog In directory sc8-pr-cvs1:/tmp/cvs-serv30672 Modified Files: Tag: v1_08 AUTHORS INSTALL Makefile.in NEWS README configure configure.in Added Files: Tag: v1_08 QUICK_INSTALL Log Message: start to fix the mess. 1.08e was not tagged. 1.08 did not contain 1.08e's changes so now 1.08 should be == to 1.08e 1.08f tag is BUSTED now shoud fix BO and some stuff, and tag 1.08g another lesson to self, always be thorogh w/ dealing w/ cvs --- NEW FILE: QUICK_INSTALL --- $Id: QUICK_INSTALL,v 1.1.8.1 2003/04/11 16:36:20 alejo Exp $ ============================================================================== Modular Syslog package QUICK_INSTALL file (C)2000, 2001 Core-SDI. Buenos Aires, Argentina. ============================================================================== This file is a basic guide for installing modular syslog. SPECIAL NOTE ------------ Most of the documentation and examples are on the manual pages provided. They are meant to be the ultimate reference. See im_bsd.8, im_linux.8 im_udp.8, om_mysql.8, om_regex.8, peochk.8 im_doors.8, im_streams.8 im_unix.8, om_peo.8, om_tcp.8, syslog.conf.5, im_file.8, im_tcp.8 om_classic.8, om_pgsql.8, om_udp.8, and syslogd.8. 0. Compile ========== # tar xzvf msyslog-vXX.tgz or # gunzip -c msyslog-vXX.tgz | tar xvf - and # cd msyslog-vXX then # ./configure for /usr/local installs, or for /usr (i.e. Solaris, BSDs) # ./configure -prefix=/usr or the following for / installs (i.e. Linux) # ./configure -prefix=/usr Now compile and install # make install 1. Configuring ============== - read syslog.conf manpage, and understand the '%' usage (it is easy, checkout the examples) - on Solaris, remove all those LOG macros on /etc/syslog.conf. - see peochk and om_peo manpages' examples for hash protection - checkout all modules you may like withe their manpages. they ALL have examples - om_regex - om_mysql, om_pgsql - om_tcp, im_tcp, om_udp, im_udp 2. Running ========== Fisrt stop and kill running syslogd (and klogd in linux). Linux YOU DON'T NEED klogd. # /sbin/syslogd -i linux -i unix Solaris # /usr/sbin/syslogd -i streams BSDs # /usr/sbin/syslogd -i bsd -i unix If you want to receive on address 'myname' through TCP on port 4321, ad to that -i tcp '-h myname -p 4321', or for UDP -i tcp '-h myname -p 4321'. Index: AUTHORS =================================================================== RCS file: /cvsroot/msyslog/syslog/AUTHORS,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- AUTHORS 13 Aug 2002 20:15:05 -0000 1.3 +++ AUTHORS 11 Apr 2003 16:36:19 -0000 1.3.2.1 @@ -9,12 +9,11 @@ The NetBSD project (www.netbsd.org) adapted it The OpenBSD project(www.openbsd.org) project did a security audit and adapted it Alejo Sanchez (al...@co...) developed Modular Syslog for Core-SDI -coding specially autoconf sql support, and dynamic library use. +general coding specially autoconf, sql support, dynamic library use. Federico Schwindt (fg...@co...) did configure -Claudio Castiglia (cl...@co...) did makefile work +Claudio Castiglia (cl...@co...) did makefile work, peo and linux module. The Core-SDI consulting project did security audit for msyslog 1.0 -Current ALAT project (msyslog, auditd, etc.) coordinator is Federico Schwindt, -msyslog maintainer is Alejo Sanchez, and audit maintainer/developer is Claudio Castiglia. -Fredrick Paul Eisele (ph...@ne...) added modules refract, directory, and maintenance. - +Current Wisdom project (msyslog, auditd, etc.) coordinator is Ariel Aizenberg, +Msyslog mantainer/developer is Alejo Sanchez, and Audit[d] mantainer/developer is +Claudio Castiglia. Index: INSTALL =================================================================== RCS file: /cvsroot/msyslog/syslog/INSTALL,v retrieving revision 1.16 retrieving revision 1.16.2.1 diff -u -d -r1.16 -r1.16.2.1 --- INSTALL 13 Aug 2002 17:25:10 -0000 1.16 +++ INSTALL 11 Apr 2003 16:36:19 -0000 1.16.2.1 @@ -10,15 +10,39 @@ Msyslog has been tested on the following platforms: - - OpenBSD 2.6, 2.7, 2.8, 2.9 - - RedHat 6.2, 7.0 - - Debian - - Solaris 7 - - Irix + - OpenBSD 2.6, 2.7, 2.8, 2.9, 3.0 + - RedHat 6.2, 7.0, 7.1, 7.2 + - Debian Potato + - Solaris 7, 8 + - Irix64 6.5 - Aix 4.3 - Arthur Korn made a package for Debian users. You can contact him by mail -at: ar...@ko.... + + + + +SPECIAL NOTE +------------ + +Most of the documentation and examples are on the manual pages provided. +They are meant to be the ultimate reference. See im_bsd.8, im_linux.8 +im_udp.8, om_mysql.8, om_regex.8, peochk.8 im_doors.8, im_streams.8 +im_unix.8, om_peo.8, om_tcp.8, syslog.conf.5, im_file.8, im_tcp.8 +om_classic.8, om_pgsql.8, om_udp.8, and syslogd.8. + + +0. Packages +=========== + +There are Debian packages you can use with Debian's apt_get and friends. +(ie. apt_get msyslog) + +There are Redhat packages at the Sourceforge page. Those are built for +now by Florin Andrei. + +In the future we plan to have the package creation of RedHat, Debian, +OpenBSD, FreeBSD, NetBSD, and Solaris in the source tree. It would be done +with some make target like 'make rpm'. 1. Compiling @@ -118,27 +142,23 @@ 4. HOW TO CONTACT US AND RELATED MAILING LISTS ============================================== - There are several mailing lists for msyslog: + There are two mailing lists for msyslog: - msy...@co... + msyslog-usr This mailing list is for general discussions about the modular syslog system. - msy...@co... + msyslog-dev This mailing list is for technical discussions about the modular syslog system. It's intended for developers or any other person interested in the inner working parts of msyslog. - Send a message to maj...@co... with the in the message body, - replacing list-name by the name of the choosen list. - e.g. subscribe <msyslog-usr> - + Send a message to maj...@co... with the text: - msy...@li... - This mailing list is for general discussions about the - modular syslog system. - This list should be used for reporting all bugs. +subscribe list-name - <http://lists.sourceforge.net/lists/listinfo/msyslog-users> +in the message body, replacing list-name by the name of the +choosen list. You can also send an email to the developers only +at cor...@co.... Index: Makefile.in =================================================================== RCS file: /cvsroot/msyslog/syslog/Makefile.in,v retrieving revision 1.27 retrieving revision 1.27.2.1 diff -u -d -r1.27 -r1.27.2.1 --- Makefile.in 3 Apr 2001 21:23:07 -0000 1.27 +++ Makefile.in 11 Apr 2003 16:36:19 -0000 1.27.2.1 @@ -1,4 +1,4 @@ -# $CoreSDI: Makefile.in,v 1.26 2001/03/07 21:35:12 alejo Exp $ +# $CoreSDI: Makefile.in,v 1.32 2002/03/04 21:47:00 claudio Exp $ # # Copyright (c) 2001, Core SDI S.A., Argentina # All rights reserved @@ -31,6 +31,10 @@ MODULES_SUBDIR = src/modules SUBDIRS = src/peo $(MODULES_SUBDIR) src src/man INSTALL_SUBDIRS = src/modules src/peo src/man src +MSYSLOG_VERSION = @MSYSLOG_VERSION@ +RELEASE= msyslog-v${MSYSLOG_VERSION} +TARBALL= ${RELEASE}-src.tar.gz + all: all-recursive @@ -56,8 +60,24 @@ .PHONY: clean distclean install -clean: clean-recursive + +clean: clean-recursive port-clean + install: all install-recursive -distclean: distclean-recursive - -rm -f Makefile config.cache config.log config.status +distclean: distclean-recursive port-distclean + -rm -f Makefile config.cache config.log config.status ${TARBALL} + +dist distribution: src-dist + +src src-dist: clean + @tar -z -c -s '/\./${RELEASE}/' -f ${TARBALL} \ + `find ./ -type f -print | egrep -v \ + "CVS|config\.log|config\.status|config\.h$$|gz$$|akefile$$|/files"` && \ + echo "Distribution file ${TARBALL} has been created." + +ports port: src-dist + +port-clean port-distclean port ports: + @cd packaging && env DISTDIR=../`pwd` make $@ + Index: NEWS =================================================================== RCS file: /cvsroot/msyslog/syslog/NEWS,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -u -d -r1.11 -r1.11.2.1 --- NEWS 30 Apr 2001 19:15:33 -0000 1.11 +++ NEWS 11 Apr 2003 16:36:19 -0000 1.11.2.1 @@ -1,4 +1,4 @@ -/* $CoreSDI: NEWS,v 1.10 2001/04/30 19:12:30 alejo Exp $ */ +/* $CoreSDI: NEWS,v 1.11 2001/04/30 19:15:33 alejo Exp $ */ 1.0 Release Notes: Index: README =================================================================== RCS file: /cvsroot/msyslog/syslog/README,v retrieving revision 1.16 retrieving revision 1.16.2.1 diff -u -d -r1.16 -r1.16.2.1 --- README 22 Oct 2001 21:15:55 -0000 1.16 +++ README 11 Apr 2003 16:36:20 -0000 1.16.2.1 @@ -1,4 +1,19 @@ -/* $CoreSDI: README,v 1.15 2001/10/18 20:32:35 alejo Exp $ */ +/* $CoreSDI: README,v 1.20 2002/03/04 21:47:14 claudio Exp $ */ + + + + +SPECIAL NOTE +------------ + +Most of the documentation and examples are on the manual pages provided. +They are meant to be the ultimate reference. See im_bsd.8, im_linux.8 +im_udp.8, om_mysql.8, om_regex.8, peochk.8 im_doors.8, im_streams.8 +im_unix.8, om_peo.8, om_tcp.8, syslog.conf.5, im_file.8, im_tcp.8 +om_classic.8, om_pgsql.8, om_udp.8, and syslogd.8. + + + Installation ------------ @@ -83,7 +98,7 @@ must be specified as om_mysql(8) manpage. PostgreSQL Output Module -------------------- +------------------------ Performs loggin in a PostgreSQL server, either local or remote. The table format must be specified as om_pgsql(8) manpage. @@ -152,4 +167,31 @@ May be needed on for other input modules. Invoke it like this on command line -i doors or -i doors:/etc/.syslog_door (or equivalent). + + + + +OpenBSD binary packages +----------------------- + +It is possible to generate two OpenBSD packages: msyslog and msyslog-devel +the first contains the msyslog binaries and the other some files for +external module makers (external module means: a module not included +into the "libmsyslog.so.X.X" library, this module should be named +"libmsyslog_<modulenaem>.so" and located into the msyslog library directory). +To generate the packages some steps should be done: + $ ./configure + $ make ports +This generates three tar balls: msyslog-vX.XX-src.tar.gz, msyslog_port-X.XX.tgz, +and msyslog_port-devel-X.XX.tgz. +A common way to generate the packages is: + $ sudo cp msyslog-vX.XX-src.tar.gz /usr/ports/distfiles/ + $ tar zxf msyslog_port-X.XX.tgz + $ tar zxf msyslog_port-devel-X.XX.tgz + $ cd msyslog_port-X.XX && make && sudo make package + $ cd ../msyslog_port-devel-X.XX && make && sudo make package +Both packages will be created at /usr/ports/packages/<plat>/All. +You can avoid the sudo command by using DISTDIR and PACKAGES variables +(see bsd.port.mk(5)). + Index: configure =================================================================== RCS file: /cvsroot/msyslog/syslog/configure,v retrieving revision 1.86.2.2 retrieving revision 1.86.2.3 diff -u -d -r1.86.2.2 -r1.86.2.3 --- configure 9 Apr 2003 19:18:50 -0000 1.86.2.2 +++ configure 11 Apr 2003 16:36:20 -0000 1.86.2.3 @@ -680,6 +680,9 @@ --without-unix Use unix socket domain input module. Activated by default. + --without-file + Use file/pip input module. Activated by default. + --without-streams Use streams input module. Activated by default. @@ -698,9 +701,6 @@ --without-peo [...1144 lines suppressed...] { (exit 1); exit 1; }; } echo $f;; @@ -5729,7 +5691,7 @@ echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:5732: error: cannot find input file: $f" >&5 + { { echo "$as_me:5694: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -5846,7 +5808,7 @@ rm -f $tmp/in if test x"$ac_file" != x-; then if cmp -s $ac_file $tmp/config.h 2>/dev/null; then - { echo "$as_me:5849: $ac_file is unchanged" >&5 + { echo "$as_me:5811: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ Index: configure.in =================================================================== RCS file: /cvsroot/msyslog/syslog/configure.in,v retrieving revision 1.146.2.2 retrieving revision 1.146.2.3 diff -u -d -r1.146.2.2 -r1.146.2.3 --- configure.in 9 Apr 2003 19:18:57 -0000 1.146.2.2 +++ configure.in 11 Apr 2003 16:36:25 -0000 1.146.2.3 @@ -1,4 +1,4 @@ -dnl $CoreSDI: configure.in,v 1.143 2001/09/19 15:58:44 alejo Exp $ +dnl $CoreSDI: configure.in,v 1.158 2002/03/04 22:17:57 alejo Exp $ dnl Process this file with autoconf to produce a configure script. AC_INIT(src/syslogd.c) AC_CONFIG_HEADER(src/config.h) @@ -23,7 +23,7 @@ AC_CHECK_HEADERS(fcntl.h limits.h paths.h strings.h inttypes.h sys/ioctl.h \ sys/types.h sys/time.h machine/endian.h syslog.h unistd.h sysctl.h \ - err.h sys/context.h ) + err.h sys/context.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST @@ -46,7 +46,7 @@ LIBS_SAVE="$LIBS" LIBS="$LIBS $SYSLOGD_LIBS" AC_CHECK_FUNCS(gethostname inet_ntop getaddrinfo regcomp poll select\ - socket strdup strerror strstr strtoul ) + socket strdup strerror strstr strtoul inet_aton inet_addr ) LIBS="$LIBS_SAVE" dnl Check endianness @@ -61,7 +61,8 @@ CFLAGS="$CFLAGS -Wall" fi -MSYSLOG_VERSION="1.08" +MSYSLOG_VERSION="1.08e" + AC_DEFINE_UNQUOTED(MSYSLOG_VERSION_STR, "$MSYSLOG_VERSION") echo msyslog version... $MSYSLOG_VERSION @@ -97,14 +98,11 @@ for MANDIR in "/usr/share/man" "/usr/man" do if test -d $MANDIR ; then + mandir=$MANDIR; break; fi done -dnl AC_MSG_CHECKING(for MAXHOSTNAMELEN) - -AC_CHECK_SIZEOF_DEFINE(MAXHOSTNAMELEN, 254) - dnl Check underscore requirement for dlsym() AC_MSG_CHECKING(wether netdb.h requires _USE_IRS) @@ -189,12 +187,9 @@ SHARED_PARAMS="-lc -bI:libmsyslog.imp -bexpall -bnoentry -brtl" cat > src/modules/libmsyslog.imp <<-EOF #! . - m_dprintf - finet + dprintf logerror - DaemonFlags add_fd_input - LocalHostName place_signal remove_fd_input printline @@ -215,9 +210,9 @@ AC_DEFINE(PID_FILE, "syslog.pid") fi - +dnl dnl Here we check module support - +dnl temp_res="no"; AC_ARG_WITH(bsd, @@ -281,6 +276,17 @@ AC_DEFINE(HAVE_UNIX_IMODULE) MANPAGES="$MANPAGES im_unix.8" fi +temp_res="yes"; + +AC_ARG_WITH(file, +[ --without-file + Use file/pip input module. Activated by default. +],[ temp_res="$with_file"; ]) +if test "X$temp_res" = "Xyes" ; then + MSRCS="$MSRCS im_file.c" + AC_DEFINE(HAVE_FILE_IMODULE) + MANPAGES="$MANPAGES im_file.8" +fi dnl Doors should only be used with streams @@ -418,38 +424,27 @@ fi fi -AC_ARG_WITH(queue, -[ --without-queue - Use directory output module. Activated by default. -],[ - if test $with_queue = "yes" ; then - MSRCS="$MSRCS om_directory.c om_queue.c" - MANPAGES="$MANPAGES om_directory.8" - fi -] -dnl ,[ -dnl MSRCS="$MSRCS om_directory.c om_queue.c" -dnl MANPAGES="$MANPAGES om_directory.8" -) - AC_ARG_WITH(regex, [ --without-regex Use regex pattern matching output module. Activated by default. ],[ if test $with_regex = "yes" ; then - MSRCS="$MSRCS om_regex.c om_refract.c" - MANPAGES="$MANPAGES om_regex.8 om_refract.8" + MSRCS="$MSRCS om_regex.c" + MANPAGES="$MANPAGES om_regex.8" fi ],[ AC_CHECK_HEADER(regex.h, [ - MSRCS="$MSRCS om_regex.c om_refract.c" - MANPAGES="$MANPAGES om_regex.8 om_refract.8" + MSRCS="$MSRCS om_regex.c" + MANPAGES="$MANPAGES om_regex.8" ]) ]) AC_CACHE_SAVE -AC_CHECK_TYPES(socklen_t) +AC_CHECK_TYPES(socklen_t,,,[#include <stdio.h> +#include <sys/socket.h> +#include <sys/types.h>]) + AC_CHECK_TYPES(uint32_t) AC_CHECK_TYPES(uint64_t) AC_CHECK_TYPES(u_int32_t) @@ -461,8 +456,6 @@ #define SYSLOG_NAMES #include <syslog.h>]) -dnl check CODE structure typedef -dnl AC_CHECK_CODE_TYPE() AC_SUBST(SYSLOGD_LIBS) AC_SUBST(SHARED_PARAMS) @@ -477,6 +470,7 @@ AC_SUBST(HAVE_SOCKLEN_T) AC_SUBST(MAIN_CPPFLAGS) AC_SUBST(MSYSLOG_DAEMON_NAME) +AC_SUBST(MSYSLOG_VERSION) dnl AC_SUBST(SYMBOL_PREFIX) @@ -486,4 +480,8 @@ src/peo/Makefile src/man/Makefile src/man/BSDmakefile - src/man/GNUmakefile]) + src/man/GNUmakefile + packaging/Makefile + packaging/OpenBSD/Makefile + packaging/OpenBSD/pkg/PLIST + packaging/OpenBSD-devel/Makefile]) |
From: <al...@us...> - 2003-04-11 16:36:49
|
Update of /cvsroot/msyslog/syslog/src/peo In directory sc8-pr-cvs1:/tmp/cvs-serv30672/src/peo Modified Files: Tag: v1_08 Makefile.in TODO hash.c hash.h peochk.c typedefs.h Log Message: start to fix the mess. 1.08e was not tagged. 1.08 did not contain 1.08e's changes so now 1.08 should be == to 1.08e 1.08f tag is BUSTED now shoud fix BO and some stuff, and tag 1.08g another lesson to self, always be thorogh w/ dealing w/ cvs Index: Makefile.in =================================================================== RCS file: /cvsroot/msyslog/syslog/src/peo/Makefile.in,v retrieving revision 1.23 retrieving revision 1.23.2.1 diff -u -d -r1.23 -r1.23.2.1 --- Makefile.in 24 May 2001 01:38:13 -0000 1.23 +++ Makefile.in 11 Apr 2003 16:36:41 -0000 1.23.2.1 @@ -1,4 +1,4 @@ -# $CoreSDI: Makefile.in,v 1.22 2001/04/28 01:52:18 alejo Exp $ +# $CoreSDI: Makefile.in,v 1.25 2002/03/01 07:31:03 alejo Exp $ # # Copyright (c) 2001, Core SDI S.A., Argentina # All rights reserved @@ -36,13 +36,13 @@ INSTALL_DIR= @prefix@/sbin PROG= peochk -SRCS= peochk.c @HASH_SRCS@ +SRCS= peochk.c ../options.c @HASH_SRCS@ OBJS= $(SRCS:.c=.o) all: $(PROG) $(OBJS) $(OBJS): $(SRCS) - $(CC) $(CFLAGS) $(CPPFLAGS) -c $(SRCS) + $(CC) $(CFLAGS) $(CPPFLAGS) -c $(@:.o=.c) -o $@ $(PROG): $(OBJS) $(CC) $(CFLAGS) $(OBJS) -o $@ @@ -56,7 +56,7 @@ install: @if [ ! -d $(INSTALL_DIR) ]; then \ - $(INSTALL) -d $(INSTALL_DIR); \ + mkdir -p $(INSTALL_DIR); \ fi -$(INSTALL) ${PROG} $(INSTALL_DIR) Index: TODO =================================================================== RCS file: /cvsroot/msyslog/syslog/src/peo/TODO,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -u -d -r1.8 -r1.8.2.1 --- TODO 7 May 2001 18:12:41 -0000 1.8 +++ TODO 11 Apr 2003 16:36:41 -0000 1.8.2.1 @@ -1,4 +1,4 @@ -/* $CoreSDI: TODO,v 1.7 2001/02/12 17:19:38 claudio Exp $ */ +/* $CoreSDI: TODO,v 1.8 2001/05/07 18:12:41 claudio Exp $ */ Things to do: - Peochek utility and commutication with audit (raw and xml) Index: hash.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/peo/hash.c,v retrieving revision 1.43 retrieving revision 1.43.2.1 diff -u -d -r1.43 -r1.43.2.1 --- hash.c 5 Apr 2001 20:56:26 -0000 1.43 +++ hash.c 11 Apr 2003 16:36:41 -0000 1.43.2.1 @@ -1,4 +1,4 @@ -/* $CoreSDI: hash.c,v 1.42 2001/03/14 23:35:22 alejo Exp $ */ +/* $CoreSDI: hash.c,v 1.43 2001/04/05 20:56:26 alejo Exp $ */ /* * Copyright (c) 2001, Core SDI S.A., Argentina Index: hash.h =================================================================== RCS file: /cvsroot/msyslog/syslog/src/peo/hash.h,v retrieving revision 1.18 retrieving revision 1.18.2.1 diff -u -d -r1.18 -r1.18.2.1 --- hash.h 5 Apr 2001 20:56:26 -0000 1.18 +++ hash.h 11 Apr 2003 16:36:41 -0000 1.18.2.1 @@ -1,4 +1,4 @@ -/* $CoreSDI: hash.h,v 1.17 2001/03/07 21:35:16 alejo Exp $ +/* $CoreSDI: hash.h,v 1.18 2001/04/05 20:56:26 alejo Exp $ */ /* * Copyright (c) 2001, Core SDI S.A., Argentina Index: peochk.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/peo/peochk.c,v retrieving revision 1.52 retrieving revision 1.52.2.1 diff -u -d -r1.52 -r1.52.2.1 --- peochk.c 3 May 2001 20:02:18 -0000 1.52 +++ peochk.c 11 Apr 2003 16:36:41 -0000 1.52.2.1 @@ -1,4 +1,4 @@ -/* $CoreSDI: peochk.c,v 1.51 2001/05/02 22:36:24 claudio Exp $ */ +/* $CoreSDI: peochk.c,v 1.54 2002/03/01 07:31:03 alejo Exp $ */ /* * Copyright (c) 2001, Core SDI S.A., Argentina @@ -50,9 +50,9 @@ * * NOTES: * 1) When logfile is specified without the -f switch, the data is - * readed from the standard input + * read from the standard input * 2) If logfile is specified using both -f switch and without it, - * the -f argument is used and data is readed from that file + * the -f argument is used and data is read from that file * 3) If logfile is specified but not the keyfile, this will be * /var/ssyslog/xxx.key where xxx is the logfile with all '/' * replaced by '.' @@ -106,8 +106,6 @@ char *macfile; int method; -extern char *optarg; - /* * release allocated memory @@ -388,6 +386,7 @@ main(int argc, char **argv) { int ch; + int argcnt; int mac; /* integrity check mode, stdin */ @@ -401,54 +400,69 @@ macfile = NULL; method = SHA1; - /* parse command line */ - while ( (ch = getopt(argc, argv, "f:ghi:k:lm:q")) != -1) { + argcnt = 1; /* skip program name */ + + while ((ch = getxopt(argc, argv, "f!logfile: g!generatekey" + " i!initkeyfile: k!keyfile: l!mac m!method: q!quiet h!help", + &argcnt)) != -1) { + switch (ch) { case 'f': /* log file (intrusion detection mode) */ if (logfile != default_logfile) free(logfile); - if ( (logfile = strrealpath(optarg)) == NULL) { + + if ((logfile = strrealpath(argv[argcnt])) + == NULL) { release(); - perror(optarg); + perror(argv[argcnt]); exit(-1); } + actionf &= ~ST_IN; break; + case 'g': /* generate new keyfile and initial key */ actionf &= ~CHECK; break; + case 'i': /* key 0 file */ if (key0file) free(key0file); - if ( (key0file = strdup(optarg)) == NULL) { + if ((key0file = strdup(argv[argcnt])) + == NULL) { release(); - perror(optarg); + perror(argv[argcnt]); exit(-1); } break; + case 'k': /* keyfile */ if (keyfile != default_keyfile) free(keyfile); - if ( (keyfile = strdup(optarg)) == NULL) { + + if ((keyfile = strdup(argv[argcnt])) == NULL) { release(); - perror(optarg); + perror(argv[argcnt]); exit(-1); } break; + case 'l': mac = 1; break; + case 'm': /* hash method */ - if ( (method = gethash(optarg)) < 0) { + if ( (method = gethash(argv[argcnt])) < 0) { release(); usage(); } break; + case 'q': /* quiet mode */ actionf |= QUIET; @@ -459,11 +473,13 @@ usage(); } + argcnt++; + } /* check logfile specified without -f switch */ - argc -= optind; - argv += optind; + argc -= argc; + argv += argc; if (argc && (actionf & ST_IN)) if ( (logfile = strrealpath(argv[argc-1])) == NULL) { release(); Index: typedefs.h =================================================================== RCS file: /cvsroot/msyslog/syslog/src/peo/typedefs.h,v retrieving revision 1.5 retrieving revision 1.5.4.1 diff -u -d -r1.5 -r1.5.4.1 --- typedefs.h 27 Mar 2001 22:53:53 -0000 1.5 +++ typedefs.h 11 Apr 2003 16:36:42 -0000 1.5.4.1 @@ -1,4 +1,4 @@ -/* $CoreSDI: typedefs.h,v 1.4 2001/03/27 22:50:26 alejo Exp $ +/* $CoreSDI: typedefs.h,v 1.5 2001/03/27 22:53:53 alejo Exp $ */ #ifndef PEO_TYPEEFS_H |
Update of /cvsroot/msyslog/syslog/src/modules In directory sc8-pr-cvs1:/tmp/cvs-serv30672/src/modules Modified Files: Tag: v1_08 Makefile.in im_bsd.c im_doors.c im_linux.c im_streams.c im_tcp.c im_udp.c im_unix.c ip_misc.c om_classic.c om_mysql.c om_peo.c om_pgsql.c om_regex.c om_tcp.c om_udp.c sql_misc.c sql_misc.h Added Files: Tag: v1_08 im_file.c Log Message: start to fix the mess. 1.08e was not tagged. 1.08 did not contain 1.08e's changes so now 1.08 should be == to 1.08e 1.08f tag is BUSTED now shoud fix BO and some stuff, and tag 1.08g another lesson to self, always be thorogh w/ dealing w/ cvs --- NEW FILE: im_file.c --- /* $CoreSDI: im_file.c,v 1.12 2002/03/01 07:31:02 alejo Exp $ */ /* * Copyright (c) 2001, Core SDI S.A., Argentina * All rights reserved * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither name of the Core SDI S.A. nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * im_file -- read from a log file being written by other program * * Author: Alejo Sanchez for Core-SDI SA * http://www.corest.com/ * */ #include "config.h" #include <sys/types.h> #include <ctype.h> #include <errno.h> #include <fcntl.h> #include <limits.h> #include <signal.h> #include <stdlib.h> #include <string.h> #include <syslog.h> #include <time.h> #include <unistd.h> #include "../modules.h" #include "../syslogd.h" struct im_file_ctx { char *timefmt; int start; }; /* * initialize file input * */ int im_file_init(struct i_module *I, char **argv, int argc) { char *path; struct im_file_ctx *c; int ch, argcnt, start; dprintf(MSYSLOG_INFORMATIVE, "im_file_init: Entering\n"); I->im_path = NULL; start = 0; path = NULL; c = NULL; /* just to make compiler happy */ /* parse command line */ argcnt = 1; /* skip module name */ while ((ch = getxopt(argc, argv, "f!file: p!pipe: n!program:" " t!timeformat: s!startpos:", &argcnt)) != -1) { switch (ch) { case 'f': /* file to read */ path = argv[argcnt]; break; case 'p': /* pipe to read */ path = argv[argcnt]; break; case 'n': I->im_path = strdup(argv[argcnt]); break; case 's': start = strtol(argv[argcnt], NULL, 10); break; case 't': if ((I->im_ctx = malloc(sizeof(struct im_file_ctx))) == NULL) { dprintf(MSYSLOG_SERIOUS, "om_file_init: error" " allocating context!\n"); return (-1); } c = (struct im_file_ctx *) I->im_ctx; c->timefmt = strdup(argv[argcnt]); break; default: dprintf(MSYSLOG_SERIOUS, "om_file_init: command line" " error, at arg %c [%s]\n", ch, argv[argcnt]? argv[argcnt]: ""); return (-1); } argcnt++; } if (I->im_ctx != NULL && c->timefmt == NULL) { dprintf(MSYSLOG_SERIOUS, "om_file_init: start of time string but" " no string!\n"); return (-1); } if (I->im_ctx != NULL) c->start = start; if (path == NULL) { dprintf(MSYSLOG_SERIOUS, "om_file_init: no file/pipe to read\n"); return (-1); } if ((I->im_fd = open(path, O_RDONLY, 0)) < 0) { dprintf(MSYSLOG_SERIOUS, "im_file_init: can't open %s (%d)\n", argv[1], errno); return (-1); } if (I->im_path == NULL) I->im_path = path; /* no name specified */ add_fd_input(I->im_fd , I); return (1); } /* * get message * */ int im_file_read(struct i_module *im, int infd, struct im_msg *ret) { char *p, *q; int i, c; RETSIGTYPE (*sigsave)(int); /* ignore sigpipes for mysql_ping */ sigsave = place_signal(SIGPIPE, SIG_IGN); i = read(im->im_fd, im->im_buf, sizeof(im->im_buf) - 1); if (i > 0) { (im->im_buf)[i] = '\0'; for (p = im->im_buf; *p != '\0'; ) { /* fsync file after write */ ret->im_flags = ADDDATE; ret->im_pri = DEFSPRI; if (im->im_ctx != NULL) { struct tm tm; struct im_file_ctx *c; char *start, *end; /* apply strftime */ c = (struct im_file_ctx *) im->im_ctx; if ((end = strptime((p + c->start), c->timefmt, &tm)) == NULL) { dprintf(MSYSLOG_WARNING, "om_file_read" ": error parsing time!\n"); } else { for (start = p + c->start; *end != '\0';) *start++ = *end++; *start = '\0'; if (strftime(ret->im_msg, sizeof(ret->im_msg) - 1, "%b %e %H:%M:%S ", &tm) == 0) { dprintf(MSYSLOG_WARNING, "om_file_read: error " "printing time!\n"); } else { ret->im_flags &= !ADDDATE; } } } else if (*p == '<') { ret->im_pri = 0; while (isdigit((int)*++p)) ret->im_pri = 10 * ret->im_pri + (*p - '0'); if (*p == '>') ++p; } strncat(ret->im_msg, im->im_path, strlen(ret->im_msg) - sizeof(ret->im_msg) - 1); strncat(ret->im_msg, ":", strlen(ret->im_msg) - sizeof(ret->im_msg) - 1); dprintf(MSYSLOG_INFORMATIVE, "im_file_read: Entering " "with header %s\n", ret->im_msg); if (ret->im_pri &~ (LOG_FACMASK|LOG_PRIMASK)) ret->im_pri = DEFSPRI; q = ret->im_msg + strlen(ret->im_msg); while (*p != '\0' && (c = *p++) != '\n' && q < &ret->im_msg[sizeof(ret->im_msg) - 1]) { *q++ = c; } *q = '\0'; ret->im_host[0] = '\0'; ret->im_len = strlen(ret->im_msg); logmsg(ret->im_pri, ret->im_msg, ret->im_host, ret->im_flags); } } else if (i < 0 && errno != EINTR) { logerror("im_file_read"); im->im_fd = -1; } /* restore previous SIGPIPE handler */ place_signal(SIGPIPE, sigsave); /* if ok return (2) wich means already logged */ return (im->im_fd == -1 ? -1: 2); } int im_file_close( struct i_module *im) { if (im->im_ctx != NULL) { struct im_file_ctx *c; c = (struct im_file_ctx *) im->im_ctx; if (c->timefmt) free(c->timefmt); free(c); } if (im->im_path != NULL) free(im->im_path); if (im->im_fd >= 0) close(im->im_fd); return (0); } Index: Makefile.in =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/Makefile.in,v retrieving revision 1.72 retrieving revision 1.72.2.1 diff -u -d -r1.72 -r1.72.2.1 --- Makefile.in 19 Sep 2001 09:58:58 -0000 1.72 +++ Makefile.in 11 Apr 2003 16:36:36 -0000 1.72.2.1 @@ -1,4 +1,4 @@ -# $CoreSDI: Makefile.in,v 1.71 2001/09/19 09:56:26 alejo Exp $ +# $CoreSDI: Makefile.in,v 1.73 2001/11/20 00:48:41 alejo Exp $ # # Copyright (c) 2001, Core SDI S.A., Argentina # All rights reserved @@ -64,7 +64,7 @@ install: @echo "installing shared library..." @if [ ! -d $(INSTALL_LIBDIR) ]; then \ - $(INSTALL) -d $(INSTALL_LIBDIR); \ + mkdir -p $(INSTALL_LIBDIR); \ fi @$(INSTALL) $(MLIBNAME) $(INSTALL_LIBDIR)/ && echo "$(INSTALL_LIBDIR)/$(MLIBNAME)" Index: im_bsd.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/im_bsd.c,v retrieving revision 1.82.2.2 retrieving revision 1.82.2.3 diff -u -d -r1.82.2.2 -r1.82.2.3 --- im_bsd.c 10 Apr 2003 02:12:57 -0000 1.82.2.2 +++ im_bsd.c 11 Apr 2003 16:36:36 -0000 1.82.2.3 @@ -1,4 +1,4 @@ -/* $CoreSDI: im_bsd.c,v 1.80 2001/03/23 00:12:29 alejo Exp $ */ +/* $CoreSDI: im_bsd.c,v 1.83 2001/11/21 05:15:25 alejo Exp $ */ /* * Copyright (c) 2001, Core SDI S.A., Argentina @@ -43,7 +43,6 @@ #include <sys/uio.h> #include <sys/param.h> -#include <assert.h> #include <fcntl.h> #include <ctype.h> #include <errno.h> @@ -67,10 +66,10 @@ im_bsd_init(struct i_module *I, char **argv, int argc) { - m_dprintf(MSYSLOG_INFORMATIVE, "im_bsd_init: Entering\n"); + dprintf(MSYSLOG_INFORMATIVE, "im_bsd_init: Entering\n"); if ((I->im_fd = open(_PATH_KLOG, O_RDONLY, 0)) < 0) { - m_dprintf(MSYSLOG_SERIOUS, "can't open %s (%d)\n", _PATH_KLOG, + dprintf(MSYSLOG_SERIOUS, "can't open %s (%d)\n", _PATH_KLOG, errno); return (-1); } @@ -94,14 +93,8 @@ char *p, *q, *lp; int i, c; - /* ret->im_mlen is the size of ret->im_msg */ - assert(ret->im_mlen > (strlen(_PATH_UNIX) + 5)); - - strncpy(ret->im_msg, _PATH_UNIX, ret->im_mlen - 3); - ret->im_msg[ret->im_mlen - 1] = '\0'; - + strncpy(ret->im_msg, _PATH_UNIX, sizeof(ret->im_msg) - 4); strncat(ret->im_msg, ": ", 2); - lp = ret->im_msg + strlen(ret->im_msg); i = read(im->im_fd, im->im_buf, sizeof(im->im_buf) - 1); @@ -126,11 +119,10 @@ ret->im_pri = DEFSPRI; q = lp; while (*p != '\0' && (c = *p++) != '\n' && - q < (ret->im_msg + ret->im_mlen)) + q < &ret->im_msg[sizeof(ret->im_msg) - 1]) *q++ = c; *q = '\0'; - strncpy(ret->im_host, LocalHostName, - sizeof(ret->im_host) - 1); + ret->im_host[0] = '\0'; ret->im_len = strlen(ret->im_msg); logmsg(ret->im_pri, ret->im_msg, ret->im_host, ret->im_flags); Index: im_doors.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/im_doors.c,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -u -d -r1.14 -r1.14.2.1 --- im_doors.c 13 Aug 2002 17:25:13 -0000 1.14 +++ im_doors.c 11 Apr 2003 16:36:36 -0000 1.14.2.1 @@ -1,4 +1,4 @@ -/* $CoreSDI: im_doors.c,v 1.12 2001/03/07 21:35:14 alejo Exp $ */ +/* $CoreSDI: im_doors.c,v 1.13 2001/03/23 00:12:29 alejo Exp $ */ /* * Copyright (c) 2001, Core SDI S.A., Argentina @@ -71,10 +71,10 @@ char *door_path = DEFAULT_DOOR; int fd; - m_dprintf(MSYSLOG_INFORMATIVE, "im_doors_init: Entering\n"); + dprintf(MSYSLOG_INFORMATIVE, "im_doors_init: Entering\n"); if (argc < 1 || argc > 2) { - m_dprintf(MSYSLOG_SERIOUS, "doors usage: -i doors[:path]\n\n"); + dprintf(MSYSLOG_SERIOUS, "doors usage: -i doors[:path]\n\n"); return (-1); } @@ -83,35 +83,35 @@ if (unlink(door_path) == -1) { if (errno != ENOENT) { - m_dprintf(MSYSLOG_SERIOUS, "im_doors: unlink(%s): %s\n", + dprintf(MSYSLOG_SERIOUS, "im_doors: unlink(%s): %s\n", door_path, strerror (errno)); return (-1); } - m_dprintf(MSYSLOG_INFORMATIVE, "%s didn't exist; it will be " + dprintf(MSYSLOG_INFORMATIVE, "%s didn't exist; it will be " "created\n", door_path); } if ((fd = open (door_path, O_CREAT | O_RDWR, 00644)) == -1) { - m_dprintf(MSYSLOG_SERIOUS, "im_doors: open(%s): %s\n", door_path, + dprintf(MSYSLOG_SERIOUS, "im_doors: open(%s): %s\n", door_path, strerror (errno)); return (-1); } if (close(fd) == -1) { /* if close() fails here, there's probably an fs error */ - m_dprintf(MSYSLOG_SERIOUS, "im_doors: close(%s): %s\n", + dprintf(MSYSLOG_SERIOUS, "im_doors: close(%s): %s\n", door_path, strerror (errno)); return (-1); } if ((fd = door_create(im_door_func, NULL, 0)) == -1) { - m_dprintf(MSYSLOG_SERIOUS, "im_doors: door_create: %s\n", + dprintf(MSYSLOG_SERIOUS, "im_doors: door_create: %s\n", strerror (errno)); return (-1); } if (fattach(fd, door_path) == -1) { - m_dprintf(MSYSLOG_SERIOUS, "im_doors: fattach(%s): %s\n", + dprintf(MSYSLOG_SERIOUS, "im_doors: fattach(%s): %s\n", door_path, strerror (errno)); return (-1); } @@ -137,14 +137,14 @@ logerror (logbuf); } else { - m_dprintf(MSYSLOG_INFORMATIVE, "door connection from uid %lu", + dprintf(MSYSLOG_INFORMATIVE, "door connection from uid %lu", (unsigned long)dcred.dc_euid); if (dcred.dc_euid != dcred.dc_ruid) - m_dprintf(MSYSLOG_INFORMATIVE) (" (%lu)", + dprintf(MSYSLOG_INFORMATIVE) (" (%lu)", (unsigned long)dcred.dc_ruid); - m_dprintf(MSYSLOG_INFORMATIVE) ("\n"); + dprintf(MSYSLOG_INFORMATIVE) ("\n"); } /* this function does absolutely nothing except return */ Index: im_linux.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/im_linux.c,v retrieving revision 1.53 retrieving revision 1.53.2.1 diff -u -d -r1.53 -r1.53.2.1 --- im_linux.c 13 Aug 2002 17:25:13 -0000 1.53 +++ im_linux.c 11 Apr 2003 16:36:37 -0000 1.53.2.1 @@ -1,4 +1,4 @@ -/* $CoreSDI: im_linux.c,v 1.51 2001/03/27 20:54:24 alejo Exp $ */ +/* $CoreSDI: im_linux.c,v 1.60 2002/03/01 08:43:37 alejo Exp $ */ /* * Copyright (c) 2001, Core SDI S.A., Argentina @@ -62,7 +62,8 @@ #define KSYM_TRANSLATE 0x01 #define KSYM_READ_TABLE 0x02 #define KLOG_USE_SYSCALL 0x04 -int flags; +#define KLOG_HAVE_NEWLINE 0x08 +int linux_flags; char *linux_input_module = "linux input module"; @@ -85,9 +86,12 @@ char *ksym_path = PATH_KSYM; Symbol *ksym_first = NULL; Symbol *ksym_current = NULL; +char saveline[MAXLINE + 1]; +int savelen; int ksym_init(); void ksym_close(); +int ksym_snprintf (char*, int, char*); Symbol *ksym_lookup (Symbol*, char*); int ksym_get_symbol (Symbol*); int ksym_parseline (char*, Symbol*); @@ -100,7 +104,7 @@ void im_linux_usage() { - m_dprintf(MSYSLOG_INFORMATIVE, "linux input module options:\n" + dprintf(MSYSLOG_INFORMATIVE, "linux input module options:\n" " [ -k file ] Use the specified file as source of kernel\n" " symbol information instead of %s.\n" " [ -r ] Force read symbol table on memory.\n" @@ -119,6 +123,30 @@ /* + * getLine: + * Search for a line on a string buffer + * returns a pointer to the line or NULL if the buffer is empty + */ +char* +getLine (char *buf, int *i) +{ + if (*buf == '\0') + return (NULL); + while (buf[*i] != '\n' && buf[*i] != '\0') + (*i)++; + if (buf[*i] == '\0') { + (*i)--; + } else { + if (buf[*i] == '\n') + linux_flags |= KLOG_HAVE_NEWLINE; + + buf[*i] = '\0'; + } + return (buf); +} + + +/* * Sets console loglevel */ int @@ -129,7 +157,7 @@ if ( (loglevel = strtoul(strlv, &err, 10)) < 0 || loglevel > 7 || *err != '\0') { - warnx("%s: invalid loglevel <%s>", linux_input_module, optarg); + warnx("%s: invalid loglevel <%s>", linux_input_module, strlv); return (-1); } warnx("%s: setting console loglevel to <%lu>", linux_input_module, @@ -149,41 +177,48 @@ im_linux_init (struct i_module *I, char **argv, int argc) { int ch; - int current_optind; + int argcnt; - m_dprintf(MSYSLOG_INFORMATIVE, "im_linux_init: Entering\n"); + dprintf(MSYSLOG_INFORMATIVE, "im_linux_init: Entering\n"); /* parse command line */ - current_optind = optind; /* syslogd calls im_linux_init when - * parsing command line - * This should be changed - */ - flags = KSYM_TRANSLATE; + /* syslogd calls im_linux_init when + * parsing command line + * This should be changed + */ + linux_flags = KSYM_TRANSLATE; if (argc > 1) { - optind = 1; - while ( (ch = getopt(argc, argv, "c:C:k:rsxh?")) != -1) + argcnt = 1; /* skip module name */ + + while ((ch = getxopt(argc, argv, "c!console: C!setconsole:" + " k!symbolfile: r!readsymbols s!syscalls x!notranslate" + " h!help", &argcnt)) != -1) { + switch(ch) { case 'c': /* specify console loglevel */ - if (im_linux_set_console_loglevel(optarg) < 0) + if (im_linux_set_console_loglevel(argv[argcnt]) + < 0) return (-1); break; case 'C': /* specify console loglevel and force exit */ - im_linux_set_console_loglevel(optarg); + im_linux_set_console_loglevel(argv[argcnt]); return (-1); case 'k': /* specify symbol file */ - if (strcmp(ksym_path, optarg)) - if ( (ksym_path = strdup(optarg)) == NULL) { + if (strcmp(ksym_path, argv[argcnt]) != 0 || + (ksym_path = strdup(argv[argcnt])) == NULL) { + warn("%s", linux_input_module); return (-1); + } break; case 'r': /* force to read symbol table and keep * it in memory */ - flags |= KSYM_READ_TABLE; + linux_flags |= KSYM_READ_TABLE; break; /* not supported yet, we need to talk about somethings */ @@ -191,12 +226,12 @@ case 's': /* force to use syscall instead * of _PATH_KLOG */ - flags |= KLOG_USE_SYSCALL; + linux_flags |= KLOG_USE_SYSCALL; break; #endif case 'x': /* do not translate kernel symbols */ - flags &= ~KSYM_TRANSLATE; + linux_flags &= ~KSYM_TRANSLATE; break; case 'h': /* usage */ @@ -205,11 +240,13 @@ im_linux_usage(); return (-1); } + argcnt++; + } } I->im_path = NULL; I->im_fd = 0; - if (flags & ~KLOG_USE_SYSCALL) { + if (!(linux_flags & KLOG_USE_SYSCALL)) { if ( (I->im_fd = open(_PATH_KLOG, O_RDONLY, 0)) >= 0) I->im_path = _PATH_KLOG; @@ -234,11 +271,12 @@ } /* open/read symbol table file */ - if ((flags & KSYM_TRANSLATE) && ksym_init() < 0) + if ((linux_flags & KSYM_TRANSLATE) && ksym_init() < 0) return (-1); - I->im_flags |= IMODULE_FLAG_KERN & ADDDATE; - optind = current_optind; + I->im_flags |= IMODULE_FLAG_KERN; + saveline[0] = '\0'; /* yes, globals are zeroed, but... */ + savelen = 0; add_fd_input(I->im_fd , I); return (I->im_fd); } @@ -262,7 +300,7 @@ /* syscall not supported yet */ #if 0 - if (im->im_path == NULL || flags & KLOG_USE_SYSCALL) + if (im->im_path == NULL || linux_flags & KLOG_USE_SYSCALL) /* this blocks */ /* i = klogctl(2, im->im_buf, sizeof(im->im_buf)-1); */ @@ -278,96 +316,50 @@ } if (i) { - char *nextline; - im->im_buf[i] = '\0'; /* log each msg line */ + i = 0; ptr = im->im_buf; - do { - - /* multiple lines ? */ - if((nextline = strchr(ptr, '\n')) != NULL) { - /* terminate this line and advance */ - *nextline++ = '\0'; - } - - if (*ptr == '\0') { - if (nextline != NULL) { - ptr = nextline; - continue; - } else - return (0); - } - - if (sscanf(ptr, "<%d>", &ret->im_pri) == 1) { - ptr = &ptr[3]; - } else { + while ( (ptr = getLine(ptr, &i)) != NULL) { + char *msg; + int buflen; + + /* get priority */ + if (i >= 3 && ptr[0] == '<' && + ptr[2] == '>' && isdigit(ptr[1])) { + ret->im_pri = ptr[1] - '0'; + ptr += 3; + i -= 3; + } + else /* from printk.c: DEFAULT_MESSAGE_LOGLEVEL */ ret->im_pri = LOG_WARNING; - } - - - /* parse kernel/module symbols */ - if (flags & KSYM_TRANSLATE) { - char buf[512], symbuf[20]; - Symbol sym; - int n; - - n = 0; - strncpy(ret->im_msg, "kernel: ", - sizeof(ret->im_msg) - 1); - ret->im_len = 8; - - while (sscanf(ptr, "%511[^[][<%[0-9a-fA-F]>]%n", - buf, symbuf, &n) == 2) { - - ptr = &ptr[n]; - n = 0; - - symbuf[sizeof(symbuf) - 1] = '\0'; - buf[sizeof(buf) - 1] = '\0'; - - ret->im_len += snprintf(ret->im_msg - + ret->im_len, sizeof(ret->im_msg) - - 1 - ret->im_len, "%s", buf); - - if (ksym_lookup(&sym, symbuf) == NULL) { - ret->im_len += snprintf(ret->im_msg - + ret->im_len, sizeof(ret->im_msg) - - 1 - ret->im_len, "[%s]", - symbuf); - continue; - } - - ret->im_len += snprintf(ret->im_msg - + ret->im_len, sizeof(ret->im_msg) - - 1 - ret->im_len, "[<%s> %s.%s ]", - sym.addr, sym.mname, sym.name); - } + msg = &saveline[savelen]; + buflen = sizeof(saveline) - savelen; - if (n > 0) { - ret->im_len += snprintf(ret->im_msg - + ret->im_len, sizeof(ret->im_msg) - - 1 - ret->im_len, "%s", buf); - ret->im_msg[ret->im_len] = '\0'; - } - } else - ret->im_len = snprintf(ret->im_msg, - sizeof(ret->im_msg) - 1, "kernel: %s", ptr); + /* + * Parse kernel/module symbols and print. + */ + if (linux_flags & KSYM_TRANSLATE) + savelen = ksym_snprintf(msg, buflen, ptr); + else + savelen = snprintf(msg, buflen, + savelen == 0 ? "kernel: %s" : "%s", ptr); - strncpy(ret->im_host, LocalHostName, - sizeof(ret->im_host)); - ret->im_host[sizeof(ret->im_host) - 1] = '\0'; + ret->im_host[0] = '\0'; - logmsg(ret->im_pri, ret->im_msg, ret->im_host, - im->im_flags); + if (linux_flags & KLOG_HAVE_NEWLINE) { + logmsg(ret->im_pri, saveline, ret->im_host, im->im_flags); + saveline[0] = '\0'; + savelen = 0; + linux_flags &= ~KLOG_HAVE_NEWLINE; + } ptr += i + 1; i = 0; - } while (nextline != NULL); + } } - return (0); } @@ -402,7 +394,7 @@ warn("%s: ksym_init: %s", linux_input_module, ksym_path); return (-1); } - if (flags & KSYM_READ_TABLE) { + if (linux_flags & KSYM_READ_TABLE) { last = NULL; while (fgets(buf, sizeof(buf), ksym_fd) != NULL) { if ( (next = (Symbol*) malloc(sizeof(Symbol))) == NULL) { @@ -449,6 +441,66 @@ } if (ksym_path != PATH_KSYM) free(ksym_path); +} + + +/* + * ksym_snprintf + */ +int +ksym_snprintf (char *buf, int bufsize, char *raw) +{ + int i; + int printed; + char *p1; + char *p2; + Symbol sym; + + if ( (printed = snprintf(buf, bufsize, "kernel: ")) < 0) + return (-1); + bufsize -= printed; + + while (bufsize && *raw != '\0') { + if ( (p1 = strstr(raw, "[<")) != NULL && + (p2 = strstr(p1, ">]")) != NULL) { + for (i = 2; p1+i < p2 && isxdigit(p1[i]); i++); + if (p1+i == p2) { + *p2 = '\0'; + if (ksym_lookup(&sym, p1+2) != NULL) { + *p1 = '\0'; + if ( (printed += + snprintf(buf+printed, bufsize, + "%s [<%s> %s.%s ]", raw, sym.addr, + sym.mname, sym.name)) < 0) + return (-1); + bufsize -= printed; + + /* we need to solve some things + * about buf and msg params on + * im_xxxxx_read. + * so, i think that is better + * not to change raw data ;;; + */ + *p1 = '['; + *p2 = '>'; + raw = p2+2; + continue; + } + *p2 = '>'; + } + } + break; + } + + if (*raw) { + /* kernel message without symbols */ + if ( (i = snprintf(buf+printed, bufsize, "%s", raw)) < 0) + return (-1); + else + printed += i; + } + + return (printed); } Index: im_streams.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/im_streams.c,v retrieving revision 1.17 retrieving revision 1.17.2.1 diff -u -d -r1.17 -r1.17.2.1 --- im_streams.c 13 Aug 2002 17:25:13 -0000 1.17 +++ im_streams.c 11 Apr 2003 16:36:37 -0000 1.17.2.1 @@ -1,4 +1,4 @@ -/* $CoreSDI: im_streams.c,v 1.15 2001/05/01 02:26:16 alejo Exp $ */ +/* $CoreSDI: im_streams.c,v 1.17 2001/11/21 05:15:25 alejo Exp $ */ /* * Copyright (c) 2001, Core SDI S.A., Argentina @@ -90,7 +90,7 @@ r = getmsg (im->im_fd, &ctl, &dat, &flags); if (r & MORECTL) { - m_dprintf(MSYSLOG_SERIOUS, "im_streams_read: getmsg() " + dprintf(MSYSLOG_SERIOUS, "im_streams_read: getmsg() " "returned too much control information\n"); logerror("im_streams_read: getmsg() returned too much" " control information"); @@ -100,7 +100,7 @@ do { if (r & MOREDATA) { /* message is too long for im_msg */ - m_dprintf(MSYSLOG_INFORMATIVE, "im_streams_read: " + dprintf(MSYSLOG_INFORMATIVE, "im_streams_read: " "STREAMS device offered too much data (remainder " "to come) ...\n"); } @@ -114,10 +114,11 @@ ret->im_len = dat.len; ret->im_pri = lc.pri; - logmsg (ret->im_pri, ret->im_msg, - LocalHostName, ret->im_flags); + ret->im_host[0] = '\0'; + logmsg(ret->im_pri, ret->im_msg, ret->im_host, + ret->im_flags); } else { - m_dprintf(MSYSLOG_INFORMATIVE, "im_streams_read: " + dprintf(MSYSLOG_INFORMATIVE, "im_streams_read: " "STREAMS device offered no data?\n"); logerror("im_streams_read: STREAMS device offered" " no data?"); @@ -137,10 +138,10 @@ { char *streams_logpath; - m_dprintf(MSYSLOG_INFORMATIVE, "im_streams_init: Entering\n"); + dprintf(MSYSLOG_INFORMATIVE, "im_streams_init: Entering\n"); if (I == NULL || argv == NULL || argc < 1 || argc > 2) { - m_dprintf(MSYSLOG_SERIOUS, "usage: -i streams[:path]\n\n"); + dprintf(MSYSLOG_SERIOUS, "usage: -i streams[:path]\n\n"); return(-1); } @@ -149,7 +150,7 @@ } else { streams_logpath = strdup(DEFAULT_LOGGER); } - m_dprintf(MSYSLOG_INFORMATIVE, "streams_logpath = %s\n", + dprintf(MSYSLOG_INFORMATIVE, "streams_logpath = %s\n", streams_logpath); I->im_path = streams_logpath; @@ -180,7 +181,7 @@ I->im_fd = open (I->im_path, O_RDONLY|O_NOCTTY|O_NONBLOCK); if (I->im_fd == -1) { - m_dprintf(MSYSLOG_SERIOUS, "couldn't open %s: %s\n", I->im_path, + dprintf(MSYSLOG_SERIOUS, "couldn't open %s: %s\n", I->im_path, strerror (errno)); return (-1); } else { @@ -190,7 +191,7 @@ ioctbuf.ic_cmd = I_CONSLOG; /* why I_CONSLOG? */ if (ioctl (I->im_fd, I_STR, &ioctbuf) == -1) { - m_dprintf(MSYSLOG_SERIOUS, "ioctl(%s): %s\n", + dprintf(MSYSLOG_SERIOUS, "ioctl(%s): %s\n", I->im_path, strerror (errno)); close (I->im_fd); return (-1); Index: im_tcp.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/im_tcp.c,v retrieving revision 1.31 retrieving revision 1.31.2.1 diff -u -d -r1.31 -r1.31.2.1 --- im_tcp.c 13 Aug 2002 17:25:13 -0000 1.31 +++ im_tcp.c 11 Apr 2003 16:36:38 -0000 1.31.2.1 @@ -1,4 +1,4 @@ -/* $CoreSDI: im_tcp.c,v 1.28 2001/09/20 01:21:13 alejo Exp $ */ +/* $CoreSDI: im_tcp.c,v 1.35 2002/03/01 07:31:02 alejo Exp $ */ /* * Copyright (c) 2001, Core SDI S.A., Argentina @@ -61,6 +61,7 @@ #include <sys/types.h> #include <sys/socket.h> #include <sys/uio.h> +#include <ctype.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> @@ -80,8 +81,9 @@ struct tcp_conn { struct tcp_conn *next; int fd; - char name[SIZEOF_MAXHOSTNAMELEN + 1]; + char name[MAXHOSTNAMELEN + 1]; char port[20]; + char saveline[MAXLINE + 3]; /* maxline + cr lf */ }; struct im_tcp_ctx { @@ -113,12 +115,12 @@ { struct im_tcp_ctx *c; char *host, *port; - int ch, optind_s; + int ch, argcnt; - m_dprintf(MSYSLOG_INFORMATIVE, "im_tcp_init: entering\n"); + dprintf(MSYSLOG_INFORMATIVE, "im_tcp_init: entering\n"); if ( (I->im_ctx = calloc(1, sizeof(struct im_tcp_ctx))) == NULL) { - m_dprintf(MSYSLOG_SERIOUS, "om_tcp_init: cant alloc memory"); + dprintf(MSYSLOG_SERIOUS, "om_tcp_init: cant alloc memory"); return (-1); } @@ -127,21 +129,19 @@ host = "0.0.0.0"; port = "syslog"; - /* parse command line */ - optind_s = optind; /* save main's optind */ - optind = 1; -#ifdef HAVE_OPTRESET - optreset = 1; -#endif - while ((ch = getopt(argc, argv, "h:p:aq")) != -1) { + argcnt = 1; /* skip module name */ + + while ((ch = getxopt(argc, argv, "h!host: p!port: a!addhost q!nofqdn", + &argcnt)) != -1) { + switch (ch) { case 'h': /* get addr to bind */ - host = optarg; + host = argv[argcnt]; break; case 'p': /* get remote host port */ - port = optarg; + port = argv[argcnt]; break; case 'a': c->flags |= M_USEMSGHOST; @@ -151,17 +151,16 @@ c->flags |= M_NOTFQDN; break; default: - m_dprintf(MSYSLOG_SERIOUS, "om_tcp_init: parsing error" + dprintf(MSYSLOG_SERIOUS, "om_tcp_init: parsing error" " [%c]\n", ch); free(c); return (-1); } + argcnt++; } - optind = optind_s; /* restore main's optind */ - if ( (I->im_fd = listen_tcp(host, port, &c->addrlen)) < 0) { - m_dprintf(MSYSLOG_SERIOUS, "im_tcp_init: error with listen_tcp() %s\n", + dprintf(MSYSLOG_SERIOUS, "im_tcp_init: error with listen_tcp() %s\n", strerror(errno)); free(c); return (-1); @@ -171,7 +170,7 @@ add_fd_input(I->im_fd , I); - m_dprintf(MSYSLOG_INFORMATIVE, "im_tcp_init: running\n"); + dprintf(MSYSLOG_INFORMATIVE, "im_tcp_init: running\n"); return (1); } @@ -189,23 +188,27 @@ struct tcp_conn *con; int n; + dprintf(MSYSLOG_INFORMATIVE, "im_tcp_read: entering...\n"); + if (im == NULL || ret == NULL) { - m_dprintf(MSYSLOG_SERIOUS, "im_tcp_read: arg %s%s is null\n", + dprintf(MSYSLOG_SERIOUS, "im_tcp_read: arg %s%s is null\n", ret? "ret":"", im? "im" : ""); return (-1); } if ((c = (struct im_tcp_ctx *) im->im_ctx) == NULL) { - m_dprintf(MSYSLOG_SERIOUS, "im_tcp_read: null context\n"); + dprintf(MSYSLOG_SERIOUS, "im_tcp_read: null context\n"); return (-1); } if (infd == im->im_fd) { + dprintf(MSYSLOG_INFORMATIVE, "im_tcp_read: new connection\n"); + /* create a new connection */ if ((con = (struct tcp_conn *) calloc(1, sizeof(*con))) == NULL) { - m_dprintf(MSYSLOG_SERIOUS, "im_tcp_read: " + dprintf(MSYSLOG_SERIOUS, "im_tcp_read: " "error allocating conn struct\n"); return (-1); } @@ -213,7 +216,7 @@ /* accept it and add to queue */ if ((con->fd = accept_tcp(infd, c->addrlen, con->name, sizeof(con->name), con->port, sizeof(con->port))) < 0) { - m_dprintf(MSYSLOG_SERIOUS, "im_tcp_read: couldn't accept\n"); + dprintf(MSYSLOG_SERIOUS, "im_tcp_read: couldn't accept\n"); free (con); return (-1); } @@ -227,7 +230,7 @@ c->last = con; - m_dprintf(MSYSLOG_INFORMATIVE, "im_tcp_read: new conection from" + dprintf(MSYSLOG_INFORMATIVE, "im_tcp_read: new conection from" " %s with fd %d\n", con->name, con->fd); /* add to inputs list */ @@ -239,14 +242,14 @@ /* read connected socket */ - m_dprintf(MSYSLOG_INFORMATIVE, "im_tcp_read: reading connection fd %d\n", + dprintf(MSYSLOG_INFORMATIVE, "im_tcp_read: reading connection fd %d\n", infd); /* find connection */ for (con = c->first; con && con->fd != infd; con = con->next); if (con == NULL || con->fd != infd) { - m_dprintf(MSYSLOG_SERIOUS, "im_tcp_read: no such connection " + dprintf(MSYSLOG_SERIOUS, "im_tcp_read: no such connection " "fd %d !\n", infd); remove_fd_input(infd); return (-1); @@ -256,7 +259,7 @@ if (n == 0) { struct tcp_conn *prev; - m_dprintf(MSYSLOG_INFORMATIVE, "im_tcp_read: conetion from %s" + dprintf(MSYSLOG_INFORMATIVE, "im_tcp_read: conetion from %s" " closed\n", con->name); remove_fd_input(con->fd); @@ -274,12 +277,16 @@ prev->next = con->next; } - free(con); + if (con->saveline[0] != '\0') + printline(ret->im_host, con->saveline, + strlen(con->saveline), 0); + free(con); + return (0); } else if (n < 0 && errno != EINTR) { - m_dprintf(MSYSLOG_INFORMATIVE, "im_tcp_read: conetion from %s" + dprintf(MSYSLOG_INFORMATIVE, "im_tcp_read: conetion from %s" " closed with error [%s]\n", con->name, strerror(errno)); logerror("im_tcp_read"); con->fd = -1; @@ -290,15 +297,33 @@ /* terminate it */ (im->im_buf)[n] = '\0'; + p = &im->im_buf[0]; + + dprintf(MSYSLOG_INFORMATIVE, "im_tcp_read: read: %s [%s]", + con->name, im->im_buf); + /* change non printable chars to X, just in case */ + for(p = im->im_buf; *p != '\0'; p++) + if (!isprint((unsigned int) *p) && *p != '\n') + *p = 'X'; p = im->im_buf; do { + char *msg; + + msg = p; /* multiple lines ? */ if((nextline = strchr(p, '\n')) != NULL) { /* terminate this line and advance */ *nextline++ = '\0'; + if (*nextline == '\0') + nextline = NULL; /* no more lines */ + } else { + /* save this partial line and return */ + strncat(con->saveline, p, + sizeof(con->saveline) - 1); + con->saveline[sizeof(con->saveline) - 1] = '\0'; } /* remove trailing carriage returns */ @@ -317,22 +342,34 @@ char host[90]; int n1, n2; + if (con->saveline[0] != '\0') { + strncat(con->saveline, p, + sizeof(con->saveline) - 1); + con->saveline[sizeof(con->saveline) - 1] + = '\0'; + msg = con->saveline; + } else { + msg = p; + } + /* extract hostname from message */ - if ((sscanf(p, "<%*d>%*3s %*i %*i:%*i:%*i %n%89s" + if ((sscanf(msg, "<%*d>%*3s %*i %*i:%*i:%*i %n%89s" " %n", &n1, host, &n2) != 1 && - sscanf(p, "%*3s %*i %*i:%*i:%*i %n%89s %n", + sscanf(msg, "%*3s %*i %*i:%*i:%*i %n%89s %n", &n1, host, &n2) != 1 && - sscanf(p, "%n%89s %n", &n1, + sscanf(msg, "%n%89s %n", &n1, host, &n2) != 1) || im->im_buf[n2] == '\0') { - m_dprintf(MSYSLOG_INFORMATIVE, + dprintf(MSYSLOG_INFORMATIVE, "im_tcp_read: ignoring invalid " - "message [%s]\n", p); + "message [%s]\n", msg); if (nextline != NULL) { p = nextline; continue; - } else + } else { return (0); + con->saveline[0] = '\0'; + } } /* remove host from message */ @@ -359,7 +396,8 @@ *dot = '\0'; } - printline(ret->im_host, p, strlen(p), 0); + printline(ret->im_host, msg, strlen(msg), 0); + *msg = '\0'; p = nextline; Index: im_udp.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/im_udp.c,v retrieving revision 1.69.2.1 retrieving revision 1.69.2.2 diff -u -d -r1.69.2.1 -r1.69.2.2 --- im_udp.c 9 Apr 2003 18:08:15 -0000 1.69.2.1 +++ im_udp.c 11 Apr 2003 16:36:38 -0000 1.69.2.2 @@ -1,4 +1,4 @@ -/* $CoreSDI: im_udp.c,v 1.67 2001/09/20 01:11:42 alejo Exp $ */ + /* $CoreSDI: im_udp.c,v 1.75 2002/03/01 07:31:02 alejo Exp $ */ /* * Copyright (c) 2001, Core SDI S.A., Argentina @@ -46,6 +46,7 @@ #include <sys/param.h> #include <netinet/in.h> +#include <ctype.h> #include <errno.h> #include <syslog.h> #include <netdb.h> @@ -82,12 +83,13 @@ int im_udp_read(struct i_module *im, int infd, struct im_msg *ret) { + struct sockaddr_in frominet; struct im_udp_ctx *c; - struct sockaddr_in frominet; - int slen; + char *p; + int slen; if (ret == NULL) { - m_dprintf(MSYSLOG_SERIOUS, "im_udp: arg is null\n"); + dprintf(MSYSLOG_SERIOUS, "im_udp: arg is null\n"); return (-1); } @@ -96,8 +98,9 @@ ret->im_flags = 0; slen = sizeof(frominet); - if ((ret->im_len = recvfrom(im->im_fd, ret->im_msg, ret->im_mlen - 1, 0, - (struct sockaddr *)&frominet, (socklen_t *)&slen)) < 1) { + if ((ret->im_len = recvfrom(im->im_fd, ret->im_msg, + sizeof(ret->im_msg) - 1, 0, (struct sockaddr *)&frominet, + (socklen_t *)&slen)) < 1) { if (ret->im_len < 0 && errno != EINTR) logerror("recvfrom inet"); return (1); @@ -107,6 +110,11 @@ c = (struct im_udp_ctx *) im->im_ctx; + /* change non printable chars to X, just in case */ + for(p = ret->im_msg; *p != '\0'; p++) + if (!isprint((unsigned int) *p) && *p != '\n') + *p = 'X'; + if (c->flags & M_USEMSGHOST) { char host[90]; int n1, n2; @@ -121,7 +129,7 @@ sscanf(ret->im_msg, "%n%89s %n%*s", &n1, host, &n2) != 1) || ret->im_msg[n2] == '\0') { - m_dprintf(MSYSLOG_INFORMATIVE, "im_udp_read: skipped" + dprintf(MSYSLOG_INFORMATIVE, "im_udp_read: skipped" " invalid message [%s]\n", ret->im_msg); return (0); } @@ -134,7 +142,7 @@ ret->im_msg[n1++] = ret->im_msg[n2++]; ret->im_msg[n1] = '\0'; - strncpy(ret->im_host, host, sizeof(ret->im_host) - 1); + strncat(ret->im_host, host, sizeof(ret->im_host)); ret->im_host[sizeof(ret->im_host) - 1] = '\0'; } else { @@ -144,10 +152,10 @@ sizeof(frominet.sin_addr), frominet.sin_family); if (hent) { strncpy(ret->im_host, hent->h_name, - sizeof(ret->im_host) - 1); + sizeof(ret->im_host)); } else { strncpy(ret->im_host, inet_ntoa(frominet.sin_addr), - sizeof(ret->im_host) - 1); + sizeof(ret->im_host)); } } @@ -174,7 +182,7 @@ struct sockaddr *sa; struct im_udp_ctx *c; char *host, *port; - int ch; + int ch, argcnt; socklen_t salen; if ( (I->im_ctx = calloc(1, sizeof(struct im_udp_ctx))) == NULL) @@ -185,20 +193,18 @@ port = "syslog"; host = "0.0.0.0"; - /* parse command line */ - optind = 1; -#ifdef HAVE_OPTRESET - optreset = 1; -#endif - while ((ch = getopt(argc, argv, "h:p:aq")) != -1) { + argcnt = 1; /* skip module name */ + + while ((ch = getxopt(argc, argv, "h!host: p!port: a!addhost q!nofqdn", + &argcnt)) != -1) { switch (ch) { case 'h': /* get addr to bind */ - host = optarg; + host = argv[argcnt]; break; case 'p': /* get remote host port */ - port = optarg; + port = argv[argcnt]; break; case 'a': c->flags |= M_USEMSGHOST; @@ -208,54 +214,43 @@ c->flags |= M_NOTFQDN; break; default: - m_dprintf(MSYSLOG_SERIOUS, "om_udp_init: parsing error" + dprintf(MSYSLOG_SERIOUS, "im_udp_init: parsing error" " [%c]\n", ch); free(c); return (-1); } + argcnt++; } I->im_fd = socket(AF_INET, SOCK_DGRAM, 0); if ((sa = resolv_name(host, port, "udp", &salen)) == NULL) { - m_dprintf(MSYSLOG_SERIOUS, "om_udp_init: error resolving host" + dprintf(MSYSLOG_SERIOUS, "im_udp_init: error resolving host" "[%s] and port [%s]", host, port); free(c); return (-1); } if (bind(I->im_fd, sa, salen) < 0) { - m_dprintf(MSYSLOG_SERIOUS, "om_udp_init: error binding to host" + dprintf(MSYSLOG_SERIOUS, "im_udp_init: error binding to host" "[%s] and port [%s]", host, port); free(c); return (-1); } I->im_path = NULL; - if (finet < 0) { - /* finet not in use */ - finet = I->im_fd; - DaemonFlags |= SYSLOGD_INET_IN_USE; - DaemonFlags |= SYSLOGD_INET_READ; - } add_fd_input(I->im_fd , I); - m_dprintf(MSYSLOG_INFORMATIVE, "im_udp: running\n"); + dprintf(MSYSLOG_INFORMATIVE, "im_udp: running\n"); return (1); } int im_udp_close(struct i_module *im) { - if (finet == im->im_fd) { - finet = -1; - DaemonFlags &= ~SYSLOGD_INET_IN_USE; - DaemonFlags &= ~SYSLOGD_INET_READ; - } close(im->im_fd); return (0); } - Index: im_unix.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/im_unix.c,v retrieving revision 1.52 retrieving revision 1.52.2.1 diff -u -d -r1.52 -r1.52.2.1 --- im_unix.c 13 Aug 2002 17:25:13 -0000 1.52 +++ im_unix.c 11 Apr 2003 16:36:38 -0000 1.52.2.1 @@ -1,4 +1,4 @@ -/* $CoreSDI: im_unix.c,v 1.50 2001/03/23 00:12:29 alejo Exp $ */ +/* $CoreSDI: im_unix.c,v 1.53 2001/11/21 05:15:26 alejo Exp $ */ /* * Copyright (c) 2001, Core SDI S.A., Argentina @@ -82,12 +82,13 @@ slen = sizeof(fromunix); - ret->im_len = recvfrom(im->im_fd, ret->im_msg, ret->im_mlen, - 0, (struct sockaddr *)&fromunix, (socklen_t *)&slen); + ret->im_len = recvfrom(im->im_fd, ret->im_msg, + sizeof(ret->im_msg) - 1, 0, (struct sockaddr *)&fromunix, + (socklen_t *)&slen); if (ret->im_len > 0) { ret->im_msg[ret->im_len] = '\0'; - strncpy(ret->im_host, LocalHostName, sizeof(ret->im_host)); + ret->im_host[0] = '\0'; } else if (ret->im_len < 0 && errno != EINTR) { logerror("recvfrom unix"); ret->im_msg[0] = '\0'; @@ -110,7 +111,7 @@ struct sockaddr_un sunx; char *logger; - m_dprintf(MSYSLOG_INFORMATIVE, "im_unix_init: Entering\n"); + dprintf(MSYSLOG_INFORMATIVE, "im_unix_init: Entering\n"); if (I == NULL || argv == NULL || (argc != 2 && argc != 1)) return (-1); @@ -135,7 +136,7 @@ (void) snprintf(I->im_buf, sizeof(I->im_buf), "cannot create %s", logger); logerror(I->im_buf); - m_dprintf(MSYSLOG_SERIOUS, "cannot create %s (%d)\n", + dprintf(MSYSLOG_SERIOUS, "cannot create %s (%d)\n", logger, errno); return (-1); } Index: ip_misc.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/ip_misc.c,v retrieving revision 1.23 retrieving revision 1.23.2.1 diff -u -d -r1.23 -r1.23.2.1 --- ip_misc.c 13 Aug 2002 17:25:13 -0000 1.23 +++ ip_misc.c 11 Apr 2003 16:36:38 -0000 1.23.2.1 @@ -1,4 +1,4 @@ -/* $CoreSDI: ip_misc.c,v 1.21 2001/09/21 11:25:07 alejo Exp $ */ +/* $CoreSDI: ip_misc.c,v 1.26 2001/12/05 20:47:56 alejo Exp $ */ /* * Copyright (c) 2001, Core SDI S.A., Argentina @@ -148,7 +148,7 @@ } #endif /* HAVE_INET_NTOP */ - m_dprintf(MSYSLOG_SERIOUS, "resolv_addr: error resolving " + dprintf(MSYSLOG_SERIOUS, "resolv_addr: error resolving " "remote host name!\n"); if (host) host[0] = '\0'; @@ -172,6 +172,9 @@ #ifdef HAVE_GETADDRINFO struct addrinfo hints, *res; int i; +#if defined(HAVE_INET_ADDR) && !defined(HAVE_INET_ATON) + in_addr_t addr; +#endif memset(&hints, 0, sizeof(hints)); hints.ai_flags = AI_PASSIVE; @@ -184,7 +187,7 @@ if ( (i = getaddrinfo(host, port, &hints, &res)) != 0) { - m_dprintf(MSYSLOG_SERIOUS, "resolv_name: error on address " + dprintf(MSYSLOG_SERIOUS, "resolv_name: error on address " "to listen %s, %s: %s\n", host, port, gai_strerror(i)); return (NULL); @@ -225,13 +228,26 @@ sin->sin_port = portnum; memset(&sin->sin_addr, 0, sizeof(sin->sin_addr)); - if (host == NULL || inet_aton(host, &sin->sin_addr) == 1) { + if (host == NULL || +#ifdef HAVE_INET_ATON + +inet_aton(host, &sin->sin_addr) == 1 + +#elif defined(HAVE_INET_ADDR) + + (addr = inet_addr(host)) > 0 && + memcpy(&sin->sin_addr, &addr, sizeof(sin->sin_addr)) != NULL + +#else +# error NEED RESOLVING FUNCTION, PLEASE REPORT +#endif + ) { return ((struct sockaddr *) sin); } else if ((hp = gethostbyname(host)) == NULL) { - m_dprintf(MSYSLOG_SERIOUS, "resolv_name: error " + dprintf(MSYSLOG_SERIOUS, "resolv_name: error " "resolving host address %s, %s\n", host, port); return (NULL); } @@ -405,4 +421,24 @@ udp_send(int fd, char *msg, int mlen, void *addr, int addrlen) { return (sendto(fd, msg, mlen, 0, (struct sockaddr *) addr, addrlen)); +} + +/* + * resolv_domain: get a domain for a name, used to get local domain + * + */ + +int +resolv_domain(char *buf, int buflen, char *host) +{ + struct sockaddr *sa; + socklen_t salen; + + if ((sa = resolv_name(host, NULL, NULL, &salen)) == NULL || + resolv_addr(sa, salen, buf, buflen, NULL, 0) == -1) { + + *buf = '\0'; + } + + return (1); } Index: om_classic.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/om_classic.c,v retrieving revision 1.87 retrieving revision 1.87.2.1 diff -u -d -r1.87 -r1.87.2.1 --- om_classic.c 13 Aug 2002 17:25:13 -0000 1.87 +++ om_classic.c 11 Apr 2003 16:36:39 -0000 1.87.2.1 @@ -1,4 +1,4 @@ -/* $CoreSDI: om_classic.c,v 1.85 2001/10/25 22:41:23 alejo Exp $ */ +/* $CoreSDI: om_classic.c,v 1.89 2001/11/21 05:30:46 alejo Exp $ */ /* * Copyright (c) 1983, 1988, 1993, 1994 * The Regents of the University of California. All rights reserved. @@ -102,7 +102,7 @@ union { char f_uname[MAXUNAMES][UT_NAMESIZE+1]; struct { - char f_hname[SIZEOF_MAXHOSTNAMELEN]; + char f_hname[MAXHOSTNAMELEN]; struct sockaddr f_addr; } f_forw; /* forwarding address */ char f_fname[MAXPATHLEN]; @@ -130,7 +130,7 @@ time_t now; if (m == NULL || m->msg == NULL || !strcmp(m->msg, "")) { - m_dprintf(MSYSLOG_INFORMATIVE, "om_classic_write: no message!"); + dprintf(MSYSLOG_INFORMATIVE, "om_classic_write: no message!"); return (-1); } @@ -169,39 +169,39 @@ v->iov_len = strlen(m->msg); v++; - m_dprintf(MSYSLOG_INFORMATIVE, "Logging to %s", TypeNames[c->f_type]); + dprintf(MSYSLOG_INFORMATIVE, "Logging to %s", TypeNames[c->f_type]); switch (c->f_type) { case F_UNUSED: - m_dprintf(MSYSLOG_INFORMATIVE, "\n"); + dprintf(MSYSLOG_INFORMATIVE, "\n"); break; case F_FORW: - if (finet < 0) { - m_dprintf(MSYSLOG_SERIOUS, "om_classic: write: " + if (c->fd < 0) { + dprintf(MSYSLOG_SERIOUS, "om_classic: write: " "can't forward message, socket down\n"); return(-1); } - m_dprintf(MSYSLOG_INFORMATIVE, " %s\n", c->f_un.f_forw.f_hname); + dprintf(MSYSLOG_INFORMATIVE, " %s\n", c->f_un.f_forw.f_hname); l = snprintf(line, sizeof(line), "<%d>%.15s %s", f->f_prevpri, (char *) iov[0].iov_base, (char *) iov[4].iov_base); - if (sendto(finet, line, l, 0, &c->f_un.f_forw.f_addr, + if (sendto(c->fd, line, l, 0, &c->f_un.f_forw.f_addr, #ifdef AF_INET6 c->f_un.f_forw.f_addr.sa_family == AF_INET6 ? sizeof(struct sockaddr_in6) : #endif sizeof(struct sockaddr_in)) != l) { c->f_type = F_UNUSED; - m_dprintf(MSYSLOG_WARNING, "om_classic: error on sendto()"); + dprintf(MSYSLOG_WARNING, "om_classic: error on sendto()"); } break; case F_CONSOLE: if (flags & IGN_CONS) { - m_dprintf(MSYSLOG_INFORMATIVE, " (ignored)\n"); + dprintf(MSYSLOG_INFORMATIVE, " (ignored)\n"); break; } /* FALLTHROUGH */ @@ -209,7 +209,7 @@ case F_TTY: case F_PIPE: case F_FILE: - m_dprintf(MSYSLOG_INFORMATIVE, " %s\n", c->f_un.f_fname); + dprintf(MSYSLOG_INFORMATIVE, " %s\n", c->f_un.f_fname); if (c->f_type != F_FILE) { v->iov_base = "\r\n"; v->iov_len = 2; @@ -236,7 +236,7 @@ O_WRONLY|O_APPEND, 0); if (c->fd < 0) { c->f_type = F_UNUSED; - m_dprintf(MSYSLOG_WARNING, "om_classic: " + dprintf(MSYSLOG_WARNING, "om_classic: " "error on %s", c->f_un.f_fname); } else goto again; @@ -244,7 +244,7 @@ c->f_type = F_UNUSED; c->fd = -1; errno = e; - m_dprintf(MSYSLOG_WARNING, "om_classic: error " + dprintf(MSYSLOG_WARNING, "om_classic: error " "on %s", c->f_un.f_fname); } } else if (flags & SYNC_FILE) @@ -253,7 +253,7 @@ case F_USERS: case F_WALL: - m_dprintf(MSYSLOG_INFORMATIVE, "\n"); + dprintf(MSYSLOG_INFORMATIVE, "\n"); v->iov_base = "\r\n"; v->iov_len = 2; wallmsg(f, iov, c); @@ -276,15 +276,15 @@ { struct sockaddr *sa; struct om_classic_ctx *c; - socklen_t salen; + size_t salen; int i, statbuf_len; char *p, *q, statbuf[1024]; - m_dprintf(MSYSLOG_INFORMATIVE, "om_classic_init: Entering\n"); + dprintf(MSYSLOG_INFORMATIVE, "om_classic_init: Entering\n"); /* accepts "%classic /file" or "%classic -t TYPE /file" */ if ( (argc != 2 && argc != 4) || argv == NULL) { - m_dprintf(MSYSLOG_SERIOUS, "om_classic_init: incorrect " + dprintf(MSYSLOG_SERIOUS, "om_classic_init: incorrect " "parameters %d args [%s %s %s %s]\n", argc, argc > 0? argv[1] : "", argc > 1? argv[2] : "", @@ -294,7 +294,7 @@ } if ((*ctx = (void *) calloc(1, sizeof(struct om_classic_ctx))) == NULL) { - m_dprintf(MSYSLOG_SERIOUS, "om_classic_init: cannot allocate " + dprintf(MSYSLOG_SERIOUS, "om_classic_init: cannot allocate " "context\n"); return (-1); } @@ -304,7 +304,7 @@ if (argc > 2) { if (strncmp(argv[1], "-t", 2)) { - m_dprintf(MSYSLOG_SERIOUS, "om_classic_init: incorrect" + dprintf(MSYSLOG_SERIOUS, "om_classic_init: incorrect" " parameter %s, should be '-t'\n", argv[1]); free(*ctx); *ctx = NULL; @@ -315,7 +315,7 @@ for (i = 0; TypeNames[i] && strncmp(TypeNames[i], argv[2], strlen(argv[2])); i++); if (TypeNames[i] == NULL) { - m_dprintf(MSYSLOG_SERIOUS, "om_classic_init: couldn't" + dprintf(MSYSLOG_SERIOUS, "om_classic_init: couldn't" " determine type %s\n", argv[2]); free(*ctx); *ctx = NULL; @@ -331,30 +331,7 @@ switch (*p) { case '@': - if (!(DaemonFlags & SYSLOGD_INET_IN_USE)) { - - finet = socket(AF_INET, SOCK_DGRAM, 0); - - if ((sa = resolv_name("0.0.0.0", "syslog", "udp", - &salen)) == NULL) { - errno = 0; - m_dprintf(MSYSLOG_SERIOUS, "om_classic_init: " - "can't bind udp port"); - free(*ctx); - *ctx = NULL; - return (-1); - } - - if (bind(finet, sa, salen) < 0) { - m_dprintf(MSYSLOG_WARNING, "om_classic: error " - "on bind()"); - free(sa); - free(*ctx); - *ctx = NULL; - return (-1); - } - free(sa); - } + c->fd = socket(AF_INET, SOCK_DGRAM, 0); strncpy(c->f_un.f_forw.f_hname, ++p, sizeof(c->f_un.f_forw.f_hname) - 1); @@ -363,7 +340,7 @@ if ((sa = resolv_name(c->f_un.f_forw.f_hname, "syslog", "udp", &salen)) == NULL) { - m_dprintf(MSYSLOG_SERIOUS, "om_classic: error resolving " + dprintf(MSYSLOG_SERIOUS, "om_classic: error resolving " "host %s\n", c->f_un.f_forw.f_hname); break; } @@ -391,7 +368,7 @@ } if (c->fd < 0) { - m_dprintf(MSYSLOG_CRITICAL, "om_classic_init: error " + dprintf(MSYSLOG_CRITICAL, "om_classic_init: error " "opening log file: %s\n", p); free(*ctx); *ctx = NULL; @@ -451,19 +428,10 @@ c = (struct om_classic_ctx *) ctx; - switch (c->f_type) { - case F_FILE: - case F_PIPE: - case F_TTY: - case F_CONSOLE: - return (close(c->fd)); - case F_FORW: - if ((finet > -1) && (DaemonFlags & SYSLOGD_INET_IN_USE) - && !(DaemonFlags & SYSLOGD_INET_READ)) - return (close(finet)); - default: - return (0); - } + if (c->fd > -1) + close(c->fd); + + return (0); } int @@ -495,7 +463,7 @@ if (reenter++) return; if ( (uf = fopen(_PATH_UTMP, "r")) == NULL) { - m_dprintf(MSYSLOG_SERIOUS, "om_classic: error opening " + dprintf(MSYSLOG_SERIOUS, "om_classic: error opening " "%s\n", _PATH_UTMP); reenter = 0; return; @@ -516,7 +484,7 @@ if (c->f_type == F_WALL) { if ((p = ttymsg(iov, 6, line, TTYMSGTIME)) != NULL) { errno = 0; /* already in msg */ - m_dprintf(MSYSLOG_SERIOUS, "om_classic: error " + dprintf(MSYSLOG_SERIOUS, "om_classic: error " "%s\n", p); } continue; @@ -530,7 +498,7 @@ if ((p = ttymsg(iov, 6, line, TTYMSGTIME)) != NULL) { errno = 0; /* already in msg */ - m_dprintf(MSYSLOG_SERIOUS, "om_classic: error " + dprintf(MSYSLOG_SERIOUS, "om_classic: error " "%s\n", p); } break; Index: om_mysql.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/om_mysql.c,v retrieving revision 1.80 retrieving revision 1.80.2.1 diff -u -d -r1.80 -r1.80.2.1 --- om_mysql.c 13 Aug 2002 17:25:13 -0000 1.80 +++ om_mysql.c 11 Apr 2003 16:36:40 -0000 1.80.2.1 @@ -1,4 +1,4 @@ -/* $CoreSDI: om_mysql.c,v 1.78 2001/10/22 22:49:42 alejo Exp $ */ +/* $CoreSDI: om_mysql.c,v 1.85 2002/03/01 07:31:03 alejo Exp $ */ /* * Copyright (c) 2001, Core SDI S.A., Argentina @@ -56,7 +56,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#define SYSLOG_NAMES #include <syslog.h> #include <unistd.h> #include <dlfcn.h> @@ -93,7 +92,6 @@ #define OM_MYSQL_PRIORITY 0x8 int om_mysql_close(struct filed *, void *); -char *decode_val(int, CODE *); /* * Define our prototypes for MySQL functions @@ -105,12 +103,13 @@ int om_mysql_write(struct filed *f, int flags, struct m_msg *m, void *ctx) { - struct om_mysql_ctx *c; - char query[MAX_QUERY], err_buf[100], facility[11], priority[11]; - int i; - RETSIGTYPE (*sigsave)(int); + struct om_mysql_ctx *c; + char query[MAX_QUERY], err_buf[100]; + char facility[16], priority[16], *p; + int i; + RETSIGTYPE (*sigsave)(int); - m_dprintf(MSYSLOG_INFORMATIVE, "om_mysql_write: entering [%s] [%s]\n", + dprintf(MSYSLOG_INFORMATIVE, "om_mysql_write: entering [%s] [%s]\n", m->msg, f->f_prevline); c = (struct om_mysql_ctx *) ctx; @@ -127,14 +126,9 @@ c->lost++; if (c->lost == 1) { snprintf(err_buf, sizeof(err_buf), "om_mysql_write: " - "Lost connection! [%s]", -#ifndef mysql_error - (c->mysql_error) -#else - mysql_error -#endif - (c->h)); - m_dprintf(MSYSLOG_SERIOUS, "%s", err_buf); + "Lost connection! [%s]", c->mysql_error? + c->mysql_error(c->h) : "<unknown>"); + dprintf(MSYSLOG_SERIOUS, "%s", err_buf); logerror(err_buf); } return (1); @@ -143,13 +137,19 @@ /* restore previous SIGPIPE handler */ place_signal(SIGPIPE, sigsave); - /* - * NOTE: could use prioritynames[] and facilitynames[] - */ - if (c->flags & OM_MYSQL_FACILITY) - snprintf(facility, sizeof(facility), "'%s',", decode_val(m->fac<<3, facilitynames)); - if (c->flags & OM_MYSQL_PRIORITY) - snprintf(priority, sizeof(priority), "'%s',", decode_val(m->pri, prioritynames)); + if (c->flags & OM_MYSQL_FACILITY) { + if ((p = decode_val(m->fac<<3, CODE_FACILITY)) != NULL) + snprintf(facility, sizeof(facility), "'%s',", p); + else + snprintf(facility, sizeof(facility), "'%d',", m->fac<<3); + } + + if (c->flags & OM_MYSQL_PRIORITY) { + if ((p = decode_val(m->pri, CODE_PRIORITY)) != NULL) + snprintf(priority, sizeof(priority), "'%s',", p); + else + snprintf(priority, sizeof(priority), "'%d',", m->pri); + } /* table, yyyy-mm-dd, hh:mm:ss, host, msg */ i = snprintf(query, sizeof(query), "INSERT %sINTO %s (%s%s date, time, " @@ -188,7 +188,7 @@ else query[sizeof(query) - 1] = '\0'; - m_dprintf(MSYSLOG_INFORMATIVE2, "om_mysql_write: query [%s]\n", + dprintf(MSYSLOG_INFORMATIVE2, "om_mysql_write: query [%s]\n", query); if ((c->mysql_query)(c->h, query) < 0) @@ -206,19 +206,14 @@ else query[sizeof(query) - 1] = '\0'; - m_dprintf(MSYSLOG_INFORMATIVE2, "om_mysql_write: query [%s]\n", + dprintf(MSYSLOG_INFORMATIVE2, "om_mysql_write: query [%s]\n", query); if ((i = (c->mysql_query)(c->h, query)) < 0) { snprintf(err_buf, sizeof(err_buf), "om_mysql_write: error " - "inserting on table [%s]", -#ifndef mysql_error - (c->mysql_error) -#else - mysql_error -#endif - (c->h)); - m_dprintf(MSYSLOG_SERIOUS, "%s\n", err_buf); + "inserting on table [%s]", c->mysql_error? + c->mysql_error(c->h) : "<unknown>"); + dprintf(MSYSLOG_SERIOUS, "%s\n", err_buf); return (-1); } @@ -245,22 +240,25 @@ om_mysql_init(int argc, char **argv, struct filed *f, char *prog, void **c, char **status) { + char err_buf[256]; + char statbuf[1024]; struct om_mysql_ctx *ctx; - char *p, err_buf[256], statbuf[1024]; - int ch; + char *p; + int ch; + int argcnt; if (argv == NULL || *argv == NULL || argc < 2 || f == NULL || c == NULL || *c != NULL) return (-1); - m_dprintf(MSYSLOG_INFORMATIVE, "om_mysql_init: alloc context\n"); + dprintf(MSYSLOG_INFORMATIVE, "om_mysql_init: alloc context\n"); /* alloc context */ if ((*c = (void *) calloc(1, sizeof(struct om_mysql_ctx))) == NULL) return (-1); ctx = (struct om_mysql_ctx *) *c; if ((ctx->lib = dlopen("libmysqlclient.so", DLOPEN_FLAGS)) == NULL) { - m_dprintf(MSYSLOG_SERIOUS, "om_mysql_init: Error loading" + dprintf(MSYSLOG_SERIOUS, "om_mysql_init: Error loading" " api library, %s\n", dlerror()); free(ctx); return (-1); @@ -275,59 +273,59 @@ || !(ctx->mysql_query = (int (*)(void *, char *)) dlsym(ctx->lib, SYMBOL_PREFIX "mysql_query")) || !(ctx->mysql_close = (void (*)(void *)) dlsym(ctx->lib, - SYMBOL_PREFIX "mysql_close")) -#ifndef mysql_error - || !(ctx->mysql_error = (char * (*)(void *)) dlsym(ctx->lib, - SYMBOL_PREFIX "mysql_error")) -#endif - ) { - m_dprintf(MSYSLOG_SERIOUS, "om_mysql_init: Error resolving" + SYMBOL_PREFIX "mysql_close")) ) { + dprintf(MSYSLOG_SERIOUS, "om_mysql_init: Error resolving" " api symbols, %s\n", dlerror()); free(ctx); return (-1); } - /* parse line */ - optind = 1; -#ifdef HAVE_OPTRESET - optreset = 1; -#endif - while ((ch = getopt(argc, argv, "s:u:p:d:t:DPF")) != -1) { + /* this may be missing on old versions */ + ctx->mysql_error = (char * (*)(void *)) dlsym(ctx->lib, SYMBOL_PREFIX + "mysql_error"); + + argcnt = 1; /* skip module name */ + + while ((ch = getxopt(argc, argv, "s!server: u!user: p!password:" + " d!database: t!table: D!delayed P!priority F!facility", &argcnt)) + != -1) { + switch (ch) { case 's': /* get database host name and port */ - if ((p = strstr(optarg, ":")) == NULL) { + if ((p = strstr(argv[argcnt], ":")) == NULL) { ctx->port = MYSQL_PORT; } else { *p = '\0'; - ctx->port = atoi(++p); + ctx->port = strtol(++p, NULL, 10); } - ctx->host = strdup(optarg); + ctx->host = strdup(argv[argcnt]); break; case 'u': - ctx->user = strdup(optarg); + ctx->user = strdup(argv[argcnt]); break; case 'p': - ctx->passwd = strdup(optarg); + ctx->passwd = strdup(argv[argcnt]); break; case 'd': - ctx->db = strdup(optarg); + ctx->db = strdup(argv[argcnt]); break; case 't': - ctx->table = strdup(optarg); + ctx->table = strdup(argv[argcnt]); break; case 'D': ctx->flags |= OM_MYSQL_DELAYED_INSERTS; break; case 'P': - ctx->flags |= OM_MYSQL_FACILITY; + ctx->flags |= OM_MYSQL_PRIORITY; break; case 'F': - ctx->flags |= OM_MYSQL_PRIORITY; + ctx->flags |= OM_MYSQL_FACILITY; break; default: goto om_mysql_init_bad; } + argcnt++; } if (ctx->user == NULL || ctx->db == NULL || ctx->port == 0 || @@ -343,10 +341,10 @@ goto om_mysql_init_bad; } - m_dprintf(MSYSLOG_INFORMATIVE, "om_mysql_init: mysql_init returned %p\n", + dprintf(MSYSLOG_INFORMATIVE, "om_mysql_init: mysql_init returned %p\n", ctx->h); - m_dprintf(MSYSLOG_INFORMATIVE, "om_mysql_init: params %p %s %s %s %i" + dprintf(MSYSLOG_INFORMATIVE, "om_mysql_init: params %p %s %s %s %i" " \n", ctx->h, ctx->host, ctx->user, ctx->db, ctx->port); snprintf(statbuf, sizeof(statbuf), "om_mysql: sending " @@ -359,11 +357,7 @@ snprintf(err_buf, sizeof(err_buf), "om_mysql_init: Error " "connecting to db server [%s], [%s:%i] user [%s] db [%s]", -#ifndef mysql_error - (ctx->mysql_error)(ctx->h), -#else - mysql_error(ctx->h), -#endif + ctx->mysql_error? ctx->mysql_error(ctx->h) : "<unknown>", ctx->host, ctx->port, ctx->user, ctx->db); logerror(err_buf); return (1); Index: om_peo.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/om_peo.c,v retrieving revision 1.73 retrieving revision 1.73.2.1 diff -u -d -r1.73 -r1.73.2.1 --- om_peo.c 13 Aug 2002 17:25:13 -0000 1.73 +++ om_peo.c 11 Apr 2003 16:36:40 -0000 1.73.2.1 @@ -1,4 +1,4 @@ -/* $CoreSDI: om_peo.c,v 1.71 2001/05/02 22:36:23 claudio Exp $ */ +/* $CoreSDI: om_peo.c,v 1.77 2002/03/01 07:31:03 alejo Exp $ */ /* * Copyright (c) 2001, Core SDI S.A., Argentina @@ -71,7 +71,7 @@ #define SHA1 0 #endif -#define MAXBUF MAXSVLINE+SIZEOF_MAXHOSTNAMELEN+20 +#define MAXBUF MAXSVLINE+MAXHOSTNAMELEN+20 struct om_peo_ctx { short flags; @@ -82,7 +82,7 @@ }; int -om_peo_write(struct filed *f, int flags, char *msg, void *ctx) +om_peo_write(struct filed *f, int flags, struct m_msg *msg, void *ctx) { struct om_peo_ctx *c; int fd, mfd, len, keylen, newkeylen; @@ -90,9 +90,9 @@ unsigned char m[MAXBUF], newkey[41]; char time_buf[16]; - m_dprintf(MSYSLOG_INFORMATIVE, "om_peo_write: Entering\n"); + dprintf(MSYSLOG_INFORMATIVE, "om_peo_write: Entering\n"); - if (f == NULL || ctx == NULL) + if (f == NULL || ctx == NULL || msg == NULL) return (-1); c = (struct om_peo_ctx *) ctx; @@ -100,21 +100,21 @@ strftime(time_buf, sizeof(time_buf), "%b %e %H:%M:%S", &f->f_tm); time_buf[15] = '\0'; len = snprintf((char *) m, MAXBUF, "%s %s %s\n", time_buf, - f->f_prevhost, msg ? msg : f->f_prevline) - 1; + f->f_prevhost, msg->msg ? msg->msg : f->f_prevline) - 1; - m_dprintf(MSYSLOG_INFORMATIVE, "om_peo_write: len = %i, msg = %s\n ", + dprintf(MSYSLOG_INFORMATIVE, "om_peo_write: len = %i, msg->msg = %s\n ", len, m); /* Open keyfile and read last key */ if ( (fd = open(c->keyfile, O_RDWR, 0)) < 0) { - m_dprintf(MSYSLOG_SERIOUS, "om_peo_write: opening keyfile: %s:" + dprintf(MSYSLOG_SERIOUS, "om_peo_write: opening keyfile: %s:" " %s\n", c->keyfile, strerror(errno)); return (-1); } bzero(key, sizeof(key)); if ( (keylen = read(fd, key, 40)) < 0) { close(fd); - m... [truncated message content] |
From: <al...@us...> - 2003-04-10 14:53:56
|
Update of /cvsroot/msyslog/syslog In directory sc8-pr-cvs1:/tmp/cvs-serv2763 Modified Files: Tag: v1_08f configure configure.in Log Message: VER = 1.08f Index: configure =================================================================== RCS file: /cvsroot/msyslog/syslog/configure,v retrieving revision 1.86.2.2 retrieving revision 1.86.2.2.2.1 diff -u -d -r1.86.2.2 -r1.86.2.2.2.1 --- configure 9 Apr 2003 19:18:50 -0000 1.86.2.2 +++ configure 10 Apr 2003 14:53:41 -0000 1.86.2.2.2.1 @@ -3567,7 +3567,7 @@ CFLAGS="$CFLAGS -Wall" fi -MSYSLOG_VERSION="1.08" +MSYSLOG_VERSION="1.08f" cat >>confdefs.h <<EOF #define MSYSLOG_VERSION_STR "$MSYSLOG_VERSION" EOF Index: configure.in =================================================================== RCS file: /cvsroot/msyslog/syslog/configure.in,v retrieving revision 1.146.2.2 retrieving revision 1.146.2.2.2.1 diff -u -d -r1.146.2.2 -r1.146.2.2.2.1 --- configure.in 9 Apr 2003 19:18:57 -0000 1.146.2.2 +++ configure.in 10 Apr 2003 14:53:47 -0000 1.146.2.2.2.1 @@ -61,7 +61,7 @@ CFLAGS="$CFLAGS -Wall" fi -MSYSLOG_VERSION="1.08" +MSYSLOG_VERSION="1.08f" AC_DEFINE_UNQUOTED(MSYSLOG_VERSION_STR, "$MSYSLOG_VERSION") echo msyslog version... $MSYSLOG_VERSION |
From: <al...@us...> - 2003-04-10 14:43:05
|
Update of /cvsroot/msyslog/syslog In directory sc8-pr-cvs1:/tmp/cvs-serv27661 Modified Files: Tag: v1_09d configure.in configure Log Message: ver = 1.09d Index: configure.in =================================================================== RCS file: /cvsroot/msyslog/syslog/configure.in,v retrieving revision 1.147 retrieving revision 1.147.4.1 diff -u -d -r1.147 -r1.147.4.1 --- configure.in 14 Aug 2002 14:32:19 -0000 1.147 +++ configure.in 10 Apr 2003 14:42:46 -0000 1.147.4.1 @@ -61,7 +61,7 @@ CFLAGS="$CFLAGS -Wall" fi -MSYSLOG_VERSION="1.08e" +MSYSLOG_VERSION="1.09d" AC_DEFINE_UNQUOTED(MSYSLOG_VERSION_STR, "$MSYSLOG_VERSION") echo msyslog version... $MSYSLOG_VERSION Index: configure =================================================================== RCS file: /cvsroot/msyslog/syslog/configure,v retrieving revision 1.87.4.1 retrieving revision 1.87.4.2 diff -u -d -r1.87.4.1 -r1.87.4.2 --- configure 10 Apr 2003 14:35:19 -0000 1.87.4.1 +++ configure 10 Apr 2003 14:42:49 -0000 1.87.4.2 @@ -3570,7 +3570,7 @@ CFLAGS="$CFLAGS -Wall" fi -MSYSLOG_VERSION="1.08e" +MSYSLOG_VERSION="1.09d" cat >>confdefs.h <<EOF #define MSYSLOG_VERSION_STR "$MSYSLOG_VERSION" |
From: <al...@us...> - 2003-04-10 14:35:39
|
Update of /cvsroot/msyslog/syslog In directory sc8-pr-cvs1:/tmp/cvs-serv22540 Modified Files: Tag: v1_09d configure Log Message: autoconf-2.52 Index: configure =================================================================== RCS file: /cvsroot/msyslog/syslog/configure,v retrieving revision 1.87 retrieving revision 1.87.4.1 diff -u -d -r1.87 -r1.87.4.1 --- configure 14 Aug 2002 14:32:19 -0000 1.87 +++ configure 10 Apr 2003 14:35:19 -0000 1.87.4.1 @@ -1,85 +1,155 @@ #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# Generated by Autoconf 2.52. # +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. [...7663 lines suppressed...] +ac_clean_files=$ac_clean_files_save + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + exec 5>/dev/null + $SHELL $CONFIG_STATUS || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi |
From: <al...@us...> - 2003-04-10 02:13:01
|
Update of /cvsroot/msyslog/syslog/src/modules In directory sc8-pr-cvs1:/tmp/cvs-serv22963/src/modules Modified Files: Tag: v1_08 im_bsd.c Log Message: use assert (jkohen@ pushed for it!) Index: im_bsd.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/im_bsd.c,v retrieving revision 1.82.2.1 retrieving revision 1.82.2.2 diff -u -d -r1.82.2.1 -r1.82.2.2 --- im_bsd.c 9 Apr 2003 18:08:15 -0000 1.82.2.1 +++ im_bsd.c 10 Apr 2003 02:12:57 -0000 1.82.2.2 @@ -43,6 +43,7 @@ #include <sys/uio.h> #include <sys/param.h> +#include <assert.h> #include <fcntl.h> #include <ctype.h> #include <errno.h> @@ -94,8 +95,7 @@ int i, c; /* ret->im_mlen is the size of ret->im_msg */ - if (ret->im_mlen < 10) - return (-1); + assert(ret->im_mlen > (strlen(_PATH_UNIX) + 5)); strncpy(ret->im_msg, _PATH_UNIX, ret->im_mlen - 3); ret->im_msg[ret->im_mlen - 1] = '\0'; |
From: <al...@us...> - 2003-04-09 19:19:04
|
Update of /cvsroot/msyslog/syslog In directory sc8-pr-cvs1:/tmp/cvs-serv24255 Modified Files: Tag: v1_08 configure configure.in Log Message: fix autoconf, upgrade to 2.52 while there Index: configure =================================================================== RCS file: /cvsroot/msyslog/syslog/configure,v retrieving revision 1.86.2.1 retrieving revision 1.86.2.2 diff -u -d -r1.86.2.1 -r1.86.2.2 --- configure 9 Apr 2003 17:58:54 -0000 1.86.2.1 +++ configure 9 Apr 2003 19:18:50 -0000 1.86.2.2 @@ -2943,7 +2943,8 @@ if test $ac_cv_lib_dl_dlopen = yes; then SYSLOGD_LIBS="$SYSLOGD_LIBS -ldl" fi -echo "$as_me:2946: checking for connect in -lsocket" >&5 + +echo "$as_me:2947: checking for connect in -lsocket" >&5 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2951,7 +2952,7 @@ ac_check_lib_save_LIBS=$LIBS [...1703 lines suppressed...] # /dev/null tree - { { echo "$as_me:5372: error: cannot find input file: $f" >&5 + { { echo "$as_me:5732: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -5486,7 +5846,7 @@ rm -f $tmp/in if test x"$ac_file" != x-; then if cmp -s $ac_file $tmp/config.h 2>/dev/null; then - { echo "$as_me:5489: $ac_file is unchanged" >&5 + { echo "$as_me:5849: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ @@ -5552,3 +5912,4 @@ # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi + Index: configure.in =================================================================== RCS file: /cvsroot/msyslog/syslog/configure.in,v retrieving revision 1.146.2.1 retrieving revision 1.146.2.2 diff -u -d -r1.146.2.1 -r1.146.2.2 --- configure.in 9 Apr 2003 17:58:54 -0000 1.146.2.1 +++ configure.in 9 Apr 2003 19:18:57 -0000 1.146.2.2 @@ -1,7 +1,7 @@ dnl $CoreSDI: configure.in,v 1.143 2001/09/19 15:58:44 alejo Exp $ dnl Process this file with autoconf to produce a configure script. -AC_INIT(src/syslogd.c)dnl -AC_CONFIG_HEADER(src/config.h)dnl +AC_INIT(src/syslogd.c) +AC_CONFIG_HEADER(src/config.h) dnl Checks for programs. AC_PROG_CC @@ -23,7 +23,7 @@ AC_CHECK_HEADERS(fcntl.h limits.h paths.h strings.h inttypes.h sys/ioctl.h \ sys/types.h sys/time.h machine/endian.h syslog.h unistd.h sysctl.h \ - err.h sys/context.h )dnl + err.h sys/context.h ) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST @@ -33,10 +33,10 @@ AC_STRUCT_TM dnl Checks for library functions. -AC_CHECK_LIB(dl, dlopen, SYSLOGD_LIBS="$SYSLOGD_LIBS -ldl")dnl -AC_CHECK_LIB(socket, connect, SYSLOGD_LIBS="$SYSLOGD_LIBS -lsocket")dnl -AC_CHECK_LIB(nsl, gethostbyname, SYSLOGD_LIBS="$SYSLOGD_LIBS -lnsl")dnl -AC_DEFINE(SYSLOGD_LIBS, $SYSLOGD_LIBS)dnl +AC_CHECK_LIB(dl, dlopen, SYSLOGD_LIBS="$SYSLOGD_LIBS -ldl") +AC_CHECK_LIB(socket, connect, SYSLOGD_LIBS="$SYSLOGD_LIBS -lsocket") +AC_CHECK_LIB(nsl, gethostbyname, SYSLOGD_LIBS="$SYSLOGD_LIBS -lnsl") +AC_DEFINE(SYSLOGD_LIBS, $SYSLOGD_LIBS) AC_PROG_GCC_TRADITIONAL AC_FUNC_MEMCMP AC_TYPE_SIGNAL @@ -46,7 +46,7 @@ LIBS_SAVE="$LIBS" LIBS="$LIBS $SYSLOGD_LIBS" AC_CHECK_FUNCS(gethostname inet_ntop getaddrinfo regcomp poll select\ - socket strdup strerror strstr strtoul )dnl + socket strdup strerror strstr strtoul ) LIBS="$LIBS_SAVE" dnl Check endianness @@ -62,11 +62,11 @@ fi MSYSLOG_VERSION="1.08" -AC_DEFINE_UNQUOTED(MSYSLOG_VERSION_STR, "$MSYSLOG_VERSION")dnl +AC_DEFINE_UNQUOTED(MSYSLOG_VERSION_STR, "$MSYSLOG_VERSION") echo msyslog version... $MSYSLOG_VERSION MLIBNAME="libmsyslog.so.$MSYSLOG_VERSION" ; -AC_DEFINE_UNQUOTED(MLIBNAME_STR, "$MLIBNAME")dnl +AC_DEFINE_UNQUOTED(MLIBNAME_STR, "$MLIBNAME") MANPAGES="syslog.conf.5 syslogd.8" @@ -91,7 +91,7 @@ fi done AC_MSG_RESULT(root-mode pid file will go in $dir) -AC_DEFINE_UNQUOTED(PID_DIR, "$dir")dnl +AC_DEFINE_UNQUOTED(PID_DIR, "$dir") dnl search mandir for non bsd systems for MANDIR in "/usr/share/man" "/usr/man" @@ -103,7 +103,7 @@ dnl AC_MSG_CHECKING(for MAXHOSTNAMELEN) -AC_CHECK_SIZEOF_DEFINE(MAXHOSTNAMELEN, 254)dnl +AC_CHECK_SIZEOF_DEFINE(MAXHOSTNAMELEN, 254) dnl Check underscore requirement for dlsym() @@ -121,7 +121,7 @@ AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) -])dnl +]) AC_MSG_CHECKING(for daemon name) @@ -137,9 +137,9 @@ else MSYSLOG_DAEMON_NAME="$withval"; fi -])dnl +]) -AC_MSG_RESULT("$MSYLOG_DAEMON_NAME") +AC_MSG_RESULT("$MSYSLOG_DAEMON_NAME") AC_ARG_WITH(maximum-optimization, [ --without-maximum-optimization @@ -149,27 +149,27 @@ MAIN_CPPFLAGS=""; UNAME=`uname` if test "$UNAME" = "OpenBSD" ; then - AC_DEFINE(DLOPEN_FLAGS, RTLD_LAZY)dnl - AC_DEFINE_UNQUOTED(SYMBOL_PREFIX, "_")dnl + AC_DEFINE(DLOPEN_FLAGS, RTLD_LAZY) + AC_DEFINE_UNQUOTED(SYMBOL_PREFIX, "_") SHARED_PARAMS="-Bshareable" DCCFLAGS="-fPIC" elif test "$UNAME" = "Linux" ; then - AC_DEFINE(DLOPEN_FLAGS, RTLD_LAZY | RTLD_GLOBAL)dnl - AC_DEFINE_UNQUOTED(SYMBOL_PREFIX, "")dnl + AC_DEFINE(DLOPEN_FLAGS, RTLD_LAZY | RTLD_GLOBAL) + AC_DEFINE_UNQUOTED(SYMBOL_PREFIX, "") MAIN_CPPFLAGS="-Xlinker -E"; SHARED_PARAMS="-Bshareable" DCCFLAGS="" AC_DEFINE(_GNU_SOURCE, 1) elif test "$UNAME" = "SunOS" ; then - AC_DEFINE(DLOPEN_FLAGS, RTLD_LAZY)dnl - AC_DEFINE(_REENTRANT)dnl - AC_DEFINE_UNQUOTED(SYMBOL_PREFIX, "")dnl + AC_DEFINE(DLOPEN_FLAGS, RTLD_LAZY) + AC_DEFINE(_REENTRANT) + AC_DEFINE_UNQUOTED(SYMBOL_PREFIX, "") SHARED_PARAMS="-G" DCCFLAGS="-fPIC" elif test "$UNAME" = "IRIX" -o "$UNAME" = "IRIX64" ; then - AC_DEFINE(DLOPEN_FLAGS, RTLD_LAZY)dnl - AC_DEFINE_UNQUOTED(SYMBOL_PREFIX, "")dnl - AC_DEFINE(INET6)dnl + AC_DEFINE(DLOPEN_FLAGS, RTLD_LAZY) + AC_DEFINE_UNQUOTED(SYMBOL_PREFIX, "") + AC_DEFINE(INET6) CFLAGS="-D_BSD_SIGNALS" if test "x$GCC" == "xyes" then @@ -182,9 +182,9 @@ fi SHARED_PARAMS="-shared -soname $MLIBNAME -all" elif test "$UNAME" = "AIX" ; then - AC_DEFINE(DLOPEN_FLAGS, RTLD_LAZY | RTLD_GLOBAL)dnl - AC_DEFINE(NEEDS_DLOPEN_NULL)dnl - AC_DEFINE_UNQUOTED(SYMBOL_PREFIX, "")dnl + AC_DEFINE(DLOPEN_FLAGS, RTLD_LAZY | RTLD_GLOBAL) + AC_DEFINE(NEEDS_DLOPEN_NULL) + AC_DEFINE_UNQUOTED(SYMBOL_PREFIX, "") DCCFLAGS="-shared" SHARED_PARAMS="-lc -bI:libmsyslog.imp -bexpall -bnoentry -brtl" cat > src/modules/libmsyslog.imp <<-EOF @@ -202,9 +202,9 @@ SYSLOGD_LIBS="$SYSLOGD_LIBS -Wl,-bexpall" else - AC_MSG_WARN(cannot determine system type falling to defaults)dnl - AC_DEFINE_UNQUOTED(SYMBOL_PREFIX, "")dnl - AC_DEFINE(DLOPEN_FLAGS, RTLD_LAZY)dnl + AC_MSG_WARN(cannot determine system type falling to defaults) + AC_DEFINE_UNQUOTED(SYMBOL_PREFIX, "") + AC_DEFINE(DLOPEN_FLAGS, RTLD_LAZY) SHARED_PARAMS="-Bshareable" fi @@ -215,9 +215,9 @@ AC_DEFINE(PID_FILE, "syslog.pid") fi -dnl + dnl Here we check module support -dnl + temp_res="no"; AC_ARG_WITH(bsd, @@ -230,11 +230,11 @@ -o "$UNAME" = "TrustedBSD" ; then temp_res="yes"; fi -])dnl +]) if test "X$temp_res" = "Xyes" ; then MSRCS="$MSRCS im_bsd.c"; MANPAGES="$MANPAGES im_bsd.8"; - AC_DEFINE(HAVE_BSD_IMODULE)dnl + AC_DEFINE(HAVE_BSD_IMODULE) fi AC_ARG_WITH(linux, @@ -251,8 +251,8 @@ MSRCS="$MSRCS im_linux.c" MANPAGES="$MANPAGES im_linux.8" AC_DEFINE(HAVE_LINUX_IMODULE) - ])dnl -])dnl + ]) +]) temp_res="no"; AC_ARG_WITH(udp, @@ -261,8 +261,8 @@ ],[ temp_res="$with_udp"; ],[ AC_CHECK_HEADER(sys/socket.h, [ temp_res="yes"; - ])dnl -])dnl + ]) +]) if test "X$temp_res" = "Xyes" ; then MSRCS="$MSRCS im_udp.c om_udp.c" MANPAGES="$MANPAGES im_udp.8 om_udp.8"; @@ -274,8 +274,8 @@ [ --without-unix Use unix socket domain input module. Activated by default. ],[ temp_res="$with_unix"; ],[ - AC_CHECK_HEADER(sys/un.h, [ temp_res="yes"; ])dnl -])dnl + AC_CHECK_HEADER(sys/un.h, [ temp_res="yes"; ]) +]) if test "X$temp_res" = "Xyes" ; then MSRCS="$MSRCS im_unix.c" AC_DEFINE(HAVE_UNIX_IMODULE) @@ -294,8 +294,8 @@ temp_res="yes" fi ],[ - AC_CHECK_HEADER(sys/strlog.h, strlog_h="yes", strlog_h="no")dnl - AC_CHECK_HEADER(door.h, door_h="yes", door_h="no")dnl + AC_CHECK_HEADER(sys/strlog.h, strlog_h="yes", strlog_h="no") + AC_CHECK_HEADER(door.h, door_h="yes", door_h="no") if test "$strlog_h" = "yes" -a "$door_h" = "yes" ; then temp_res="yes" fi @@ -426,10 +426,10 @@ MSRCS="$MSRCS om_directory.c om_queue.c" MANPAGES="$MANPAGES om_directory.8" fi -dnl ],[ +] +dnl ,[ dnl MSRCS="$MSRCS om_directory.c om_queue.c" dnl MANPAGES="$MANPAGES om_directory.8" -dnl ] ) AC_ARG_WITH(regex, @@ -444,32 +444,41 @@ AC_CHECK_HEADER(regex.h, [ MSRCS="$MSRCS om_regex.c om_refract.c" MANPAGES="$MANPAGES om_regex.8 om_refract.8" - ])dnl + ]) ]) AC_CACHE_SAVE -AC_HAVE_TYPES(socklen_t uint32_t uint64_t u_int32_t u_int64_t \ - __uint32_t __uint64_t CODE)dnl +AC_CHECK_TYPES(socklen_t) +AC_CHECK_TYPES(uint32_t) +AC_CHECK_TYPES(uint64_t) +AC_CHECK_TYPES(u_int32_t) +AC_CHECK_TYPES(u_int64_t) +AC_CHECK_TYPES(__uint32_t) +AC_CHECK_TYPES(__uint64_t) + +AC_CHECK_TYPES(CODE,,,[#include <stdio.h> +#define SYSLOG_NAMES +#include <syslog.h>]) dnl check CODE structure typedef -dnl AC_CHECK_CODE_TYPE()dnl +dnl AC_CHECK_CODE_TYPE() -AC_SUBST(SYSLOGD_LIBS)dnl -AC_SUBST(SHARED_PARAMS)dnl -AC_SUBST(DCCFLAGS)dnl -AC_SUBST(MSRCS)dnl -AC_SUBST(MLIBS)dnl -AC_SUBST(MLIBNAME)dnl -AC_SUBST(MANPAGES)dnl -AC_SUBST(HASH_SRCS)dnl -AC_SUBST(HASH_SRCS_MODULES)dnl -AC_SUBST(HASH_OBJS_MODULES)dnl -AC_SUBST(HAVE_SOCKLEN_T)dnl -AC_SUBST(MAIN_CPPFLAGS)dnl -AC_SUBST(MSYSLOG_DAEMON_NAME)dnl +AC_SUBST(SYSLOGD_LIBS) +AC_SUBST(SHARED_PARAMS) +AC_SUBST(DCCFLAGS) +AC_SUBST(MSRCS) +AC_SUBST(MLIBS) +AC_SUBST(MLIBNAME) +AC_SUBST(MANPAGES) +AC_SUBST(HASH_SRCS) +AC_SUBST(HASH_SRCS_MODULES) +AC_SUBST(HASH_OBJS_MODULES) +AC_SUBST(HAVE_SOCKLEN_T) +AC_SUBST(MAIN_CPPFLAGS) +AC_SUBST(MSYSLOG_DAEMON_NAME) -dnl AC_SUBST(SYMBOL_PREFIX)dnl +dnl AC_SUBST(SYMBOL_PREFIX) AC_OUTPUT([Makefile src/Makefile @@ -477,4 +486,4 @@ src/peo/Makefile src/man/Makefile src/man/BSDmakefile - src/man/GNUmakefile])dnl + src/man/GNUmakefile]) |
From: <al...@us...> - 2003-04-09 18:08:18
|
Update of /cvsroot/msyslog/syslog/src/modules In directory sc8-pr-cvs1:/tmp/cvs-serv23441/src/modules Modified Files: Tag: v1_08 im_bsd.c im_udp.c Log Message: fix strncpy/strncat usage, from Core advisory by jcohen@ Index: im_bsd.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/im_bsd.c,v retrieving revision 1.82 retrieving revision 1.82.2.1 diff -u -d -r1.82 -r1.82.2.1 --- im_bsd.c 13 Aug 2002 17:25:13 -0000 1.82 +++ im_bsd.c 9 Apr 2003 18:08:15 -0000 1.82.2.1 @@ -93,8 +93,15 @@ char *p, *q, *lp; int i, c; + /* ret->im_mlen is the size of ret->im_msg */ + if (ret->im_mlen < 10) + return (-1); + strncpy(ret->im_msg, _PATH_UNIX, ret->im_mlen - 3); + ret->im_msg[ret->im_mlen - 1] = '\0'; + strncat(ret->im_msg, ": ", 2); + lp = ret->im_msg + strlen(ret->im_msg); i = read(im->im_fd, im->im_buf, sizeof(im->im_buf) - 1); Index: im_udp.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/im_udp.c,v retrieving revision 1.69 retrieving revision 1.69.2.1 diff -u -d -r1.69 -r1.69.2.1 --- im_udp.c 13 Aug 2002 17:25:13 -0000 1.69 +++ im_udp.c 9 Apr 2003 18:08:15 -0000 1.69.2.1 @@ -134,7 +134,7 @@ ret->im_msg[n1++] = ret->im_msg[n2++]; ret->im_msg[n1] = '\0'; - strncat(ret->im_host, host, sizeof(ret->im_host)); + strncpy(ret->im_host, host, sizeof(ret->im_host) - 1); ret->im_host[sizeof(ret->im_host) - 1] = '\0'; } else { @@ -144,10 +144,10 @@ sizeof(frominet.sin_addr), frominet.sin_family); if (hent) { strncpy(ret->im_host, hent->h_name, - sizeof(ret->im_host)); + sizeof(ret->im_host) - 1); } else { strncpy(ret->im_host, inet_ntoa(frominet.sin_addr), - sizeof(ret->im_host)); + sizeof(ret->im_host) - 1); } } |
From: <al...@us...> - 2003-04-09 18:07:24
|
Update of /cvsroot/msyslog/syslog/src/modules In directory sc8-pr-cvs1:/tmp/cvs-serv22563/src/modules Modified Files: Tag: v1_09 im_bsd.c im_tcp.c im_udp.c imfile.c Log Message: fix strncpy/strncat usage, from Core advisory by jcohen@ Index: im_bsd.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/im_bsd.c,v retrieving revision 1.83 retrieving revision 1.83.2.1 diff -u -d -r1.83 -r1.83.2.1 --- im_bsd.c 14 Aug 2002 14:32:22 -0000 1.83 +++ im_bsd.c 9 Apr 2003 18:07:19 -0000 1.83.2.1 @@ -93,8 +93,12 @@ char *p, *q, *lp; int i, c; - strncpy(ret->im_msg, _PATH_UNIX, sizeof(ret->im_msg) - 4); - strncat(ret->im_msg, ": ", 2); + strncpy(ret->im_msg, _PATH_UNIX, sizeof(ret->im_msg) - 1); + ret->im_msg[sizeof (ret->im_msg) - 1] = '\0'; + + strncat(ret->im_msg, ": ", sizeof (ret->im_msg) - 1 + - strlen(ret->im_msg)); + lp = ret->im_msg + strlen(ret->im_msg); i = read(im->im_fd, im->im_buf, sizeof(im->im_buf) - 1); Index: im_tcp.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/im_tcp.c,v retrieving revision 1.32 retrieving revision 1.32.2.1 diff -u -d -r1.32 -r1.32.2.1 --- im_tcp.c 14 Aug 2002 14:32:22 -0000 1.32 +++ im_tcp.c 9 Apr 2003 18:07:20 -0000 1.32.2.1 @@ -322,8 +322,8 @@ } else { /* save this partial line and return */ strncat(con->saveline, p, - sizeof(con->saveline) - 1); - con->saveline[sizeof(con->saveline) - 1] = '\0'; + sizeof(con->saveline) - 1 + - strlen(con->saveline)); } /* remove trailing carriage returns */ @@ -344,9 +344,8 @@ if (con->saveline[0] != '\0') { strncat(con->saveline, p, - sizeof(con->saveline) - 1); - con->saveline[sizeof(con->saveline) - 1] - = '\0'; + sizeof(con->saveline) - 1 + - strlen(con->saveline)); msg = con->saveline; } else { msg = p; Index: im_udp.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/im_udp.c,v retrieving revision 1.70 retrieving revision 1.70.2.1 diff -u -d -r1.70 -r1.70.2.1 --- im_udp.c 14 Aug 2002 14:32:22 -0000 1.70 +++ im_udp.c 9 Apr 2003 18:07:20 -0000 1.70.2.1 @@ -142,7 +142,7 @@ ret->im_msg[n1++] = ret->im_msg[n2++]; ret->im_msg[n1] = '\0'; - strncat(ret->im_host, host, sizeof(ret->im_host)); + strncpy(ret->im_host, host, sizeof(ret->im_host) - 1); ret->im_host[sizeof(ret->im_host) - 1] = '\0'; } else { @@ -152,10 +152,10 @@ sizeof(frominet.sin_addr), frominet.sin_family); if (hent) { strncpy(ret->im_host, hent->h_name, - sizeof(ret->im_host)); + sizeof(ret->im_host) - 1); } else { strncpy(ret->im_host, inet_ntoa(frominet.sin_addr), - sizeof(ret->im_host)); + sizeof(ret->im_host) - 1); } } Index: imfile.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/Attic/imfile.c,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -d -r1.1 -r1.1.2.1 --- imfile.c 14 Aug 2002 14:32:22 -0000 1.1 +++ imfile.c 9 Apr 2003 18:07:20 -0000 1.1.2.1 @@ -207,10 +207,10 @@ ++p; } - strncat(ret->im_msg, im->im_path, strlen(ret->im_msg) - - sizeof(ret->im_msg) - 1); - strncat(ret->im_msg, ":", strlen(ret->im_msg) - - sizeof(ret->im_msg) - 1); + strncpy(ret->im_msg, im->im_path, sizeof(ret->im_msg) - 1); + strncat(ret->im_msg, ":", sizeof(ret->im_msg) - 1 + - strlen(ret->im_msg)); + m_dprintf(MSYSLOG_INFORMATIVE, "im_file_read: Entering " "with header %s\n", ret->im_msg); |
From: <al...@us...> - 2003-04-09 17:59:08
|
Update of /cvsroot/msyslog/syslog In directory sc8-pr-cvs1:/tmp/cvs-serv18608 Modified Files: Tag: v1_08 configure.in configure Log Message: disable queue/directory module by default Index: configure.in =================================================================== RCS file: /cvsroot/msyslog/syslog/configure.in,v retrieving revision 1.146 retrieving revision 1.146.2.1 diff -u -d -r1.146 -r1.146.2.1 --- configure.in 13 Aug 2002 20:15:06 -0000 1.146 +++ configure.in 9 Apr 2003 17:58:54 -0000 1.146.2.1 @@ -426,10 +426,11 @@ MSRCS="$MSRCS om_directory.c om_queue.c" MANPAGES="$MANPAGES om_directory.8" fi -],[ - MSRCS="$MSRCS om_directory.c om_queue.c" - MANPAGES="$MANPAGES om_directory.8" -]) +dnl ],[ +dnl MSRCS="$MSRCS om_directory.c om_queue.c" +dnl MANPAGES="$MANPAGES om_directory.8" +dnl ] +) AC_ARG_WITH(regex, [ --without-regex Index: configure =================================================================== RCS file: /cvsroot/msyslog/syslog/configure,v retrieving revision 1.86 retrieving revision 1.86.2.1 diff -u -d -r1.86 -r1.86.2.1 --- configure 13 Aug 2002 20:15:05 -0000 1.86 +++ configure 9 Apr 2003 17:58:54 -0000 1.86.2.1 @@ -1,81 +1,155 @@ #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# Generated by Autoconf 2.52. # +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. [...7254 lines suppressed...] -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 +ac_clean_files=$ac_clean_files_save + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + exec 5>/dev/null + $SHELL $CONFIG_STATUS || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi |