Hide $NOTIFY_SOCKET from plugins

refs #7329
This commit is contained in:
Alexander A. Klimov 2021-06-23 17:42:25 +02:00
parent e98a7a9140
commit 0fd474ee8d
1 changed files with 5 additions and 0 deletions

View File

@ -105,6 +105,7 @@ static Value ProcessSpawnImpl(struct msghdr *msgh, const Dictionary::Ptr& reques
auto **envp = new char *[envc + (extraEnvironment ? extraEnvironment->GetLength() : 0) + 2]; auto **envp = new char *[envc + (extraEnvironment ? extraEnvironment->GetLength() : 0) + 2];
const char* lcnumeric = "LC_NUMERIC="; const char* lcnumeric = "LC_NUMERIC=";
const char* notifySocket = "NOTIFY_SOCKET=";
int j = 0; int j = 0;
for (int i = 0; i < envc; i++) { for (int i = 0; i < envc; i++) {
@ -112,6 +113,10 @@ static Value ProcessSpawnImpl(struct msghdr *msgh, const Dictionary::Ptr& reques
continue; continue;
} }
if (strncmp(environ[i], notifySocket, strlen(notifySocket)) == 0) {
continue;
}
envp[j] = strdup(environ[i]); envp[j] = strdup(environ[i]);
++j; ++j;
} }