[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: file



>>> christer solstrand johannessen 6-Jun-02 21:39 >>>

> > > just checked the /etc/magic, and it is, unfortunately, a plain
> > > text file as you specified. darn. :/
> > Better make sure that /etc/magic is the file that file(1) is
> > reading.
> >     # mv /etc/magic /etc/magic.save
> >     # file
> >     file: couldn't find any magic files!
> > And then put it back:
> >     # mv /etc/magic.save /etc/magic
> > And also try
> >     # file -m /etc/magic
> > to specify the "magic" file to use.
>
> done, with the same results as you got. when specifying
>
>   # file -m /etc/magic
>
> i got the same result as i did initially; same when i run it
> with no parameters.

Okay, so we're definitely running file(1) with your /etc/magic.

> > Could you also try a
> >
> >     # ls -l /etc/magic
>
>   # ls -l /etc/magic
>   -r--r--r--    1 root     bin        391795 May 31 17:50 /etc/magic

Now, mine gives (admittedly on 3.0):

-r--r--r--    1 root     bin        143953 Mar  6 18:27 /etc/magic

which is about _half_ the size of yours ;-)

> > and what does
> >
> >     # head /etc/magic
> >
> > say?
>
>   # head /etc/magic
>   # Magic
>   #       $OpenBSD: Header,v 1.5 1997/04/03 17:39:38 kstailey Exp $
>
>   # Magic data for file(1) command.
>   # Machine-genererated from src/usr.bin/file/magdir/*; edit there only!
>   # Format is described in magic(files), where:
>   # files is 4 on V7 and BSD, 4 on SV, and ?? in the SVID.

So the file starts okay.

:
: [snip]
:
>
> yes... now that you mention that, i recall i had a problem with
> /etc/syslog.conf being all garbage and had to be replaced after
> i had upgraded from 3.1-stable to 3.1-current... think i'll try
> and replace the /etc/magic file from a snapshot binary set, and
> if that fails, i'll try another userland build.

So: it looks like a CVS version of /etc/magic (or even some other
file) has been _appended_ to your /etc/magic.  You could check this
with

    # grep '^head' /etc/magic

which should give nothing on a correct /etc/magic, but something
like:

    4234:head  1.1;

if you do have a CVS file appended.

Replacing /etc/magic should be fine; just extract it from
etc31.tgz.

I'd be interested to see a copy of your corrupt /etc/magic; could
you email it to me directly?

Thanks

Tom