PowerDNS / pdns

PowerDNS Authoritative, PowerDNS Recursor, dnsdist
https://www.powerdns.com/
GNU General Public License v2.0
3.48k stars 888 forks source link

Lua2 backend unable to parse boolean value from 0/1 integer #7008

Open rage4 opened 5 years ago

rage4 commented 5 years ago

Short description

Lua2 backend unable to parse boolean value from bit

Environment

Expected behaviour

Lua2 backend should be able to parse boolean from bit value

Actual behaviour

Lua2 backend expects array of tables as result of certain methods such as 'dns_lookup' or 'dns_get_domain_keys'. When returning the result and using bit (0/1) values for 'auth' ('dns_lookup') or 'active' ('dns_get_domain_keys') the backend fails with '(boost::bad_get: failed value get using boost::get)'

Steps to reproduce

Using example from https://github.com/PowerDNS/pdns/blob/master/modules/lua2backend/regression-tests/lua2-dnssec.lua line 78 table.insert(ret, { name = qname, type = newQType(k), content = row, ttl = 60, domain_id = d_id, auth = true }) will work but table.insert(ret, { name = qname, type = newQType(k), content = row, ttl = 60, domain_id = d_id, auth = 1 }) will fail

Habbie commented 5 years ago

Can you show some code so we understand what 'bit values' are?

rage4 commented 5 years ago

Updated report with steps to reproduce, not exactly our code but you should get the idea