Lines Matching refs:filename

146 static bool tomoyo_correct_path2(const char *filename, const size_t len);
250 char *filename;
257 filename = tomoyo_read_token(param);
258 if (!tomoyo_correct_word(filename))
260 ptr->filename = tomoyo_get_name(filename);
261 return ptr->filename != NULL;
526 * @filename: The pathname to check.
527 * @len: Length of @filename.
529 * Returns true if @filename follows the naming rules, false otherwise.
531 static bool tomoyo_correct_path2(const char *filename, const size_t len)
533 const char *cp1 = memchr(filename, '/', len);
534 const char *cp2 = memchr(filename, '.', len);
536 return cp1 && (!cp2 || (cp1 < cp2)) && tomoyo_correct_word2(filename, len);
542 * @filename: The pathname to check.
545 * Returns true if @filename follows the naming rules, false otherwise.
547 bool tomoyo_correct_path(const char *filename)
549 return tomoyo_correct_path2(filename, strlen(filename));
631 * @filename: The string to evaluate.
633 * Returns the initial length without a pattern in @filename.
635 static int tomoyo_const_part_length(const char *filename)
640 if (!filename)
642 while ((c = *filename++) != '\0') {
647 c = *filename++;
656 c = *filename++;
659 c = *filename++;
691 * @filename: The start of string to check.
696 * Returns true if @filename matches @pattern, false otherwise.
698 static bool tomoyo_file_matches_pattern2(const char *filename,
703 while (filename < filename_end && pattern < pattern_end) {
709 if (*filename++ != *pattern++)
713 c = *filename;
720 if (filename[1] == '\\')
721 filename++;
722 else if (tomoyo_byte_range(filename + 1))
723 filename += 3;
731 if (*++filename != '\\')
750 if (c == '\\' && tomoyo_byte_range(filename + 1)
751 && strncmp(filename + 1, pattern, 3) == 0) {
752 filename += 3;
759 for (i = 0; i <= filename_end - filename; i++) {
761 filename + i, filename_end,
764 c = filename[i];
769 if (filename[i + 1] == '\\')
771 else if (tomoyo_byte_range(filename + i + 1))
781 while (isdigit(filename[j]))
784 while (isxdigit(filename[j]))
787 while (tomoyo_alphabet_char(filename[j]))
792 filename + i, filename_end,
798 filename++;
804 return filename == filename_end && pattern == pattern_end;
810 * @filename: The start of string to check.
815 * Returns true if @filename matches @pattern, false otherwise.
817 static bool tomoyo_file_matches_pattern(const char *filename,
830 result = tomoyo_file_matches_pattern2(filename,
841 result = tomoyo_file_matches_pattern2(filename, filename_end,
912 * tomoyo_path_matches_pattern - Check whether the given filename matches the given pattern.
914 * @filename: The filename to check.
937 bool tomoyo_path_matches_pattern(const struct tomoyo_path_info *filename,
940 const char *f = filename->name;
946 return !tomoyo_pathcmp(filename, pattern);
948 if (filename->is_dir != pattern->is_dir)