View Issue Details

IDProjectCategoryView StatusLast Update
0000457fileGeneralpublic2023-07-30 16:32
Reporterulm Assigned Tochristos  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version5.44 
Fixed in VersionHEAD 
Summary0000457: application/vnd.hp-HPGL false positives
DescriptionForwarding Gentoo Linux bug

sys-apps/file added detection for "Hewlett-Packard Graphics Language" in <>. This causes files in /etc/env.d that start with "PA" like "PATH" or "NP" as in "NPM_CONFIG_GLOBALCONFIG" to be detected as "Hewlett-Packard Graphics Language" files and not as "ASCII text".

Configuration files or shell scripts starting with assignment of PATH or any other all-caps variable are very common, therefore the HPGL magic should do some additional plausibility checks in order to avoid false positives.
Steps To Reproduce$ cat 95eselect-wine
$ file -i 95eselect-wine
95eselect-wine: application/vnd.hp-HPGL; charset=us-ascii
$ file 95eselect-wine
95eselect-wine: Hewlett-Packard Graphics Language, starting with "PATH="/etc/eselect/wine/bin"" with "MANPATH="/"
TagsNo tags attached.



2023-06-12 11:53


95eselect-wine (107 bytes)   
95eselect-wine (107 bytes)   


2023-06-16 19:36

manager   ~0003947

Applied patch from Joerg Jenderek. Does it help?


2023-06-16 20:15

reporter   ~0003953

The patch doesn't fix the problem.

The test file that I had attached is recognised as text/plain now:

$ file -i 95eselect-wine
95eselect-wine: text/plain; charset=us-ascii
$ file 95eselect-wine
95eselect-wine: ASCII text

However, it still fails with another example in the /etc/env.d/ directory of a Gentoo Linux system:

$ cat 50npm
$ file -i 50npm
50npm: application/vnd.hp-HPGL; charset=us-ascii
$ file 50npm
50npm: Hewlett-Packard Graphics Language, starting with "NPM_CONFIG_GLOBALCONFIG=/etc/npm/npmrc"
50npm (39 bytes)   
50npm (39 bytes)   


2023-07-28 11:04

reporter   ~0003968

I can still reproduce that issue with the new file contents:

with file-5.45.


2023-07-30 16:32

manager   ~0003969

Fixed, thanks!

Issue History

Date Modified Username Field Change
2023-06-12 11:53 ulm New Issue
2023-06-12 11:53 ulm File Added: 95eselect-wine
2023-06-16 19:35 christos Assigned To => christos
2023-06-16 19:35 christos Status new => assigned
2023-06-16 19:36 christos Status assigned => feedback
2023-06-16 19:36 christos Note Added: 0003947
2023-06-16 20:15 ulm Note Added: 0003953
2023-06-16 20:15 ulm File Added: 50npm
2023-06-16 20:15 ulm Status feedback => assigned
2023-07-28 11:04 thesamesam Note Added: 0003968
2023-07-30 16:32 christos Status assigned => resolved
2023-07-30 16:32 christos Resolution open => fixed
2023-07-30 16:32 christos Fixed in Version => HEAD
2023-07-30 16:32 christos Note Added: 0003969