Skip to content

Find root directory on UDF 2.50 - #430

Open
Zopolis4 wants to merge 1 commit into
superg:mainfrom
Zopolis4:inescapable
Open

Find root directory on UDF 2.50#430
Zopolis4 wants to merge 1 commit into
superg:mainfrom
Zopolis4:inescapable

Conversation

@Zopolis4

@Zopolis4 Zopolis4 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Kind of a mess to figure out, slightly less of a mess to implement.

This just extends the functionality of #403 to cover UDF 2.50 images (i.e. the kind that aren't just backwards compatible ISO9660). Another PR will be needed to support actually reading files and traversing directories and so on.

As before, this is tested and working but because it isn't ready to be directly used I haven't added the temporary command I used to test it.

Summary by CodeRabbit

  • New Features

    • Improved UDF filesystem support for virtual, sparable, and metadata partitions.
    • Added support for extended file entries and additional UDF file and directory descriptors.
    • Enhanced partition tracking to locate file sets and root directories correctly across supported partition types.
  • Bug Fixes

    • Improved root-directory detection and handling for discs using extended UDF metadata.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: dd083866-8fda-4359-8b59-3ef80f8860f1

📥 Commits

Reviewing files that changed from the base of the PR and between df2ea4d and cce48b7.

📒 Files selected for processing (2)
  • filesystem/udf/udf_browser.ixx
  • filesystem/udf/udf_defs.ixx
🚧 Files skipped from review as they are similar to previous changes (1)
  • filesystem/udf/udf_browser.ixx

📝 Walkthrough

Walkthrough

The UDF definitions add metadata partition and extended file-entry structures. The UDF browser resolves partition locations from logical-volume maps, reads extents through those locations, and returns either a regular or extended root directory entry.

Changes

UDF partition and root directory support

Layer / File(s) Summary
UDF descriptor contracts
filesystem/udf/udf_defs.ixx
Adds partition type identifiers, file-related tag values, packed partition-map structures, short_ad, and ExtendedFileEntry. Changes EntityID identifier fields to character arrays.
Partition resolution and root entry dispatch
filesystem/udf/udf_browser.ixx
Parses metadata partition maps, tracks partition locations by partition number, reads file-set and root-directory extents through the selected location, and returns the matching file-entry pointer type in a variant.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant DataReader
  participant PartitionMap
  participant RootDirectory
  Browser->>DataReader: Read logical volume partition maps
  Browser->>PartitionMap: Identify metadata partition map
  Browser->>DataReader: Read metadata file and partition extent
  Browser->>DataReader: Read file-set and root-directory descriptors
  Browser->>RootDirectory: Return FileEntry or ExtendedFileEntry
Loading

Possibly related PRs

  • superg/redumper#403: Introduces the UDF browser and descriptor types extended by this change.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: locating the root directory in UDF 2.50 images.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@filesystem/udf/udf_browser.ixx`:
- Around line 133-137: Update the root directory read in the surrounding UDF
browser logic to index partition_starting_locations with
root_directory_icb_extent.extent_location.partition_reference_number, matching
the preceding bounds check; leave the file set descriptor partition reference
unchanged for its own reads.
- Around line 92-119: Harden the partition-map parsing loop around
partition_map_offset and number_of_partition_maps by using a size-safe counter
and validating each structure read, including the header, type-2 header, and
partition_map_length advancement, against lvd_data.size(); skip or abort on
invalid values. Before using metadata_partition_map.partition_number, validate
it against partition_starting_locations.size(), and before reading
metadata_file_ad validate sizeof(udf::ExtendedFileEntry) plus
length_of_extended_attributes against metadata_file_data.size().
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: acf95496-b02e-412d-a383-ef874665df2e

📥 Commits

Reviewing files that changed from the base of the PR and between 5f91452 and df2ea4d.

📒 Files selected for processing (2)
  • filesystem/udf/udf_browser.ixx
  • filesystem/udf/udf_defs.ixx

Comment thread filesystem/udf/udf_browser.ixx
Comment thread filesystem/udf/udf_browser.ixx Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant