* utilunix.c (mc_tmpdir): Check that tmpdir is correctly initialized.

This commit is contained in:
Leonard den Ottolander 2005-07-27 15:03:24 +00:00
parent 3b40737834
commit 772c2600b9
2 changed files with 8 additions and 3 deletions

View File

@ -1,4 +1,8 @@
2005-07-24 Leonard den Ottolander <leonard den ottolander nl>
2005-07-27 Adam Byrtek <alpha@debian.org>
* utilunix.c (mc_tmpdir): Check that tmpdir is correctly initialized.
2005-07-24 Leonard den Ottolander <leonard den ottolander nl>
* wtools.h: #include "widget.h" and remove redundant declarations
of Dlg_head and WListbox;

View File

@ -240,8 +240,9 @@ mc_tmpdir (void)
struct stat st;
const char *error = NULL;
/* Check if already initialized */
if (tmpdir)
/* Check if already correctly initialized */
if (tmpdir && lstat (tmpdir, &st) == 0 && S_ISDIR (st.st_mode) &&
st.st_uid == getuid () && (st.st_mode & 0777) == 0700)
return tmpdir;
sys_tmp = getenv ("TMPDIR");