-
Notifications
You must be signed in to change notification settings - Fork 146
Conversation
LGTM Examples:
|
@@ -227,7 +227,7 @@ func (l linuxSeccompBase) AssertValid() error { | |||
return nil | |||
} | |||
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") |
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.
This error message could be also updated there...
E.g. "errno must be a string containing only digits and upper case characters"
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.
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.
Definitely my bad, I forgot some of them contain numbers. Perhaps a better check would be |
Updated patch to do the checks as suggested. cc: @lucab |
(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>
Fixed gofmt. |
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.
LGTM
errno symbols can contain numeric characters.