RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2180914 - Sequence processing failures for group_add using server context
Summary: Sequence processing failures for group_add using server context
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: ipa
Version: 9.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Antonio Torres
QA Contact: anuja
URL:
Whiteboard:
: 2180915 (view as bug list)
Depends On:
Blocks: 2180918 2180919
TreeView+ depends on / blocked
 
Reported: 2023-03-22 15:58 UTC by Antonio Torres
Modified: 2023-11-07 09:54 UTC (History)
7 users (show)

Fixed In Version: ipa-4.10.2-1.el9
Doc Type: No Doc Update
Doc Text:
Clone Of:
: 2180918 2180919 (view as bug list)
Environment:
Last Closed: 2023-11-07 08:34:04 UTC
Type: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Fedora Pagure freeipa issue 9349 0 None None None 2023-03-22 16:29:18 UTC
Red Hat Issue Tracker FREEIPA-9583 0 None None None 2023-03-22 15:59:02 UTC
Red Hat Issue Tracker RHELPLAN-152765 0 None None None 2023-03-22 15:59:06 UTC
Red Hat Product Errata RHBA-2023:6477 0 None None None 2023-11-07 08:34:39 UTC

Description Antonio Torres 2023-03-22 15:58:39 UTC
Cloned from upstream: https://pagure.io/freeipa/issue/9349

### Issue
Issues have been found for group_add sequence processing with server context with the work on https://github.com/freeipa/ansible-freeipa/pull/1001

1) Using group_add in sequence processing to create several groups where one is external, all groups have objectclass ipaexternalgroup, even if external is set to False for the group_add command.
2) After creating a nonposix group, all following group_add calls to add posix groups calls are failing with `missing attribute "gidNumber" required by object class "posixGroup"`

#### Reproducer 1 (external)

    from ipalib import api, errors

    api.bootstrap_with_global_options(context='server')
    api.finalize()
    if api.env.in_server:
        api.Backend.ldap2.connect()
    else:
        api.Backend.rpcclient.connect()

    print("Remove 'testgroup1'")
    try:
        api.Command["group_del"]("testgroup1")
    except errors.NotFound:
        pass

    print("Remove 'testgroup2'")
    try:
        api.Command["group_del"]("testgroup2")
    except errors.NotFound:
        pass

    print("Create 'testgroup1' with external=True")
    api.Command["group_add"]("testgroup1", external=True)

    print("Create 'testgroup2' with external=False")
    api.Command["group_add"]("testgroup2", external=False)

    result1 = api.Command["group_show"]("testgroup1", all=True)["result"]
    print("'testgroup1' userclass: %s" % repr(result1["objectclass"]))

    result2 = api.Command["group_show"]("testgroup2", all=True)["result"]
    print("'testgroup2' userclass: %s" % repr(result2["objectclass"]))


#### Reproducer 2 (nonposix)

    from ipalib import api, errors

    api.bootstrap_with_global_options(context='server')
    api.finalize()
    if api.env.in_server:
        api.Backend.ldap2.connect()
    else:
        api.Backend.rpcclient.connect()

    print("Remove 'testgroup1'")
    try:
        api.Command["group_del"]("testgroup1")
    except errors.NotFound:
        pass

    print("Remove 'testgroup2'")
    try:
        api.Command["group_del"]("testgroup2")
    except errors.NotFound:
        pass

    print("Remove 'testgroup3'")
    try:
        api.Command["group_del"]("testgroup3")
    except errors.NotFound:
        pass

    print("Create 'testgroup1' with nonposix=False")
    api.Command["group_add"]("testgroup1", nonposix=False)

    try:
        print("Create 'testgroup2' with nonposix=True")
        api.Command["group_add"]("testgroup2", nonposix=True)
    except Exception as e:
        print(str(e))

    try:
        print("Create 'testgroup3' with external=True")
        api.Command["group_add"]("testgroup3", external=True)
    except Exception as e:
        print(str(e))

#### Actual behavior
1) With reproducer 1 all groups are external.

    $ python3 external_test.py 
    Remove 'testgroup1'
    Remove 'testgroup2'
    Create 'testgroup1' with external=True
    Create 'testgroup2' with external=False
    'testgroup1' userclass: ['top', 'groupofnames', 'nestedgroup', 'ipausergroup', 'ipaobject', 'ipaexternalgroup']
    'testgroup2' userclass: ['top', 'groupofnames', 'nestedgroup', 'ipausergroup', 'ipaobject', 'ipaexternalgroup', 'posixgroup', 'ipantgroupattrs']


2) Reproducer 2 fails to create posix groups after nonposix group has been created.

    $ python3 nonposix_test.py 
    Remove 'testgroup1'
    Remove 'testgroup2'
    Remove 'testgroup3'
    Create 'testgroup1' with nonposix=False
    Create 'testgroup2' with nonposix=True
    missing attribute "gidNumber" required by object class "posixGroup"
    Create 'testgroup3' with external=True
    missing attribute "gidNumber" required by object class "posixGroup"

2) Reproducer 2 fails to create posix groups after nonposix group has been created.

#### Expected behavior
No issues.

#### Version/Release/Distribution

    $ rpm -q freeipa-server freeipa-client ipa-server ipa-client 389-ds-base pki-ca krb5-server
    freeipa-server-4.9.9-1.fc36.x86_64
    freeipa-client-4.9.9-1.fc36.x86_64
    package ipa-server is not installed
    package ipa-client is not installed
    389-ds-base-2.1.1-2.fc36.x86_64
    package pki-ca is not installed
    krb5-server-1.19.2-6.fc36.x86_64

### Addititional Information
The reproducers are passing using client context.

Comment 1 Antonio Torres 2023-03-22 16:01:22 UTC
*** Bug 2180915 has been marked as a duplicate of this bug. ***

Comment 2 Antonio Torres 2023-03-22 16:07:09 UTC
Upstream PR: https://github.com/freeipa/freeipa/pull/6741

Comment 3 Florence Blanc-Renaud 2023-03-23 09:14:09 UTC
Fixed upstream
master:
https://pagure.io/freeipa/c/05279ef447fbd3b59d47db51824e410728913064

Comment 4 Florence Blanc-Renaud 2023-03-23 13:36:10 UTC
Fixed upstream
ipa-4-6:
https://pagure.io/freeipa/c/6c9edcf2b1a830b06100f988503388b5022c16cf

Comment 5 Florence Blanc-Renaud 2023-03-23 16:13:11 UTC
Fixed upstream
ipa-4-10:
https://pagure.io/freeipa/c/b1b7cbc08d96e125ce21113ba1793a592d0ba35a

Comment 6 Florence Blanc-Renaud 2023-03-23 16:51:33 UTC
Fixed upstream
ipa-4-9:
https://pagure.io/freeipa/c/62fe608390c41115edf4e356a6cff2ab1a6d0daf

Comment 13 errata-xmlrpc 2023-11-07 08:34:04 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (ipa bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:6477


Note You need to log in before you can comment on or make changes to this bug.