2002-01-02 Jeremy Katz <katzj@redhat.com>

* util/grub-install.in: Support using mktemp as well as tempfile
	for secure temporary file creation.
This commit is contained in:
okuji 2002-01-02 18:46:31 +00:00
parent 6e8c6154fb
commit daa965eccc
3 changed files with 17 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2002-01-02 Jeremy Katz <katzj@redhat.com>
* util/grub-install.in: Support using mktemp as well as tempfile
for secure temporary file creation.
2002-01-02 Jeremy Katz <katzj@redhat.com> 2002-01-02 Jeremy Katz <katzj@redhat.com>
* stage2/md5.c (md5_password): Ensure the password exists before * stage2/md5.c (md5_password): Ensure the password exists before

View file

@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23. .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23.
.TH GRUB-INSTALL "8" "December 2001" "grub-install (GNU GRUB 0.90)" FSF .TH GRUB-INSTALL "8" "January 2002" "grub-install (GNU GRUB 0.90)" FSF
.SH NAME .SH NAME
grub-install \- install GRUB on your drive grub-install \- install GRUB on your drive
.SH SYNOPSIS .SH SYNOPSIS

View file

@ -39,6 +39,15 @@ force_lba=
recheck=no recheck=no
debug=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 # Usage: usage
# Print the usage. # Print the usage.
usage () { usage () {
@ -268,7 +277,7 @@ if test -f "$device_map"; then
: :
else else
# Create a safe temporary file. # 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 <<EOF >$log_file $grub_shell --batch --device-map=$device_map <<EOF >$log_file
quit quit
@ -342,7 +351,7 @@ for file in \
done done
# Create a safe temporary file. # Create a safe temporary file.
test -x /bin/tempfile && log_file=`tempfile --prefix=grub` test -n "$mkstemp" && log_file=`$mkstemp`
# Now perform the installation. # Now perform the installation.
$grub_shell --batch --device-map=$device_map <<EOF >$log_file $grub_shell --batch --device-map=$device_map <<EOF >$log_file