Skip to content
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

Fix invalid UTF-8 in protobuf strings #5119

Merged
merged 2 commits into from
Mar 10, 2025
Merged

Conversation

jessegeens
Copy link
Contributor

EOS supports having non-UTF8 attributes, which get returned in a Stat. This is problematic for us, as we pass these attributes in the ArbitraryMetadata, which gets sent over gRPC. However, the protobuf language specification states:

A string must always contain UTF-8 encoded or 7-bit ASCII text, and cannot be longer than 2^32.

An example of such an attribute is:

user.$KERNEL.PURGE.SEC.FILEHASH="S��ϫ]���z��#1}��uU�v��8�L0R�9j�j��e?�2K�T<sJ�*�l���Dǭ��_[�>η�...��w�w[��Yg"

We fix this by stripping non-UTF8 metadata entries before sending the ResourceInfo over gRPC

Copy link

update-docs bot commented Mar 10, 2025

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@jessegeens jessegeens force-pushed the fix/better-eosfs-logging branch 2 times, most recently from 582c0bf to 419b246 Compare March 10, 2025 13:58
@jessegeens jessegeens marked this pull request as ready for review March 10, 2025 13:58
@jessegeens jessegeens force-pushed the fix/better-eosfs-logging branch 3 times, most recently from 755cc58 to 8a152e5 Compare March 10, 2025 14:31
@jessegeens jessegeens force-pushed the fix/better-eosfs-logging branch from 8a152e5 to 0b13cf8 Compare March 10, 2025 14:44
@jessegeens jessegeens merged commit b50845e into master Mar 10, 2025
15 checks passed
@diocas diocas deleted the fix/better-eosfs-logging branch March 10, 2025 16:00
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.

2 participants