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;
521 * @filename: The pathname to check.
522 * @len: Length of @filename.
524 * Returns true if @filename follows the naming rules, false otherwise.
526 static bool tomoyo_correct_path2(const char *filename, const size_t len)
528 const char *cp1 = memchr(filename, '/', len);
529 const char *cp2 = memchr(filename, '.', len);
531 return cp1 && (!cp2 || (cp1 < cp2)) && tomoyo_correct_word2(filename, len);
537 * @filename: The pathname to check.
540 * Returns true if @filename follows the naming rules, false otherwise.
542 bool tomoyo_correct_path(const char *filename)
544 return tomoyo_correct_path2(filename, strlen(filename));
626 * @filename: The string to evaluate.
628 * Returns the initial length without a pattern in @filename.
630 static int tomoyo_const_part_length(const char *filename)
635 if (!filename)
637 while ((c = *filename++) != '\0') {
642 c = *filename++;
651 c = *filename++;
654 c = *filename++;
686 * @filename: The start of string to check.
691 * Returns true if @filename matches @pattern, false otherwise.
693 static bool tomoyo_file_matches_pattern2(const char *filename,
698 while (filename < filename_end && pattern < pattern_end) {
704 if (*filename++ != *pattern++)
708 c = *filename;
715 if (filename[1] == '\\')
716 filename++;
717 else if (tomoyo_byte_range(filename + 1))
718 filename += 3;
726 if (*++filename != '\\')
745 if (c == '\\' && tomoyo_byte_range(filename + 1)
746 && strncmp(filename + 1, pattern, 3) == 0) {
747 filename += 3;
754 for (i = 0; i <= filename_end - filename; i++) {
756 filename + i, filename_end,
759 c = filename[i];
764 if (filename[i + 1] == '\\')
766 else if (tomoyo_byte_range(filename + i + 1))
776 while (isdigit(filename[j]))
779 while (isxdigit(filename[j]))
782 while (tomoyo_alphabet_char(filename[j]))
787 filename + i, filename_end,
793 filename++;
799 return filename == filename_end && pattern == pattern_end;
805 * @filename: The start of string to check.
810 * Returns true if @filename matches @pattern, false otherwise.
812 static bool tomoyo_file_matches_pattern(const char *filename,
825 result = tomoyo_file_matches_pattern2(filename,
836 result = tomoyo_file_matches_pattern2(filename, filename_end,
907 * tomoyo_path_matches_pattern - Check whether the given filename matches the given pattern.
909 * @filename: The filename to check.
932 bool tomoyo_path_matches_pattern(const struct tomoyo_path_info *filename,
935 const char *f = filename->name;
941 return !tomoyo_pathcmp(filename, pattern);
943 if (filename->is_dir != pattern->is_dir)