[Freeipa-devel] [PATCH] 1012 validate domain in installer

Martin Kosek mkosek at redhat.com
Mon May 14 08:36:36 UTC 2012


On Fri, 2012-05-11 at 16:03 -0400, Rob Crittenden wrote:
> Use our domain validator to validate the domain name we get in the 
> installer.
> 
> rob

I found few issues with the patch:

1) The "unexpected error" is not very user friendly error message:

# ipa-server-install 
...
Server host name [vm-109.idm.lab.bos.redhat.com]: 

The domain name has been calculated based on the host name.

Please confirm the domain name [idm.lab.bos.redhat.com]: bar-.com

Unexpected error - see ipaserver-install.log for details:
 only letters, numbers, and - are allowed. DNS label may not start or
end with -


I think we should make it consistent with hostname validation error
message format:

# ipa-server-install 
...
Server host name [vm-109.idm.lab.bos.redhat.com]: foo-

Invalid hostname 'foo-', must be fully-qualified.


2) The error is also confusing when domain is passed as an option, user
won't know what actually failed:

# ipa-server-install --domain ..
...
Server host name [vm-109.idm.lab.bos.redhat.com]: 

Unexpected error - see ipaserver-install.log for details:
 empty DNS label

As for value passed via option, I think we should quit immediately and
not in second or third interactive step - like we do for --zonemgr
validation:

# ipa-server-install --zonemgr=foo
Usage: ipa-server-install [options]

ipa-server-install: error: invalid zonemgr: missing address domain

This applies both for --hostname and --domain options.

Martin




More information about the Freeipa-devel mailing list