[Freeipa-devel] [PATCH] 151 Add --zonemgr validator

Rob Crittenden rcritten at redhat.com
Fri Oct 21 15:31:29 UTC 2011


Martin Kosek wrote:
> On Fri, 2011-10-14 at 14:11 -0400, Rob Crittenden wrote:
>> Martin Kosek wrote:
>>> Do at least a basic validation of DNS zone manager mail address.
>>>
>>> Do not require '@' to be in the mail address as it is not used
>>> in common DNS zone configuration (in bind for example) and people
>>> may be used to configure it that way. '@' is always removed by the
>>> installer before the DNS zone is created.
>>>
>>> https://fedorahosted.org/freeipa/ticket/1966
>>
>> There is already a zonemgr_callback defined for this option, can the
>> verify_zonemgr call be either integrated or called from that?
>>
>> rob
>>
>
> Right. Please, try this one. I also added a parser error when more than
> one '@' is in the checked value.
>
> Martin

A couple of things:

In the block where you are counting @ why not add an :

else:
     raise ValueError('address is not fully qualified')

rather than looking for '.' in the result? I think it will be clearer 
that way. I wonder if the error should contain an example as well, are 
people going to know what a fully-qualified means?

The regex is very strict for e-mail addresses, perhaps too much so. It 
doesn't allow upper-case characters, periods or _, both of which are 
allowed in login names. A common e-mail format is first.last at domain.

rob




More information about the Freeipa-devel mailing list