Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:moyo_path_matches_pattern2 - Do pathname pattern matching.*@f: The start of string to check.*@p: The start of pattern to compare.* Returns true if @f matches @p, false otherwise.

Proto:static bool tomoyo_path_matches_pattern2(const char *f, const char *p)

Type:bool

Parameter:

TypeParameterName
const char *f
const char *p
837  When f && p cycle
838  f_delimiter = strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for
839  If Not f_delimiter Then f_delimiter = f + strlen - Find the length of a string*@s: The string to be sized
841  p_delimiter = strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for
842  If Not p_delimiter Then p_delimiter = p + strlen - Find the length of a string*@s: The string to be sized
844  If p == '\\' && *(p + 1) == '{' Then Go to recursive
846  If Not moyo_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. Then Return false
849  f = f_delimiter
850  If f Then f++
852  p = p_delimiter
853  If p Then p++
857  When p == '\\' && ( *(p + 1) == '*' || *(p + 1) == '@' ) cycle
859  p += 2
860  Return Not f && Not p
861  recursive :
868  If *(p - 1) != '/' || p_delimiter <= p + 3 || p_delimiter != '/' || *(p_delimiter - 1) != '}' || *(p_delimiter - 2) != '\\' Then Return false
871  Do
873  If Not moyo_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. Then Break
877  f = f_delimiter
878  If Not f Then Break
880  f++
882  If moyo_path_matches_pattern2 - Do pathname pattern matching.*@f: The start of string to check.*@p: The start of pattern to compare.* Returns true if @f matches @p, false otherwise. Then Return true
884  f_delimiter = strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for
885  When f_delimiter cycle
886  Return false
Caller
NameDescribe
tomoyo_path_matches_pattern2moyo_path_matches_pattern2 - Do pathname pattern matching.*@f: The start of string to check.*@p: The start of pattern to compare.* Returns true if @f matches @p, false otherwise.
tomoyo_path_matches_patternmoyo_path_matches_pattern - Check whether the given filename matches the given pattern.*@filename: The filename to check.*@pattern: The pattern to compare.* Returns true if matches, false otherwise.* The following patterns are available.* \\ \ itself.