Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Oct 2001 23:34:59 -0700
From:      "Crist J. Clark" <cristjc@earthlink.net>
To:        Dag-Erling Smorgrav <des@ofug.org>
Cc:        freebsd-audit@FreeBSD.ORG
Subject:   Re: dmesg.boot Gets Overwritten without Reboot
Message-ID:  <20011004233459.M297@blossom.cjclark.org>
In-Reply-To: <xzpwv2bau40.fsf@flood.ping.uio.no>; from des@ofug.org on Fri, Oct 05, 2001 at 01:00:31AM %2B0200
References:  <20011003221310.Q8391@blossom.cjclark.org> <xzpelojfwdk.fsf@flood.ping.uio.no> <20011004152541.I297@blossom.cjclark.org> <xzp1ykjc9gc.fsf@flood.ping.uio.no> <xzpwv2bau40.fsf@flood.ping.uio.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Oct 05, 2001 at 01:00:31AM +0200, Dag-Erling Smorgrav wrote:
> Dag-Erling Smorgrav <des@ofug.org> writes:
> > $ find /var/run -type f -name dmesg.boot -newermt "$(sysctl -n kern.boottime | sed 's/.*}//')"
> > /var/run/dmesg.boot
> 
> Sorry, I forgot you don't have sed(1) available.  Use this:

Actually, we do. If we're playing in /var...

>     boottime="$(sysctl -n kern.boottime)"
>     foo="$(find /var/run -type f -name dmesg.boot -newermt "${boottime#*\}}")"
>     if [ "${foo}" != "/var/run/dmesg.boot] ; then
>         echo 'Spank me!'
>     fi

But more intereting, does this tickle a sh(1) bug? I've reproduced
this on several FreeBSD machines (-STABLE and -CURRENT),

  #!/bin/sh

  boottime="$(sysctl -n kern.boottime)"

  echo "Without quotes: "  ${boottime#*\}}
  echo "With quotes:    " "${boottime#*\}}"

Produces,

  Without quotes:  Thu Oct 4 11:44:35 2001
  With quotes:     { sec = 1002221075, usec = 383948 } Thu Oct  4 11:44:35 2001

I'm not sure what is going on in the second one. I've tried to do some
metacharacter escapes, but no luck.

bash produces,

  Without quotes:  Thu Oct 4 11:44:35 2001
  With quotes:      Thu Oct  4 11:44:35 2001

Which is more like what I expect.
-- 
Crist J. Clark                           cjclark@alum.mit.edu
                                         cjclark@jhu.edu
                                         cjc@freebsd.org

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-audit" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011004233459.M297>