diff options
author | Janne Blomqvist <jb@gcc.gnu.org> | 2012-05-05 09:30:51 +0300 |
---|---|---|
committer | Janne Blomqvist <jb@gcc.gnu.org> | 2012-05-05 09:30:51 +0300 |
commit | 68ee9c0807fd3c9a66c649aa7bd3bebacfb0dff0 (patch) | |
tree | ac63807666eaf2ebc05379c848806981ba536332 /libgfortran/libgfortran.h | |
parent | 9154c66213636f44954feb8d73257560370c11c2 (diff) | |
download | gcc-68ee9c0807fd3c9a66c649aa7bd3bebacfb0dff0.zip gcc-68ee9c0807fd3c9a66c649aa7bd3bebacfb0dff0.tar.gz gcc-68ee9c0807fd3c9a66c649aa7bd3bebacfb0dff0.tar.bz2 |
Fix handling of temporary files.
2012-05-05 Janne Blomqvist <jb@gcc.gnu.org>
* gfortran.texi (GFORTRAN_TMPDIR): Rename to TMPDIR, explain
algorithm for choosing temp directory.
2012-05-05 Janne Blomqvist <jb@gcc.gnu.org>
* config.h.in: Regenerated.
* configure: Regenerated.
* configure.ac: Add checks for getegid and __secure_getenv.
* io/unix.c (P_tmpdir): Fallback definition for macro.
(tempfile_open): New function.
(tempfile): Use secure_getenv, call tempfile_open to try each
directory in turn.
* libgfortran.h (DEFAULT_TMPDIR): Remove macro.
(secure_getenv): New macro/prototype.
* runtime/environ.c (secure_getenv): New function.
(variable_table): Rename GFORTRAN_TMPDIR to TMPDIR.
* runtime/main.c (find_addr2line): Use secure_getenv.
From-SVN: r187190
Diffstat (limited to 'libgfortran/libgfortran.h')
-rw-r--r-- | libgfortran/libgfortran.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/libgfortran/libgfortran.h b/libgfortran/libgfortran.h index e7f5b71..051e2e8 100644 --- a/libgfortran/libgfortran.h +++ b/libgfortran/libgfortran.h @@ -584,10 +584,6 @@ iexport_data_proto(filename); #define gfc_alloca(x) __builtin_alloca(x) -/* Directory for creating temporary files. Only used when none of the - following environment variables exist: GFORTRAN_TMPDIR, TMP and TEMP. */ -#define DEFAULT_TEMPDIR "/tmp" - /* The default value of record length for preconnected units is defined here. This value can be overriden by an environment variable. Default value is 1 Gb. */ @@ -776,6 +772,18 @@ internal_proto(show_variables); unit_convert get_unformatted_convert (int); internal_proto(get_unformatted_convert); +/* Secure getenv() which returns NULL if running as SUID/SGID. */ +#ifdef HAVE___SECURE_GETENV +#define secure_getenv __secure_getenv +#elif defined(HAVE_GETUID) && defined(HAVE_GETEUID) \ + && defined(HAVE_GETGID) && defined(HAVE_GETEGID) +#define FALLBACK_SECURE_GETENV +extern char *secure_getenv (const char *); +internal_proto(secure_getenv); +#else +#define secure_getenv getenv +#endif + /* string.c */ extern int find_option (st_parameter_common *, const char *, gfc_charlen_type, |