diff options
author | Sumit Bose <sbose@redhat.com> | 2012-10-02 22:11:17 +0200 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2012-10-04 22:15:36 -0400 |
commit | 58a99dd5ac5755cb02feb0feecb18d294eaa805c (patch) | |
tree | 5cf269bb15017f740fbdf81c48158ae515f51778 | |
parent | f5e839ef213d409b501b197cda3a974a55af518b (diff) | |
download | freeipa-58a99dd5ac5755cb02feb0feecb18d294eaa805c.tar.gz freeipa-58a99dd5ac5755cb02feb0feecb18d294eaa805c.tar.xz freeipa-58a99dd5ac5755cb02feb0feecb18d294eaa805c.zip |
Add SIDs for existing users and groups at the end of ipa-adtrust-install
Fixes https://fedorahosted.org/freeipa/ticket/3104
-rw-r--r-- | daemons/ipa-slapi-plugins/ipa-sidgen/Makefile.am | 1 | ||||
-rw-r--r-- | daemons/ipa-slapi-plugins/ipa-sidgen/ipa-sidgen-task-example.ldif | 10 | ||||
-rw-r--r-- | daemons/ipa-slapi-plugins/ipa-sidgen/ipa-sidgen-task-run.ldif | 10 | ||||
-rwxr-xr-x | install/tools/ipa-adtrust-install | 5 | ||||
-rw-r--r-- | install/tools/man/ipa-adtrust-install.1 | 10 | ||||
-rw-r--r-- | ipaserver/install/adtrustinstance.py | 19 |
6 files changed, 43 insertions, 12 deletions
diff --git a/daemons/ipa-slapi-plugins/ipa-sidgen/Makefile.am b/daemons/ipa-slapi-plugins/ipa-sidgen/Makefile.am index 0d8b74e86..a0d0e9ecf 100644 --- a/daemons/ipa-slapi-plugins/ipa-sidgen/Makefile.am +++ b/daemons/ipa-slapi-plugins/ipa-sidgen/Makefile.am @@ -49,6 +49,7 @@ appdir = $(IPA_DATA_DIR) app_DATA = \ ipa-sidgen-conf.ldif \ ipa-sidgen-task-conf.ldif \ + ipa-sidgen-task-run.ldif \ $(NULL) EXTRA_DIST = \ diff --git a/daemons/ipa-slapi-plugins/ipa-sidgen/ipa-sidgen-task-example.ldif b/daemons/ipa-slapi-plugins/ipa-sidgen/ipa-sidgen-task-example.ldif deleted file mode 100644 index 9cfded73b..000000000 --- a/daemons/ipa-slapi-plugins/ipa-sidgen/ipa-sidgen-task-example.ldif +++ /dev/null @@ -1,10 +0,0 @@ -dn: cn=sidgen,cn=ipa-sidgen-task,cn=plugins,cn=config -changetype: add -objectClass: top -objectClass: nsSlapdPlugin -objectClass: extensibleObject -cn: ipa-sidgen-task -nsslapd-pluginPath: libipa_sidgen_task -nsslapd-pluginInitfunc: sidgen_task_init -nsslapd-basedn: $SUFFIX -delay: 0 diff --git a/daemons/ipa-slapi-plugins/ipa-sidgen/ipa-sidgen-task-run.ldif b/daemons/ipa-slapi-plugins/ipa-sidgen/ipa-sidgen-task-run.ldif new file mode 100644 index 000000000..663b7597b --- /dev/null +++ b/daemons/ipa-slapi-plugins/ipa-sidgen/ipa-sidgen-task-run.ldif @@ -0,0 +1,10 @@ +dn: cn=sidgen,cn=ipa-sidgen-task,cn=tasks,cn=config +changetype: add +objectClass: top +objectClass: extensibleObject +cn: sidgen +# $SUFFIX must be replaced with the base DN of the IPA directory tree +nsslapd-basedn: $SUFFIX +# delay specifies the time the task should sleep between the generation of SIDs +# in nanoseconds +delay: 0 diff --git a/install/tools/ipa-adtrust-install b/install/tools/ipa-adtrust-install index 4285642e6..52179038e 100755 --- a/install/tools/ipa-adtrust-install +++ b/install/tools/ipa-adtrust-install @@ -61,6 +61,9 @@ def parse_options(): parser.add_option("-A", "--admin-name", sensitive=True, dest="admin_name", default='admin', help="admin user principal") + parser.add_option("--add-sids", dest="add_sids", action="store_true", + default=False, help="Add SIDs for existing users and" \ + "groups as the final step") options, args = parser.parse_args() safe_options = parser.get_safe_opts(options) @@ -250,7 +253,7 @@ def main(): smb.autobind = service.ENABLED smb.setup(api.env.host, ip_address, api.env.realm, api.env.domain, netbios_name, options.rid_base, options.secondary_rid_base, - options.no_msdcs) + options.no_msdcs, options.add_sids) smb.find_local_id_range() smb.create_instance() diff --git a/install/tools/man/ipa-adtrust-install.1 b/install/tools/man/ipa-adtrust-install.1 index fa63bca3c..9204b7d5f 100644 --- a/install/tools/man/ipa-adtrust-install.1 +++ b/install/tools/man/ipa-adtrust-install.1 @@ -71,6 +71,16 @@ are needed for the IPA domain which should point to all IPA servers: .IP \(bu _kerberos._udp.Default-First-Site-Name._sites.dc._msdcs .TP +\fB\-\-add\-sids\fR +Add SIDs to existing users and groups as a final step of the +ipa\-adtrust\-install run. If there a many existing users and groups and a +couple of replicas in the environment this operation might lead to a high +replication traffic and a performance degradation of all IPA servers in the +environment. To avoid this the SID generation can be run after +ipa\-adtrust\-install is run and scheduled independently. To start this task +you have to load an edited version of ipa-sidgen-task-run.ldif with the +ldapmodify command info the directory server. +.TP \fB\-U\fR, \fB\-\-unattended\fR An unattended installation that will never prompt for user input .TP diff --git a/ipaserver/install/adtrustinstance.py b/ipaserver/install/adtrustinstance.py index 79503c46e..1a92b2885 100644 --- a/ipaserver/install/adtrustinstance.py +++ b/ipaserver/install/adtrustinstance.py @@ -110,6 +110,7 @@ class ADTRUSTInstance(service.Service): self.domain_name = None self.netbios_name = None self.no_msdcs = None + self.add_sids = None self.smbd_user = None self.suffix = DN() self.ldapi_socket = None @@ -360,6 +361,16 @@ class ADTRUSTInstance(service.Service): try: self._ldap_mod("ipa-sidgen-conf.ldif", self.sub_dict) self._ldap_mod("ipa-sidgen-task-conf.ldif", self.sub_dict) + except Exception: + pass + + def __add_sids(self): + """ + Add SIDs for existing users and groups + """ + + try: + self._ldap_mod("ipa-sidgen-task-run.ldif", self.sub_dict) except: pass @@ -602,7 +613,8 @@ class ADTRUSTInstance(service.Service): FQDN = self.fqdn) def setup(self, fqdn, ip_address, realm_name, domain_name, netbios_name, - rid_base, secondary_rid_base, no_msdcs=False, smbd_user="samba"): + rid_base, secondary_rid_base, no_msdcs=False, add_sids=False, + smbd_user="samba"): self.fqdn = fqdn self.ip_address = ip_address self.realm = realm_name @@ -611,6 +623,7 @@ class ADTRUSTInstance(service.Service): self.rid_base = rid_base self.secondary_rid_base = secondary_rid_base self.no_msdcs = no_msdcs + self.add_sids = add_sids self.smbd_user = smbd_user self.suffix = ipautil.realm_to_suffix(self.realm) self.ldapi_socket = "%%2fvar%%2frun%%2fslapd-%s.socket" % \ @@ -700,6 +713,10 @@ class ADTRUSTInstance(service.Service): self.__configure_selinux_for_smbd) self.step("starting CIFS services", self.__start) + if self.add_sids: + self.step("adding SIDs to existing users and groups", + self.__add_sids) + self.start_creation("Configuring CIFS:") def uninstall(self): |