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 https://bugs.gentoo.org/908401:

sys-apps/file added detection for "Hewlett-Packard Graphics Language" in <https://github.com/file/file/commit/57df9984ca59a54a0ad2ac548bc155dabe07f03a>. 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
PATH="/etc/eselect/wine/bin"
MANPATH="/etc/eselect/wine/share/man"
XDG_DATA_DIRS="/etc/eselect/wine/share"
$ 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.

Activities

ulm

2023-06-12 11:53

reporter  

95eselect-wine (107 bytes)   
PATH="/etc/eselect/wine/bin"
MANPATH="/etc/eselect/wine/share/man"
XDG_DATA_DIRS="/etc/eselect/wine/share"
95eselect-wine (107 bytes)   

christos

2023-06-16 19:36

manager   ~0003947

Applied patch from Joerg Jenderek. Does it help?

ulm

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
NPM_CONFIG_GLOBALCONFIG=/etc/npm/npmrc
$ 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)   
NPM_CONFIG_GLOBALCONFIG=/etc/npm/npmrc
50npm (39 bytes)   

thesamesam

2023-07-28 11:04

reporter   ~0003968

I can still reproduce that issue with the new file contents:
```
NPM_CONFIG_GLOBALCONFIG=/etc/npm/npmrc
```

with file-5.45.

christos

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