<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/9717">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Kevin Harwell: Looks good to me, but someone else must approve
Richard Mudgett: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">loader: Process dependencies for built-in modules.<br><br>With the new module loader it was missed that built-in modules never<br>parsed dependencies from mod->info into vectors of mod. This caused<br>manager to be initialized before acl (named_acl). If manager.conf<br>used any named ACL's they would not be found and result in no ACL being<br>applied to the AMI user.<br><br>In addition to the manager ACL fix this adds "extconfig" to all builtin<br>modules which support realtime configuration. This only matters if one<br>of the builtin modules is configured with 'preload', depending on<br>"extconfig" will cause config.c to automatically be initialize during<br>the preload stage.<br><br>Change-Id: I482ed6bca6c1064b05bb538d7861cd7a4f02d9fc<br>---<br>M main/cdr.c<br>M main/cel.c<br>M main/dnsmgr.c<br>M main/dsp.c<br>M main/enum.c<br>M main/features.c<br>M main/http.c<br>M main/indications.c<br>M main/loader.c<br>M main/logger.c<br>M main/manager.c<br>M main/named_acl.c<br>M main/plc.c<br>M main/sounds.c<br>M main/udptl.c<br>15 files changed, 32 insertions(+), 6 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/cdr.c b/main/cdr.c</span><br><span>index 62fcdf5..1c47e24 100644</span><br><span>--- a/main/cdr.c</span><br><span>+++ b/main/cdr.c</span><br><span>@@ -4628,4 +4628,5 @@</span><br><span> .unload = unload_module,</span><br><span> .reload = reload_module,</span><br><span> .load_pri = AST_MODPRI_CORE,</span><br><span style="color: hsl(120, 100%, 40%);">+ .requires = "extconfig",</span><br><span> );</span><br><span>diff --git a/main/cel.c b/main/cel.c</span><br><span>index 91c625a..0ec728e 100644</span><br><span>--- a/main/cel.c</span><br><span>+++ b/main/cel.c</span><br><span>@@ -1753,4 +1753,5 @@</span><br><span> .unload = unload_module,</span><br><span> .reload = reload_module,</span><br><span> .load_pri = AST_MODPRI_CORE,</span><br><span style="color: hsl(120, 100%, 40%);">+ .requires = "extconfig",</span><br><span> );</span><br><span>diff --git a/main/dnsmgr.c b/main/dnsmgr.c</span><br><span>index c25b601..db13b1d 100644</span><br><span>--- a/main/dnsmgr.c</span><br><span>+++ b/main/dnsmgr.c</span><br><span>@@ -523,4 +523,5 @@</span><br><span> .unload = unload_module,</span><br><span> .reload = reload_module,</span><br><span> .load_pri = AST_MODPRI_CORE,</span><br><span style="color: hsl(120, 100%, 40%);">+ .requires = "extconfig",</span><br><span> );</span><br><span>diff --git a/main/dsp.c b/main/dsp.c</span><br><span>index ea653d8..433e61a 100644</span><br><span>--- a/main/dsp.c</span><br><span>+++ b/main/dsp.c</span><br><span>@@ -2425,4 +2425,5 @@</span><br><span> .unload = unload_module,</span><br><span> .reload = reload_module,</span><br><span> .load_pri = AST_MODPRI_CORE,</span><br><span style="color: hsl(120, 100%, 40%);">+ .requires = "extconfig",</span><br><span> );</span><br><span>diff --git a/main/enum.c b/main/enum.c</span><br><span>index 8b6d3fe..344ae40 100644</span><br><span>--- a/main/enum.c</span><br><span>+++ b/main/enum.c</span><br><span>@@ -1023,4 +1023,5 @@</span><br><span> .unload = unload_module,</span><br><span> .reload = reload_module,</span><br><span> .load_pri = AST_MODPRI_CORE,</span><br><span style="color: hsl(120, 100%, 40%);">+ .requires = "extconfig",</span><br><span> );</span><br><span>diff --git a/main/features.c b/main/features.c</span><br><span>index 3db6d39..8c2d9bc 100644</span><br><span>--- a/main/features.c</span><br><span>+++ b/main/features.c</span><br><span>@@ -1174,4 +1174,5 @@</span><br><span> .unload = unload_module,</span><br><span> .reload = reload_features_config,</span><br><span> .load_pri = AST_MODPRI_CORE,</span><br><span style="color: hsl(120, 100%, 40%);">+ .requires = "extconfig",</span><br><span> );</span><br><span>diff --git a/main/http.c b/main/http.c</span><br><span>index 55d1029..d7ec60a 100644</span><br><span>--- a/main/http.c</span><br><span>+++ b/main/http.c</span><br><span>@@ -2314,4 +2314,5 @@</span><br><span> .unload = unload_module,</span><br><span> .reload = reload_module,</span><br><span> .load_pri = AST_MODPRI_CORE,</span><br><span style="color: hsl(120, 100%, 40%);">+ .requires = "extconfig",</span><br><span> );</span><br><span>diff --git a/main/indications.c b/main/indications.c</span><br><span>index c9f0241..6a7414d 100644</span><br><span>--- a/main/indications.c</span><br><span>+++ b/main/indications.c</span><br><span>@@ -1158,4 +1158,5 @@</span><br><span> .unload = unload_module,</span><br><span> .reload = reload_module,</span><br><span> .load_pri = AST_MODPRI_CORE,</span><br><span style="color: hsl(120, 100%, 40%);">+ .requires = "extconfig",</span><br><span> );</span><br><span>diff --git a/main/loader.c b/main/loader.c</span><br><span>index d6837f8..eb345b5 100644</span><br><span>--- a/main/loader.c</span><br><span>+++ b/main/loader.c</span><br><span>@@ -569,6 +569,18 @@</span><br><span> *((struct ast_module **) &(info->self)) = mod;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+static int module_post_register(struct ast_module *mod)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ int res;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Split lists from mod->info. */</span><br><span style="color: hsl(120, 100%, 40%);">+ res = ast_vector_string_split(&mod->requires, mod->info->requires, ",", 0, strcasecmp);</span><br><span style="color: hsl(120, 100%, 40%);">+ res |= ast_vector_string_split(&mod->optional_modules, mod->info->optional_modules, ",", 0, strcasecmp);</span><br><span style="color: hsl(120, 100%, 40%);">+ res |= ast_vector_string_split(&mod->enhances, mod->info->enhances, ",", 0, strcasecmp);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ return res;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> static void module_destroy(struct ast_module *mod)</span><br><span> {</span><br><span> AST_VECTOR_CALLBACK_VOID(&mod->requires, ast_free);</span><br><span>@@ -1526,11 +1538,7 @@</span><br><span> return required ? AST_MODULE_LOAD_FAILURE : AST_MODULE_LOAD_DECLINE;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- /* Split lists from mod->info. */</span><br><span style="color: hsl(0, 100%, 40%);">- res = ast_vector_string_split(&mod->requires, mod->info->requires, ",", 0, strcasecmp);</span><br><span style="color: hsl(0, 100%, 40%);">- res |= ast_vector_string_split(&mod->optional_modules, mod->info->optional_modules, ",", 0, strcasecmp);</span><br><span style="color: hsl(0, 100%, 40%);">- res |= ast_vector_string_split(&mod->enhances, mod->info->enhances, ",", 0, strcasecmp);</span><br><span style="color: hsl(0, 100%, 40%);">- if (res) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (module_post_register(mod)) {</span><br><span> goto prestart_error;</span><br><span> }</span><br><span> }</span><br><span>@@ -1846,6 +1854,11 @@</span><br><span> continue;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ /* Parse dependendencies from mod->info. */</span><br><span style="color: hsl(120, 100%, 40%);">+ if (module_post_register(mod)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ return -1;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /* Built-in modules are not preloaded, most have an early load priority. */</span><br><span> if (!add_to_load_order(mod->resource, load_order, 0, 0, 1)) {</span><br><span> return -1;</span><br><span>diff --git a/main/logger.c b/main/logger.c</span><br><span>index 46d61ed..8b4f678 100644</span><br><span>--- a/main/logger.c</span><br><span>+++ b/main/logger.c</span><br><span>@@ -2381,6 +2381,7 @@</span><br><span> .support_level = AST_MODULE_SUPPORT_CORE,</span><br><span> .load = load_module,</span><br><span> .unload = unload_module,</span><br><span style="color: hsl(120, 100%, 40%);">+ /* This reload does not support realtime so it does not require "extconfig". */</span><br><span> .reload = reload_module,</span><br><span> .load_pri = 0,</span><br><span> );</span><br><span>diff --git a/main/manager.c b/main/manager.c</span><br><span>index ab42432..a0dcf6c 100644</span><br><span>--- a/main/manager.c</span><br><span>+++ b/main/manager.c</span><br><span>@@ -9600,5 +9600,5 @@</span><br><span> .unload = unload_module,</span><br><span> .reload = reload_module,</span><br><span> .load_pri = AST_MODPRI_CORE,</span><br><span style="color: hsl(0, 100%, 40%);">- .requires = "http",</span><br><span style="color: hsl(120, 100%, 40%);">+ .requires = "extconfig,acl,http",</span><br><span> );</span><br><span>diff --git a/main/named_acl.c b/main/named_acl.c</span><br><span>index c462821..8cf09c2 100644</span><br><span>--- a/main/named_acl.c</span><br><span>+++ b/main/named_acl.c</span><br><span>@@ -591,4 +591,5 @@</span><br><span> .unload = unload_module,</span><br><span> .reload = reload_module,</span><br><span> .load_pri = AST_MODPRI_CORE,</span><br><span style="color: hsl(120, 100%, 40%);">+ .requires = "extconfig",</span><br><span> );</span><br><span>diff --git a/main/plc.c b/main/plc.c</span><br><span>index 369d285..20d5122 100644</span><br><span>--- a/main/plc.c</span><br><span>+++ b/main/plc.c</span><br><span>@@ -296,4 +296,5 @@</span><br><span> .unload = unload_module,</span><br><span> .reload = reload_module,</span><br><span> .load_pri = AST_MODPRI_CORE,</span><br><span style="color: hsl(120, 100%, 40%);">+ .requires = "extconfig",</span><br><span> );</span><br><span>diff --git a/main/sounds.c b/main/sounds.c</span><br><span>index 745b628..e0cb33a 100644</span><br><span>--- a/main/sounds.c</span><br><span>+++ b/main/sounds.c</span><br><span>@@ -340,6 +340,7 @@</span><br><span> .support_level = AST_MODULE_SUPPORT_CORE,</span><br><span> .load = load_module,</span><br><span> .unload = unload_module,</span><br><span style="color: hsl(120, 100%, 40%);">+ /* This reload doesn't use config so this module doesn't require "extconfig". */</span><br><span> .reload = reload_module,</span><br><span> /* Load after the format modules to reduce processing during startup. */</span><br><span> .load_pri = AST_MODPRI_APP_DEPEND + 1,</span><br><span>diff --git a/main/udptl.c b/main/udptl.c</span><br><span>index f6cd3b9..7349d6a 100644</span><br><span>--- a/main/udptl.c</span><br><span>+++ b/main/udptl.c</span><br><span>@@ -1420,4 +1420,5 @@</span><br><span> .unload = unload_module,</span><br><span> .reload = reload_module,</span><br><span> .load_pri = AST_MODPRI_CORE,</span><br><span style="color: hsl(120, 100%, 40%);">+ .requires = "extconfig",</span><br><span> );</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/9717">change 9717</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/9717"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I482ed6bca6c1064b05bb538d7861cd7a4f02d9fc </div>
<div style="display:none"> Gerrit-Change-Number: 9717 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>