Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bionet!ames!sun-arpa!male!pitstop!sun!imagen!atari!apratt From: apratt@atari.UUCP (Allan Pratt) Newsgroups: comp.sys.atari.st Subject: Re: ARGV definition (MWC) Keywords: Extended Arguments MWC ARGV Pexec Message-ID: <1455@atari.UUCP> Date: 14 Apr 89 22:18:45 GMT References: <845@per2.UUCP> Reply-To: apratt@atari.UUCP (Allan Pratt) Organization: Atari (US) Corporation, Sunnyvale, California Lines: 36 In article <845@per2.UUCP> rec@mwc.uucp (Roger Critchlow @ Mark Williams Company) writes: > [material deleted] > > "If the environment vector contains a parameter named ARGV, then the > "run time start-up assumes that the program was executed by msh (...) > > Quoted material is Copyright (c) 1986 by Mark Williams Company. > > -- rec -- This is the root of the problem, isn't it? There's no validation of the arguments. It could be that the program's PARENT was executed by msh, and the program itself was executed by something which didn't know a thing about ARGV. If every MWC tool and ARGV-compatible program checked to see if the "ARGV" in its environment was really meant for its use, we'd have much smaller objections to ARGV. As it happens, the person(s) who wrote the execve code for the MWC library DID leave a hook for validation: they made sure the command-line length byte held 0x7f, which is the highest possible number this byte can legally hold. I always assumed the MWC startup code could say, "If my command-line length byte isn't 0x7f, the ARGV in my environment can't be meant for me." Then ignorant programs which simply passed ARGV on to their children wouldn't be harmed, because the children would know that the args aren't meant for them. The other problems of ignorant programs finding strange things in their environments (each "argument" string appears as a separate environment variables) are minor by comparison. ============================================ Opinions expressed above do not necessarily -- Allan Pratt, Atari Corp. reflect those of Atari Corp. or anyone else. ...ames!atari!apratt