File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -681,6 +681,7 @@ cc_library(
681681 "//sandboxed_api/util:fileops" ,
682682 "//sandboxed_api/util:raw_logging" ,
683683 "//sandboxed_api/util:status" ,
684+ "@abseil-cpp//absl/container:flat_hash_set" ,
684685 "@abseil-cpp//absl/status" ,
685686 "@abseil-cpp//absl/status:statusor" ,
686687 "@abseil-cpp//absl/strings" ,
Original file line number Diff line number Diff line change @@ -643,20 +643,17 @@ add_library(sandbox2_mounts ${SAPI_LIB_TYPE}
643643add_library (sandbox2::mounts ALIAS sandbox2_mounts )
644644target_link_libraries (sandbox2_mounts
645645 PRIVATE absl::flat_hash_set
646- absl::str_format
647646 protobuf::libprotobuf
647+ sandbox2::library_resolver
648+ sapi::base
648649 sapi::config
649650 sapi::file_base
650651 sapi::fileops
651- sandbox2::minielf
652- sapi::strerror
653- sapi::base
654652 sapi::raw_logging
655653 sapi::status
656654 PUBLIC absl::status
657655 absl::statusor
658656 absl::strings
659- sandbox2::library_resolver
660657 sandbox2::mount_tree_proto
661658)
662659
Original file line number Diff line number Diff line change 2828#include < utility>
2929#include < vector>
3030
31+ #include " absl/container/flat_hash_set.h"
3132#include " absl/status/status.h"
3233#include " absl/status/statusor.h"
3334#include " absl/strings/match.h"
@@ -345,14 +346,14 @@ absl::StatusOr<std::string> Mounts::ResolvePath(absl::string_view path) const {
345346
346347absl::Status Mounts::AddMappingsForBinary (const std::string& path,
347348 absl::string_view ld_library_path) {
348- std::vector <std::string> imported_libraries;
349+ absl::flat_hash_set <std::string> imported_libraries;
349350 SAPI_ASSIGN_OR_RETURN (
350351 auto interpreter,
351352 ResolveLibraryPaths (path, ld_library_path, [&](absl::string_view lib) {
352- imported_libraries.push_back (std::string (lib));
353+ imported_libraries.insert (std::string (lib));
353354 }));
354355 if (!interpreter.empty ()) {
355- imported_libraries.push_back (interpreter);
356+ imported_libraries.insert (interpreter);
356357 }
357358 for (const auto & lib : imported_libraries) {
358359 SAPI_RETURN_IF_ERROR (AddFile (lib));
You can’t perform that action at this time.
0 commit comments