Closed Bug 139292 Opened 24 years ago Closed 24 years ago

NSS_NoDB_Init behavior change in NSS 3.4

Categories

(NSS :: Libraries, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: julien.pierre, Assigned: rrelyea)

Details

Attachments

(1 file, 1 obsolete file)

This function takes a pathname (configdir) as an argument. In NSS 3.3, it doesn't appear that the configdir has much relevance. There are obviously no cert or key DBs loaded; but the secmod.db if present is also not loaded. In NSS 3.4, this function looks at the configdir and does load secmod.db . We need to clarify the behavior for this API and decide which one is the correct thing to do.
Changed the QA contact to Bishakha.
QA Contact: sonja.mirtitsch → bishakhabanerjee
Assigned the bug to Bob.
Assignee: wtc → relyea
Priority: -- → P1
Target Milestone: --- → 3.6
The 3.3 behavior is more correct. Applications use NSS_NoDB_Init() so that it can use NSS encryption/hashing primitives without pulling in the whole API. bob
Bob, What is the purpose of the configdir argument in that function if we never use it ? Should the function take no arguments instead ? I realize we can't change the prototype now, but it seems odd that it had this argument that was never used. NSS 3.4 allows the configdir parameter to be NULL, and then everything behaves like in 3.3 . The NSS 3.4 behavior seems logical, except that it isn't backwards-compatible with 3.3 .
Julien, I believe that at the time that the NSS_NoDB_Init funciton was created, the only other NSS init functions were NSS_Init and NSS_InitReadWrite, both of which took a directory name argument. The other forms of NSS_Init had not yet been invented. It was deemed desirable for all 3 forms of NSS_Init to have identical signatures, so that one could create a pointer to an NSS init function that could point to any of them. That is why NSS_NoDB_Init takes a directory argument that it originally did not use. I agree with bob that NoDB_Init should not open/create/modify secmod.db any more than it opens/creates/modifies the cert and key dbs.
Better to change SECMOD_DB to "". The existing patch would still open secmod.db if it happened to be in the current directory. (or "/", I'm I'd have to look at the code). bob
Attached patch new patch — — Splinter Review
Bob, I think both secmod and configdir should be "" . We don't want configdir passed down to anywhere to make sure it never gets used, just like in 3.3 in before. And we also don't want secmod.db to be opened in the current directory.
Attachment #87152 - Attachment is obsolete: true
Is this simple patch OK ?
Wan-Teh, Bob, should I check this one in for 3.6 ?
Comment on attachment 87166 [details] [diff] [review] new patch r=wtc. Please check it in.
Attachment #87166 - Flags: review+
Checking in nssinit.c; /cvsroot/mozilla/security/nss/lib/nss/nssinit.c,v <-- nssinit.c new revision: 1.54; previous revision: 1.53 done
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: