Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd CMake support, implement fuzzers #284
Conversation
The new CMake project allows the user to select which SDK version to use. The Xcode path is also configurable to support non-standard installation paths and/or systems with multiple versions installed. Code signing can now be configured via command line, using the CODESIGN_IDENTITY environment variable. New fuzzing targets (libFuzzer) - SantaCache - santactl - santad New make targets: - tests: Runs the tests - fuzz: Runs the fuzzer - redist: Regenerates the redistributable folder - install: Installs Santa
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
|
I have signed the CLA! |
|
CLAs look good, thanks! |
|
Thank you for the PR, sorry it took so long to review. I had a few comments but they're mostly minor things. |
| endif() | ||
|
|
||
| if(NOT MACOSX_VERSION_MIN) | ||
| set(MACOSX_VERSION_MIN 10.13) |
russellhancox
Jun 26, 2018
Collaborator
Thus far we've been targeting 10.9 as the minimum version, that seems like a reasonable default here.
Thus far we've been targeting 10.9 as the minimum version, that seems like a reasonable default here.
| endif() | ||
|
|
||
| if(NOT XCODE_ROOT_FOLDER) | ||
| set(XCODE_ROOT_FOLDER "/Applications/Xcode.app") |
russellhancox
Jun 26, 2018
Collaborator
Could this instead be determined using xcode-select -p?
Could this instead be determined using xcode-select -p?
| @@ -47,6 +53,9 @@ mkdir -p /usr/local/bin | |||
| # Reload syslogd to pick up ASL configuration change. | |||
| /usr/bin/killall -HUP syslogd | |||
|
|
|||
| # Install the configuration file | |||
| /usr/bin/profiles install -path=${SOURCE}/conf/com.google.santa.example.mobileconfig | |||
russellhancox
Jun 26, 2018
Collaborator
I think I'd prefer to leave this line out, the example mobileconfig file isn't all that useful on its own and I generally wouldn't expect a sysadmin to package the mobileconfig up with the Santa package - it should either be distributed as its own package or installed using a config management tool (an MDM, Puppet, etc.)
I think I'd prefer to leave this line out, the example mobileconfig file isn't all that useful on its own and I generally wouldn't expect a sysadmin to package the mobileconfig up with the Santa package - it should either be distributed as its own package or installed using a config management tool (an MDM, Puppet, etc.)
| @@ -21,6 +30,10 @@ user=$(/usr/bin/stat -f '%u' /dev/console) | |||
| /bin/rm -f /private/etc/asl/com.google.santa.asl.conf | |||
| /bin/rm -f /private/etc/newsyslog.d/com.google.santa.newsyslog.conf | |||
| /bin/rm -f /usr/local/bin/santactl # just a symlink | |||
|
|
|||
| # Uninstall the configuration file | |||
| /usr/bin/profiles remove -path=${SOURCE}/conf/com.google.santa.example.mobileconfig | |||
russellhancox
Jun 26, 2018
Collaborator
Same here
Same here
| return 0; | ||
| } | ||
|
|
||
| SNTCommandSyncRuleDownload *obj = [[SNTCommandSyncRuleDownload alloc] initWithState:state]; |
russellhancox
Jun 26, 2018
Collaborator
nit: indented too far
nit: indented too far
| ) | ||
|
|
||
| target_compile_definitions("${PROJECT_NAME}" PRIVATE | ||
| SNT_OS_LOG_CATEGORY=\"${PROJECT_NAME}\" |
russellhancox
Jun 26, 2018
Collaborator
What's this define for?
What's this define for?
| #include <SNTRule.h> | ||
|
|
||
| extern "C" int LLVMFuzzerTestOneInput(const std::uint8_t *data, std::size_t size) { | ||
| NSData* buffer = [NSData dataWithBytes:static_cast<const void *>(data) length:size]; |
russellhancox
Jun 26, 2018
Collaborator
To be consistent with the rest of the source, the * should be with the variable name:
NSData *buffer
To be consistent with the rest of the source, the * should be with the variable name:
NSData *buffer
|
|
||
| extern "C" int LLVMFuzzerTestOneInput(const std::uint8_t *data, std::size_t size) { | ||
| NSData* buffer = [NSData dataWithBytes:static_cast<const void *>(data) length:size]; | ||
| if (buffer == nil) { |
russellhancox
Jun 26, 2018
Collaborator
Also consistency: we generally use the form if (buffer) { here.
Also consistency: we generally use the form if (buffer) { here.
|
|
||
| #pragma pack(push, 1) | ||
|
|
||
| #pragma pack(pop) |
russellhancox
Jun 26, 2018
Collaborator
Are these 2 pragma's leftovers from something?
Are these 2 pragma's leftovers from something?
| @@ -0,0 +1,51 @@ | |||
| #import "SNTDriverManager.h" | |||
russellhancox
Jun 26, 2018
Collaborator
Can you add a comment at the top of this file describing what it's testing. I'm guessing it's a test that attempts to connect to the driver from multiple threads simultaneously doesn't cause crashes.
Can you add a comment at the top of this file describing what it's testing. I'm guessing it's a test that attempts to connect to the driver from multiple threads simultaneously doesn't cause crashes.
alessandrogario
Jun 28, 2018
Author
Contributor
You are right! I have added a comment at the top of the file
You are right! I have added a comment at the top of the file
|
@russellhancox Thanks so much for the review! I've updated the branch with the changes you have requested |
629e702
into
google:master
|
Thanks again for the submission! |
The new CMake project allows the user to select which SDK version to use. The Xcode path is also configurable to support non-standard installation paths and/or systems with multiple versions installed. Code signing can now be configured via command line, using the CODESIGN_IDENTITY environment variable. New fuzzing targets (libFuzzer) - SantaCache - santactl - santad New make targets: - tests: Runs the tests - fuzz: Runs the fuzzer - redist: Regenerates the redistributable folder - install: Installs Santa
The new CMake project allows the user to select which SDK version to use. The Xcode path is also configurable to support non-standard installation paths and/or systems with multiple versions installed.
Code signing can now be configured via command line, using the CODESIGN_IDENTITY environment variable.
New fuzzing targets (libFuzzer)
New make targets:
A small issue has been found in santactl when the the sync-server returns a valid JSON that does not get deserialized to a dictionary object (not yet fixed inside this PR).