From owner-freebsd-bugs Sun May 26 6:50:11 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id A799537B405 for ; Sun, 26 May 2002 06:50:02 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g4QDo2A36204; Sun, 26 May 2002 06:50:02 -0700 (PDT) (envelope-from gnats) Date: Sun, 26 May 2002 06:50:02 -0700 (PDT) Message-Id: <200205261350.g4QDo2A36204@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Peter Pentchev Subject: Re: bin/38558: newsyslog disobeys -F flag Reply-To: Peter Pentchev Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/38558; it has been noted by GNATS. From: Peter Pentchev To: "Brandon D.Valentine" Cc: bug-followup@FreeBSD.org Subject: Re: bin/38558: newsyslog disobeys -F flag Date: Sun, 26 May 2002 16:41:25 +0300 On Sat, May 25, 2002 at 11:07:51PM -0500, Brandon D.Valentine wrote: > > >Number: 38558 > >Category: bin > >Synopsis: newsyslog disobeys -F flag > >Originator: Brandon D. Valentine > >Environment: > System: FreeBSD leto 4.5-RELEASE-p2 FreeBSD 4.5-RELEASE-p2 #1: Fri Apr 26 01:50:45 CDT 2002 root@leto:/export/obj/export/src/sys/LETO_DEBUG i386 > > > >Description: > /usr/sbin/newsyslog fails to obey the -F flag to force log trimming. According > to newsyslog(8): > > -F Force newsyslog to trim the logs, even if the trim conditions > have not been met. This option is useful for diagnosing system problems > by providing you with fresh logs that contain only the problems. I believe that this may have something to do with the fix I made in rev. 1.39 of src/usr.sbin/newsyslog/newsyslog.c and later MFC'd into RELENG_4 in rev. 1.25.2.5. As this is not technically a security fix, though, it will probably not make its way into the 'security branches', such as RELENG_4_5 is. If you are building your systems from source, you may add a new step to your build process - applying other patches - and apply the attached patch to the src/usr.sbin/newsyslog/newsyslog.c file. Since this change was merged into RELENG_4, it will make its way into FreeBSD 4.6-RELEASE, which will be out soon. Until then (and even after that), the only way to handle this on RELENG_4_x security branches, where x < 6, would be to apply the attached patch manually before the build. G'luck, Peter -- Peter Pentchev roam@ringlet.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 This sentence claims to be an Epimenides paradox, but it is lying. Index: src/usr.sbin/newsyslog/newsyslog.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/newsyslog/newsyslog.c,v retrieving revision 1.25.2.4 diff -u -r1.25.2.4 newsyslog.c --- src/usr.sbin/newsyslog/newsyslog.c 14 Nov 2001 16:58:58 -0000 1.25.2.4 +++ src/usr.sbin/newsyslog/newsyslog.c 3 Feb 2002 09:35:09 -0000 @@ -159,7 +159,7 @@ if (verbose) printf("does not exist.\n"); } else { - if (ent->flags & CE_TRIMAT) { + if (ent->flags & CE_TRIMAT && !force) { if (timenow < ent->trim_at || difftime(timenow, ent->trim_at) >= 60 * 60) { if (verbose) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message