diff options
author | Rob Crittenden <rcritten@redhat.com> | 2008-10-24 14:17:20 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2008-10-24 14:17:20 -0400 |
commit | 34520981eeaac5d4f37915509a9e26428e26f5c0 (patch) | |
tree | cb1e7c161faeb2c6a73171218a4377c77d5d278b /ipalib | |
parent | 8788afe18403e7585e4fc2b6a52a352a035fee0b (diff) | |
download | freeipa-34520981eeaac5d4f37915509a9e26428e26f5c0.tar.gz freeipa-34520981eeaac5d4f37915509a9e26428e26f5c0.tar.xz freeipa-34520981eeaac5d4f37915509a9e26428e26f5c0.zip |
Don't allow service-add to create host/ principals
Diffstat (limited to 'ipalib')
-rw-r--r-- | ipalib/errors.py | 4 | ||||
-rw-r--r-- | ipalib/plugins/f_service.py | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/ipalib/errors.py b/ipalib/errors.py index 9c40981ff..c2d83e73b 100644 --- a/ipalib/errors.py +++ b/ipalib/errors.py @@ -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 diff --git a/ipalib/plugins/f_service.py b/ipalib/plugins/f_service.py index 9e9cec538..f02176ffc 100644 --- a/ipalib/plugins/f_service.py +++ b/ipalib/plugins/f_service.py @@ -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() |