Blame SOURCES/dont-disable-internal-module.patch

66ebb3
diff -up ./nss/cmd/modutil/pk11.c.1056036 ./nss/cmd/modutil/pk11.c
66ebb3
--- ./nss/cmd/modutil/pk11.c.1056036	2014-02-24 15:49:00.802754246 -0800
66ebb3
+++ ./nss/cmd/modutil/pk11.c	2014-02-24 15:49:00.806754285 -0800
66ebb3
@@ -826,6 +826,12 @@ EnableModule(char *moduleName, char *slo
66ebb3
 		    PK11_GetSlotName(slot), "enabled");
66ebb3
 	    }
66ebb3
 	} else {
66ebb3
+	    if (module->internal) {
66ebb3
+		PR_fprintf(PR_STDERR, errStrings[ENABLE_FAILED_ERR],
66ebb3
+		    "disable", PK11_GetSlotName(slot));
66ebb3
+		rv = ENABLE_FAILED_ERR;
66ebb3
+		goto loser;
66ebb3
+	    }
66ebb3
 	    if(! PK11_UserDisableSlot(slot)) {
66ebb3
 		PR_fprintf(PR_STDERR, errStrings[ENABLE_FAILED_ERR],
66ebb3
 		    "disable", PK11_GetSlotName(slot));
66ebb3
diff -up ./nss/doc/modutil.xml.1056036 ./nss/doc/modutil.xml
66ebb3
--- ./nss/doc/modutil.xml.1056036	2014-01-03 11:59:10.000000000 -0800
66ebb3
+++ ./nss/doc/modutil.xml	2014-02-24 15:49:00.806754285 -0800
66ebb3
@@ -86,7 +86,7 @@
66ebb3
 
66ebb3
       <varlistentry>
66ebb3
         <term>-disable modulename</term>
66ebb3
-	  <listitem><para>Disable all slots on the named module. Use the <option>-slot</option> argument to disable a specific slot.</para></listitem>
66ebb3
+	  <listitem><para>Disable all slots on the named module. Use the <option>-slot</option> argument to disable a specific slot.</para><para>The internal NSS PKCS #11 module cannot be disabled.</para></listitem>
66ebb3
       </varlistentry>
66ebb3
 
66ebb3
       <varlistentry>
66ebb3
diff -up ./nss/lib/dev/devtoken.c.1056036 ./nss/lib/dev/devtoken.c
66ebb3
--- ./nss/lib/dev/devtoken.c.1056036	2014-02-24 15:55:16.687529925 -0800
66ebb3
+++ ./nss/lib/dev/devtoken.c	2014-02-24 15:56:15.720143547 -0800
66ebb3
@@ -1438,6 +1438,7 @@ nssToken_IsPresent (
66ebb3
   NSSToken *token
66ebb3
 )
66ebb3
 {
66ebb3
+    if (token == NULL) return PR_FALSE;
66ebb3
     return nssSlot_IsTokenPresent(token->slot);
66ebb3
 }
66ebb3