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

NEW
Unassigned

Status

NSS
Tools
--
enhancement
5 years ago
5 years ago

People

(Reporter: kaie, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
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.
(Reporter)

Comment 1

5 years ago
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?

Comment 2

5 years ago
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).

Comment 3

5 years ago
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);

Comment 4

5 years ago
I agree that modutil should not print that WARNING message if
the security databases are SQLite databases.
You need to log in before you can comment on or make changes to this bug.