aboutsummaryrefslogtreecommitdiff
path: root/posix/tst-vfork3.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2017-05-08 14:57:59 +0200
committerFlorian Weimer <fweimer@redhat.com>2017-05-08 16:20:40 +0200
commitc22553effb151532eb95fc1f7bb17a3aebe63202 (patch)
tree6064f0d1bf34b0ec8aaebd04cd1758c81f4666ce /posix/tst-vfork3.c
parent706256afb6c844a0e6aaab2b60f4326b91aca2e9 (diff)
downloadglibc-c22553effb151532eb95fc1f7bb17a3aebe63202.tar
glibc-c22553effb151532eb95fc1f7bb17a3aebe63202.tar.gz
glibc-c22553effb151532eb95fc1f7bb17a3aebe63202.tar.bz2
glibc-c22553effb151532eb95fc1f7bb17a3aebe63202.zip
support: Prevent multiple deletion of temporary files
Otherwise, another user might recreate these files after the first deletion. Particularly with temporary directories, this could result in the removal of unintended files through symbol link attacks.
Diffstat (limited to 'posix/tst-vfork3.c')
-rw-r--r--posix/tst-vfork3.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/posix/tst-vfork3.c b/posix/tst-vfork3.c
index c104271c44..80898b3e41 100644
--- a/posix/tst-vfork3.c
+++ b/posix/tst-vfork3.c
@@ -159,11 +159,10 @@ do_prepare (void)
strcpy (stpcpy (script1, tmpdirname), "/script1.sh");
strcpy (stpcpy (script2, tmpdirname), "/script2.sh");
+ add_temp_file (tmpdirname);
add_temp_file (script0);
add_temp_file (script1);
add_temp_file (script2);
- /* Need to make sure tmpdirname is at the end of the linked list. */
- add_temp_file (tmpdirname);
const char content0[] = "#!/bin/sh\necho empty\n";
create_script (script0, content0, sizeof content0);