Bug 159708 - file doesn't detect the correct content type of zmd.exe, and similar brain damages
Summary: file doesn't detect the correct content type of zmd.exe, and similar brain da...
Status: RESOLVED FIXED
Alias: None
Product: SUSE Linux 10.1
Classification: openSUSE
Component: Mono (show other bugs)
Version: Beta 8
Hardware: i686 SUSE Other
: P5 - None : Normal with 23 votes (vote)
Target Milestone: ---
Assignee: Dr. Werner Fink
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-21 10:51 UTC by Hans-Peter Jansen
Modified: 2006-03-27 11:34 UTC (History)
6 users (show)

See Also:
Found By: Beta-Customer
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
magic change to recognize mono assemblies (409 bytes, patch)
2006-03-24 20:23 UTC, Paolo Molaro
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hans-Peter Jansen 2006-03-21 10:51:11 UTC
# file /usr/lib/zmd/zmd.exe
/usr/lib/zmd/zmd.exe: PE executable for MS Windows (console) Intel 80386 32-bit

# file /usr/lib/zmd/Novell.Zenworks.Zmd.dll 
/usr/lib/zmd/Novell.Zenworks.Zmd.dll: PE executable for MS Windows (DLL) (console) Intel 80386 32-bit

Please retire this brain fart - pardon: naming convention - before it's to late..
Comment 1 Andreas Gruenbacher 2006-03-21 12:22:18 UTC
"File" looks at file contents, the file name doesn't matter. Someone from the mono team would have to come up with the right magic (man magic) for mono executables and libraries.
Comment 2 Michael Gross 2006-03-21 14:10:15 UTC
At first, this is not a blocker. Then: What should the actual type of these files be? The output looks correct to me. As Andreas already mentioned: file checks for magic numbers and sometimes header-information of the detected type, not the suffix.
Comment 3 Martin Schlander 2006-03-21 14:36:13 UTC
In my not-very-technical opinion it should be possible for users to tell the difference between (1) mono files that run natively on Linux and (2) Windows executables and dlls - *without* checking magic numbers or header information.

I foresee a lot of trouble explaining to noobs and non technical people why one *.exe works with Linux and another *.exe doesn't.

What the extension is, is not important, so long as it is not easily confused with other file types or files running on different platforms.
Comment 4 Forgotten User OS1JNCFbCX 2006-03-21 15:22:06 UTC
Users never run these binaries manually. So why should they care at all?

Then there is no need to explain this to the user at all. You don't explain to the user why they cannot run HP-UX binaries on Linux, do you? Every user that still has some brain left does easily understand that you cannot run a HP-UX binary on Linux if you just tell him. Why shouldn't he understand the same for a Windows binary?

Java uses to call his class files *.class. This is the very same situation. Do you suggest to remove the ".class" of all *.class files?

Do you really suggest that the fact that we use some technology that was originally brought to market by Microsoft must be hidden from the user? Where is this spirit of the Linux community to just make use of technology if it has proven to show some advantages in a specific situation? Did this completely move now into a group of fundamentalists that have no technological background just crying around about everything that has a word in it they do not like. --- Well then we actually already _reached_ the level of the average Windows user communities...
Comment 5 Forgotten User 7L3tOtZIov 2006-03-21 15:28:42 UTC
Is the program a windows or dos program or does it run under Linux? If it runs under Linux, then it should get no extention or another extention that is generaly accepted under Linux.
Comment 6 Forgotten User OS1JNCFbCX 2006-03-21 15:41:26 UTC
It is CIL bytecode which is used to have the extension EXE. You can run it on _any_ CLR implementation if you have all required libraries installed.

Java applications also run on Linux. They also have an extension (.class). Logical conclusion: Your statement does not make sense.
Comment 7 Hans-Peter Jansen 2006-03-21 16:59:22 UTC
Dear Michael,

> At first, this is not a blocker. 

Okay, accepted, it just reflected my state of mind..

> Then: What should the actual type of these
> files be? The output looks correct to me. As Andreas already mentioned: file
> checks for magic numbers and sometimes header-information of the detected 
> type, not the suffix.

Sure, I know these facts, I was simply disgusted about that output:
If we have to accept those suffixes as a convention, as Robert pointed out (and I anticipated), it should be possible to determine the difference between real Windows binaries and Mono binaries, and file is the tool at hand. 

Dear Robert, 
> It is CIL bytecode which is used to have the extension EXE. You can run it 
> on _any_ CLR implementation if you have all required libraries installed.

thanks for this clarification, I haven't heard about this convention. Obviously I hadn't any contact with mono, yet. These insights were enough to keep it like that, since IMHO, it inherits a major disease from the paragon: naming shared libs something.dll leads straight into dll hell.. Funny enough, beagle seems to mix both library types. 

Thanks god, that c#/mono was invented after breaking with the 8.3 filename limit..
Comment 8 Michael Gross 2006-03-22 12:48:29 UTC
I don't even have these files in my installation, only an /usr/lib/zmd/zmd-bin which is typed as ELF executable.

Werner: Could this easily be added to the `file'-command or should this better be reported/requested upstream?
Comment 9 Dr. Werner Fink 2006-03-22 13:04:27 UTC
I do not understand. The command file looks at the contents of a file
and determine with the help of /usr/share/misc/magic a matching
byte sequence and the the corresponding file type.  Extensions will
never be mentioned by file.  Without the correct magic byte sequences
I will do nothing.  Reopen only if one can provide the correct magics
for mono executables and note it should be tested. I do not accept
magigs which breaks other magics.
Comment 10 Dr. Werner Fink 2006-03-22 13:28:43 UTC
For reassign to mono maintainer
Comment 11 Dr. Werner Fink 2006-03-22 13:31:15 UTC
Someone of the mono maintainers has to provide the correct and working
entries for those zen binary files.  After this please reassign back
to the maintainer of the pacakge file (me).
Comment 12 Dr. Werner Fink 2006-03-23 13:18:25 UTC
Please provide the requested magic entries for the pacakge file.
Comment 13 Paolo Molaro 2006-03-24 20:23:58 UTC
Created attachment 74984 [details]
magic change to recognize mono assemblies

Patch for the magic file, apply and recompile it with file -C.
Comment 14 Dr. Werner Fink 2006-03-27 11:34:50 UTC
Fixed.