[Bug 283238] makefs: cd9660 produces conflicting short paths

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 10 Dec 2024 18:37:46 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=283238

            Bug ID: 283238
           Summary: makefs: cd9660 produces conflicting short paths
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: emaste@freebsd.org

Rock ridge extensions add support for longer path and directory names than
vanilla iso9660, but iso9660 data structures still need to be populated with
unique, shortened versions of the longer names.

makefs has cd9660_handle_collisions() to find conflicting entries which uses
cd9660_rename_filename() to choose a new name when a conflict is found. This is
called for both file and directory names (and chooses a new name to resolve the
conflict for both file and directory names) but the emitted data still has a
conflict.

Demonstration:
```
$ mkdir -p test9660/this-is-a-directory-with-a-long-common-prefix-1
test9660/this-is-a-directory-with-a-long-common-prefix-2
$ makefs -t cd9660 -o rockridge test.iso test9660/
$ isoinfo -p -i test.iso
Setting input-charset to 'UTF-8' from locale.
Path table starts at block 18, size 86
   1:    1 14 
   2:    1 15 THIS_IS_A_DIRECTORY_WITH_A_LON
   3:    1 16 THIS_IS_A_DIRECTORY_WITH_A_LON
```

-- 
You are receiving this mail because:
You are the assignee for the bug.