Skip to content

BUG-26: apply-test-identities --remove-old-groups deletes some groups before it fails on one with an entry under it #136

Closed

Description

@ephico2real2

Part of #110

What is wrong: apply-test-identities.sh --remove-old-groups deletes some old groups and then fails. This occurs when one old group holds an entry under it. ldapdelete stops at that group with exit 66, after the groups before it are gone. Nothing puts those groups back.

Where: examples/cmapi-sso/ldap/apply-test-identities.sh, function remove_old, on PR #112 at ecc5cb3. The loop checks the objectClass of each old group. It does not check for entries under the group before the first delete.

How to prove it: On the OpenLDAP stand-in of deploy/tests/ldap-identities-test.sh, add cn=child,cn=cmapi-auditors,ou=Groups,<base>. Then run --remove-old-groups. The run must fail with no delete request.

Measured or inferred: Measured on 2026-11-13 on macOS with Podman, on osixia/openldap 1.5.0, by Codex gpt-6.1-sol and again by OB1. Before the fix: exit 66, 10 delete requests, and 9 old groups gone. No cluster and no real directory.

Severity: Medium. The directory is shared, and a partial delete cannot be reversed by the script.

What must hold after the fix: With an entry under an old group, the run fails before the first delete. The message tells the operator to stop and report to the directory owner. A run with no such entry deletes the ten groups as before.

Research: OpenLDAP's ldapdelete deletes only leaf entries without -r (measured: "Operation not allowed on non-leaf (66)"). A recursive delete is refused, because it removes entries that the script did not write.

Solution (inline, not applied): Before any delete, search one level under each old group (search -b "$dn" -s one "(objectClass=*)" dn). Fail if the result is not empty. Codex's patch C2.patch holds the full code.

Class: INV. The defect is in new INV work (#110) that is not merged, so its fix is part of that work.

Activity

  1. added
    bug
    class:INV
    status:open
    sev:medium
    In-Progress
    on Nov 13, 2026
  2. ephico2real2 commented on Nov 13, 2026

    @ephico2real2
    OwnerAuthor

    In-Progress: found by the second pass on PR #112 (Codex gpt-6.1-sol, 2026-11-13). The fix goes on the branch of PR #112 (draft), with its case in deploy/tests/ldap-identities-test.sh.

  3. added a commit that references this issue on Nov 13, 2026
    7537b2c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    In-Progressbugclass:INVsev:mediumstatus:open

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions