-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
token: sort paths for reproducible extract #656
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution!
The change looks good overall, but I would like to see some things fixed before I can merge it.
Thanks for your feedback, I tried to incorporate the requested changes. Let me know if I overlooked something. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
@katexochen please rebase it to master so I can merge. |
There is no defined order in which readdir will return the entries of a directory. In practice, order can depend on inode number or similar. If we run p11-kit on different files systems with similar directory structure but different inode order the output of extract can change. To get a stable and reproducible output, sort the paths returned by readdir before extracting. Co-authored-by: Tom Dohrmann <[email protected]> Signed-off-by: Paul Meyer <[email protected]>
There is no defined order in which readdir will return the entries of a directory. In practice, order can depend on inode number or similar. If we run p11-kit on different files systems with similar directory structure but different inode order the output of extract can change.
To get a stable and reproducible output, sort the paths returned by readdir before extracting.