Use `mkstemp' instead of `mktemp'.
authorThien-Thi Nguyen <ttn@gnuvola.org>
Wed, 13 Jan 2010 08:49:44 +0000 (09:49 +0100)
committerAndy Wingo <wingo@pobox.com>
Wed, 13 Jan 2010 19:49:37 +0000 (20:49 +0100)
* test-suite/standalone/test-unwind.c (check_ports):
Use `mkstemp' instead of `mktemp'.

Signed-off-by: Thien-Thi Nguyen <ttn@gnuvola.org>
test-suite/standalone/test-unwind.c

index f9820cc224175eb33e27f42fb7018407969d48e3..f333c8c3a965380ccefbc2b6a71757d10d7f07e1 100644 (file)
@@ -210,7 +210,9 @@ check_ports ()
   strcpy (filename, tmpdir);
   strcat (filename, FILENAME_TEMPLATE);
 
-  if (mktemp (filename) == NULL)
+  /* Sanity check: Make sure that `filename' is actually writeable.
+     We used to use mktemp(3), but that is now considered a security risk.  */
+  if (0 > mkstemp (filename))
     exit (1);
 
   scm_dynwind_begin (0);