From 057a1ef4ebdf018d9f260faf34a2f40f7b2227f7 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sat, 19 Dec 2020 11:02:16 +0000 Subject: Erase iso9660 signature when clearing hybrid ISO partition table (mga#27864) --- perl-install/partition_table/dos.pm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'perl-install/partition_table/dos.pm') diff --git a/perl-install/partition_table/dos.pm b/perl-install/partition_table/dos.pm index 3bcb226c4..aa020131a 100644 --- a/perl-install/partition_table/dos.pm +++ b/perl-install/partition_table/dos.pm @@ -272,6 +272,12 @@ sub start_write { open $F, ">$file" or die "error opening test file $file"; } else { $F = partition_table::raw::openit($hd, 2) or die "error opening device $hd->{device} for writing"; + if ($hd->{was_hybrid_iso}) { + log::l("partition::dos::start_write erasing hybrid iso9660 signature"); + c::lseek_sector(fileno($F), 0, 0x8001) or return 0; + syswrite $F, "\0\0\0\0\0", 5 or return 0; + $hd->{was_hybrid_iso} = 0; + } } $F; } @@ -344,6 +350,8 @@ sub initialize { my ($class, $hd) = @_; # Remember whether any existing partitions are mounted, for use by need_to_tell_kernel(). $hd->{hadMountedPartitions} = 1 if any { $_->{isMounted} } partition_table::get_normal_parts($hd); + # Remember whether this was a hybrid ISO so we can wipe the iso9660 signature. + $hd->{was_hybrid_iso} = 1 if $hd->{primary}{is_hybrid_iso}; $hd->{primary} = empty_raw(); bless $hd, $class; } -- cgit v1.2.1