diff --git a/src/ChangeLog b/src/ChangeLog index d2b465308..242ac744b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,4 +1,8 @@ -2005-07-24 Leonard den Ottolander +2005-07-27 Adam Byrtek + + * utilunix.c (mc_tmpdir): Check that tmpdir is correctly initialized. + +2005-07-24 Leonard den Ottolander * wtools.h: #include "widget.h" and remove redundant declarations of Dlg_head and WListbox; diff --git a/src/utilunix.c b/src/utilunix.c index bd9b5546d..f8efd7c84 100644 --- a/src/utilunix.c +++ b/src/utilunix.c @@ -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");