~ubuntu-branches/ubuntu/raring/nss/raring-security

« back to all changes in this revision

Viewing changes to debian/patches/85_security_load.patch

  • Committer: Bazaar Package Importer
  • Author(s): Chris Coulson
  • Date: 2010-03-25 13:46:06 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20100325134606-bl6liuok2w9l7snv
Tags: 3.12.6-0ubuntu1
* New upstream release 3.12.6 RTM (NSS_3_12_6_RTM)
  - fixes CVE-2009-3555 aka US-CERT VU#120541
* Adjust patches to changed upstream code base
  - update debian/patches/38_kbsd.patch
  - update debian/patches/38_mips64_build.patch
  - update debian/patches/85_security_load.patch
* Remove patches that are merged upstream
  - delete debian/patches/91_nonexec_stack.patch
  - update debian/patches/series
* Bump nspr dependency to 4.8
  - update debian/control
* Add new symbols for 3.12.6
  - update debian/libnss3-1d.symbols

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
85_security_load.dpatch 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
 
--- nss/mozilla/security/nss/lib/freebl/genload.c
7
 
+++ nss/mozilla/security/nss/lib/freebl/genload.c
8
 
@@ -113,9 +124,14 @@
 
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-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
 
10
@@ -769,6 +769,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-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
 
23
@@ -393,6 +393,7 @@
 
24
     SECStatus rv;
 
25
     PRBool alreadyLoaded = PR_FALSE;
 
26
     char *disableUnload = NULL;
 
27
+    char * tmp;
 
28
 
 
29
     if (mod->loaded) return SECSuccess;
 
30
 
 
31
@@ -440,6 +441,16 @@
 
32
         * unload the library if anything goes wrong from here on out...
 
33
         */
 
34
        library = PR_LoadLibrary(full_name);
 
35
+       if (library == NULL) {
 
36
+            tmp = rindex(full_name, PR_GetDirectorySeparator());
 
37
+            if (tmp)
 
38
+                tmp++;
 
39
+            else
 
40
+                tmp = full_name;
 
41
+            library = PORT_LoadLibraryFromOrigin(my_shlib_name,
 
42
+                                      (PRFuncPtr) &softoken_LoadDSO,
 
43
+                                      tmp);
 
44
+       }
 
45
        mod->library = (void *)library;
 
46
        PORT_Free(full_name);
 
47
 
 
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
 
52
@@ -104,9 +104,14 @@
9
53
 
10
54
     /* Remove the trailing filename from referencePath and add the new one */
11
55
     c = strrchr(referencePath, PR_GetDirectorySeparator());
22
65
         if (fullName) {
23
66
             memcpy(fullName, referencePath, referencePathSize);
24
67
             strcpy(fullName + referencePathSize, name); 
25
 
@@ -125,7 +141,17 @@
 
68
@@ -116,6 +121,12 @@
26
69
 #endif
27
70
             libSpec.type = PR_LibSpec_Pathname;
28
71
             libSpec.value.pathname = fullName;
32
75
+            }
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
 
81
@@ -123,6 +134,10 @@
 
82
                                           | PR_LD_ALT_SEARCH_PATH 
 
83
 #endif
 
84
                                           );
36
85
+            if (! dlh) {
37
86
+                strcpy(fullName + referencePathSize, name);
38
87
+                dlh = PR_LoadLibraryWithFlags(libSpec, PR_LD_NOW | PR_LD_LOCAL);
40
89
             PORT_Free(fullName);
41
90
         }
42
91
     }
43
 
--- nss/mozilla/security/nss/lib/pk11wrap/pk11load.c
44
 
+++ nss/mozilla/security/nss/lib/pk11wrap/pk11load.c
45
 
@@ -331,6 +331,14 @@
46
 
 #endif
47
 
 
48
 
        if (library == NULL) {
49
 
+           full_name = rindex(mod->dllName, PR_GetDirectorySeparator());
50
 
+           if (full_name)
51
 
+               full_name++;
52
 
+           else
53
 
+               full_name = mod->dllName;
54
 
+           library = loader_LoadLibrary(full_name);
55
 
+       }
56
 
+       if (library == NULL) {
57
 
            return SECFailure;
58
 
        }
59
 
 
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);
68
 
+    if (!lib)
69
 
+        lib = PR_LoadLibrary("/usr/lib/nss/libsoftokn3.so");
70
 
     assert(lib != NULL);
71
 
     PR_FreeLibraryName(libname);
72
 
 
73