Subject: Re: more user-friendly error message for /bin/sh?
To: None <>
From: Alan Barrett <>
List: tech-userlevel
Date: 01/17/2007 08:11:26
On Tue, 16 Jan 2007, James K. Lowden wrote:
> > What about other binary files that the kernel can run? a.out for
> > example? coff?
> > 
> > I would say just check if the first few bytes of the file are non ascii,
> > and say that you cannot execute binary /bin/cat...

Yes, that would be much better than a single special case (or even a list of
special cases).

> I disagree.  Roland's patch converts one common, mysterious message into
> something useful. Why isn't that enough?  Surely ELF is by far the most
> common flavor.  

I thought that the most common scenario was: binary is for the wrong OS,
the wrong hardware, or needs a kernel option that's not enabled; kernel
can't exec it; something decides to try interpreting it with a shell;
shell prints a cryptic message.  No list of magic numbers is going to be
comprehensive enough to cover this case.

--apb (Alan Barrett)