From 0fd474ee8dd457952b01383d085b13550513c8d7 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Wed, 23 Jun 2021 17:42:25 +0200 Subject: [PATCH] Hide $NOTIFY_SOCKET from plugins refs #7329 --- lib/base/process.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/base/process.cpp b/lib/base/process.cpp index 2592b3393..53af4ffd2 100644 --- a/lib/base/process.cpp +++ b/lib/base/process.cpp @@ -105,6 +105,7 @@ static Value ProcessSpawnImpl(struct msghdr *msgh, const Dictionary::Ptr& reques auto **envp = new char *[envc + (extraEnvironment ? extraEnvironment->GetLength() : 0) + 2]; const char* lcnumeric = "LC_NUMERIC="; + const char* notifySocket = "NOTIFY_SOCKET="; int j = 0; for (int i = 0; i < envc; i++) { @@ -112,6 +113,10 @@ static Value ProcessSpawnImpl(struct msghdr *msgh, const Dictionary::Ptr& reques continue; } + if (strncmp(environ[i], notifySocket, strlen(notifySocket)) == 0) { + continue; + } + envp[j] = strdup(environ[i]); ++j; }