Loading cmds/installd/InstalldNativeService.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -519,6 +519,9 @@ binder::Status InstalldNativeService::clearAppData(const std::unique_ptr<std::st if (access(path.c_str(), F_OK) == 0) { if (delete_dir_contents(path) != 0) { res = error("Failed to delete contents of " + path); } else if ((flags & (FLAG_CLEAR_CACHE_ONLY | FLAG_CLEAR_CODE_CACHE_ONLY)) == 0) { remove_path_xattr(path, kXattrInodeCache); remove_path_xattr(path, kXattrInodeCodeCache); } } } Loading cmds/installd/utils.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -733,6 +733,12 @@ std::string read_path_inode(const std::string& parent, const char* name, const c } } void remove_path_xattr(const std::string& path, const char* inode_xattr) { if (removexattr(path.c_str(), inode_xattr) && errno != ENODATA) { PLOG(ERROR) << "Failed to remove xattr " << inode_xattr << " at " << path; } } /** * Validate that the path is valid in the context of the provided directory. * The path is allowed to have at most one subdirectory and no indirections Loading cmds/installd/utils.h +1 −0 Original line number Diff line number Diff line Loading @@ -120,6 +120,7 @@ int get_path_inode(const std::string& path, ino_t *inode); int write_path_inode(const std::string& parent, const char* name, const char* inode_xattr); std::string read_path_inode(const std::string& parent, const char* name, const char* inode_xattr); void remove_path_xattr(const std::string& path, const char* inode_xattr); int validate_system_app_path(const char* path); bool validate_secondary_dex_path(const std::string& pkgname, const std::string& dex_path, Loading Loading
cmds/installd/InstalldNativeService.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -519,6 +519,9 @@ binder::Status InstalldNativeService::clearAppData(const std::unique_ptr<std::st if (access(path.c_str(), F_OK) == 0) { if (delete_dir_contents(path) != 0) { res = error("Failed to delete contents of " + path); } else if ((flags & (FLAG_CLEAR_CACHE_ONLY | FLAG_CLEAR_CODE_CACHE_ONLY)) == 0) { remove_path_xattr(path, kXattrInodeCache); remove_path_xattr(path, kXattrInodeCodeCache); } } } Loading
cmds/installd/utils.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -733,6 +733,12 @@ std::string read_path_inode(const std::string& parent, const char* name, const c } } void remove_path_xattr(const std::string& path, const char* inode_xattr) { if (removexattr(path.c_str(), inode_xattr) && errno != ENODATA) { PLOG(ERROR) << "Failed to remove xattr " << inode_xattr << " at " << path; } } /** * Validate that the path is valid in the context of the provided directory. * The path is allowed to have at most one subdirectory and no indirections Loading
cmds/installd/utils.h +1 −0 Original line number Diff line number Diff line Loading @@ -120,6 +120,7 @@ int get_path_inode(const std::string& path, ino_t *inode); int write_path_inode(const std::string& parent, const char* name, const char* inode_xattr); std::string read_path_inode(const std::string& parent, const char* name, const char* inode_xattr); void remove_path_xattr(const std::string& path, const char* inode_xattr); int validate_system_app_path(const char* path); bool validate_secondary_dex_path(const std::string& pkgname, const std::string& dex_path, Loading