Skip to content

Commit

Permalink
idrange-add: add a warning because 389ds restart is required
Browse files Browse the repository at this point in the history
After the addition of a new idrange, the sidgen plugin is not
immediately aware of the new idrange and a restart of 389ds is
required. Otherwise the creation of new user/group with a uid/gid
inside the new range fails to grant a SID to the user/group.

Fixes: https://pagure.io/freeipa/issue/9558

Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
  • Loading branch information
flo-renaud committed Mar 20, 2024
1 parent f9a1d74 commit 64861a0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ipaserver/plugins/idrange.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,12 @@ def post_callback(self, ldap, dn, entry_attrs, *keys, **options):
self.obj.handle_ipabaserid(entry_attrs, options)
self.obj.handle_iparangetype(entry_attrs, options,
keep_objectclass=True)
self.add_message(
messages.ServiceRestartRequired(
service=services.knownservices.dirsrv.service_instance(""),
server=_('<all IPA servers>')
)
)
return dn


Expand Down
22 changes: 22 additions & 0 deletions ipatests/test_xmlrpc/test_range_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@
"domain. Run `ipa help idrange` for more information"
)

dirsrv_instance = services.knownservices.dirsrv.service_instance("")


@pytest.mark.tier1
class test_range(Declarative):
Expand Down Expand Up @@ -464,6 +466,11 @@ def fin():
),
value=testrange1,
summary=u'Added ID range "%s"' % (testrange1),
messages=(
messages.ServiceRestartRequired(
service=dirsrv_instance,
server='<all IPA servers>').to_dict(),
),
),
),

Expand Down Expand Up @@ -633,6 +640,11 @@ def fin():
),
value=testrange2,
summary=u'Added ID range "%s"' % (testrange2),
messages=(
messages.ServiceRestartRequired(
service=dirsrv_instance,
server='<all IPA servers>').to_dict(),
),
),
),

Expand Down Expand Up @@ -792,6 +804,11 @@ def fin():
),
value=unicode(domain7range1),
summary=u'Added ID range "%s"' % (domain7range1),
messages=(
messages.ServiceRestartRequired(
service=dirsrv_instance,
server='<all IPA servers>').to_dict(),
),
),
),

Expand Down Expand Up @@ -1079,6 +1096,11 @@ def fin():
),
value=testrange9,
summary=u'Added ID range "%s"' % (testrange9),
messages=(
messages.ServiceRestartRequired(
service=dirsrv_instance,
server='<all IPA servers>').to_dict(),
),
),
),

Expand Down

0 comments on commit 64861a0

Please sign in to comment.