Fixes for script lilo-uuid-diskid (permissions, device name)
[rrq/maintain_lilo.git] / debian / scripts / lilo-uuid-diskid
index 7f1772f355bc7821ccc8f26aa362b24e05d5ce97..6b0c5d8492312dd647206dd107aede8264ce8c25 100644 (file)
@@ -206,9 +206,11 @@ sub read_fstab {
        if($root_part =~ /\/dev\/md/) {
                $root_part = check_raid($root_part);
        }
-       # now find the right block device name
-       $root_part =~ s/\d+$//;
-       $root_part =~ s/part$/disc/;
+       unless ($root_part =~ /^UUID/) {
+               # now find the right block device name
+               $root_part =~ s/\d+$//;
+               $root_part =~ s/part$/disc/;
+       }
 
        return $root_part;
 }
@@ -325,6 +327,7 @@ sub write_boot_option {
                @status = stat($liloconf);
                move ($liloconf, $liloconfold);
                utime ($status[9],$status[9],$liloconfold);
+               chmod (0600,$liloconfold);
 
                # copy all lines from lilo.conf_old into
                # new lilo.conf and add 'boot=' line
@@ -378,6 +381,7 @@ sub write_boot_option {
                }
                close(MYFH_OLD);
                close(MYFH_NEW);
+               chmod (0600,$liloconf);
        }
        else {
                print "file $liloconf does not exist: nothing changed\n";