From owner-freebsd-ports Sat Oct 20 8:44:47 2001 Delivered-To: freebsd-ports@freebsd.org Received: from pr0n.kutulu.org (pr0n.kutulu.org [151.196.107.157]) by hub.freebsd.org (Postfix) with ESMTP id A805B37B401; Sat, 20 Oct 2001 08:44:42 -0700 (PDT) Received: from cc191573g (cc191573-g.longhill1.md.home.com [24.37.104.136]) by pr0n.kutulu.org (8.11.6/8.11.6) with SMTP id f9KFihR42463; Sat, 20 Oct 2001 11:44:44 -0400 (EDT) (envelope-from kutulu@kutulu.org) Message-ID: <008101c1597d$aa0c2030$88682518@longhill1.md.home.com> From: "Kutulu" To: , References: <200110201346.f9KDkoH94175@freefall.freebsd.org> Subject: Re: ports/30431: ircd-hybrid fails to open logfile when started as root and running as non-root Date: Sat, 20 Oct 2001 11:41:13 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org From: To: ; ; Sent: Saturday, October 20, 2001 9:46 AM Subject: Re: ports/30431: ircd-hybrid fails to open logfile when started as root and running as non-root > Synopsis: ircd-hybrid fails to open logfile when started as root and running as non-root > > State-Changed-From-To: open->feedback > State-Changed-By: ijliao > State-Changed-When: Sat Oct 20 06:44:18 PDT 2001 > State-Changed-Why: > what version of ircd-hybrid did you use ? > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-ports" in the body of the message > Oops, the patch I submitted was against hybrid 6.0. I forgot I'd upgraded the port/irc/ircd-hybrid stuff by hand before I submitted the patch. 5.3p8 seems to have the same basic problem, it opens the debugfile after checking to see if it needs to setuid(). Typically LPATH is set to some file inside DPATH but in the off chance that someone (like myself) wanted to put the logfile in /var/log with the rest of them, it would fail. Here's a very rough patch that does the same thing as the original, with 5.3p8 source (untested, having hardware problems trying to compile stuff lately): --- src/ircd.c.old Sat Oct 20 11:36:28 2001 +++ src/ircd.c Sat Oct 20 11:38:36 2001 @@ -1230,6 +1230,9 @@ } #endif + NOW = time(NULL); + open_debugfile(); + #if !defined(CHROOTDIR) || (defined(IRC_UID) && defined(IRC_GID)) # ifndef AIX (void)setuid((uid_t)euid); @@ -1285,8 +1288,6 @@ initwhowas(); initstats(); init_tree_parse(msgtab); - NOW = time(NULL); - open_debugfile(); NOW = time(NULL); init_fdlist(&serv_fdlist); init_fdlist(&oper_fdlist); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message