We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d5f73f commit 1e95464Copy full SHA for 1e95464
1 file changed
src/vmaware.hpp
@@ -7032,14 +7032,31 @@ struct VM {
7032
return false;
7033
}
7034
7035
- if (hv_present != 0) return true;
+ if (hv_present != 0) {
7036
+ return true;
7037
+ }
7038
7039
std::unique_ptr<std::string> result = util::sys_result("csrutil status");
- 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
7052
7053
debug("MAC_SIP: ", "result = ", tmp);
7054
- return (util::find(tmp, "disabled") || (!util::find(tmp, "enabled")));
7055
+ if (util::find(tmp, "unknown")) {
7056
7057
7058
7059
+ return (util::find(tmp, "disabled"));
7060
7061
7062
0 commit comments