diff options
author | David Kupka <dkupka@redhat.com> | 2014-10-22 09:07:44 -0400 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2014-11-05 15:22:51 +0100 |
commit | 364d466fd7def3589ddb9e4a9f8d73fc2df80439 (patch) | |
tree | 6a453eae45f12c1aa496ae20ade51eb7f35c5e1a /ipaserver/install/installutils.py | |
parent | 0b08043c37210d0f86cb0c66d659acafda0fb529 (diff) | |
download | freeipa-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 'ipaserver/install/installutils.py')
-rw-r--r-- | ipaserver/install/installutils.py | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/ipaserver/install/installutils.py b/ipaserver/install/installutils.py index 757bc5b1b..d3f09eccb 100644 --- a/ipaserver/install/installutils.py +++ b/ipaserver/install/installutils.py @@ -29,8 +29,6 @@ from ConfigParser import SafeConfigParser, NoOptionError import traceback import textwrap from contextlib import contextmanager -import pwd -import grp from dns import resolver, rdatatype from dns.exception import DNSException @@ -84,8 +82,6 @@ class ReplicaConfig: subject_base = ipautil.dn_attribute_property('_subject_base') -log = log_mgr.get_logger(__name__) - def get_fqdn(): fqdn = "" try: @@ -1039,41 +1035,3 @@ def load_external_cert(files, subject_base): ca_file.flush() return cert_file, ca_file - - -def create_system_user(name, group, homedir, shell): - """Create a system user with a corresponding group""" - try: - grp.getgrnam(group) - except KeyError: - log.debug('Adding group %s', group) - args = [paths.GROUPADD, '-r', group] - try: - ipautil.run(args) - log.debug('Done adding group') - except ipautil.CalledProcessError as e: - log.critical('Failed to add group: %s', e) - raise - else: - log.debug('group %s exists', group) - - try: - pwd.getpwnam(name) - except KeyError: - log.debug('Adding user %s', name) - args = [ - paths.USERADD, - '-g', group, - '-c', 'DS System User', - '-d', homedir, - '-s', shell, - '-M', '-r', name, - ] - try: - ipautil.run(args) - log.debug('Done adding user') - except ipautil.CalledProcessError as e: - log.critical('Failed to add user: %s', e) - raise - else: - log.debug('user %s exists', name) |