diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-08-28 09:38:02 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-08-28 09:38:02 +0000 |
commit | b8a801583778dee5b9075e938ed318d17c63a162 (patch) | |
tree | db0bc8b83d78519fe0844b26d01e2d29689baa3c | |
parent | 7dbb82bda658c7aa17d764ebccd4953a389a833b (diff) | |
download | drakx-b8a801583778dee5b9075e938ed318d17c63a162.tar drakx-b8a801583778dee5b9075e938ed318d17c63a162.tar.gz drakx-b8a801583778dee5b9075e938ed318d17c63a162.tar.bz2 drakx-b8a801583778dee5b9075e938ed318d17c63a162.tar.xz drakx-b8a801583778dee5b9075e938ed318d17c63a162.zip |
security fix and various
-rw-r--r-- | perl-install/bootloader.pm | 1 | ||||
-rw-r--r-- | perl-install/c/stuff.xs.pm | 13 | ||||
-rwxr-xr-x | perl-install/standalone/drakboot | 2 |
3 files changed, 15 insertions, 1 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index 2cd02125e..df680587f 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -992,6 +992,7 @@ sub install { my %l = grep_each { $::b } %{$lilo->{methods}}; my @rcs = map { + c::is_secure_file('/tmp/.error') or die "can't ensure a safe /tmp/.error"; my $f = $bootloader::{"install_$_"} or die "unknown bootloader method $_"; eval { $f->(@_) }; $@; diff --git a/perl-install/c/stuff.xs.pm b/perl-install/c/stuff.xs.pm index d0e5bf2a5..f6e63a85d 100644 --- a/perl-install/c/stuff.xs.pm +++ b/perl-install/c/stuff.xs.pm @@ -157,6 +157,19 @@ setMouseLive(display, type, emulate3buttons) print ' int +is_secure_file(filename) + char * filename + CODE: + { + int fd; + unlink(filename); /* in case it exists and we manage to remove it */ + RETVAL = (fd = open(filename, O_RDWR | O_CREAT | O_EXCL, 0600)) != -1; + if (RETVAL) close(fd); + } + OUTPUT: + RETVAL + +int is_ext3(device_name) char * device_name CODE: diff --git a/perl-install/standalone/drakboot b/perl-install/standalone/drakboot index dc63f22a7..8a17b4813 100755 --- a/perl-install/standalone/drakboot +++ b/perl-install/standalone/drakboot @@ -22,7 +22,7 @@ $::expert = /-expert/; my $in = 'interactive'->vnew('su', 'bootloader'); -require 'bootlook.pm' if ref($in) =~ /gtk/; +require 'bootlook.pm' if $in->isa('interactive_gtk'); lilo_choice(); |