summaryrefslogtreecommitdiffstats
path: root/ipaplatform/redhat/tasks.py
diff options
context:
space:
mode:
authorDavid Kupka <dkupka@redhat.com>2014-10-22 09:07:44 -0400
committerMartin Kosek <mkosek@redhat.com>2014-11-05 15:22:51 +0100
commit364d466fd7def3589ddb9e4a9f8d73fc2df80439 (patch)
tree6a453eae45f12c1aa496ae20ade51eb7f35c5e1a /ipaplatform/redhat/tasks.py
parent0b08043c37210d0f86cb0c66d659acafda0fb529 (diff)
downloadfreeipa-364d466fd7def3589ddb9e4a9f8d73fc2df80439.tar.gz
freeipa-364d466fd7def3589ddb9e4a9f8d73fc2df80439.tar.xz
freeipa-364d466fd7def3589ddb9e4a9f8d73fc2df80439.zip
Respect UID and GID soft static allocation.
https://fedoraproject.org/wiki/Packaging:UsersAndGroups?rd=Packaging/UsersAndGroups#Soft_static_allocation https://fedorahosted.org/freeipa/ticket/4585 Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipaplatform/redhat/tasks.py')
-rw-r--r--ipaplatform/redhat/tasks.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/ipaplatform/redhat/tasks.py b/ipaplatform/redhat/tasks.py
index 30033b274..0386f7f9c 100644
--- a/ipaplatform/redhat/tasks.py
+++ b/ipaplatform/redhat/tasks.py
@@ -390,5 +390,28 @@ class RedHatTaskNamespace(BaseTaskNamespace):
return True
+ def create_system_user(self, name, group, homedir, shell, uid = None, gid = None, comment = None):
+ """
+ Create a system user with a corresponding group
+
+ According to https://fedoraproject.org/wiki/Packaging:UsersAndGroups?rd=Packaging/UsersAndGroups#Soft_static_allocation
+ some system users should have fixed UID, GID and other parameters set.
+ This values should be constant and may be hardcoded.
+ Add other values for other users when needed.
+ """
+ if name == 'pkiuser':
+ if uid is None:
+ uid = 17
+ if gid is None:
+ gid = 17
+ if comment is None:
+ comment = 'CA System User'
+ if name == 'dirsrv':
+ if comment is None:
+ comment = 'DS System User'
+
+ super(RedHatTaskNamespace, self).create_system_user(name, group,
+ homedir, shell, uid, gid, comment)
+
tasks = RedHatTaskNamespace()