1
85_security_load.dpatch by Mike Hommey <glandium@debian.org>
3
All lines beginning with `## DP:' are a description of the patch.
4
DP: Load modules from $ORIGIN/nss.
6
--- nss/mozilla/security/nss/lib/freebl/genload.c
7
+++ nss/mozilla/security/nss/lib/freebl/genload.c
1
## 85_security_load.patch by Mike Hommey <glandium@debian.org>
3
## All lines beginning with `## DP:' are a description of the patch.
4
## DP: Load modules from $ORIGIN/nss.
6
Index: nss-3.12.6/mozilla/security/nss/cmd/shlibsign/shlibsign.c
7
===================================================================
8
--- nss-3.12.6.orig/mozilla/security/nss/cmd/shlibsign/shlibsign.c 2008-11-20 15:44:12.000000000 +0000
9
+++ nss-3.12.6/mozilla/security/nss/cmd/shlibsign/shlibsign.c 2010-03-29 12:06:03.560531797 +0100
11
libname = PR_GetLibraryName(NULL, "softokn3");
12
assert(libname != NULL);
13
lib = PR_LoadLibrary(libname);
15
+ lib = PR_LoadLibrary("/usr/lib/nss/libsoftokn3.so");
17
PR_FreeLibraryName(libname);
19
Index: nss-3.12.6/mozilla/security/nss/lib/pk11wrap/pk11load.c
20
===================================================================
21
--- nss-3.12.6.orig/mozilla/security/nss/lib/pk11wrap/pk11load.c 2009-10-30 09:44:45.000000000 +0000
22
+++ nss-3.12.6/mozilla/security/nss/lib/pk11wrap/pk11load.c 2010-03-29 12:14:42.600534017 +0100
25
PRBool alreadyLoaded = PR_FALSE;
26
char *disableUnload = NULL;
29
if (mod->loaded) return SECSuccess;
32
* unload the library if anything goes wrong from here on out...
34
library = PR_LoadLibrary(full_name);
35
+ if (library == NULL) {
36
+ tmp = rindex(full_name, PR_GetDirectorySeparator());
41
+ library = PORT_LoadLibraryFromOrigin(my_shlib_name,
42
+ (PRFuncPtr) &softoken_LoadDSO,
45
mod->library = (void *)library;
48
Index: nss-3.12.6/mozilla/security/nss/lib/util/secload.c
49
===================================================================
50
--- nss-3.12.6.orig/mozilla/security/nss/lib/util/secload.c 2009-10-30 09:44:47.000000000 +0000
51
+++ nss-3.12.6/mozilla/security/nss/lib/util/secload.c 2010-03-29 12:06:03.560531797 +0100
10
54
/* Remove the trailing filename from referencePath and add the new one */
11
55
c = strrchr(referencePath, PR_GetDirectorySeparator());
23
66
memcpy(fullName, referencePath, referencePathSize);
24
67
strcpy(fullName + referencePathSize, name);
27
70
libSpec.type = PR_LibSpec_Pathname;
28
71
libSpec.value.pathname = fullName;
33
76
+ strcpy(fullName + referencePathSize, "nss/");
34
77
+ strcpy(fullName + referencePathSize + 4, name);
35
dlh = PR_LoadLibraryWithFlags(libSpec, PR_LD_NOW | PR_LD_LOCAL);
78
dlh = PR_LoadLibraryWithFlags(libSpec, PR_LD_NOW | PR_LD_LOCAL
79
#ifdef PR_LD_ALT_SEARCH_PATH
80
/* allow library's dependencies to be found in the same directory
82
| PR_LD_ALT_SEARCH_PATH
37
86
+ strcpy(fullName + referencePathSize, name);
38
87
+ dlh = PR_LoadLibraryWithFlags(libSpec, PR_LD_NOW | PR_LD_LOCAL);
40
89
PORT_Free(fullName);
43
--- nss/mozilla/security/nss/lib/pk11wrap/pk11load.c
44
+++ nss/mozilla/security/nss/lib/pk11wrap/pk11load.c
48
if (library == NULL) {
49
+ full_name = rindex(mod->dllName, PR_GetDirectorySeparator());
53
+ full_name = mod->dllName;
54
+ library = loader_LoadLibrary(full_name);
56
+ if (library == NULL) {
60
diff --git a/mozilla/security/nss/cmd/shlibsign/shlibsign.c b/mozilla/security/nss/cmd/shlibsign/shlibsign.c
61
index 6e93225..501e70b 100644
62
--- a/mozilla/security/nss/cmd/shlibsign/shlibsign.c
63
+++ b/mozilla/security/nss/cmd/shlibsign/shlibsign.c
64
@@ -769,6 +769,8 @@ int main(int argc, char **argv)
65
libname = PR_GetLibraryName(NULL, "softokn3");
66
assert(libname != NULL);
67
lib = PR_LoadLibrary(libname);
69
+ lib = PR_LoadLibrary("/usr/lib/nss/libsoftokn3.so");
71
PR_FreeLibraryName(libname);