This repository was archived by the owner on Aug 14, 2020. It is now read-only.
linuxSeccompBase: Fix errno check#692
Merged
squeed merged 1 commit intoappc:masterfrom Sep 19, 2017
glevand:for-merge-linuxSeccompBase
Merged
linuxSeccompBase: Fix errno check#692squeed merged 1 commit intoappc:masterfrom glevand:for-merge-linuxSeccompBase
squeed merged 1 commit intoappc:masterfrom
glevand:for-merge-linuxSeccompBase
Conversation
Member
|
LGTM Examples: |
jellonek
reviewed
Sep 9, 2017
| for _, c := range l.val.Errno { | ||
| if !unicode.IsUpper(c) { | ||
| if !(unicode.IsUpper(c) || unicode.IsNumber(c)) { | ||
| return errors.New("errno must be an upper case string") |
Contributor
There was a problem hiding this comment.
This error message could be also updated there...
E.g. "errno must be a string containing only digits and upper case characters"
Contributor
There was a problem hiding this comment.
As we wish, I think the additional OR-condition doesn't change the spirit of the previous error label. @jellonek's suggestion is strictly speaking more correct.
Contributor
|
Definitely my bad, I forgot some of them contain numbers. Perhaps a better check would be |
Contributor
Author
|
Updated patch to do the checks as suggested. cc: @lucab |
Contributor
|
(go fmt is unhappy about the latest rebase) |
errno must start with an 'E' character, and can also contain numeric characters. Fixup the errno check for these. Also, improve the error message by printing the offending errno value. Signed-off-by: Geoff Levand <geoff@infradead.org>
Contributor
Author
|
Fixed gofmt. |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
errno symbols can contain numeric characters.