Lines Matching refs:dir
115 DIR* dir = opendir(user_path.c_str()); in create_data_user_ce_package_path() local
116 if (dir == nullptr) { in create_data_user_ce_package_path()
122 while ((ent = readdir(dir))) { in create_data_user_ce_package_path()
131 closedir(dir); in create_data_user_ce_package_path()
136 closedir(dir); in create_data_user_ce_package_path()
312 DIR* dir = opendir(path.c_str()); in get_known_users() local
313 if (dir == NULL) { in get_known_users()
320 while ((ent = readdir(dir))) { in get_known_users()
332 closedir(dir); in get_known_users()
726 DIR* dir = opendir(parent.c_str()); in read_path_inode() local
727 if (dir == nullptr) { in read_path_inode()
733 while ((ent = readdir(dir))) { in read_path_inode()
742 closedir(dir); in read_path_inode()
747 closedir(dir); in read_path_inode()
765 static int validate_path(const std::string& dir, const std::string& path, int maxSubdirs) { in validate_path() argument
767 if (dir.find('/') != 0 || dir.rfind('/') != dir.size() - 1 in validate_path()
768 || dir.find("..") != std::string::npos) { in validate_path()
769 LOG(ERROR) << "Invalid directory " << dir; in validate_path()
777 if (path.compare(0, dir.size(), dir) != 0) { in validate_path()
783 auto pos = path.find('/', dir.size()); in validate_path()
794 LOG(ERROR) << "Invalid path depth " << path << " when tested against " << dir; in validate_path()
807 for (const auto& dir : android_system_dirs) { in validate_system_app_path() local
808 if (validate_path(dir, path, 1) == 0) { in validate_system_app_path()