mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 11:58:52 +00:00
acl: implement a centralized ACL output mechanism for HAs and ACLs.
named_acl.c (which is really a named_ha) now uses ast_ha_output. I've also updated main/manager.c to output the actual ACL on "manager show user <username>" if one is set. If this works then we can add similar to other modules as required. Change-Id: I0ec9876a90dddd379c80ec078d48e3ee6991eb0f
This commit is contained in:
@@ -411,8 +411,6 @@ publish_failure:
|
||||
*/
|
||||
static void cli_display_named_acl(int fd, const char *name)
|
||||
{
|
||||
struct ast_ha *ha;
|
||||
int ha_index = 0;
|
||||
int is_realtime = 0;
|
||||
|
||||
RAII_VAR(struct named_acl_config *, cfg, ao2_global_obj_ref(globals), ao2_cleanup);
|
||||
@@ -437,12 +435,7 @@ static void cli_display_named_acl(int fd, const char *name)
|
||||
}
|
||||
|
||||
ast_cli(fd, "\nACL: %s%s\n---------------------------------------------\n", name, is_realtime ? " (realtime)" : "");
|
||||
for (ha = named_acl->ha; ha; ha = ha->next) {
|
||||
char *addr = ast_strdupa(ast_sockaddr_stringify_addr(&ha->addr));
|
||||
char *mask = ast_sockaddr_stringify_addr(&ha->netmask);
|
||||
ast_cli(fd, "%3d: %s - %s/%s\n", ha_index, ha->sense == AST_SENSE_ALLOW ? "allow" : " deny", addr, mask);
|
||||
ha_index++;
|
||||
}
|
||||
ast_ha_output(fd, named_acl->ha, NULL);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
Reference in New Issue
Block a user