* utilunix.c (mc_tmpdir): Don't exit if the temporary directory

cannot be created - it should be possible to run mc on read-only
filesystems.  Try to chmod() the temporary directory.
This commit is contained in:
Pavel Roskin 2002-10-20 08:34:31 +00:00
parent e55c720591
commit 69dd1ca00c
3 changed files with 14 additions and 7 deletions

View File

@ -1,3 +1,9 @@
2002-10-20 Pavel Roskin <proski@gnu.org>
* utilunix.c (mc_tmpdir): Don't exit if the temporary directory
cannot be created - it should be possible to run mc on read-only
filesystems. Try to chmod() the temporary directory.
2002-10-17 Andrew V. Samoilov <sav@bcs.zp.ua>
* man2hlp.c (handle_tp_ip): Implement .IP and .TP macroses

View File

@ -11,8 +11,6 @@ Crash on circular macro definitions in the editor.
Add minimal UTF-8 support on Red Hat 8.0 to fix the frames or disable
support for S-Lang library compiled with UTF-8 support.
REGRESSION: Allow minimal functionality on read-only filesystems.
Don't rely on temporary scripts being executable. Run shell explicitly.
reimplement "-P" in a safer way (temp file instead of stdout) - possibly

View File

@ -324,11 +324,14 @@ mc_tmpdir (void)
pwd->pw_name);
canonicalize_pathname (tmpdir);
/* No recursion or VFS here. If $TMPDIR is missing, exit. */
if (mkdir (tmpdir, 0700) != 0 && errno != EEXIST) {
fprintf (stderr, _("Cannot create temporary directory %s: %s\n"),
if (chmod (tmpdir, S_IRWXU) != 0) {
/* Need to create directory. */
if (mkdir (tmpdir, S_IRWXU) != 0) {
fprintf (stderr,
_("Cannot create temporary directory %s: %s\n"),
tmpdir, unix_error_string (errno));
exit (1);
g_snprintf (tmpdir, sizeof (tmpdir), sys_tmp);
}
}
return tmpdir;