Lines Matching refs:dir
79 DIR* dir = opendir(root_path.c_str()); in resolve_ce_path_by_inode_or_fallback() local
80 if (dir == nullptr) { in resolve_ce_path_by_inode_or_fallback()
86 while ((ent = readdir(dir))) { in resolve_ce_path_by_inode_or_fallback()
93 closedir(dir); in resolve_ce_path_by_inode_or_fallback()
98 closedir(dir); in resolve_ce_path_by_inode_or_fallback()
357 DIR* dir = opendir(path.c_str()); in get_known_users() local
358 if (dir == nullptr) { in get_known_users()
365 while ((ent = readdir(dir))) { in get_known_users()
377 closedir(dir); in get_known_users()
795 DIR* dir = opendir(parent.c_str()); in read_path_inode() local
796 if (dir == nullptr) { in read_path_inode()
802 while ((ent = readdir(dir))) { in read_path_inode()
811 closedir(dir); in read_path_inode()
816 closedir(dir); in read_path_inode()
834 static int validate_path(const std::string& dir, const std::string& path, int maxSubdirs) { in validate_path() argument
836 if (dir.find('/') != 0 || dir.rfind('/') != dir.size() - 1 in validate_path()
837 || dir.find("..") != std::string::npos) { in validate_path()
838 LOG(ERROR) << "Invalid directory " << dir; in validate_path()
846 if (path.compare(0, dir.size(), dir) != 0) { in validate_path()
852 auto pos = path.find('/', dir.size()); in validate_path()
863 LOG(ERROR) << "Invalid path depth " << path << " when tested against " << dir; in validate_path()
876 for (const auto& dir : android_system_dirs) { in validate_system_app_path() local
877 if (validate_path(dir, path, 1) == 0) { in validate_system_app_path()