<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://reviewboard.asterisk.org/r/1978/">https://reviewboard.asterisk.org/r/1978/</a>
</td>
</tr>
</table>
<br />
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers, Mark Michelson, Terry Wilson, and Olle E Johansson.</div>
<div>By jrose.</div>
<p style="color: grey;"><i>Updated June 26, 2012, 12:25 p.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The whole concept has changed somewhat in the latest patch.
ACLs can be represented on a consumer by a linked list container which stores both regular ACLs specified with permit/deny as well as named ACLs. If a regular ACL is contained, it will simply be an unnamed ACL node which is the head element of the list. All named ACLs are separate elements.
Rather than building a compound ast_ha based on the order of specification of ACL, Permit, and Deny, Named ACLs are evaluated completely separately from the regular ACL when ast_appply_acl (similar to ast_apply_ha) is used. Each ACL must pass independently in order for the ACL list to return AST_SENSE_ALLOW. If any individual ACL in the list returns AST_SENSE_DENY from ast_apply_ha, ast_apply_acl will return AST_SENSE_DENY.
Some effort has been made to ensure that named ACLs will be easy to modify (add, change rules for, and delete) and have those modifications be spreadable to their consumers, but so far there are no actual methods of manipulation (such as through CLI or AMI) in the code yet since we can't ensure persistent storage of those changes. This may change after realtime is added, but for now the priority it simply to guarantee that making these changes won't require significant reworking of the named ACL subsystem.
Right now, only one consumer demonstrates use of the named ACL subsystem, and that is manager.c
Like before, it reacts very simply to changes. It subscribes to named ACl change events, and when it receives one, it forcibly reloads it's config. It isn't elegant, but since the only way to force those changes right now is to reload the named ACL configuration, there isn't a great deal of need for an elegant solution yet.
When those changes are needed though, I've ensured that We can include specific items to react to changes in our subscriptions and also that the events are able to send specific names of ACLs that have been modified. This means enabling a consumer to make changes to a specific ACL container or even just a specific named ACL will be quite simple and there are unused functions readyf or that purpose.
There is one small issue that I think needs to be addressed though... see below.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This feature is based on oej's deluxepine (or something like that) branch with a similarly named feature. ACLs are defined in acl.conf and can be used by pretty much anything that has ACL options permit/deny (acl='aclname'). acl= works similarly to permit= and deny= in that it simply appends to the working ACL, so they can be combined with other uses of permit/deny/acl.
Also in use in this patch are twilson's new config options.
Since named acls are duplicated when used in another configuration, configurations that use named acls need to be updated if acl.conf is reloaded. This is accomplished with a new event type and the consumption of that event is demonstrated currently only in manager.conf
If this seems like a proper approach to this problem, that will be replicated across other consumers of named acls.
NOTE: This code is very much WIP and not intended for merging.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Various tests for configuring and using named acls were performed, and a task for writing comprehensive testsuite tests is in the queue. Additionally, various means of reloading the configuration have been performed, and so far they pan out aside from a bug with an unchanged acl.conf which is a generic problem against config options accidentally introduced a little while back.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> (updated)</h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>/trunk/CHANGES <span style="color: grey">(369406)</span></li>
<li>/trunk/configs/acl.conf.sample <span style="color: grey">(PRE-CREATION)</span></li>
<li>/trunk/configs/manager.conf.sample <span style="color: grey">(369406)</span></li>
<li>/trunk/include/asterisk/acl.h <span style="color: grey">(369406)</span></li>
<li>/trunk/include/asterisk/event_defs.h <span style="color: grey">(369406)</span></li>
<li>/trunk/main/acl.c <span style="color: grey">(369406)</span></li>
<li>/trunk/main/asterisk.c <span style="color: grey">(369406)</span></li>
<li>/trunk/main/loader.c <span style="color: grey">(369406)</span></li>
<li>/trunk/main/manager.c <span style="color: grey">(369406)</span></li>
<li>/trunk/main/named_acl.c <span style="color: grey">(PRE-CREATION)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/1978/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>