1 diff -Nru bash-2.02.1/builtins/fc.def bash-2.02.1.new/builtins/fc.def
2 --- bash-2.02.1/builtins/fc.def Thu Jul 17 15:42:44 1997
3 +++ bash-2.02.1.new/builtins/fc.def Tue Oct 6 04:15:29 1998
6 char *ename, *command, *newcom, *line;
12 reverse = listing = execute = 0;
19 - /* XXX - this is raceable */
20 - sprintf (fn, "/tmp/bash%d", (int)time ((time_t *) 0) + (int)getpid ());
21 + fn = tempnam(0, "bash");
24 + builtin_error ("unable to generate a unique filename");
25 + return (EXECUTION_FAILURE);
28 + fd = open (fn, O_CREAT | O_EXCL | O_WRONLY, 0600);
31 + builtin_error ("cannot open temp file %s", fn);
33 + return (EXECUTION_FAILURE);
36 - stream = fopen (fn, "w");
37 + stream = fdopen (fd, "w");
41 builtin_error ("cannot open temp file %s", fn);
43 return (EXECUTION_FAILURE);
52 return (EXECUTION_SUCCESS);
58 if (retval != EXECUTION_SUCCESS)
62 return (EXECUTION_FAILURE);
67 run_unwind_frame ("fc builtin");
73 diff -Nru bash-2.02.1/general.h bash-2.02.1.new/general.h
74 --- bash-2.02.1/general.h Tue Feb 24 21:51:04 1998
75 +++ bash-2.02.1.new/general.h Tue Oct 6 04:15:29 1998
77 #if !defined (_GENERAL_H_)
80 +#include <sys/types.h>
83 #include "bashtypes.h"
84 diff -Nru bash-2.02.1/subst.c bash-2.02.1.new/subst.c
85 --- bash-2.02.1/subst.c Tue Jun 30 18:09:45 1998
86 +++ bash-2.02.1.new/subst.c Tue Oct 6 04:15:29 1998
91 - tname = mktemp (savestring ("/tmp/sh-np-XXXXXX"));
92 - if (mkfifo (tname, 0600) < 0)
93 + tname = tempnam(0, "sh-np");
94 + if (!tname || mkfifo (tname, 0600) < 0)
97 return ((char *)NULL);