delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/10/18/07:57:28

Date: Sun, 18 Oct 1998 13:52:44 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Andris Pavenis <pavenis AT lanet DOT lv>
cc: djgpp-workers AT delorie DOT com, dj AT delorie DOT com
Subject: Re: Patch for src/libc/dos/process/dosexec.c
In-Reply-To: <Pine.A32.3.91.981017152040.83628A-100000@ieva01.lanet.lv>
Message-ID: <Pine.SUN.3.91.981018135225.2705l-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com

On Sat, 17 Oct 1998, Andris Pavenis wrote:

> 	we should SKIP additional extension when it is "" to
> 	avoid BAT file (or some script) missinterpretted as
> 	unstubbed COFF.

Thanks for the patch.

However, I'm not sure this is the right thing to do to correct the
bug.  This patch loses when foo.bat *is* an unstubified COFF image
(or, in fact, anything other than a batch file).  Preventing users
from being able to have a file with a .bat extension that isn't a
batch file is a subtle restriction that shouldn't be introduced with
no good reason, IMHO.

I think a better way to correct this bug would be to change go32_exec
function (which gets called by the original version of dosexec.c for
this case) so that a file that is neither a V2 executable, nor a shell
script, and doesn't have the DOS MZ signature (use the
_V2_EXEC_FORMAT_EXE macro with the value returned by _check_v2_prog),
is passed to __dosexec_command_exec (instead of direct_exec in the
original code).  This is analogous to the handling of .sh, .pl, .sed
etc. files, so why make a special treatment for a .bat file?

Andris, could you please try this alternative solution and see if it
works?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019