Skip to content

Conversation

@strike
Copy link
Contributor

@strike strike commented Jul 17, 2025

Example:

++ find images/hook-embedded -type f -not -type l -print
++ LC_ALL=C
++ sort
++ xargs sha256sum
++ sha256sum
++ cut '-d ' -f1
sha256sum: images/hook-embedded/images/overlay2/4f2b976a728e2f978ec5a0728e7a7de5ac8e86d05424567038829628a23a0787/diff/nix/store/q94x70qac6cnly6w60mlgfkaa8npk9xw-systemd-257.5/example/systemd/system/system-systemdx2dcryptsetup.slice: No such file or directory

File enumeration should use a null-terminated approach that safely preserves file names regardless of any whitespace or special characters.

-print0 and -0 Options: These ensure file names are treated as complete, atomic strings.
LC_ALL=C sort -z: This guarantees a consistent, bytewise sort order while preserving the null termination.

Fixes: #260

…ter filenames

Example:
```
++ find images/hook-embedded -type f -not -type l -print
++ LC_ALL=C
++ sort
++ xargs sha256sum
++ sha256sum
++ cut '-d ' -f1
sha256sum: images/hook-embedded/images/overlay2/4f2b976a728e2f978ec5a0728e7a7de5ac8e86d05424567038829628a23a0787/diff/nix/store/q94x70qac6cnly6w60mlgfkaa8npk9xw-systemd-257.5/example/systemd/system/system-systemdx2dcryptsetup.slice: No such file or directory
```

Signed-off-by: Zubarev Alexander <astrike@avride.ai>
Copy link
Member

@jacobweinstock jacobweinstock left a comment

Choose a reason for hiding this comment

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

Thanks for this, @strike !

@jacobweinstock jacobweinstock added the ready-to-merge Signal to Mergify to merge the PR. label Jul 17, 2025
mergify bot added a commit that referenced this pull request Jul 17, 2025
@mergify mergify bot merged commit a659ccd into tinkerbell:main Jul 17, 2025
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Signal to Mergify to merge the PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Broken Hash Calculation for Embedded Container Images

2 participants