Index: ChangeLog =================================================================== RCS file: /cvsroot/grub/grub/ChangeLog,v retrieving revision 1.452 diff -u -u -r1.452 ChangeLog --- ChangeLog 30 Dec 2001 08:23:16 -0000 1.452 +++ ChangeLog 2 Jan 2002 17:54:42 -0000 @@ -1,3 +1,8 @@ +2002-01-02 Jeremy Katz + + * util/grub-install.in: Support using mktemp as well as tempfile + for secure temporary file creation + 2001-12-30 Yoshinori K. Okuji * stage1/stage1.S: Don't call INT 13, AH=48H, because it is Index: util/grub-install.in =================================================================== RCS file: /cvsroot/grub/grub/util/grub-install.in,v retrieving revision 1.32 diff -u -u -r1.32 grub-install.in --- util/grub-install.in 29 Dec 2001 18:53:30 -0000 1.32 +++ util/grub-install.in 2 Jan 2002 17:54:42 -0000 @@ -39,6 +39,16 @@ recheck=no debug=no +# look for secure tempfile creation wrappers on this platform +if test -x /bin/tempfile; then + mkstemp="/bin/tempfile --prefix=grub" +elif test -x /bin/mktemp; then + mkstemp="/bin/mktemp /tmp/grub-install.log.XXXXXX" +else + mkstemp="" +fi + + # Usage: usage # Print the usage. usage () { @@ -268,7 +278,7 @@ : else # Create a safe temporary file. - test -x /bin/tempfile && log_file=`tempfile --prefix=grub` + test -n "$mkstemp" && log_file=`$mkstemp` $grub_shell --batch --device-map=$device_map <$log_file quit @@ -342,7 +352,7 @@ done # Create a safe temporary file. -test -x /bin/tempfile && log_file=`tempfile --prefix=grub` +test -n "$mkstemp" && log_file=`$mkstemp` # Now perform the installation. $grub_shell --batch --device-map=$device_map <$log_file