#1028125 wrong source-contains-prebuilt-windows-binary for GB18030-encoded text file

#1028125#5
Date:
2023-01-07 14:31:39 UTC
From:
To:
Hi,

I get (well, got, it's overriden now)

libreoffice source: source-contains-prebuilt-windows-binary

on LibreOffices sw/qa/extras/txtimport/data/GB18030.txt

Looking at that file gives:

rene@frodo:~/LibreOffice/git/master$ cat
sw/qa/extras/txtimport/data/GB18030.txt
�������֮������ʮ�����ǧ������ΪһԪ��
rene@frodo:~/LibreOffice/git/master$ file
sw/qa/extras/txtimport/data/GB18030.txt
sw/qa/extras/txtimport/data/GB18030.txt: COM executable for DOS

which is suspicious indeed, BUT GB18030 is a chinese character encoding
so I just tried recode:

rene@frodo:~/LibreOffice/git/master$ recode GB18030..UTF-8
sw/qa/extras/txtimport/data/GB18030.txt
rene@frodo:~/LibreOffice/git/master$ cat
sw/qa/extras/txtimport/data/GB18030.txt
盖闻天地之数,有十二万九千六百岁为一元。
rene@frodo:~/LibreOffice/git/master$ file
sw/qa/extras/txtimport/data/GB18030.txt
sw/qa/extras/txtimport/data/GB18030.txt: UTF-8 Unicode text

so it's text, as the directory says :-) (And yes, it needs to be GB18030
because that is exactly the purpose of the unit test using it - test
GB18030 text files import).

This is overriden now. :)

(BTW: Windows binary is also wrong in an  other way. file says
"COM executable for DOS". DOS != Windows. Windows binaries would be
reported by file as Windows:

rene@frodo:~/LibreOffice/git/master$ file
testtools/source/cliversioning/version_libs/*
testtools/source/cliversioning/version_libs/readme.txt:        ASCII text
testtools/source/cliversioning/version_libs/version_3_0_0.dll: PE32
executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
testtools/source/cliversioning/version_libs/version_3_0_1.dll: PE32
executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
testtools/source/cliversioning/version_libs/version_3_1_1.dll: PE32
executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
testtools/source/cliversioning/version_libs/version_3_1.dll:   PE32
executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
testtools/source/cliversioning/version_libs/version_3_2_1.dll: PE32
executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
testtools/source/cliversioning/version_libs/version_3_2.dll:   PE32
executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
testtools/source/cliversioning/version_libs/version_3_3.dll:   PE32
executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
rene@frodo:~/Software$ file *.exe
<removed, OSS windows software>: PE32 executable (GUI) Intel 80386, for
MS Windows, Nullsoft
rene@frodo:~/Software$ file FRITZOS/FRITZ.Box_7590_AX-07.31-recover.exe
FRITZOS/FRITZ.Box_7590_AX-07.31-recover.exe: PE32 executable (GUI) Intel
80386, for MS Windows

as PE32)

Filing as important since wrong source-contains-prebuilt-windows-binary
_might_ (just an assumption) be a reason ftp-masters might reject -
*especially if the windows binary is "hidden" in a .txt file*...

Regards,

Rene

#1028125#10
Date:
2023-02-06 09:57:17 UTC
From:
To:
Hi Rene,

Do you know whether this is a regression (as in: did lintian/file previously
correctly identify the file type for GB18030.txt)?

There seems to be some code adjustments in libmagic recently, in particular
related to PE32 file types.  I didn't manage to understand the reasoning and
effect of those changes, but am wondering if they could be related to this bug.

Thanks,
James

#1028125#15
Date:
2024-02-21 13:05:19 UTC
From:
To:
This filetype ambiguity seems to be reported by the 'file' command that
lintian invokes[1] to identify the file type for source files that it scans.

[1] - https://sources.debian.org/src/lintian/2.117.0/lib/Lintian/Index/FileTypes.pm/#L75-L119