Lines Matching refs:dir

89         DIR* dir = opendir(root_path.c_str());  in resolve_ce_path_by_inode_or_fallback()  local
90 if (dir == nullptr) { in resolve_ce_path_by_inode_or_fallback()
96 while ((ent = readdir(dir))) { in resolve_ce_path_by_inode_or_fallback()
103 closedir(dir); in resolve_ce_path_by_inode_or_fallback()
108 closedir(dir); in resolve_ce_path_by_inode_or_fallback()
403 DIR* dir = opendir(path.c_str()); in get_known_users() local
404 if (dir == nullptr) { in get_known_users()
411 while ((ent = readdir(dir))) { in get_known_users()
423 closedir(dir); in get_known_users()
732 static auto open_dir(const char* dir) { in open_dir() argument
736 return std::unique_ptr<DIR, DirCloser>(::opendir(dir)); in open_dir()
741 auto dir = open_dir(pathname.c_str()); in foreach_subdir() local
742 if (!dir) return -1; in foreach_subdir()
744 int dfd = dirfd(dir.get()); in foreach_subdir()
751 while ((de = readdir(dir.get()))) { in foreach_subdir()
768 auto dir = open_dir(pathname.c_str()); in cleanup_invalid_package_dirs_under_path() local
769 if (!dir) { in cleanup_invalid_package_dirs_under_path()
772 int dfd = dirfd(dir.get()); in cleanup_invalid_package_dirs_under_path()
779 while ((de = readdir(dir.get()))) { in cleanup_invalid_package_dirs_under_path()
997 DIR* dir = opendir(parent.c_str()); in read_path_inode() local
998 if (dir == nullptr) { in read_path_inode()
1004 while ((ent = readdir(dir))) { in read_path_inode()
1013 closedir(dir); in read_path_inode()
1018 closedir(dir); in read_path_inode()
1036 static int validate_path(const std::string& dir, const std::string& path, int maxSubdirs) { in validate_path() argument
1038 if (dir.find('/') != 0 || dir.rfind('/') != dir.size() - 1 in validate_path()
1039 || dir.find("..") != std::string::npos) { in validate_path()
1040 LOG(ERROR) << "Invalid directory " << dir; in validate_path()
1048 if (path.compare(0, dir.size(), dir) != 0) { in validate_path()
1054 auto pos = path.find('/', dir.size()); in validate_path()
1065 LOG(ERROR) << "Invalid path depth " << path << " when tested against " << dir; in validate_path()
1078 for (const auto& dir : android_system_dirs) { in validate_system_app_path() local
1079 if (validate_path(dir, path, 1) == 0) { in validate_system_app_path()