Vulnerability Development mailing list archives
Re: Unix * weirdness
From: BlueBoar () THIEVCO COM (Blue Boar)
Date: Sat, 1 Jan 2000 19:29:20 -0800
"Andrew W. Flury" wrote:
/usr/bin/rm -rf /tmp/*The above command would work properly with a file named "-foo" in /tmp. The shell would simply replace /tmp/* with /tmp/-foo (among other things), which isn't parsed by getopt(3). There is only a problem here if the script did something like "cd /tmp && rm -rf *".
How about if it's -foo with a space in front? The /tmp example is a bad one... the point is to delete all files and subdirectories anyway, so perhaps that's why Sun ships with the above statement. I have to wonder if I could get the rm to choke, and therefore the script to abort. That would allow files to stick around between reboots in /tmp. A pretty minor problem.
All of these characters are interpreted BEFORE the glob (*) is expanded, so they should work just fine. The only exception would be if the programmer does something dumb like passing the glob to eval.
That was one of the key questions I was trying to ask.
BB
Current thread:
- Re: Unix * weirdness, (continued)
- Re: Unix * weirdness Yong S. Yi (Jan 01)
- Re: Unix * weirdness Forever shall I be. (Jan 01)
- Re: Unix * weirdness Blue Boar (Jan 01)
- Re: Unix * weirdness Warner Losh (Jan 01)
- Re: Unix * weirdness Bernie Cosell (Jan 01)
- Re: Unix * weirdness Blue Boar (Jan 01)
- iishack/tesoiis.c - What's wrong ? Ory Segal (Jan 03)
- Re: iishack/tesoiis.c - What's wrong ? Seth Georgion (Jan 03)
- Re: iishack/tesoiis.c - What's wrong ? The Underground Legendary Emperor (Jan 04)
- Re: Unix * weirdness Blue Boar (Jan 01)
- Re: Unix * weirdness Blue Boar (Jan 01)
