Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\tomoyo\util.c Create Date:2022-07-28 19:47:48
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:moyo_correct_word2 - Validate a string.*@string: The string to check. Maybe non-'\0'-terminated.*@len: Length of @string.* Check whether the given string follows the naming rules.* Returns true if @string follows the naming rules, false otherwise.

Proto:static bool tomoyo_correct_word2(const char *string, size_t len)

Type:bool

Parameter:

TypeParameterName
const char *string
size_tlen
435  start = string
436  bool in_repetition = false
441  If Not len Then Go to out
443  When len-- cycle
444  c = string++
445  If c == '\\' Then
446  If Not len -- Then Go to out
448  c = string++
450  Case c == '\\'
451  Continue
452  Case c == '$'
453  Case c == '+'
454  Case c == '?'
455  Case c == '*'
456  Case c == '@'
457  Case c == 'x'
458  Case c == 'X'
459  Case c == 'a'
460  Case c == 'A'
461  Case c == '-'
462  Continue
463  Case c == '{'
464  If string - 3 < start || *(string - 3) != '/' Then Break
466  in_repetition = true
467  Continue
468  Case c == '}'
469  If string != '/' Then Break
471  If Not in_repetition Then Break
473  in_repetition = false
474  Continue
475  Case c == '0'
476  Case c == '1'
477  Case c == '2'
478  Case c == '3'
479  If Not len -- || Not len -- Then Break
481  d = string++
482  e = string++
483  If d < '0' || d > '7' || e < '0' || e > '7' Then Break
486  If c <= ' ' || c >= 127 Then Continue
489  Go to out
490  Else if in_repetition && c == '/' Then
491  Go to out
492  Else if c <= ' ' || c >= 127 Then
493  Go to out
496  If in_repetition Then Go to out
498  Return true
499  out :
500  Return false
Caller
NameDescribe
tomoyo_correct_wordmoyo_correct_word - Validate a string.*@string: The string to check.* Check whether the given string follows the naming rules.* Returns true if @string follows the naming rules, false otherwise.
tomoyo_correct_domainmoyo_correct_domain - Check whether the given domainname follows the naming rules.*@domainname: The domainname to check.* Returns true if @domainname follows the naming rules, false otherwise.
tomoyo_domain_defmoyo_domain_def - Check whether the given token can be a domainname.*@buffer: The token to check.* Returns true if @buffer possibly be a domainname, false otherwise.