Skip to content

module is not compatible with stdlib >= 4.6.0 #45

@maxenced

Description

@maxenced

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions