[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-----
Hash: SHA1
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"
| validation via javascript regex'es or inside your PHP scripts. You can
| 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
submit patches.
Hugo.
- --
hvdkooij at vanderkooij.org http://hugo.vanderkooij.org/
PGP/GPG? Use: http://hugo.vanderkooij.org/0x58F19981.asc
A: Yes.
>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)
iD8DBQFHp0i2BvzDRVjxmYERAq9KAJ9w5T8FLV8I1cQUdqnyDal3TEHpaQCfULQy
dfebwEPbg2/rxrMSKGE527Q=
=ZSWX
-----END PGP SIGNATURE-----
More information about the Pdns-users
mailing list