Subject: Re: more user-friendly error message for /bin/sh?
To: None <tech-userlevel@netbsd.org>
From: James K. Lowden <jklowden@schemamania.org>
List: tech-userlevel
Date: 01/17/2007 23:44:06
Alan Barrett wrote:
> > > 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).

These are not mutually exclusive choices.  If not ASCII then if ELF say
ELF else say ENOSCRIPT?  ;-) 

> > 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

With respect, Alan, I think you're letting your fertile imagination run
away with this idea.  You already cooked up scenarios I hadn't thought of.
But "common"?   The '"(" unexpected' message was recognized by more than
one person as an indication that the shell was trying to interpret an ELF
binary.  How many others would be so recognized?  Surely that's evidence
of its prevalence.  

I said Roland's little patch makes things better, and you agree, no?  No
one's said it wouldn't be useful, only that it wouldn't be useful
*enough*, which to me is making the perfect the enemy of the good.  

Roland answered a question on this list about an inscrutable message; my
impression is he answered it once too often and decided to try to fix it. 
I think that deserves support.  

--jkl