Re #2: [patch] Re: [PATCH] modules_install

Adam Sulmicki (adam@cfar.umd.edu)
Sun, 04 Oct 1998 21:47:11 -0400


Alan Cox writes:

->> + mkdir $$TMPDIR; \
->> + if [ $$? -ne 0 ]; then \
->> + echo "$0: Can't create temp dir $$TMPDIR, exiting..."; \
->> + exit 1; \
->> + fi; \
->
->And this is a denial of service attack
->
->Just back the patch out. Its a complete turkey. If you want to fix it
->you need additional tools like mktemp which not all distributions include

Now, as I think a bit more about it, I think that in the above
you see an attempt to try protect oneself from races.

It is not case, the above is attempt to try to protect from case when
someone make the file before hand, but they also used chattr command to
make it immutable and therefore not removable by 'rm -rf'. Even mktemp
won't help here (in fact the test condition below mkdir comes form
manpage on mktmp :)

Adam

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/