Skip to content

Commit

Permalink
Merge d47aeec into 51b0f71
Browse files Browse the repository at this point in the history
  • Loading branch information
tburgin committed May 6, 2024
2 parents 51b0f71 + d47aeec commit efd4b8b
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 52 deletions.
16 changes: 6 additions & 10 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,44 @@ module(name = "santa")

bazel_dep(name = "apple_support", version = "1.15.1", repo_name = "build_bazel_apple_support")
bazel_dep(name = "abseil-cpp", version = "20230802.1", repo_name = "com_google_absl")

bazel_dep(name = "rules_python", version = "0.31.0")
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "rules_apple", version = "3.5.0", repo_name = "build_bazel_rules_apple")
bazel_dep(name = "rules_swift", version = "1.18.0", repo_name = "build_bazel_rules_swift")

bazel_dep(name = "protobuf", version = "main", repo_name = "com_google_protobuf")
git_override(
module_name = "protobuf",
remote = "https://github.com/protocolbuffers/protobuf.git",
commit = "21d75f861cdbc03b0a6b235a9ccf3ba0e1f09b32",
remote = "https://github.com/protocolbuffers/protobuf.git",
)

bazel_dep(name = "googletest", version = "1.14.0.bcr.1", repo_name = "com_google_googletest")

bazel_dep(name = "molcertificate", version = "2.1", repo_name = "MOLCertificate")
git_override(
module_name = "molcertificate",
remote = "https://github.com/google/macops-molcertificate.git",
commit = "34f0ccf68a34a07cc636ada89057c529f90bec3a",
remote = "https://github.com/google/macops-molcertificate.git",
)

bazel_dep(name = "molauthenticatingurlsession", version = "3.0", repo_name = "MOLAuthenticatingURLSession")
git_override(
module_name = "molauthenticatingurlsession",
remote = "https://github.com/google/macops-molauthenticatingurlsession.git",
commit = "0a50a67f29d635a4012981714c1dedef9ac25fe6",
remote = "https://github.com/google/macops-molauthenticatingurlsession.git",
)

bazel_dep(name = "molcodesignchecker", version = "3.0", repo_name = "MOLCodesignChecker")
git_override(
module_name = "molcodesignchecker",
remote = "https://github.com/google/macops-molcodesignchecker.git",
commit = "5060bcc8baa90bae3b0ca705d14850328bbbec53",
remote = "https://github.com/google/macops-molcodesignchecker.git",
)

bazel_dep(name = "molxpcconnection", version = "2.1", repo_name = "MOLXPCConnection")
git_override(
module_name = "molxpcconnection",
remote = "https://github.com/russellhancox/macops-molxpcconnection.git",
commit = "da816dc49becac96d941ef6a5c4153ed39d1fe7c",
remote = "https://github.com/russellhancox/macops-molxpcconnection.git",
)

non_module_deps = use_extension("//:non_module_deps.bzl", "non_module_deps")
Expand All @@ -52,7 +49,6 @@ use_repo(non_module_deps, "OCMock")
bazel_dep(name = "hedron_compile_commands", dev_dependency = True)
git_override(
module_name = "hedron_compile_commands",
remote = "https://github.com/hedronvision/bazel-compile-commands-extractor.git",
commit = "0e990032f3c5a866e72615cf67e5ce22186dcb97",
remote = "https://github.com/hedronvision/bazel-compile-commands-extractor.git",
)

5 changes: 3 additions & 2 deletions Source/gui/SNTBinaryMessageWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ - (void)loadWindow {
if (eventDetailText) {
[self.openEventButton setTitle:eventDetailText];
// Require the button keyEquivalent set to be CMD + Return
[self.openEventButton setKeyEquivalent:@"\r"]; // Return Key
[self.openEventButton setKeyEquivalentModifierMask:NSEventModifierFlagCommand]; // Command Key
[self.openEventButton setKeyEquivalent:@"\r"]; // Return Key
[self.openEventButton
setKeyEquivalentModifierMask:NSEventModifierFlagCommand]; // Command Key
}
}

Expand Down
6 changes: 3 additions & 3 deletions Source/santad/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -913,9 +913,6 @@ santa_unit_test(
santa_unit_test(
name = "SantadTest",
srcs = ["SantadTest.mm"],
structured_resources = [
"//Source/santad/testdata:binaryrules_testdata",
],
minimum_os_version = "11.0",
sdk_dylibs = [
"bsm",
Expand All @@ -924,6 +921,9 @@ santa_unit_test(
sdk_frameworks = [
"DiskArbitration",
],
structured_resources = [
"//Source/santad/testdata:binaryrules_testdata",
],
tags = ["exclusive"],
deps = [
":EndpointSecurityMessage",
Expand Down
4 changes: 2 additions & 2 deletions Source/santad/EventProviders/DiskArbitrationTestUtil.mm
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@ void DARegisterDiskAppearedCallback(DASessionRef session, CFDictionaryRef __null

void DARegisterDiskDisappearedCallback(DASessionRef session, CFDictionaryRef __nullable match,
DADiskDisappearedCallback callback,
void *__nullable context) {};
void *__nullable context){};

void DARegisterDiskDescriptionChangedCallback(DASessionRef session,
CFDictionaryRef __nullable match,
CFArrayRef __nullable watch,
DADiskDescriptionChangedCallback callback,
void *__nullable context) {};
void *__nullable context){};

void DASessionSetDispatchQueue(DASessionRef session, dispatch_queue_t __nullable queue) {
MockDiskArbitration *mockDA = [MockDiskArbitration mockDiskArbitration];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,16 +387,16 @@ - (void)testPerformStartupTasks {
// Create mock disks with desired args
MockDADisk * (^CreateMockDisk)(NSString *, NSString *) =
^MockDADisk *(NSString *mountOn, NSString *mountFrom) {
MockDADisk *mockDisk = [[MockDADisk alloc] init];
mockDisk.diskDescription = @{
@"DAVolumePath" : mountOn, // f_mntonname,
@"DADevicePath" : mountOn, // f_mntonname,
@"DAMediaBSDName" : mountFrom, // f_mntfromname,
};

return mockDisk;
MockDADisk *mockDisk = [[MockDADisk alloc] init];
mockDisk.diskDescription = @{
@"DAVolumePath" : mountOn, // f_mntonname,
@"DADevicePath" : mountOn, // f_mntonname,
@"DAMediaBSDName" : mountFrom, // f_mntfromname,
};

return mockDisk;
};

// Reset the Mock DA property, setup disks and remount args, then trigger the test
void (^PerformStartupTest)(NSArray<MockDADisk *> *, NSArray<NSString *> *,
SNTDeviceManagerStartupPreferences) =
Expand Down
2 changes: 1 addition & 1 deletion Source/santad/ProcessTree/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ objc_library(
name = "process_tree_test_helpers",
srcs = ["process_tree_test_helpers.mm"],
hdrs = ["process_tree_test_helpers.h"],
visibility = ["//Source/santad/ProcessTree:__subpackages__"],
deps = [
":process",
":process_tree",
"@com_google_absl//absl/synchronization",
],
visibility = ["//Source/santad/ProcessTree:__subpackages__"],
)

santa_unit_test(
Expand Down
4 changes: 2 additions & 2 deletions Source/santad/ProcessTree/annotations/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ cc_library(

cc_library(
name = "originator",
hdrs = ["originator.h"],
srcs = ["originator.cc"],
hdrs = ["originator.h"],
deps = [
":annotator",
"//Source/santad/ProcessTree:process",
Expand All @@ -31,7 +31,7 @@ santa_unit_test(
deps = [
":originator",
"//Source/santad/ProcessTree:process",
"//Source/santad/ProcessTree:process_tree_test_helpers",
"//Source/santad/ProcessTree:process_tree_cc_proto",
"//Source/santad/ProcessTree:process_tree_test_helpers",
],
)
2 changes: 1 addition & 1 deletion Source/santad/ProcessTree/annotations/originator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
#include <string>
#include <utility>

#include "absl/container/flat_hash_map.h"
#include "Source/santad/ProcessTree/process.h"
#include "Source/santad/ProcessTree/process_tree.h"
#include "Source/santad/ProcessTree/process_tree.pb.h"
#include "absl/container/flat_hash_map.h"

namespace ptpb = ::santa::pb::v1::process_tree;

Expand Down
4 changes: 2 additions & 2 deletions Source/santad/ProcessTree/annotations/originator.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ class OriginatorAnnotator : public Annotator {
public:
OriginatorAnnotator()
: originator_(::santa::pb::v1::process_tree::Annotations::Originator::
Annotations_Originator_UNSPECIFIED) {};
Annotations_Originator_UNSPECIFIED){};
explicit OriginatorAnnotator(
::santa::pb::v1::process_tree::Annotations::Originator originator)
: originator_(originator) {};
: originator_(originator){};

void AnnotateFork(ProcessTree &tree, const Process &parent,
const Process &child) override;
Expand Down
2 changes: 1 addition & 1 deletion Testing/lint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
set -xo pipefail
set -exo pipefail

GIT_ROOT=$(git rev-parse --show-toplevel)

Expand Down
1 change: 0 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ workspace(name = "santa")
load(
"@bazel_tools//tools/build_defs/repo:git.bzl",
"git_repository",
"new_git_repository",
)
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

Expand Down
40 changes: 21 additions & 19 deletions non_module_deps.bzl
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
"""Modules for dependencies not included in the Bazel Central Registry"""

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

def _non_module_deps_impl(ctx):
# FMDB is used to access SQLite from Objective-C(++) code.
git_repository(
name = "FMDB",
remote = "https://github.com/ccgus/fmdb.git",
commit = "61e51fde7f7aab6554f30ab061cc588b28a97d04",
shallow_since = "1589301502 -0700",
build_file_content = """
def _non_module_deps_impl(_):
# FMDB is used to access SQLite from Objective-C(++) code.
git_repository(
name = "FMDB",
remote = "https://github.com/ccgus/fmdb.git",
commit = "61e51fde7f7aab6554f30ab061cc588b28a97d04",
shallow_since = "1589301502 -0700",
build_file_content = """
objc_library(
name = "FMDB",
srcs = glob(["src/fmdb/*.m"], exclude=["src/fmdb.m"]),
Expand All @@ -17,12 +19,12 @@ objc_library(
visibility = ["//visibility:public"],
)
""",
)
)

# OCMock is used in several tests.
git_repository(
name = "OCMock",
build_file_content = """
# OCMock is used in several tests.
git_repository(
name = "OCMock",
build_file_content = """
objc_library(
name = "OCMock",
testonly = 1,
Expand All @@ -39,11 +41,11 @@ objc_library(
visibility = ["//visibility:public"],
)
""",
commit = "afd2c6924e8a36cb872bc475248b978f743c6050", # tag = v3.9.1
patch_args = ["-p1"],
patches = ["//external_patches/OCMock:503.patch"],
remote = "https://github.com/erikdoe/ocmock",
shallow_since = "1635703064 +0100",
)
commit = "afd2c6924e8a36cb872bc475248b978f743c6050", # tag = v3.9.1
patch_args = ["-p1"],
patches = ["//external_patches/OCMock:503.patch"],
remote = "https://github.com/erikdoe/ocmock",
shallow_since = "1635703064 +0100",
)

non_module_deps = module_extension(implementation = _non_module_deps_impl)

0 comments on commit efd4b8b

Please sign in to comment.