Closed Bug 179156 Opened 24 years ago Closed 23 years ago

database consistency check / fix

Categories

(NSS :: Libraries, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 157934

People

(Reporter: julien.pierre, Assigned: wtc)

Details

With the new cert8 database format in NSS 3.7, there are two new types of issues that can develop over time : 1) the user can (accidentally or intentionally) delete files under cert8.dir . At that point, cert8.db will have entries that point to nothing. There needs to be a way to fix those entries . 2) it's possible for files to be added to cert8.dir that no longer have indices . This can happen easily for example if a user restores multiple generation of backups. The filenames under cert8.dir are not intuitive, so there is no way for the user to tell which ones are no longer needed. We need to have ways to detect , or better, fix these problems. The first one will manifest itself in various strange ways to the users. The second one will just waste disk space. I suggest that there should be some APIs to do the checks and fixes. The fix would be radical - remove all the entries for cert8.db that don't have data files, and remove all the files that don't have an index. The check function would return PR_TRUE if there is no consistency problem, and otherwise return a list of invalid DB entries and extraneous files. I can't see how a real-world application would use the data returned though, it probably would just care for the boolean return value, and prompt the user to call the fix function or not.
Another type of database corruption that we have encountered with cert7 and that can be fixed programmatically is the case of user certs with missing user trust bits. See bug 182607 . When we implement the API to do the check & fix of the database, this type of fix should also be performed.
Julien, I believe there is an existing bug for this function.
The bug in comment #1 was in fact a dupe of 157934 . Consolidating all corruption issues under that bug. *** This bug has been marked as a duplicate of 157934 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.