View Issue Details

IDProjectCategoryView StatusLast Update
0000484fileGeneralpublic2024-02-04 19:18
Reporteraulonsal Assigned Tochristos  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx86_64OSArch LinuxOS Versionrolling
Product Version5.45 
Fixed in VersionHEAD 
Summary0000484: Misclassifies lua source file as 'JavaScript source, ASCII text'
DescriptionLua source files using `require()` get classified as 'JavaScript source, ASCII text' in version 5.45, whereas earlier versions (tested 5.44) used to classify them as 'ASCII text'.

This is probably due to what is [commit a2756aa50fdf7d87ebb14002ffd7609373ea6839](https://github.com/file/file/commit/a2756aa50fdf7d87ebb14002ffd7609373ea6839) on the Github readonly mirror.
Steps To ReproduceCreate the following lua source files:
test.lua:
```lua
require('other')
```
other.lua:
```lua
```
(blank file)

```shell
> file --version
file-5.45
magic file from /usr/share/file/misc/magic
seccomp support included
> file test.lua
test.lua: JavaScript source, ASCII text
```

```shell
> LD_PRELOAD=../lib/libmagic.so ./file -m ../share/file/misc/magic.mgc --version
file-5.44
magic file from ../share/file/misc/magic.mgc
seccomp support included
> LD_PRELOAD=../lib/libmagic.so ./file -m ../share/file/misc/magic.mgc ../../../../../../sample/test.lua
../../../../../../sample/test.lua: ASCII text
```
The above magic file is the one included with version 5.44

```
> file -m ../../../5.44-3/usr/share/file/misc/magic.mgc --version
file-5.45
magic file from ../../../5.44-3/usr/share/file/misc/magic.mgc
seccomp support included
> file -m ../../../5.44-3/usr/share/file/misc/magic.mgc ../../../../../../sample/test.lua
../../../../../../sample/test.lua: ASCII text
```
Version 5.45 works as before with the magic from version 5.44 (this is probably obvious, but I didn't know how file(1) worked at the start of this). Version 5.44 misclassifies when used with the magic from version 5.45.
TagsNo tags attached.

Activities

christos

2024-02-04 19:18

manager   ~0003995

Fixed, thanks

Issue History

Date Modified Username Field Change
2023-10-18 02:12 aulonsal New Issue
2024-02-04 19:18 christos Assigned To => christos
2024-02-04 19:18 christos Status new => assigned
2024-02-04 19:18 christos Status assigned => resolved
2024-02-04 19:18 christos Resolution open => fixed
2024-02-04 19:18 christos Fixed in Version => HEAD
2024-02-04 19:18 christos Note Added: 0003995