nss: patch http location moved, let's keep it in filesystem

+82 -7
+80
pkgs/development/libraries/nss/85_security_load.patch
···
··· 1 + ## 85_security_load.patch by Mike Hommey <glandium@debian.org> 2 + ## 3 + ## All lines beginning with `## DP:' are a description of the patch. 4 + ## DP: Load modules from $ORIGIN/nss. 5 + 6 + Index: nss/nss/cmd/shlibsign/shlibsign.c 7 + =================================================================== 8 + --- nss.orig/nss/cmd/shlibsign/shlibsign.c 2013-08-05 14:40:31.041657554 +0900 9 + +++ nss/nss/cmd/shlibsign/shlibsign.c 2013-08-05 14:40:31.033657739 +0900 10 + @@ -851,6 +851,8 @@ 11 + libname = PR_GetLibraryName(NULL, "softokn3"); 12 + assert(libname != NULL); 13 + lib = PR_LoadLibrary(libname); 14 + + if (!lib) 15 + + lib = PR_LoadLibrary("/usr/lib/nss/libsoftokn3.so"); 16 + assert(lib != NULL); 17 + PR_FreeLibraryName(libname); 18 + 19 + Index: nss/nss/lib/pk11wrap/pk11load.c 20 + =================================================================== 21 + --- nss.orig/nss/lib/pk11wrap/pk11load.c 2013-08-05 14:40:31.041657554 +0900 22 + +++ nss/nss/lib/pk11wrap/pk11load.c 2013-08-05 14:40:31.033657739 +0900 23 + @@ -406,6 +406,13 @@ 24 + * unload the library if anything goes wrong from here on out... 25 + */ 26 + library = PR_LoadLibrary(mod->dllName); 27 + + if ((library == NULL) && 28 + + !rindex(mod->dllName, PR_GetDirectorySeparator())) { 29 + + library = PORT_LoadLibraryFromOrigin(my_shlib_name, 30 + + (PRFuncPtr) &softoken_LoadDSO, 31 + + mod->dllName); 32 + + } 33 + + 34 + mod->library = (void *)library; 35 + 36 + if (library == NULL) { 37 + Index: nss/nss/lib/util/secload.c 38 + =================================================================== 39 + --- nss.orig/nss/lib/util/secload.c 2013-08-05 14:40:31.041657554 +0900 40 + +++ nss/nss/lib/util/secload.c 2013-08-05 14:40:31.033657739 +0900 41 + @@ -69,9 +69,14 @@ 42 + 43 + /* Remove the trailing filename from referencePath and add the new one */ 44 + c = strrchr(referencePath, PR_GetDirectorySeparator()); 45 + + if (!c) { /* referencePath doesn't contain a / means that dladdr gave us argv[0] 46 + + * and program was called from $PATH. Hack to get libs from /usr/lib */ 47 + + referencePath = "/usr/lib/"; 48 + + c = &referencePath[8]; /* last / */ 49 + + } 50 + if (c) { 51 + size_t referencePathSize = 1 + c - referencePath; 52 + - fullName = (char*) PORT_Alloc(strlen(name) + referencePathSize + 1); 53 + + fullName = (char*) PORT_Alloc(strlen(name) + referencePathSize + 5); 54 + if (fullName) { 55 + memcpy(fullName, referencePath, referencePathSize); 56 + strcpy(fullName + referencePathSize, name); 57 + @@ -81,6 +86,12 @@ 58 + #endif 59 + libSpec.type = PR_LibSpec_Pathname; 60 + libSpec.value.pathname = fullName; 61 + + if ((referencePathSize >= 4) && 62 + + (strncmp(fullName + referencePathSize - 4, "bin", 3) == 0)) { 63 + + memcpy(fullName + referencePathSize -4, "lib", 3); 64 + + } 65 + + strcpy(fullName + referencePathSize, "nss/"); 66 + + strcpy(fullName + referencePathSize + 4, name); 67 + dlh = PR_LoadLibraryWithFlags(libSpec, PR_LD_NOW | PR_LD_LOCAL 68 + #ifdef PR_LD_ALT_SEARCH_PATH 69 + /* allow library's dependencies to be found in the same directory 70 + @@ -88,6 +99,10 @@ 71 + | PR_LD_ALT_SEARCH_PATH 72 + #endif 73 + ); 74 + + if (! dlh) { 75 + + strcpy(fullName + referencePathSize, name); 76 + + dlh = PR_LoadLibraryWithFlags(libSpec, PR_LD_NOW | PR_LD_LOCAL); 77 + + } 78 + PORT_Free(fullName); 79 + } 80 + }
+2 -7
pkgs/development/libraries/nss/default.nix
··· 9 sha256 = "1k1m8lsgqwxx251943hks1dd13hz1adpqqb0hxwn011by5vmi201"; 10 }; 11 12 - secLoadPatch = fetchurl { 13 - name = "security_load.patch"; 14 - urls = http://patch-tracker.debian.org/patch/series/dl/nss/2:3.15.3.1-1/85_security_load.patch; 15 - sha256 = "041c6v4cxwsy14qr5m9qs0gkv3w24g632cwpz27kacxpa886r1ds"; 16 - }; 17 - 18 in stdenv.mkDerivation rec { 19 name = "nss-${version}"; 20 version = "3.15.3.1"; ··· 32 33 patches = 34 [ ./nss-3.15-gentoo-fixups.patch 35 - secLoadPatch 36 ./nix_secload_fixup.patch 37 ]; 38
··· 9 sha256 = "1k1m8lsgqwxx251943hks1dd13hz1adpqqb0hxwn011by5vmi201"; 10 }; 11 12 in stdenv.mkDerivation rec { 13 name = "nss-${version}"; 14 version = "3.15.3.1"; ··· 26 27 patches = 28 [ ./nss-3.15-gentoo-fixups.patch 29 + # from http://patch-tracker.debian.org/patch/series/dl/nss/2:3.15.4-1/85_security_load.patch 30 + ./85_security_load.patch 31 ./nix_secload_fixup.patch 32 ]; 33