Commit 18bc9cca by Samuel Tardieu Committed by Samuel Tardieu

re PR ada/34553 (Unsafe calls to mktemp and tmpname)

    gcc/ada/
	PR ada/34553
	* adaint.c (__gnat_open_new_temp, __gnat_tmp_name): Use mkstemp()
	instead of mktemp() or tmpnam() on NetBSD.

From-SVN: r131201
parent 83588991
2007-12-27 Samuel Tardieu <sam@rfc1149.net>
PR ada/34553
* adaint.c (__gnat_open_new_temp, __gnat_tmp_name): Use mkstemp()
instead of mktemp() or tmpnam() on NetBSD.
2007-12-23 Eric Botcazou <ebotcazou@adacore.com> 2007-12-23 Eric Botcazou <ebotcazou@adacore.com>
* trans.c (call_to_gnu): Make the temporary for non-addressable * trans.c (call_to_gnu): Make the temporary for non-addressable
...@@ -887,7 +887,8 @@ __gnat_open_new_temp (char *path, int fmode) ...@@ -887,7 +887,8 @@ __gnat_open_new_temp (char *path, int fmode)
strcpy (path, "GNAT-XXXXXX"); strcpy (path, "GNAT-XXXXXX");
#if (defined (__FreeBSD__) || defined (linux)) && !defined (__vxworks) #if (defined (__FreeBSD__) || defined (__NetBSD__) || defined (linux)) && \
!defined (__vxworks)
return mkstemp (path); return mkstemp (path);
#elif defined (__Lynx__) #elif defined (__Lynx__)
mktemp (path); mktemp (path);
...@@ -979,7 +980,7 @@ __gnat_tmp_name (char *tmp_filename) ...@@ -979,7 +980,7 @@ __gnat_tmp_name (char *tmp_filename)
free (pname); free (pname);
} }
#elif defined (linux) || defined (__FreeBSD__) #elif defined (linux) || defined (__FreeBSD__) || defined (__NetBSD__)
#define MAX_SAFE_PATH 1000 #define MAX_SAFE_PATH 1000
char *tmpdir = getenv ("TMPDIR"); char *tmpdir = getenv ("TMPDIR");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment