View Issue Details

IDProjectCategoryView StatusLast Update
0000504fileGeneralpublic2024-03-01 03:33
Reporterskissane Assigned Tochristos  
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Product Version5.45 
Fixed in VersionHEAD 
Summary0000504: Recognise z/OS Program Objects
DescriptionCurrently, magic/Magdir/ibm370 recognises various old IBM mainframe executable format, but does not recognise the current z/OS executable format defined by IBM ("z/OS Program Object"), which is the IBM mainframe executable format you are most likely to encounter in the wild today.

I am supplying a patch to recognise this format. (It is quite simple, it is just "IEWPLMH " as magic at start of the file, except that is in EBCDIC instead of ASCII.)
Steps To Reproduce1. Download https://github.com/ZOSOpenTools/bashport/releases/download/STABLE_bashport_2038/bash-5.2.21.20240126_140514.zos.pax.Z (port of bash to IBM z/OS)
2. Extract the file bin/bash from that archive (it is a compressed tar archive, so tar xzf can extract it)
3. file ./bash
EXPECTED: something like "z/OS Program Object executable"
ACTUAL: reports "data"
4. Apply attached patch to magic/Magdir/ibm370
5. file -m ibm370.new ./bash
ACTUAL: reports "z/OS Program Object executable"
Additional InformationI attach a patch to magic/Magdir/ibm370. I also attach (gzipped) the bash executable I mention above so you don't have to download and extract it.

Also, there was a comment line saying "What the heck *is* "USS/370"?"

The answer is, "USS/370" is a very old (early 1990s) name for the IBM's Unix compatibility subsystem for z/OS (formerly known as MVS or OS/390). So I replaced that question with its answer. I haven't changed the name in the magic rules, since for those very old executable formats (which IBM doesn't use any more) it is arguably the correct name.
Tagsmagic

Activities

skissane

2024-02-20 09:09

reporter  

ibm370.patch (937 bytes)   
diff --git a/magic/Magdir/ibm370 b/magic/Magdir/ibm370
index dc976f87..c3153b84 100644
--- a/magic/Magdir/ibm370
+++ b/magic/Magdir/ibm370
@@ -4,7 +4,7 @@
 # ibm370:  file(1) magic for IBM 370 and compatibles.
 #
 # "ibm370" said that 0x15d == 0535 was "ibm 370 pure executable".
-# What the heck *is* "USS/370"?
+# "USS/370" is an old name for the z/OS Unix subsystem
 # AIX 4.1's "/etc/magic" has
 #
 #	0	short		0535		370 sysV executable
@@ -50,3 +50,9 @@
 # NETDATA (https://en.wikipedia.org/wiki/NETDATA)
 #	-\INMR01 In EBCDIC
 0	string 		\x60\xe0\xc9\xd5\xd4\xd9\xf0\xf1	IBM NETDATA file
+
+# z/OS Program Object executable
+# Starts with "IEWPLMH" in EBCDIC, followed by a single EBCDIC space to pad
+# to 8 bytes. According to https://www.ibm.com/support/pages/apar/PK91585
+# IEWPLMH is eyecatcher for "Binder Program Load Module Header" control block
+0	string   	\xc9\xc5\xe6\xd7\xd3\xd4\xc8\x40	z/OS Program Object executable
ibm370.patch (937 bytes)   
bash.zos.gz (1,481,466 bytes)

christos

2024-03-01 03:33

manager   ~0004016

Added, thanks!

Issue History

Date Modified Username Field Change
2024-02-20 09:09 skissane New Issue
2024-02-20 09:09 skissane File Added: ibm370.patch
2024-02-20 09:09 skissane File Added: bash.zos.gz
2024-02-20 18:26 skissane Tag Attached: magic
2024-03-01 03:32 christos Assigned To => christos
2024-03-01 03:32 christos Status new => assigned
2024-03-01 03:33 christos Status assigned => resolved
2024-03-01 03:33 christos Resolution open => fixed
2024-03-01 03:33 christos Fixed in Version => HEAD
2024-03-01 03:33 christos Note Added: 0004016