]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blame - nss/patches/nss-sysinit-userdb-first.patch
Move all packages to root.
[people/amarx/ipfire-3.x.git] / nss / patches / nss-sysinit-userdb-first.patch
CommitLineData
137c9981
MT
1diff -up ./mozilla/security/nss/lib/sysinit/nsssysinit.c.orig ./mozilla/security/nss/lib/sysinit/nsssysinit.c
2--- ./mozilla/security/nss/lib/sysinit/nsssysinit.c.orig 2010-06-17 09:17:30.732643399 -0700
3+++ ./mozilla/security/nss/lib/sysinit/nsssysinit.c 2010-06-17 09:20:22.691642397 -0700
4@@ -263,9 +263,18 @@ get_list(char *filename, char *stripped_
5 sysdb = getSystemDB();
6 userdb = getUserDB();
7
8- /* Don't open root's user DB */
9+ /* return a list of databases to open. First the system database. */
10+ if (sysdb) {
11+ const char *readonly = userCanModifySystemDB() ? "" : "flags=readonly";
12+ module_list[next++] = PR_smprintf(
13+ "library= "
14+ "module=\"NSS system database\" "
15+ "parameters=\"configdir='sql:%s' tokenDescription='NSS system database' %s\" "
16+ "NSS=\"%sflags=internal,critical\"",sysdb, readonly, nssflags);
17+ }
18+
19+ /* Next the user database, but not for root. */
20 if (userdb != NULL && !userIsRoot()) {
21- /* return a list of databases to open. First the user Database */
22 module_list[next++] = PR_smprintf(
23 "library= "
24 "module=\"NSS User database\" "
25@@ -284,40 +293,6 @@ get_list(char *filename, char *stripped_
26 userdb, stripped_parameters);
27 }
28
29-#if 0
30- /* This doesn't actually work. If we register
31- both this and the sysdb (in either order)
32- then only one of them actually shows up */
33-
34- /* Using a NULL filename as a Boolean flag to
35- * prevent registering both an application-defined
36- * db and the system db. rhbz #546211.
37- */
38- PORT_Assert(filename);
39- if (sysdb && PL_CompareStrings(filename, sysdb))
40- filename = NULL;
41- else if (userdb && PL_CompareStrings(filename, userdb))
42- filename = NULL;
43-
44- if (filename && !userIsRoot()) {
45- module_list[next++] = PR_smprintf(
46- "library= "
47- "module=\"NSS database\" "
48- "parameters=\"configdir='sql:%s' tokenDescription='NSS database sql:%s'\" "
49- "NSS=\"%sflags=internal\"",filename, filename, nssflags);
50- }
51-#endif
52-
53- /* now the system database (always read only unless it's root) */
54- if (sysdb) {
55- const char *readonly = userCanModifySystemDB() ? "" : "flags=readonly";
56- module_list[next++] = PR_smprintf(
57- "library= "
58- "module=\"NSS system database\" "
59- "parameters=\"configdir='sql:%s' tokenDescription='NSS system database' %s\" "
60- "NSS=\"%sflags=internal,critical\"",sysdb, readonly, nssflags);
61- }
62-
63 /* that was the last module */
64 module_list[next] = 0;
65