diff options
author | Joachim Schrod <jschrod@acm.org> | 2007-07-02 20:55:41 +0000 |
---|---|---|
committer | Joachim Schrod <jschrod@acm.org> | 2007-07-02 20:55:41 +0000 |
commit | 70d9dce6238727d0686b987b98005a46765a64f1 (patch) | |
tree | 52bd743d43a08da44a648777acee4097e7b59e2a /Build/source/texk/dviljk/config.h | |
parent | 9551484d7cfbdd630209f91e685fe5be87b43bce (diff) |
Security issue: Repaired tempfile creation race condition.
Include file special parsing does not access unrelated variables
any more.
git-svn-id: svn://tug.org/texlive/trunk@4531 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dviljk/config.h')
-rw-r--r-- | Build/source/texk/dviljk/config.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Build/source/texk/dviljk/config.h b/Build/source/texk/dviljk/config.h index 9d9ffb613c6..d792a5a11b6 100644 --- a/Build/source/texk/dviljk/config.h +++ b/Build/source/texk/dviljk/config.h @@ -440,6 +440,21 @@ typedef FILE *FILEPTR; #endif #endif +/* If unlink and rmdir are not there, we don't delete the temporary files. */ +#ifndef HAVE_RMDIR +#define rmdir(dir) +#endif +#ifndef HAVE_UNLINK +#define unlink(file) +#endif + +/* If mkdtemp() does not exist, we have to use tmpnam(). */ +#ifndef HAVE_MKDTEMP +#define mkdtemp(dir) (tmpnam(dir) ? \ + ( mkdir(dir, 0700) == -1 ? NULL : dir ) : \ + ( errno = EINVAL, NULL ) ) +#endif + #ifndef KPATHSEA /* FIXME: Should provide a strdup function. But currently this tree is only used in connection with kpathsea anyhow. */ |