Open Bug 900086 Opened 11 years ago Updated 6 months ago

modutil shouldn't warn about concurrent access when using sql:

Categories

(NSS :: Tools, enhancement, P5)

3.15
enhancement

Tracking

(Not tracked)

People

(Reporter: KaiE, Unassigned)

Details

When executing modutil with a -dbdir parameter that is prefixed by sql:
then modutil probably shouldn't print its concurrency warning?

Do you agree?

This is printed:

 WARNING: Performing this operation while the browser is running could cause
 corruption of your security databases. If the browser is currently running,
 you should exit browser before continuing this operation.

However, can modutil reliably know the warning isn't necessary? For example, a user might have set the NSS_DEFAULT_DB_TYPE variable to "sql", in which case the warning wouldn't be necessary either.

So, if we agreed to remove the warning in the "sql" access scenario, we'd have to work on complete testing what access database version is being used.
Bob, do you agree with my statement in comment 1?

(In reply to Kai Engert (:kaie) from comment #0)
> When executing modutil with a -dbdir parameter that is prefixed by sql:
> then modutil probably shouldn't print its concurrency warning?
> 
> Do you agree?
Yes, here's my complete comment from the RH bug:

 modutil's warning. This is an upstream issue. We probably should only warn if we are using dbm. I don't consider this a serious or high priority. It actually won't be really easy to fix (the underlying details of the token are usually pretty hidden from the application. Looking at the string is not a reliable way of fixing this, someday NSS may change the default to always be sql).
OK, here's some code that could determine that we aren't using an old database:

   /* dbprefix secmodName and nocertdb are already set the by application */
   /* params is a char *, modulelist is a char **, isOldDB is a PRBool. */
   /* by the end of the block, isOldDB is set to true if it's an old database */

   params=PR_smprintf("configdir=%s certPrefix=%s "
                      "keyPrefix=%s secmod=%s flags=readonly%s",
                       SECU_ConfigDirectory(NULL),dbprefix,dbprefix,
                       secmodName, nocertdb ? ",noCertDB");
                       
   moduleList =NSSUTIL_DoModuleDBFunction(
        SECMOD_MODULE_DB_FUNCTION_FIND, params, NULL);

   isOldDB = PR_FALSE;
   if (moduleList != NULL) {
       NSSUTIL_DoModuleDBFunction(SECMOD_MODULE_DB_FUNCTION_RELEASE,
                                  params, moduleList);
   } else if (PORT_GetError() == SEC_ERROR_LEGACY_DATABASE) {
       isOldDB = PR_TRUE;
   }
   PR_smprintf_free(params);
I agree that modutil should not print that WARNING message if
the security databases are SQLite databases.
Severity: normal → S3
Severity: S3 → N/A
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.