fix: ignore all NODE_ envs from foreign parent in node process (#40770)

* fix: ignore all NODE_ envs from foreign parent

* fix: recognize ad-hoc signed binary
This commit is contained in:
Cheng Zhao 2024-01-04 16:34:08 +09:00 committed by GitHub
parent baca2e302d
commit dfce1a9eb4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 115 additions and 16 deletions

View file

@ -10,9 +10,14 @@
namespace electron {
// Given a pid, check if the process belongs to current app by comparing its
// code signature with current app.
bool ProcessBelongToCurrentApp(pid_t pid);
// Given a pid, return true if the process has the same code signature with
// with current app.
// This API returns true if current app is not signed or ad-hoc signed, because
// checking code signature is meaningless in this case, and failing the
// signature check would break some features with unsigned binary (for example,
// process.send stops working in processes created by child_process.fork, due
// to the NODE_CHANNEL_ID env getting removed).
bool ProcessSignatureIsSameWithCurrentApp(pid_t pid);
} // namespace electron