Closed Bug 133646 Opened 23 years ago Closed 22 years ago

NSS_shutdown failure

Categories

(NSS :: Libraries, defect)

x86
Other
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 133584

People

(Reporter: Neil.Brittliff, Assigned: rrelyea)

Details

In previous releases of NSS it was possible to connect from one directory to 
another simply by performing:

NSS_InitReadWrite("d:\\nss\\store1");

PK11_Logout(PK11_GetInternalKeySlot());
NSS_Shutdown();

NSS_InitReadWrite("d:\\nss\\store2");

NSS still remembers the old store - d:\\nss\\store1 in 3.4.  

All the utility programs e.g. certutil will not show this up since operate on 
the one directory.
Assigned the bug to Bob.

This bug looks like a duplicate of bug 133584.
Assignee: wtc → relyea
Status: UNCONFIRMED → NEW
Ever confirmed: true
Please try replacing
    PK11_Logout(PK11_GetInternalKeySlot());
with
    PK11SlotInfo *slot;

    slot = PK11_GetInternalKeySlot();
    PK11_Logout(slot);
    PK11_FreeSlot(slot);

This is because slots are reference counted.
PK11_GetInternalKeySlot() increments the reference
count of the slot, so you need to call PK11_FreeSlot()
to decrement the reference count when you are done
with the slot reference.

In NSS 3.3.x, the DB is separate from the NSS internal
module and is always closed in NSS_Shutdown.  In NSS
3.4, the DB is part of the NSS internal module, and
won't be closed if there is a leaked slot reference.
I tried that piece of code - unfortunately, it still doesn't seem to work 

    PK11SlotInfo *slot;

    slot = PK11_GetInternalKeySlot();
    PK11_Logout(slot);
    PK11_FreeSlot(slot);

You can't switch to another directory after initialisation which you could in 
in NSS 3.1.1, etc

Changed the QA contact to Bishakha.
QA Contact: sonja.mirtitsch → bishakhabanerjee

*** This bug has been marked as a duplicate of 133584 ***
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.