[File] [PATCH] Magdir/archive for LibreOffice/OpenOffice extension *.oxt versus Zip archive

Jörg Jenderek joerg.jen.der.ek at gmx.net
Tue Mar 8 15:38:01 UTC 2022


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

some days ago i had trouble with my spelling software. So i looked at
the components. Some have the file name extension OXT.

When running file command version 5.41 on such extensions i get an
output like:

Gallery-Puzzle.2.1.0.1.oxt: Zip data
			    (MIME type
		"application/vnd.openofficeorg.extension"?)
all3.oxt:                   Zip archive data,
			    at least v2.0 to extract,
			    compression method=deflate
business_pictogramme.oxt:   Zip archive data,
			    at least v2.0 to extract,
			    compression method=deflate
no-description.oxt:         Zip archive data,
			    at least v2.0 to extract,
			    compression method=deflate
qrcodejs.oxt:               Zip archive data,
			    at least v2.0 to extract,
			    compression method=deflate

With --extension option only ??? is displayed. Furthermore with -i
option for many samples only generic application/zip is shown.

For comparison reason i run the file format identification utility
TrID ( See https://mark0.net/soft-trid-e.html). This identifies also
all samples generic as "ZIP compressed archive" by definition
ark-zip.trid.xml. But many examples are described more precisely as
"OpenOffice Extension" by oxt.trid.xml (See appended
oxt_trid-v.txt.gz)

For comparison reason i also run the file format identification
utility DROID ( See https://sourceforge.net/projects/droid/). This
identifies all examples also only generic as "ZIP Format" by PUID
x-fmt/263, but it complains about the file name extension OXT (See
appended oxt_droid.csv.gz)

With the information of these tools i found a page about on File
Format on openoffice.org. That information is expressed by comment
line inside Magdir/archive like:

# URL:	https://wiki.openoffice.org/
#	wiki/Documentation/DevGuide/Extensions/File_Format

According to that page OXT are just ZIP archives containing sometimes
as first a 8 byte size file with name mimetype and with 39 byte mime
type content string "application/vnd.openofficeorg.extension". I
verified such examples by command like:
	unzip -Zv *.oxt
	7z l -slt *.oxt

The message for such OXT examples is triggered by part handling mime
type "application/<OTHER>" meaning that there exist no code fragment
for "vnd.openofficeorg.extension" application. This relationship is
also listed on nirsoft website extension.nirsoft.net.
So i insert after section for OpenOffice 1.x handled by vnd.sun.xml
the new part. This now looks like

 >> 50	string	vnd.openofficeorg.	OpenOffice
 >>> 68	string	extension		\b/LibreOffice Extension
 !:mime	application/vnd.openofficeorg.extension
 !:ext	oxt

I also find such extensions not only inside OpenOffice but also  in
LibreOffice directories. And following some hints on the net probably
also NeoOffice use that extensions, but i do not know if this true.

After applying the above mentioned modifications by patch
file-5.41-archive-oxt.diff and using Magdir/zip then a few extension
samples (Sorry only one of my examples) are now described more
precisely. This now looks option like:

Gallery-Puzzle.2.1.0.1.oxt: OpenOffice/LibreOffice Extension
all3.oxt:                   Zip archive data,
			    at least v2.0 to extract,
			    compression method=deflate
business_pictogramme.oxt:   Zip archive data,
			    at least v2.0 to extract,
			    compression method=deflate
no-description.oxt:         Zip archive data,
			    at least v2.0 to extract,
			    compression method=deflate
qrcodejs.oxt:               Zip archive data,
			    at least v2.0 to extract,
			    compression method=deflate


I hope my diff file can be applied in future version of file
utility.

Unfortunately many OXT examples does not contains such starting
mimetype member. So other checks must be done to recognise OXT or
especially distinguish it from pure ZIP archive.

With best wishes
Jörg Jenderek
- --
Jörg Jenderek



-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iF0EARECAB0WIQS5/qNWKD4ASGOJGL+v8rHJQhrU1gUCYid4UAAKCRCv8rHJQhrU
1qSXAKDiDpiANGB021AgLsd62WzLRmt4UACffNtDEDLsv43M2eRt8N7BuJ/4JCc=
=Owut
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: oxt_trid-v.txt.gz
Type: application/x-gzip
Size: 706 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20220308/8b259007/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: oxt_droid.csv.gz
Type: application/x-gzip
Size: 2533 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20220308/8b259007/attachment-0001.bin>
-------------- next part --------------
--- file-5.41/magic/Magdir/archive.old	2021-08-30 11:10:26.000000000 +0200
+++ file-5.41/magic/Magdir/archive	2022-03-08 01:22:26.308578700 +0100
@@ -1276,6 +1276,18 @@
 !:mime	application/vnd.sun.xml.base
 !:ext	sdb
 
+# URL:	https://wiki.openoffice.org/wiki/Documentation/DevGuide/Extensions/File_Format
+# From:	Joerg Jenderek
+# Note:	only few OXT samples are detected here by mimetype member
+#	is used by OpenOffice and LibreOffice and probably also NeoOffice
+#	verified by `unzip -Zv *.oxt` or `7z l -slt *.oxt`
+>>50	string	vnd.openofficeorg.		OpenOffice
+>>>68	string	extension			\b/LibreOffice Extension
+# http://extension.nirsoft.net/oxt
+!:mime	application/vnd.openofficeorg.extension
+# like: Gallery-Puzzle.2.1.0.1.oxt
+!:ext	oxt
+
 #   OpenDocument formats (for OpenOffice 2.x / StarOffice >= 8)
 #   URL: http://fileformats.archiveteam.org/wiki/OpenDocument
 #    https://lists.oasis-open.org/archives/office/200505/msg00006.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file-5.41-archive-oxt.diff.sig
Type: application/octet-stream
Size: 716 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20220308/8b259007/attachment.obj>


More information about the File mailing list