Don't allow service-add to create host/ principals

This commit is contained in:
Rob Crittenden 2008-10-24 14:17:20 -04:00
parent 8788afe184
commit 34520981ee
2 changed files with 7 additions and 0 deletions

View File

@ -356,6 +356,10 @@ class DefaultGroup(ConfigurationError):
"""You cannot remove the default users group"""
faultCode = 1025
class HostService(ConfigurationError):
"""You must enroll a host in order to create a host service"""
faultCode = 1026
class FunctionDeprecated(GenericError):
"""Raised by a deprecated function"""
faultCode = 2000

View File

@ -72,6 +72,9 @@ class service_add(crud.Add):
raise errors.MalformedServicePrincipal
service = sp[0]
if service.lower() == "host":
raise errors.HostService
sr = sp[1].split('@')
if len(sr) == 1:
hostname = sr[0].lower()