libnm-util: don't ever deinit crypto methods (bgo #646300)

Because we can't ever know if we're the last user of NSS or gnutls
when nm_utils_deinit() is called, just don't bother deiniting
the crypto providers.  And atexit handlers are generally frowned
upon for the exact same reason.  You never know what library linked
into your process might be also using NSS or gnutls, so basically
if these libraries suck enough to use global data and not reference
count it, just let the data leak.  If we do clean stuff up that
can lead to crashes when other libraries might try to use NSS or
gnutls after the atexit handler or nm_utils_deinit() has been run.

See also:  https://bugzilla.mozilla.org/show_bug.cgi?id=54189#c1
This commit is contained in:
Dan Williams 2011-03-31 13:29:19 -05:00
parent d291feeb0f
commit 5b0ef4c201
3 changed files with 2 additions and 9 deletions

View file

@ -58,8 +58,6 @@ crypto_init (GError **error)
void
crypto_deinit (void)
{
if (initialized)
gnutls_global_deinit();
}
gboolean

View file

@ -74,10 +74,6 @@ crypto_init (GError **error)
void
crypto_deinit (void)
{
if (initialized) {
NSS_Shutdown ();
PR_Cleanup ();
}
}
gboolean

View file

@ -234,13 +234,12 @@ gboolean
nm_utils_init (GError **error)
{
if (!initialized) {
initialized = TRUE;
if (!crypto_init (error))
return FALSE;
_nm_utils_register_value_transformations ();
atexit (nm_utils_deinit);
initialized = TRUE;
}
return TRUE;
}