Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module is not compatible with stdlib >= 4.6.0 #45

Open
maxenced opened this issue May 20, 2015 · 0 comments
Open

module is not compatible with stdlib >= 4.6.0 #45

maxenced opened this issue May 20, 2015 · 0 comments

Comments

@maxenced
Copy link
Contributor

The bind_check_hostname function uses stdlib is_domain_name function for some part of the validation. Since 4.6.0 (exactly since commit ee13438d2a71cea8a07202eee1eeaa29553b2131), this function tries to validate that the last part of the domain (the tld) is alphabetic only (based on rfc 1123).

The issue is that bind::record type allows to declare RR without the full domain (which is good of course). So you can have something like :

   bind::zone { 'myzone-internal':
        zone_contact => 'hostmaster',
        zone_ns      => ['ns0.myzone.internal'],
        zone_serial  => '2013122208',
        zone_ttl     => '600',
        zone_origin  => 'myzone.internal'
    }

  bind::a { 'My hosts':
        ensure    => present,
        zone      => 'myzone-internal',
        hash_data => {
            'host1.dc1'           => { owner => '10.42.1.1' }
        }
   }

This will call bind_check_hostname('host1.dc1','a') which will then call is_domain_name('host1.dc1'). This will fail as 'dc1' is not alphabetic.

I think the best solution to be compatible with both old and new versions of stdlib is to validate the whole RR : <rr_part>. , ie host1.dc1.myzone.internal. The issue is that, right now, bind::record has no way to get the zone_origin as 'zone' parameter only takes the zone name. So it might have a few workaround :

  • don't rely on stdlib if the RR is not complete (does not end with a dot)
  • find some way to get the zone_origin in bind::record
  • pin version of stdlib in dependencies (as a short-term fix)

Maxence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant