[Pdns-users] Status of poweradmin?
Hugo van der Kooij
hvdkooij at vanderkooij.org
Mon Feb 4 17:17:46 UTC 2008
-----BEGIN PGP SIGNED MESSAGE-----
Rudolph Bott wrote:
| Roger Libiez wrote:
|> I would welcome receiving a patch for the AAAA and LOC records.
|> I'm not setup for IPv6 here so I'd be unable to test it even if I were
|> to add the record choice. I also have no idea how to go about
|> validating the input to keep broken data from being inserted.
| IMO the easiest way to do input validation is assigning a Regex to each
| available record type in some general config file or wherever. Since the
| syntax is quite the same you can use them either for "on the fly"
| find some examples in the config file inside the includes/ directory in
| ZoneAdmin (sf.net/projects/ZoneAdmin) - although these regex patterns
| still leave room for "bad" content. If someone here is up to the task
| you're very welcome to help us out with some code :)
The current trick used in pdnsadmin is to validate IPv4 with:
~ function is_valid_ip($ip)
~ return( $ip == long2ip(ip2long($ip))) ? true : false;
If my understanding of the PHP manual is correct this would work for
both IPv4 and IPv6 if one uses inet_pton and inet_ntop instead.
But the annotated manual said there is an issue with the detection of
some address forms in those routines. So it may not work as well as
expected. I need to think on this a bit more and test it a lot before I
hvdkooij at vanderkooij.org http://hugo.vanderkooij.org/
PGP/GPG? Use: http://hugo.vanderkooij.org/0x58F19981.asc
>Q: Are you sure?
>>A: Because it reverses the logical flow of conversation.
>>>Q: Why is top posting frowned upon?
Bored? Click on http://spamornot.org/ and rate those images.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
-----END PGP SIGNATURE-----
More information about the Pdns-users