From 1abf17d1d516cab27fe5610c7e228621b8407809 Mon Sep 17 00:00:00 2001 From: yoloyyh <1764163852@qq.com> Date: Wed, 11 Oct 2023 15:38:40 +0800 Subject: [PATCH] fix mount repeat failed and nodejs cannot block --- rasp/NSMount/main.cpp | 2 +- rasp/node/src/schema.js | 2 +- rasp/node/src/smith.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rasp/NSMount/main.cpp b/rasp/NSMount/main.cpp index 49d611455..41bb6fb0b 100644 --- a/rasp/NSMount/main.cpp +++ b/rasp/NSMount/main.cpp @@ -74,7 +74,7 @@ int main(int argc, char *argv[]) { if (std::filesystem::exists(dst, ec)) { LOG_WARNING("directory %s already exists", dst.u8string().c_str()); - return -1; + return 0; } LOG_INFO("bind %s -> %s", src.u8string().c_str(), dst.u8string().c_str()); diff --git a/rasp/node/src/schema.js b/rasp/node/src/schema.js index 4f35e79b4..237a84779 100644 --- a/rasp/node/src/schema.js +++ b/rasp/node/src/schema.js @@ -78,7 +78,7 @@ const blockSchema = { } } }, - required: ['policy_id', 'class_id', 'method_id', 'rules', 'stack_frame'] + required: ['class_id', 'method_id', 'rules'] } } }, diff --git a/rasp/node/src/smith.js b/rasp/node/src/smith.js index 5fcb73d21..41edc3579 100644 --- a/rasp/node/src/smith.js +++ b/rasp/node/src/smith.js @@ -142,7 +142,7 @@ function smithHook(func, classID, methodID, canBlock = false, processors = {}) { if (policy.rules.length > 0 && !policy.rules.some(pred)) return false; - if (policy.stack_frame === null) { + if (!policy.stack_frame) { smithTrace.blocked = true; smithTrace.policy_id = policy.policy_id; return true;