mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 04:30:28 +00:00
Merged revisions 68028 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r68028 | oej | 2007-06-07 11:55:13 +0200 (Thu, 07 Jun 2007) | 4 lines Ok, we found out that this is not about if you have any *active* clients using TLS, but if you have initialized TLS at all during the lifetime of the module. So if you reload to disable TLS, it won't help. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@68031 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -169,11 +169,11 @@ static char *ajistatus_descrip =
|
|||||||
" If not in roster variable will = 7\n";
|
" If not in roster variable will = 7\n";
|
||||||
|
|
||||||
struct aji_client_container clients;
|
struct aji_client_container clients;
|
||||||
|
|
||||||
struct aji_capabilities *capabilities = NULL;
|
struct aji_capabilities *capabilities = NULL;
|
||||||
|
|
||||||
/*! \brief Global flags, initialized to default values */
|
/*! \brief Global flags, initialized to default values */
|
||||||
static struct ast_flags globalflags = { AJI_AUTOPRUNE | AJI_AUTOREGISTER };
|
static struct ast_flags globalflags = { AJI_AUTOPRUNE | AJI_AUTOREGISTER };
|
||||||
|
static int tls_initialized = FALSE;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Deletes the aji_client data structure.
|
* \brief Deletes the aji_client data structure.
|
||||||
@@ -505,10 +505,11 @@ static int aji_act_hook(void *data, int type, iks *node)
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case IKS_NODE_START:
|
case IKS_NODE_START:
|
||||||
if (client->usetls && !iks_is_secure(client->p)) {
|
if (client->usetls && !iks_is_secure(client->p)) {
|
||||||
if (iks_has_tls())
|
if (iks_has_tls()) {
|
||||||
iks_start_tls(client->p);
|
iks_start_tls(client->p);
|
||||||
else
|
tls_initialized = TRUE;
|
||||||
ast_log(LOG_ERROR, "gnuTLS not installed.\n");
|
} else
|
||||||
|
ast_log(LOG_ERROR, "gnuTLS not installed. You need to recompile the Iksemel library with gnuTLS support\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!client->usesasl) {
|
if (!client->usesasl) {
|
||||||
@@ -2396,20 +2397,13 @@ static int aji_reload()
|
|||||||
|
|
||||||
static int unload_module(void)
|
static int unload_module(void)
|
||||||
{
|
{
|
||||||
int module_uses_tls = FALSE;
|
|
||||||
|
|
||||||
/* Check if any client use TLS. If that's the case, we can't unload this
|
/* Check if TLS is initialized. If that's the case, we can't unload this
|
||||||
module due to a bug in the iksemel library that will cause a crash or
|
module due to a bug in the iksemel library that will cause a crash or
|
||||||
a deadlock. We're trying to find a way to handle this, but in the meantime
|
a deadlock. We're trying to find a way to handle this, but in the meantime
|
||||||
we will simply refuse to die...
|
we will simply refuse to die...
|
||||||
*/
|
*/
|
||||||
ASTOBJ_CONTAINER_TRAVERSE(&clients, 1, {
|
if (tls_initialized) {
|
||||||
ASTOBJ_RDLOCK(iterator);
|
|
||||||
if (iterator->usetls)
|
|
||||||
module_uses_tls = TRUE;
|
|
||||||
ASTOBJ_UNLOCK(iterator);
|
|
||||||
});
|
|
||||||
if (module_uses_tls) {
|
|
||||||
ast_log(LOG_ERROR, "Module can't be unloaded due to a bug in the Iksemel library when using TLS.\n");
|
ast_log(LOG_ERROR, "Module can't be unloaded due to a bug in the Iksemel library when using TLS.\n");
|
||||||
return 1; /* You need a forced unload to get rid of this module */
|
return 1; /* You need a forced unload to get rid of this module */
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user