Skip to content

Commit 1e95464

Browse files
committed
VM::MAC_SIP bug fixes
1 parent 5d5f73f commit 1e95464

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

src/vmaware.hpp

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7032,14 +7032,31 @@ struct VM {
70327032
return false;
70337033
}
70347034

7035-
if (hv_present != 0) return true;
7035+
if (hv_present != 0) {
7036+
return true;
7037+
}
70367038

70377039
std::unique_ptr<std::string> result = util::sys_result("csrutil status");
7038-
const std::string tmp = *result;
7040+
7041+
if (!result) {
7042+
return false;
7043+
}
7044+
7045+
std::string tmp = *result;
7046+
7047+
auto pos = tmp.find('\n');
7048+
7049+
if (pos != std::string::npos) {
7050+
tmp.resize(pos);
7051+
}
70397052

70407053
debug("MAC_SIP: ", "result = ", tmp);
70417054

7042-
return (util::find(tmp, "disabled") || (!util::find(tmp, "enabled")));
7055+
if (util::find(tmp, "unknown")) {
7056+
return false;
7057+
}
7058+
7059+
return (util::find(tmp, "disabled"));
70437060
}
70447061

70457062

0 commit comments

Comments
 (0)