Xref: utzoo comp.sys.ibm.pc.misc:5007 comp.sys.novell:200 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!sol.ctr.columbia.edu!cunixf.cc.columbia.edu!cs.columbia.edu!abrams From: abrams@cs.columbia.edu (Steven Abrams) Newsgroups: comp.sys.ibm.pc.misc,comp.sys.novell Subject: Re: shelling to Dos Message-ID: Date: 26 Dec 90 02:04:47 GMT References: <1990Dec24.012958.9228@magnus.ircc.ohio-state.edu> <1990Dec25.233917.15240@mstr.hgc.edu> Sender: news@cs.columbia.edu (The Daily News) Organization: Columbia University Department of Computer Science Lines: 39 In-Reply-To: craig@sa2.hgc.edu's message of Tue, 25 Dec 90 23:39:17 GMT In article <1990Dec25.233917.15240@mstr.hgc.edu> craig@sa2.hgc.edu (craig chaiken) writes: >The following is a list of ways to prevent an application from shelling out to >DOS: >1) Rename COMMAND.COM just prior to executing the application, and restore > it upon exit from the application. (Dangerous if the machine crashes > while COMMAND.COM is renamed). This may be the best bet; even better, is to permanently rename COMMAND.COM to something else and use the SHELL= in config.sys to allow the system to boot with the "other" COMMAND.COM. To be doubly safe, reset COMSPEC environment variable to some nonexistent program before running the application to prevent it from checking the env. for the location of COMMAND.COM. The downside of this approach is that if, when the application exits, it has used enough RAM to walk on the transient portion of COMMAND.COM, when DOS checks the environment to find out where to load COMMAND.COM, it will fail with "Please insert disk with COMMAND.COM in Drive C: and press any key..." or something dumb like this. >4) Write a TSR to capture the INT 21H EXEC function (AH=4BH). Ignor any > requests to run COMMAND.COM, and execute all other requests. (Actually, > not that hard to program, but certainly not for beginners). I think this is the best option of all, but, as you said, not for the fainthearted. ~~~Steve -- /************************************************* * *Steven Abrams abrams@cs.columbia.edu * **************************************************/ #include #include