[File] [PATCH] of Magdir/msdos for Microsoft InfoPath Form template *.xsn

Jörg Jenderek joerg.jen.der.ek at gmx.net
Thu Jan 30 13:36:20 UTC 2020


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

Hello,

some days ago i handled some Device Metadata Packages, which are
Microsoft Cabinet archive. So i look for other CAB archives which are
not described precisely. So i look for Microsoft InfoPath Form
template with file name extension xsn. When running file command
version 5.38 on such examples i get an output like:

APPRATE.XSN:  Microsoft Cabinet archive data,
	many, 19667 bytes,
	6 files, at 0x44 +A "manifest.xsf" +A "default.xsl",
	flags 0x4, ID 6570, number 1, extra bytes 20 in head,
	9 datablocks, 0x1 compression
CD_EDIT.XSN:  Microsoft Cabinet archive data,
	many, 10557 bytes,
	8 files, at 0x44 +A "manifest.xsf" +A "schema.xsd",
	flags 0x4, ID 8978, number 1, extra bytes 20 in head,
	2 datablocks, 0x1 compression
D_VALID.XSN:  Microsoft Cabinet archive data,
	many, 11480 bytes,
	18 files, at 0x44 +A "manifest.xsf" +A "sampledata.xml",
	flags 0x4, ID 18640, number 1, extra bytes 20 in head,
	3 datablocks, 0x1 compression
INVOICED.XSN: Microsoft Cabinet archive data,
	many, 17309 bytes,
	8 files, at 0x44 +A "manifest.xsf" +A "default.xsl",
	flags 0x4, ID 9484, number 1, extra bytes 20 in head,
	4 datablocks, 0x1 compression
ISSTRKD.XSN:  Microsoft Cabinet archive data,
	many, 15232 bytes,
	6 files, at 0x44 +A "manifest.xsf" +A "script.js",
	flags 0x4, ID 6416, number 1, extra bytes 20 in head,
	4 datablocks, 0x1 compression
SALESRPT.XSN: Microsoft Cabinet archive data,
	many, 15128 bytes,
	8 files, at 0x44 +A "manifest.xsf" +A "view.xsl",
	flags 0x4, ID 9186, number 1, extra bytes 20 in head,
	3 datablocks, 0x1 compression
VENDINFO.XSN: Microsoft Cabinet archive data,
	many, 20536 bytes,
	9 files, at 0x44 +A "manifest.xsf" +A "view_1.xsl",
	flags 0x4, ID 9934, number 1, extra bytes 20 in head,
	5 datablocks, 0x1 compression

So these examples are only described by generic expression as
Microsoft Cabinet archive, but sub type classification is missing.
Furthermore with --extension option wrong file name extension "cab"
is displayed.

With the observed knowledge i searched for a web page concerning
that file format. On Wikipedia i found a page about Microsoft
InfoPath. So i add that page inside Magdir/msdos as
reference by comment line like:
 # https://en.wikipedia.org/wiki/Microsoft_InfoPath

- From output is visible that first cabinet member is a file with name
"manifest.xsf". This can also be verified by running 7z with
list option.

So i add inside Magdir/msdos in CAB archive section at point where
looking for first cab archive member name additional lines starting
with:
 >>>&-1	string 		manifest.xsf	\b, InfoPath Form Template

Afterwards display standard CAB mime type and correct file name
extension by lines:
 !:mime	application/vnd.ms-cab-compressed
 !:ext	xsn

After applying the above mentioned modifications by patch
file-5.38-msdos-xsn.diff then i get a more precise
output like:

APPRATE.XSN:  Microsoft Cabinet archive data,
	InfoPath Form Template, 19667 bytes,
	6 files, at 0x44 +A "manifest.xsf" +A "default.xsl",
	flags 0x4, ID 6570, number 1, extra bytes 20 in head,
	9 datablocks, 0x1 compression
CD_EDIT.XSN:  Microsoft Cabinet archive data,
	InfoPath Form Template, 10557 bytes,
	8 files, at 0x44 +A "manifest.xsf" +A "schema.xsd",
	flags 0x4, ID 8978, number 1, extra bytes 20 in head,
	2 datablocks, 0x1 compression
D_VALID.XSN:  Microsoft Cabinet archive data,
	InfoPath Form Template, 11480 bytes,
	18 files, at 0x44 +A "manifest.xsf" +A "sampledata.xml",
	flags 0x4, ID 18640, number 1, extra bytes 20 in head,
	3 datablocks, 0x1 compression
INVOICED.XSN: Microsoft Cabinet archive data,
	InfoPath Form Template, 17309 bytes,
	8 files, at 0x44 +A "manifest.xsf" +A "default.xsl",
	flags 0x4, ID 9484, number 1, extra bytes 20 in head,
	4 datablocks, 0x1 compression
ISSTRKD.XSN:  Microsoft Cabinet archive data,
	InfoPath Form Template, 15232 bytes,
	6 files, at 0x44 +A "manifest.xsf" +A "script.js",
	flags 0x4, ID 6416, number 1, extra bytes 20 in head,
	4 datablocks, 0x1 compression
SALESRPT.XSN: Microsoft Cabinet archive data,
	InfoPath Form Template, 15128 bytes,
	8 files, at 0x44 +A "manifest.xsf" +A "view.xsl",
	flags 0x4, ID 9186, number 1, extra bytes 20 in head,
	3 datablocks, 0x1 compression
VENDINFO.XSN: Microsoft Cabinet archive data,
	InfoPath Form Template, 20536 bytes,
	9 files, at 0x44 +A "manifest.xsf" +A "view_1.xsl",
	flags 0x4, ID 9934, number 1, extra bytes 20 in head,
	5 datablocks, 0x1 compression

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

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


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

iF0EARECAB0WIQS5/qNWKD4ASGOJGL+v8rHJQhrU1gUCXjLbwgAKCRCv8rHJQhrU
1qpZAJ9clgvnDId0zeWYBF6S0Utike3h2ACfdyF0JRBuUgKoGziq53iI9b6qUUg=
=9+gr
-----END PGP SIGNATURE-----
-------------- next part --------------
--- file-5.38/magic/Magdir/msdos.old	2019-10-18 16:16:18 +0000
+++ file-5.38/magic/Magdir/msdos	2020-01-30 13:30:59 +0000
@@ -1243,6 +1243,11 @@
 >>>&-1	string/c 	_accrpt_.snp	\b, Access report snapshot
 !:mime	application/msaccess
 !:ext	snp
+# https://en.wikipedia.org/wiki/Microsoft_InfoPath
+>>>&-1	string 		manifest.xsf	\b, InfoPath Form Template
+!:mime	application/vnd.ms-cab-compressed
+#!:mime	application/vnd.ms-infopath
+!:ext	xsn
 # https://www.cabextract.org.uk/wince_cab_format/
 # extension of DOS 8+3 name with ".000" of 1st archive member name implies Windows CE installer
 >>>&7	string 		=.000		\b, WinCE install
@@ -1306,7 +1311,6 @@
 !:mime	application/vnd.ms-cab-compressed
 !:ext	cab
 # TODO: additional extensions like
-# .xsn	InfoPath Dynamic Form
 # .xtp	InfoPath Template Part
 # .lvf	Logitech Video Effects Face Accessory
 >8	ulelong		x		\b, %u bytes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file-5.38-msdos-xsn.diff.sig
Type: application/octet-stream
Size: 95 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20200130/743086de/attachment.obj>


More information about the File mailing list