From owner-freebsd-audit Thu Oct 4 15:43:54 2001 Delivered-To: freebsd-audit@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 1AA4437B406 for ; Thu, 4 Oct 2001 15:43:51 -0700 (PDT) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.3) id AAA54267; Fri, 5 Oct 2001 00:43:48 +0200 (CEST) (envelope-from des@ofug.org) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: cjclark@alum.mit.edu Cc: freebsd-audit@FreeBSD.ORG Subject: Re: dmesg.boot Gets Overwritten without Reboot References: <20011003221310.Q8391@blossom.cjclark.org> <20011004152541.I297@blossom.cjclark.org> From: Dag-Erling Smorgrav Date: 05 Oct 2001 00:43:47 +0200 In-Reply-To: <20011004152541.I297@blossom.cjclark.org> Message-ID: Lines: 20 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG "Crist J. Clark" writes: > On Thu, Oct 04, 2001 at 02:00:23PM +0200, Dag-Erling Smorgrav wrote: > > Is there any way you can compare the timestamp on /var/run/dmesg.boot > > with `sysctl -n kern.boottime`? This would DTRT in almost all cases > > (the exception being the case where you set the clock back before > > returning from single-user mode) > Right, but is there a more graceful way than [...] Recent FreeBSD versions of find(1) have a -newerXY operator that will DTRT if X=m and Y=t: $ find /var/run -type f -name dmesg.boot -newermt "$(sysctl -n kern.boottime | sed 's/.*}//')" /var/run/dmesg.boot If find(1) outputs "/var/run/dmesg.boot", do nothing - otherwise, create the file. DES -- Dag-Erling Smorgrav - des@ofug.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message