Date: Tue, 7 Dec 2004 13:36:48 +0100 (CET) From: Helge Oldach <mail-qpopper-uidl@oldach.net> To: FreeBSD-gnats-submit@FreeBSD.org Cc: lioux@FreeBSD.org Subject: ports/74813: syslog facility wrong on startup Message-ID: <200412071236.iB7CamlS091106@sep.oldach.net> Resent-Message-ID: <200412071240.iB7CeQFx047989@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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@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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200412071236.iB7CamlS091106>