Date: Fri, 25 Mar 2016 23:30:06 +0000 (UTC) From: Jan Beich <jbeich@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r411909 - in head: mail/thunderbird mail/thunderbird/files www/firefox www/firefox-esr www/firefox-esr/files www/firefox/files www/libxul www/libxul/files www/seamonkey www/seamonkey/files Message-ID: <201603252330.u2PNU6mj041000@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jbeich Date: Fri Mar 25 23:30:06 2016 New Revision: 411909 URL: https://svnweb.freebsd.org/changeset/ports/411909 Log: gecko: fix an unlikely race with environ(7) MFH: 2016Q1 Added: head/mail/thunderbird/files/patch-bug1233275 (contents, props changed) head/www/firefox-esr/files/patch-bug1233275 (contents, props changed) head/www/firefox/files/patch-bug1233275 (contents, props changed) head/www/libxul/files/patch-bug1233275 (contents, props changed) head/www/seamonkey/files/patch-bug1233275 (contents, props changed) Modified: head/mail/thunderbird/Makefile (contents, props changed) head/www/firefox-esr/Makefile (contents, props changed) head/www/firefox/Makefile (contents, props changed) head/www/libxul/Makefile (contents, props changed) head/www/seamonkey/Makefile (contents, props changed) Modified: head/mail/thunderbird/Makefile ============================================================================== --- head/mail/thunderbird/Makefile Fri Mar 25 20:59:47 2016 (r411908) +++ head/mail/thunderbird/Makefile Fri Mar 25 23:30:06 2016 (r411909) @@ -3,6 +3,7 @@ PORTNAME= thunderbird DISTVERSION= 38.7.0 +PORTREVISION= 1 CATEGORIES= mail news net-im ipv6 MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \ MOZILLA/${PORTNAME}/candidates/${DISTVERSION}-candidates/build1/source Added: head/mail/thunderbird/files/patch-bug1233275 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/mail/thunderbird/files/patch-bug1233275 Fri Mar 25 23:30:06 2016 (r411909) @@ -0,0 +1,40 @@ +# Copy environment for IPC using NSPR to avoid race + +diff --git a/ipc/chromium/src/base/process_util_bsd.cc b/ipc/chromium/src/base/process_util_bsd.cc +--- mozilla/ipc/chromium/src/base/process_util_bsd.cc ++++ mozilla/ipc/chromium/src/base/process_util_bsd.cc +@@ -13,6 +13,7 @@ + + #include <string> + ++#include "nspr.h" + #include "base/eintr_wrapper.h" + #include "base/file_util.h" + #include "base/logging.h" +@@ -48,7 +49,6 @@ + + #ifdef HAVE_POSIX_SPAWN + #include <spawn.h> +-extern "C" char **environ __dso_public; + #endif + + namespace { +@@ -114,6 +114,7 @@ bool LaunchApp(const std::vector<std::st + // Existing variables are overwritten by env_vars_to_set. + int pos = 0; + environment_map combined_env_vars = env_vars_to_set; ++ char **environ = PR_DuplicateEnvironment(); + while(environ[pos] != NULL) { + std::string varString = environ[pos]; + std::string varName = varString.substr(0, varString.find_first_of('=')); +@@ -121,8 +122,9 @@ bool LaunchApp(const std::vector<std::st + if (combined_env_vars.find(varName) == combined_env_vars.end()) { + combined_env_vars[varName] = varValue; + } +- pos++; ++ PR_Free(environ[pos++]); + } ++ PR_Free(environ); + int varsLen = combined_env_vars.size() + 1; + + char** vars = new char*[varsLen]; Modified: head/www/firefox-esr/Makefile ============================================================================== --- head/www/firefox-esr/Makefile Fri Mar 25 20:59:47 2016 (r411908) +++ head/www/firefox-esr/Makefile Fri Mar 25 23:30:06 2016 (r411909) @@ -4,6 +4,7 @@ PORTNAME= firefox DISTVERSION= 38.7.1 DISTVERSIONSUFFIX=esr.source +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= www ipv6 MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}esr/source \ Added: head/www/firefox-esr/files/patch-bug1233275 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/firefox-esr/files/patch-bug1233275 Fri Mar 25 23:30:06 2016 (r411909) @@ -0,0 +1,40 @@ +# Copy environment for IPC using NSPR to avoid race + +diff --git a/ipc/chromium/src/base/process_util_bsd.cc b/ipc/chromium/src/base/process_util_bsd.cc +--- ipc/chromium/src/base/process_util_bsd.cc ++++ ipc/chromium/src/base/process_util_bsd.cc +@@ -13,6 +13,7 @@ + + #include <string> + ++#include "nspr.h" + #include "base/eintr_wrapper.h" + #include "base/file_util.h" + #include "base/logging.h" +@@ -48,7 +49,6 @@ + + #ifdef HAVE_POSIX_SPAWN + #include <spawn.h> +-extern "C" char **environ __dso_public; + #endif + + namespace { +@@ -114,6 +114,7 @@ bool LaunchApp(const std::vector<std::st + // Existing variables are overwritten by env_vars_to_set. + int pos = 0; + environment_map combined_env_vars = env_vars_to_set; ++ char **environ = PR_DuplicateEnvironment(); + while(environ[pos] != NULL) { + std::string varString = environ[pos]; + std::string varName = varString.substr(0, varString.find_first_of('=')); +@@ -121,8 +122,9 @@ bool LaunchApp(const std::vector<std::st + if (combined_env_vars.find(varName) == combined_env_vars.end()) { + combined_env_vars[varName] = varValue; + } +- pos++; ++ PR_Free(environ[pos++]); + } ++ PR_Free(environ); + int varsLen = combined_env_vars.size() + 1; + + char** vars = new char*[varsLen]; Modified: head/www/firefox/Makefile ============================================================================== --- head/www/firefox/Makefile Fri Mar 25 20:59:47 2016 (r411908) +++ head/www/firefox/Makefile Fri Mar 25 23:30:06 2016 (r411909) @@ -4,7 +4,7 @@ PORTNAME= firefox DISTVERSION= 45.0.1 DISTVERSIONSUFFIX=.source -PORTREVISION= 2 +PORTREVISION= 3 PORTEPOCH= 1 CATEGORIES= www ipv6 MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \ Added: head/www/firefox/files/patch-bug1233275 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/firefox/files/patch-bug1233275 Fri Mar 25 23:30:06 2016 (r411909) @@ -0,0 +1,36 @@ +# Copy environment for IPC using NSPR to avoid race + +diff --git a/ipc/chromium/src/base/process_util_bsd.cc b/ipc/chromium/src/base/process_util_bsd.cc +--- ipc/chromium/src/base/process_util_bsd.cc ++++ ipc/chromium/src/base/process_util_bsd.cc +@@ -12,10 +12,9 @@ + + #include <string> + ++#include "nspr.h" + #include "base/eintr_wrapper.h" + +-extern "C" char **environ __attribute__((__visibility__("default"))); +- + namespace base { + + void FreeEnvVarsArray(char* array[], int length) +@@ -66,6 +65,7 @@ bool LaunchApp(const std::vector<std::st + // Existing variables are overwritten by env_vars_to_set. + int pos = 0; + environment_map combined_env_vars = env_vars_to_set; ++ char **environ = PR_DuplicateEnvironment(); + while(environ[pos] != NULL) { + std::string varString = environ[pos]; + std::string varName = varString.substr(0, varString.find_first_of('=')); +@@ -73,8 +73,9 @@ bool LaunchApp(const std::vector<std::st + if (combined_env_vars.find(varName) == combined_env_vars.end()) { + combined_env_vars[varName] = varValue; + } +- pos++; ++ PR_Free(environ[pos++]); + } ++ PR_Free(environ); + int varsLen = combined_env_vars.size() + 1; + + char** vars = new char*[varsLen]; Modified: head/www/libxul/Makefile ============================================================================== --- head/www/libxul/Makefile Fri Mar 25 20:59:47 2016 (r411908) +++ head/www/libxul/Makefile Fri Mar 25 23:30:06 2016 (r411909) @@ -3,6 +3,7 @@ PORTNAME= libxul DISTVERSION= 38.7.1 +PORTREVISION= 1 CATEGORIES?= www devel MASTER_SITES= MOZILLA/firefox/releases/${DISTVERSION}esr/source \ MOZILLA/firefox/candidates/${DISTVERSION}esr-candidates/build1/source Added: head/www/libxul/files/patch-bug1233275 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/libxul/files/patch-bug1233275 Fri Mar 25 23:30:06 2016 (r411909) @@ -0,0 +1,40 @@ +# Copy environment for IPC using NSPR to avoid race + +diff --git a/ipc/chromium/src/base/process_util_bsd.cc b/ipc/chromium/src/base/process_util_bsd.cc +--- ipc/chromium/src/base/process_util_bsd.cc ++++ ipc/chromium/src/base/process_util_bsd.cc +@@ -13,6 +13,7 @@ + + #include <string> + ++#include "nspr.h" + #include "base/eintr_wrapper.h" + #include "base/file_util.h" + #include "base/logging.h" +@@ -48,7 +49,6 @@ + + #ifdef HAVE_POSIX_SPAWN + #include <spawn.h> +-extern "C" char **environ __dso_public; + #endif + + namespace { +@@ -114,6 +114,7 @@ bool LaunchApp(const std::vector<std::st + // Existing variables are overwritten by env_vars_to_set. + int pos = 0; + environment_map combined_env_vars = env_vars_to_set; ++ char **environ = PR_DuplicateEnvironment(); + while(environ[pos] != NULL) { + std::string varString = environ[pos]; + std::string varName = varString.substr(0, varString.find_first_of('=')); +@@ -121,8 +122,9 @@ bool LaunchApp(const std::vector<std::st + if (combined_env_vars.find(varName) == combined_env_vars.end()) { + combined_env_vars[varName] = varValue; + } +- pos++; ++ PR_Free(environ[pos++]); + } ++ PR_Free(environ); + int varsLen = combined_env_vars.size() + 1; + + char** vars = new char*[varsLen]; Modified: head/www/seamonkey/Makefile ============================================================================== --- head/www/seamonkey/Makefile Fri Mar 25 20:59:47 2016 (r411908) +++ head/www/seamonkey/Makefile Fri Mar 25 23:30:06 2016 (r411909) @@ -4,7 +4,7 @@ PORTNAME= seamonkey DISTVERSION= 2.39 MOZILLA_VER= 42 # above + 3 -PORTREVISION= 6 +PORTREVISION= 7 CATEGORIES?= www mail news editors irc ipv6 MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \ MOZILLA/${PORTNAME}/candidates/${DISTVERSION}-candidates/build1/source Added: head/www/seamonkey/files/patch-bug1233275 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/seamonkey/files/patch-bug1233275 Fri Mar 25 23:30:06 2016 (r411909) @@ -0,0 +1,40 @@ +# Copy environment for IPC using NSPR to avoid race + +diff --git a/ipc/chromium/src/base/process_util_bsd.cc b/ipc/chromium/src/base/process_util_bsd.cc +--- mozilla/ipc/chromium/src/base/process_util_bsd.cc ++++ mozilla/ipc/chromium/src/base/process_util_bsd.cc +@@ -13,6 +13,7 @@ + + #include <string> + ++#include "nspr.h" + #include "base/eintr_wrapper.h" + #include "base/file_util.h" + #include "base/logging.h" +@@ -48,7 +49,6 @@ + + #ifdef HAVE_POSIX_SPAWN + #include <spawn.h> +-extern "C" char **environ __dso_public; + #endif + + namespace { +@@ -114,6 +114,7 @@ bool LaunchApp(const std::vector<std::st + // Existing variables are overwritten by env_vars_to_set. + int pos = 0; + environment_map combined_env_vars = env_vars_to_set; ++ char **environ = PR_DuplicateEnvironment(); + while(environ[pos] != NULL) { + std::string varString = environ[pos]; + std::string varName = varString.substr(0, varString.find_first_of('=')); +@@ -121,8 +122,9 @@ bool LaunchApp(const std::vector<std::st + if (combined_env_vars.find(varName) == combined_env_vars.end()) { + combined_env_vars[varName] = varValue; + } +- pos++; ++ PR_Free(environ[pos++]); + } ++ PR_Free(environ); + int varsLen = combined_env_vars.size() + 1; + + char** vars = new char*[varsLen];
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201603252330.u2PNU6mj041000>