Skip to content

Commit

Permalink
Merge pull request #542 from bytedance/fix-mount-nodeblock
Browse files Browse the repository at this point in the history
fix mount repeat failed and nodejs cannot block
  • Loading branch information
yoloyyh authored Oct 19, 2023
2 parents c0504eb + 1abf17d commit a540bb8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rasp/NSMount/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion rasp/node/src/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const blockSchema = {
}
}
},
required: ['policy_id', 'class_id', 'method_id', 'rules', 'stack_frame']
required: ['class_id', 'method_id', 'rules']
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion rasp/node/src/smith.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a540bb8

Please sign in to comment.