mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-08 20:41:59 +03:00
* utilunix.c (mc_tmpdir): Make directory only if not exists.
Use strncpy() instead of g_snprintf() - there can be printf() pattern(s) in the $TMPDIR.
This commit is contained in:
parent
562cc18d4f
commit
499aa8c24f
@ -1,13 +1,17 @@
|
||||
2002-10-22 Andrew V. Samoilov <sav@bcs.zp.ua>
|
||||
|
||||
* utilunix.c (mc_tmpdir): Make directory only if not exists.
|
||||
Use strncpy() instead of g_snprintf() - there can be printf()
|
||||
pattern(s) in the $TMPDIR.
|
||||
|
||||
* man2hlp.c (handle_link): Don't strip leading space(s) from
|
||||
linkname.
|
||||
|
||||
2002-10-22 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* myslang.h: Add a replacement for addch(), which expects a
|
||||
wchar_t argument in patched S-Lang on Red Hat 8.0.
|
||||
|
||||
2002-10-21 Andrew V. Samoilov <sav@bcs.zp.ua>
|
||||
|
||||
* man2hlp.c (handle_link): Don't strip leading space(s) from
|
||||
linkname.
|
||||
|
||||
2002-10-21 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* main.c (print_mc_usage): Remove unnecessary newline.
|
||||
|
@ -324,13 +324,14 @@ mc_tmpdir (void)
|
||||
pwd->pw_name);
|
||||
canonicalize_pathname (tmpdir);
|
||||
|
||||
if (chmod (tmpdir, S_IRWXU) != 0) {
|
||||
/* Need to create directory. */
|
||||
if (chmod (tmpdir, S_IRWXU) != 0 && errno == ENOENT) {
|
||||
/* Need to create directory. */
|
||||
if (mkdir (tmpdir, S_IRWXU) != 0) {
|
||||
fprintf (stderr,
|
||||
_("Cannot create temporary directory %s: %s\n"),
|
||||
tmpdir, unix_error_string (errno));
|
||||
g_snprintf (tmpdir, sizeof (tmpdir), sys_tmp);
|
||||
strncpy (tmpdir, sys_tmp, sizeof (tmpdir) - 1);
|
||||
tmpdir [sizeof (tmpdir) - 1] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user