egberts / bind9_parser

Bind9 Parser in Python that can process all of ISC Bind configuration files
MIT License
22 stars 7 forks source link

ACL list processing problem #60

Closed llastowski closed 1 year ago

llastowski commented 1 year ago

When more than 1 acl exists in the named.conf file, only the last one gets processed - example data: acl "a3internet" { 10.1.12.25; 10.1.12.26; }; acl "my" { 127.0.0.1; };

the result is that only the last ACL is included in the output json file

egberts commented 1 year ago

Uh?

What does my unit and integration test say?

I have been passing the ones that I've (so thought) elaborated, but do recognize that I may not have accommodated all permutations and combinations.

tests/test_clause_acl.py

Will create another test using your example... Stay tuned.

egberts commented 1 year ago

Created more unit tests:

  1. extended ACL test (test_clause_acl.py) and
  2. a brand-new test (to go into test_clause.py). https://github.com/egberts/bind9_parser/blob/b5379a8523e8d275a66b5f152b778f6c03d56b0e/tests/test_clauses.py#L1575

And I am now showing that my code is failing (in the brand-new test).

Quick eyeball of the situation shows that this is my PyParsing error (probably missing a critical * symbol in the .setName('acl*') somewhere in isc_clause or isc_clause_acl to preserve the indexing number (and thusly capture the 2nd and nth rows of ACL data).

egberts commented 1 year ago

Fixed in: c9cbc26a351b04ed01a59c7613cb04125919d79a

Thank you for the issue report, llastowski

https://github.com/egberts/bind9_parser/blame/c9cbc26a351b04ed01a59c7613cb04125919d79a/bind9_parser/isc_clause_acl.py#L57

egberts commented 1 year ago

All tests except for issue #61 under tests/* have passed.