I'm working on an application which uses Xulrunner to modify an NSS database. I want that application to be flexible and allow to operate on NSS databases anywhere in the system. As of today, PSM is hardcoded to use the NSS database stored in same directory where the other Mozilla profile files live. It's obviously not a good idea to create such a Mozilla profile for each directory where an NSS database might live... I propose to introduce an override mechanism, that allows to specify the desired NSS database directory at Mozilla/Xulrunner startup time. This could be done as a parameter to the application or as an environment variable. Doing it as an environment variable has the advantage that it can be a change locally in the PSM module.
Created attachment 346130 [details] [diff] [review] Patch v1 This patch allows the use of a new environment variable named MOZPSM_NSSDBDIR_OVERRIDE (for: Mozilla PSM, NSS database directory override). Bob, do you agree this is a reasonable approach, or do you have different proposals? Description of today's behavior and the patch: - as of today, we always pass the directory path of the Mozilla profile application as the NSS init path parameter - with the patch, PSM would look for env var MOZPSM_NSSDBDIR_OVERRIDE - if MOZPSM_NSSDBDIR_OVERRIDE is set, it will be used when calling NSS init. (This allows for any special syntax that NSS might allow as part of the init string.) - if env variable is NOT set, will continue to use the current behavior
Comment on attachment 427342 [details] [diff] [review] merged to trunk Kai, if you didn't generate this patch ignoring whitespace, could you indent the original code that is now inside the "else" body?
I've indented as proposed. http://hg.mozilla.org/mozilla-central/rev/77dab2533801
Comment on attachment 427342 [details] [diff] [review] merged to trunk It would help me if this gets included into the stable branches. It shouldn't cause any harm, as the default is "environment variable not set", and when not set, the behavior is unchanged.
Kai, is there a way to pass the NSS database directory to XULRunner using XUL? Is a XULRunner application written entirely in XUL?
Comment on attachment 427342 [details] [diff] [review] merged to trunk a=beltzner for 1.9.2 and 1.9.1, though I'd really rather there be tests for this, too!
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/142ec4e82778 http://hg.mozilla.org/releases/mozilla-1.9.2/rev/f3151d415275 The patch does not affect the default behaviour, it provides an optional external mechanism, so I think a test is not required.
Comment on attachment 346130 [details] [diff] [review] Patch v1 I don't think we need this on the 1.9.0 branch.
Kai, is there anything for QA to verify here? If so, what do you suggest?
(In reply to comment #10) > Kai, is there anything for QA to verify here? If so, what do you suggest? I don't think there is a need for QA. By default, not having the environment variable set, nobody will see a difference. It there were a difference, we would have heard complaints immediately. And I can confirm the new feature works, I use it in this tool: https://fedorahosted.org/nss-gui/