OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: Problem with locate?

From: Andreas Kähäri (akfreeshell.org)
Date: Tue Jul 01 2003 - 17:03:48 CDT


Yes, I noticed this as well, and I might be the one to blame.

Someone here on misc recently had a problem with building
the locate database when a file contained the character '%'.
I answered with saying that the awk snippets in two scripts
were suspicious (locate.mklocatedb and locate.concatdb in
/usr/libexec). The complete awk program code in both scripts
was

    BEGIN { ORS = "" } NR <= 128 { printf $2 }

The input to this is the numerically sorted two column output of
/usr/libexec/locate.bigram. The awk code will fail miserably
when $2 (fragments of file names) contains a '%' character, as
someone found out, so I suggested changing the 'printf' into a
'print'. This apparantly (?) broke something else.

Having said that, I'm running the new locate scripts on two
machines, and it the locate database works on one of them.

The fsck issue has nothing to do with this.

See if changing the 'print' back into 'printf' in both scripts
solves your problem.

Andreas

On Tue, Jul 01, 2003 at 01:45:37PM -0700, Rick Pettit wrote:
> My laptop running a very recent i386 snapshot ran out of juice and died on
> me last night while I was installing a bunch of stuff in /usr. This mornings
> fsck had some errors, but I finally got the system into what I thought was
> working order.
>
> Then I noticed the following:
>
> prompt> sudo /usr/libexec/locate.updatedb
> prompt> locate gtk | less
> locate database header corrupt, bigram char outside 0, 32-127: 10
>
> Is this a good indication that a reinstall is my best bet?
>
> dmesg attached just in case that might be of help.
>
> -Rick
[cut]

--
Andreas Kähäri
Essex, England