Skip to content

aboot: Use fd and not absolute path#3507

Merged
jmarrero merged 1 commit intoostreedev:mainfrom
cgwalters:aboot-chdir
Aug 21, 2025
Merged

aboot: Use fd and not absolute path#3507
jmarrero merged 1 commit intoostreedev:mainfrom
cgwalters:aboot-chdir

Conversation

@cgwalters
Copy link
Member

Motivated by bootc-dev/bootc@6d2eb2a

(We need to have a shared helper for this stuff at some point)

Motivated by bootc-dev/bootc@6d2eb2a

(We need to have a shared helper for this stuff at some point)
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the aboot bootloader support to use a file descriptor with fchdir instead of an absolute path when calling aboot-deploy. This is a good improvement for robustness, avoiding potential TOCTOU race conditions. The implementation is sound. I've added a couple of minor suggestions to use GLib's idiomatic macros for converting between integers and pointers, which will improve code readability and maintainability.

Copy link
Member

@jmarrero jmarrero left a comment

Choose a reason for hiding this comment

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

lgtm

@jmarrero jmarrero merged commit 971a037 into ostreedev:main Aug 21, 2025
27 of 30 checks passed
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.

3 participants