Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 101639 - sys-apps/file ignores /etc/magic
Summary: sys-apps/file ignores /etc/magic
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-07 06:34 UTC by Preston Crow
Modified: 2005-08-18 15:27 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Preston Crow 2005-08-07 06:34:00 UTC
The documentation for the 'file' command states that local additions should be
placed in /etc/magic, but that file is never referenced.

This impacts dev-lang/lua-5.0.2 which installs a local addition.

Obviously, this also impacts me, as I'm also adding some entries.

The workaround is to create a symlink to /etc/magic named ~/.magic for each user.
Comment 1 Preston Crow 2005-08-07 06:38:06 UTC
Correction:  The symlink mentioned does not supplement the existing magic with
localizations in /etc/magic, it replaces it.  There may not be an effective
workaround.
Comment 2 SpanKY gentoo-dev 2005-08-17 21:40:33 UTC
looks like all versions of file do this

from a quick glance at file.c, it looks like file only works with 1 magic
database at a time ... if you have say ~/.magic, then the system magic file will
never be utilized

in the case of /etc/magic, this is a compile time default which is overridden by
/usr/share/misc/file/magic
Comment 3 SpanKY gentoo-dev 2005-08-17 21:49:30 UTC
oops, did not mean to close ...
Comment 4 Preston Crow 2005-08-18 06:33:02 UTC
I just created bug 102970 for "dev-lang/lua adds to /etc/magic, ignored."  I
referenced this bug there, so now it's linked both ways.

The issue remaining with this bug is that the documentation (man page and such)
says that localizations should go in /etc/magic, which is not how it is
implemented.  This is probably something that should be pushed upstream to the
'file' maintainer, as being able to add local additions is a useful feature.
Comment 5 SpanKY gentoo-dev 2005-08-18 06:44:12 UTC
ive e-mailed upstream already ...

personally i dont think lua should be installing /etc/magic ... what if some
other package wants to install file updates too ?  they should all be moved into
the file package
Comment 6 SpanKY gentoo-dev 2005-08-18 15:27:18 UTC
talked to upstream and they're just going to fix the documentation by trimming
all mentioning of /etc/magic

i guess it's never been supported, but no one noticed the manpage was outdated ;)

file-4.15 now in portage