Skip to content

Commit

Permalink
ProcessTree: fix missing direct deps (#1288)
Browse files Browse the repository at this point in the history
* hmm

* more lint and add another dep
  • Loading branch information
kallsyms committed Feb 9, 2024
1 parent e4c0d56 commit c35e997
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 6 additions & 4 deletions Source/santad/ProcessTree/BUILD
@@ -1,16 +1,16 @@
load("//:helper.bzl", "santa_unit_test")
load("@rules_cc//cc:defs.bzl", "cc_proto_library")
load("//:helper.bzl", "santa_unit_test")

cc_library(
name = "process",
hdrs = ["process.h"],
visibility = ["//:santa_package_group"],
deps = [
"//Source/santad/ProcessTree/annotations:annotator",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/synchronization",
],
visibility = ["//:santa_package_group"],
)

objc_library(
Expand All @@ -23,6 +23,7 @@ objc_library(
sdk_dylibs = [
"bsm",
],
visibility = ["//:santa_package_group"],
deps = [
":process",
"//Source/santad/ProcessTree:process_tree_cc_proto",
Expand All @@ -33,7 +34,6 @@ objc_library(
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/synchronization",
],
visibility = ["//:santa_package_group"],
)

proto_library(
Expand All @@ -44,15 +44,16 @@ proto_library(

cc_proto_library(
name = "process_tree_cc_proto",
deps = [":process_tree_proto"],
visibility = ["//:santa_package_group"],
deps = [":process_tree_proto"],
)

objc_library(
name = "process_tree_test_helpers",
srcs = ["process_tree_test_helpers.mm"],
hdrs = ["process_tree_test_helpers.h"],
deps = [
":process",
":process_tree",
"@com_google_absl//absl/synchronization",
],
Expand All @@ -65,5 +66,6 @@ santa_unit_test(
":process",
":process_tree_test_helpers",
"//Source/santad/ProcessTree/annotations:annotator",
"@com_google_absl//absl/synchronization",
],
)
12 changes: 5 additions & 7 deletions Source/santad/ProcessTree/process_tree.h
Expand Up @@ -56,9 +56,8 @@ class ProcessTree {
// N.B. new_pid is required as the "pid version" will have changed.
// It is a programming error to pass a new_pid such that
// p.pid_.pid != new_pid.pid.
void HandleExec(uint64_t timestamp, const Process &p,
struct Pid new_pid, struct Program prog,
struct Cred c);
void HandleExec(uint64_t timestamp, const Process &p, struct Pid new_pid,
struct Program prog, struct Cred c);

// Inform the tree of a process exit.
void HandleExit(uint64_t timestamp, const Process &p);
Expand Down Expand Up @@ -98,8 +97,7 @@ class ProcessTree {
void Iterate(std::function<void(std::shared_ptr<const Process>)> f) const;

// Get the Process for the given pid in the tree if it exists.
std::optional<std::shared_ptr<const Process>> Get(
struct Pid target) const;
std::optional<std::shared_ptr<const Process>> Get(struct Pid target) const;

// Traverse the tree from the given Process to its parent.
std::shared_ptr<const Process> GetParent(const Process &p) const;
Expand All @@ -120,8 +118,8 @@ class ProcessTree {
// updated with the results of the event.
bool Step(uint64_t timestamp);

std::optional<std::shared_ptr<Process>> GetLocked(
struct Pid target) const ABSL_SHARED_LOCKS_REQUIRED(mtx_);
std::optional<std::shared_ptr<Process>> GetLocked(struct Pid target) const
ABSL_SHARED_LOCKS_REQUIRED(mtx_);

void DebugDumpLocked(std::ostream &stream, int depth, pid_t ppid) const;

Expand Down

0 comments on commit c35e997

Please sign in to comment.