Bug 101639 - sys-apps/file ignores /etc/magic
Bug#: 101639 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: base-system@gentoo.org Reported By: pc-gentoo-bugs08a@crowcastle.net
Component: Core system
URL: 
Summary: sys-apps/file ignores /etc/magic
Keywords:  
Status Whiteboard: 
Opened: 2005-08-07 06:34 0000
Description:   Opened: 2005-08-07 06:34 0000
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 From Preston Crow 2005-08-07 06:38:06 0000 -------
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 From SpanKY 2005-08-17 21:40:33 0000 -------
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 From SpanKY 2005-08-17 21:49:30 0000 -------
oops, did not mean to close ...

------- Comment #4 From Preston Crow 2005-08-18 06:33:02 0000 -------
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 From SpanKY 2005-08-18 06:44:12 0000 -------
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 From SpanKY 2005-08-18 15:27:18 0000 -------
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