Date: Mon, 9 Jun 1997 16:27:06 -0700 (PDT) Message-Id: <199706092327.QAA04931@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: djgpp AT delorie DOT com From: Nate Eldredge Subject: DJGPP runs bogus binaries Precedence: bulk Hi everyone. Here's something to watch out for with DJGPP. When running another program with spawn, system, exec or the like, very little checking is done to make sure the program is an appropriate executable. All files without extensions are essentially checked only for being V1 COFFs, then run as V2 if not. I spent hours suspecting a bug in Make before finding a Linux ELF binary in the directory of something I was trying to port. Make would try to run it, it would be run (!) and of course crash. (As an aside, it *completely* wedged the system, requiring cold boot. Isn't protected mode supposed to prevent this?) I notice a comment in the source (src/libc/dos/process/dosexec.c) indicating that this is a known problem. Perhaps some effort should be put into fixing it. It doesn't seem that difficult; there are presumably magic numbers and such to check for. I realize this is rather a case of "Don't do that, then", but it would sure be nice if bogus binaries were checked for, or at *least* if this problem could be documented better. Hopefully others can avoid a similar difficulty. -------------------- Nate Eldredge eldredge AT ap DOT net