Backed out changeset 855eb2e4c43d (bug 1434666) for bricking installation on Ubuntu 14.04 (bug 1441449). a=backout CLOSED TREE
authorSebastian Hengst <archaeopteryx@coole-files.de>
Tue, 27 Feb 2018 23:47:00 +0200
changeset 405497 505bafeafb66
parent 405496 b184be598740
child 405538 81ff01f63004
push id33522
push userarchaeopteryx@coole-files.de
push dateTue, 27 Feb 2018 21:51:50 +0000
treeherdermozilla-central@505bafeafb66 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1434666, 1441449
milestone60.0a1
backs out855eb2e4c43d
first release with
nightly linux32
505bafeafb66 / 60.0a1 / 20180227220155 / files
nightly linux64
505bafeafb66 / 60.0a1 / 20180227220155 / files
nightly mac
505bafeafb66 / 60.0a1 / 20180227220155 / files
nightly win32
505bafeafb66 / 60.0a1 / 20180227220155 / files
nightly win64
505bafeafb66 / 60.0a1 / 20180227220155 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 855eb2e4c43d (bug 1434666) for bricking installation on Ubuntu 14.04 (bug 1441449). a=backout CLOSED TREE
toolkit/xre/nsUpdateDriver.cpp
--- a/toolkit/xre/nsUpdateDriver.cpp
+++ b/toolkit/xre/nsUpdateDriver.cpp
@@ -377,28 +377,21 @@ CopyUpdaterIntoUpdateDir(nsIFile *greDir
 static void
 AppendToLibPath(const char *pathToAppend)
 {
   char *pathValue = getenv(LD_LIBRARY_PATH_ENVVAR_NAME);
   if (nullptr == pathValue || '\0' == *pathValue) {
     // Leak the string because that is required by PR_SetEnv.
     char *s = Smprintf("%s=%s", LD_LIBRARY_PATH_ENVVAR_NAME, pathToAppend).release();
     PR_SetEnv(s);
-  } else {
-    // Check if pathToAppend is present in pathValue, properly delimited.
-    // For example, if pathValue = "/A/B/C/D" and pathToAppend = "/A/B/C"
-    // then check if ":/A/B/C/D:" contains ":/A/B/C:" (answer: no).
-    char *pathValue_sep = Smprintf(PATH_SEPARATOR "%s" PATH_SEPARATOR, pathValue).get();
-    char *pathToAppend_sep = Smprintf(PATH_SEPARATOR "%s" PATH_SEPARATOR, pathToAppend).get();
-    if (!strstr(pathValue_sep, pathToAppend_sep)) {
-      // Leak the string because that is required by PR_SetEnv.
-      char *s = Smprintf("%s=%s" PATH_SEPARATOR "%s",
-                         LD_LIBRARY_PATH_ENVVAR_NAME, pathToAppend, pathValue).release();
-      PR_SetEnv(s);
-    }
+  } else if (!strstr(pathValue, pathToAppend)) {
+    // Leak the string because that is required by PR_SetEnv.
+    char *s = Smprintf("%s=%s" PATH_SEPARATOR "%s",
+                       LD_LIBRARY_PATH_ENVVAR_NAME, pathToAppend, pathValue).release();
+    PR_SetEnv(s);
   }
 }
 #endif
 
 /**
  * Applies, switches, or stages an update.
  *
  * @param greDir       the GRE directory