From: deraadt Date: Wed, 12 Feb 1997 00:28:50 +0000 (+0000) Subject: gcc's use of /tmp files is raceable (as pointed out to me many months ago X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9e0a26757535392f7d022bdfe7b3352ffa2d42e8;p=openbsd gcc's use of /tmp files is raceable (as pointed out to me many months ago by davem@iss.net). however this code is hard to fix. for the moment make the race harder by calling mktemp with a lot of XXXXX's --- diff --git a/gnu/usr.bin/gcc/gcc.c b/gnu/usr.bin/gcc/gcc.c index fc6ca47e93b..b31e5e7a3ca 100644 --- a/gnu/usr.bin/gcc/gcc.c +++ b/gnu/usr.bin/gcc/gcc.c @@ -1587,12 +1587,12 @@ choose_temp_base () len = strlen (base); temp_filename = xmalloc (len + strlen (concat (dir_separator_str, - "ccXXXXXX")) + 1); + "ccXXXXXXXXXX")) + 1); strcpy (temp_filename, base); if (len > 0 && temp_filename[len-1] != '/' && temp_filename[len-1] != DIR_SEPARATOR) temp_filename[len++] = DIR_SEPARATOR; - strcpy (temp_filename + len, "ccXXXXXX"); + strcpy (temp_filename + len, "ccXXXXXXXXXX"); mktemp (temp_filename); temp_filename_length = strlen (temp_filename);