Subject: Re: File names and security...
To: Mike Long <mikel@shore.net>
From: James Graham - Systems Mangler <greywolf@starwolf.starwolf.com>
List: current-users
Date: 06/08/1997 13:44:51
If 'xargs' is currently so broken that it runs the command thru 'sh -c'
first or something, then we deserve to be bitten by this.  'xargs'
should do :

        char **argv;
	char *cmd;
        construct(&argv);

        execvp(cmd, argv);

...which means that "rm" gets called with, say "foo; chmod 666 /etc/passwd"
or "foo\nchmod 666 /etc/passwd" (s/passwd/master.&/g)
which would properly produce:

foo; chmod 666 : No such file or directory

	or

foo
chmod 666 : No such file or directory

If xargs is built properly, this whole discussion, which has been redone
at least three times since 1995, and so is now moot.  Can we _please_
move on?  This looks like a real straw man/red herring deal which can
be achieved with a rewrite of xargs if necessary (it doesn't appear
to be necessary).

Looking at the code, I see that xargs does just what I described above.
The only thing that could possibly do something really rotten is a CLI
(sh/csh/*sh) or something else that uses semicolons to separate commands.
rm/mv/cp/ln are not such utilities; the separation happens in the shell.

...Or Did I Miss Something Here? [TM]


				--*greywolf;
--
"Do not meddle in the affairs of wizards,
 for you are crunchy and taste good with ketchup."  --unknown;