mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Don't allow service-add to create host/ principals
This commit is contained in:
parent
8788afe184
commit
34520981ee
@ -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
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user