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

Re: file



On Thu, 6 Jun 2002, christer solstrand johannessen wrote:

> hi again :)
>
> when i run file (with or without any arguments), i get this output:
>
> # file
> file: offset head       1.1; invalid
> file: type head 1.1; invalid
> file: offset access; invalid
> file: type access; invalid
 .....
> file: offset    OPENBSD_2_1_BASE:1.1; invalid
> file: type OPENBSD_2_1_BASE:1.1; invalid
> file: offset locks; strict; invalid
> file: type locks; strict; invalid
> file: offset comment    @# @; invalid
> file: type comment      @# @; invalid
> file: type .1 invalid
> file: offset date       97.02.09.22.49.03;      author millert; state
> Exp; invalid
> file: offset branches; invalid
> file: type branches; invalid

....

> file: type @Updated from NetBSD. invalid
> file: offset @ invalid

> ...and it repeats itself for a couple thousand lines... anybody
> have a clue what causes this? i recon the file program is busted
> in one or more ways; should i compile userland again?

The errors are providing *powerful* hints about what's wrong.
No amount of recompilation will cure it.  I believe that the
/etc/magic file is broken.

How is it broken?  Those errors appear to be the contents of a
cvs/rcs/sccs/(some other version control system) file.  My bet is
that you have somehow extracted "/etc/RCS/magic,v" (or something
similar) in place of /etc/magic.  Look at /etc/magic.  The first
few lines should be:

$ 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.
#------------------------------------------------------------------------------
# Localstuff:  file(1) magic for locally observed files
#

I would scratch my head and figure out what you did wrong with
your last cvs run, or perhaps you have mistyped "ci" for "vi"?

Exercise:  <as unprivileged user>

[listread_(_at_)_pollux listread]$ cd /tmp
[listread_(_at_)_pollux tmp]$ cp /etc/magic .
[listread_(_at_)_pollux tmp]$ ci magic
magic,v  <--  magic
enter description, terminated with single '.' or end of file:
NOTE: This is NOT the log message!
>> Some STUFF from Woodchuck
>> .
initial revision: 1.1
done
[listread_(_at_)_pollux tmp]$ ls -l mag*
-r--r--r--  1 listread  wheel  144602 Jun  6 16:12 magic,v
[listread_(_at_)_pollux tmp]$ head magic,v
head	1.1;
access;
symbols;
locks; strict;
comment	@# @;


1.1
date	2002.06.06.20.12.16;	author listread;	state Exp;
branches;
[listread_(_at_)_pollux tmp]$


Look familiar?

Dave



Visit your host, monkey.org