View Issue Details

IDProjectCategoryView StatusLast Update
0000484fileGeneralpublic2023-10-18 02:13
Reporteraulonsal Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Platformx86_64OSArch LinuxOS Versionrolling
Product Version5.45 
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

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2023-10-18 02:12 aulonsal New Issue