|
|
| Author |
Message |
| 6 new of 80 responses total. |
remmers
|
|
response 75 of 80:
|
Sep 16 19:22 UTC 1999 |
By recursing, you can make 'em deep and wide.
|
flem
|
|
response 76 of 80:
|
Sep 17 13:50 UTC 1999 |
How would recursing help to make them wide? Are you assuming that the
recursion is finite? I mean, if you have something like (ignoring the
finer points of syntax)
foo()
{
mkdir("something");
chdir("something");
foo();
/* never reached */
mkdir("something else");
chdir(something else");
foo();
chdir("..");
}
you still won't get a tree-like expansion, you'll get a single line of
deeper and deeper nested children, one for each recursion, until
someone kills the program. So how would you use recursion to make 'em
wide, too? And why does it matter if they're wide, if the objective is
to fill up a filesystem? Won't deep do it just as well?
Maybe this question should be taken elsewhere? :)
|
drew
|
|
response 77 of 80:
|
Sep 17 20:08 UTC 1999 |
You need to spawn() or something like that, to get wide. And do it more than
once in each instance of the program. Deep gets you a linear growth, while
wide gets you an exponential expansion.
|
mdw
|
|
response 78 of 80:
|
Sep 17 21:49 UTC 1999 |
It doesn't really matter. We have a nice tool that digs through and
gets them all no matter if they're wide or deep. Usually, I think these
people are trying to create something that's deep and "annoying" (weird
filenames); probably they're hoping to core dump things like "find",
"restore", and "rm -rf". Filling up the filesystem appears to be of
2ndary interest to the vandals that make deeply nested directories.
|
don
|
|
response 79 of 80:
|
Sep 19 23:54 UTC 1999 |
Here's how I think they do it (ignoring syntax):
foo()
for (n=1,n<1000/*Or something equally large*/,n++)
{
mkdir("%d",n);
chdir("%d",n);
spawn(foo.c);
chdir("..");
}
This would create a tree with 1000 branches at each level, and infinitely deep
(ie, until stopped by staff or some sort of filesystem limitation).
At least, this is how I'd do it.
|
janc
|
|
response 80 of 80:
|
Sep 20 00:39 UTC 1999 |
Yup, except on Grex it would probably create maybe 50 directories before
all your processes, including your login shell, suddenly and
mysteriously died. These days our fork bomb defenses are very
effective, and that little program is a fork bomb.
|