Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:moyo_file_matches_pattern2 - Pattern matching without '/' character and "\-" pattern.*@filename: The start of string to check.*@filename_end: The end of string to check.*@pattern: The start of pattern to compare.

Proto:static bool tomoyo_file_matches_pattern2(const char *filename, const char *filename_end, const char *pattern, const char *pattern_end)

Type:bool

Parameter:

TypeParameterName
const char *filename
const char *filename_end
const char *pattern
const char *pattern_end
681  When filename < filename_end && pattern < pattern_end cycle
686  If pattern != '\\' Then
687  If filename++ != pattern++ Then Return false
689  Continue
691  c = filename
692  pattern++
694  Case pattern == '?'
695  If c == '/' Then
696  Return false
697  Else if c == '\\' Then
705  Break
706  Case pattern == '\\'
707  If c != '\\' Then Return false
709  If *++filename != '\\' Then Return false
711  Break
712  Case pattern == '+'
713  If Not isdigit(c) Then Return false
715  Break
716  Case pattern == 'x'
717  If Not isxdigit(c) Then Return false
719  Break
720  Case pattern == 'a'
723  Break
724  Case pattern == '0'
725  Case pattern == '1'
726  Case pattern == '2'
727  Case pattern == '3'
730  filename += 3
731  pattern += 2
732  Break
734  Return false
735  Case pattern == '*'
736  Case pattern == '@'
737  When i <= filename_end - filename cycle
754  Return false
755  Default
756  j = 0
757  c = pattern
758  If c == '$' Then
759  When isdigit(filename[j]) cycle
760  j++
761  Else if c == 'X' Then
762  When isxdigit(filename[j]) cycle
763  j++
764  Else if c == 'A' Then
768  When i <= j cycle
774  Return false
776  filename++
777  pattern++
779  When pattern == '\\' && ( *(pattern + 1) == '*' || *(pattern + 1) == '@' ) cycle
781  pattern += 2
782  Return filename == filename_end && pattern == pattern_end
Caller
NameDescribe
tomoyo_file_matches_pattern2moyo_file_matches_pattern2 - Pattern matching without '/' character and "\-" pattern.*@filename: The start of string to check.*@filename_end: The end of string to check.*@pattern: The start of pattern to compare.
tomoyo_file_matches_patternmoyo_file_matches_pattern - Pattern matching without '/' character.*@filename: The start of string to check.*@filename_end: The end of string to check.*@pattern: The start of pattern to compare.*@pattern_end: The end of pattern to compare.