ports/74813: syslog facility wrong on startup
Helge Oldach
mail-qpopper-uidl at oldach.net
Tue Dec 7 12:40:26 UTC 2004
>Number: 74813
>Category: ports
>Synopsis: syslog facility wrong on startup
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Tue Dec 07 12:40:25 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator: Helge Oldach
>Release: FreeBSD 4.10-STABLE i386
>Organization:
>Environment:
System: FreeBSD localhost 4.10-STABLE FreeBSD 4.10-STABLE #2035: Sat Dec 4 22:42:00 CET 2004 toor at localhost:/usr/obj/usr/src/sys/GENERIC i386
>Description:
Upon startup of qpopper the syslog facility is set to LOCAL0. This is
true even if the -y flag is specified on the command line, pointing to a
different syslog facility.
This causes startup and termination information to be logged wrongly:
Dec 7 13:23:50 sep qpopper[89470]: qpopper: Server: cleaning up and exiting normally
Dec 7 13:23:54 sep qpopper[89493]: qpopper: Server: listening on [::]:995
Dec 7 13:23:54 sep qpopper[89493]: qpopper: Server: listening on 0.0.0.0:995
The patch below attempts to read the -y flag very early in in the
startup process (similar to the -d and -t flags).
>How-To-Repeat:
>Fix:
--- popper/main.c.ORIG Tue Dec 7 12:04:48 2004
+++ popper/main.c Tue Dec 7 13:17:08 2004
@@ -402,6 +402,24 @@
trace_name, fileno(trace_file) );
break;
+ case 'y': /* log facility */
+ {
+ POP config;
+ POP *p = &config;
+ if ( set_option ( p, "log-facility", optarg ) == POP_SUCCESS ) {
+ closelog();
+#ifdef SYSLOG42
+ openlog ( pname, 0 );
+#else
+ openlog ( pname, POP_LOGOPTS, p->log_facility );
+#endif
+ } else {
+ fprintf ( stderr, "Error setting '-y' to %s\n", optarg );
+ return 1;
+ }
+ }
+ break;
+
default:
break;
}
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list