Project

General

Profile

Bug #10428

loader: really fix cd9660 dirmatch

Added by Toomas Soome 5 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
bootloader
Start date:
2019-02-20
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

The cd9660_open() does pass whole path to dirmatch() and we need to compare only the current path component, not full path. The 10412 did compare the full path.

Additinally, skip over duplicate / (if any) and check if the last component in the path was meant to be directory (having trailing /). If it is in fact a file, error out.

Testing done: used ls with different path names, with and without trailing /, different directory levels.

I have iso image:
disk3: BIOS drive F (41943040 X 512):
disk3: ISO9660

and it’s root is:
ok ls disk3:
disk3:/
.catalog
d .cdrom
.image_info
.livecd-cdrom-content
.volsetid
bin
d boot
d dev
d devices
d export
d home
d jack
d mnt
d platform
d proc
reconfigure
d root
d save
solaris.zlib
solarismisc.zlib
d system
d tmp

ok ls disk3:reconfigure/
open 'disk3:reconfigure/' failed: not a directory
ok ls disk3:reconfigure
disk3:reconfigure
ok ls disk3:boot
disk3:boot
d acpi
cdboot
.. and so on

ok ls disk3:boot/forth
disk3:boot/forth
beadm.4th
beastie.4th
brand.4th

ok ls disk3:boot/forth/beadm.4th/
open 'disk3:boot/forth/beadm.4th/' failed: not a directory

Also confirmed by Peter.

History

#1

Updated by Toomas Soome 5 months ago

  • Description updated (diff)
#2

Updated by Electric Monk 5 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 4bf63a956d4991cc5b0ead02fdea0b65bad10e78

commit  4bf63a956d4991cc5b0ead02fdea0b65bad10e78
Author: Toomas Soome <tsoome@me.com>
Date:   2019-02-22T17:34:02.000Z

    10428 loader: really fix cd9660 dirmatch
    Reviewed by: Andy Stormont <astormont@racktopsystems.com>
    Reviewed by: Peter Tribble <peter.tribble@gmail.com>
    Reviewed by: Andy Fiddaman <andy@omniosce.org>
    Approved by: Robert Mustacchi <rm@joyent.com>

Also available in: Atom PDF