-
Notifications
You must be signed in to change notification settings - Fork 303
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance validation and testing for reading from fw_ver
Summary: - Replace the check for whitespace/control character with a check for any characters except alphanumeric and period/dash/underscore (.-_). (Leading/trailing whitespace is still permitted / ignored.) - Check for too-long version strings. Length limit is 64 characters. - Add some unit tests covering both new and existing cases. The main reason to make these changes is to prevent issues with ODS keys, which have certain limitations: https://www.internalfb.com/intern/wiki/ODS/ODS_User_Guide/Time_Series/Entity-Key_Name_Restrictions/ I expect fb303 or any other ODS library handles invalid keys gracefully, but even so in the best case there will be some data loss or bad data. The new checks do not trip on any of the existing firmware versions (XXX.YYY.ZZZ, see also previous diff) and allow e.g. CRC checksums which we may support in the future. Reviewed By: tao-ren Differential Revision: D66527099 fbshipit-source-id: 5a3e4ad2f5da8c6ff3920150fb5f1493d7f49e24
- Loading branch information
1 parent
1cd75b9
commit d0bc333
Showing
3 changed files
with
35 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters