Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-86315

Dsidm get_dn option fails for organizational unit, service and posixgroup

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Normal Normal
    • rhel-10.1
    • None
    • 389-ds-base
    • None
    • 389-ds-base-3.1.3-2.el10
    • No
    • Moderate
    • rhel-idm-ds
    • 0
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • None

      Description of a problem

      "dsidm get_dn" option fails for organizational unit, service and posixgroup

      Version-Release number of the selected component

      rpm -q 389-ds-base

      389-ds-base-2.5.2-2.el9_5.x86_64

      Steps to reproduce

      1. Create an instance
      2. Run "dsidm ... organizationalunit get_dn" on any organizational unit
      3. Run the same but for service and posixgroup
      

      Actual results (attached results are for organizational unit, but service and posixgroup yield identical output)

      Fails with "ERROR: Error: search_ext() argument 1 must be str, not function"
      
      Verbose output:
      DEBUG: The 389 Directory Server Identity Manager
      DEBUG: Inspired by works of: ITS, The University of Adelaide
      DEBUG: dsrc path: /root/.dsrc
      DEBUG: dsrc container path: /data/config/container.inf
      DEBUG: dsrc instances: []
      DEBUG: dsrc no such section: slapd-localhost
      DEBUG: Called with: Namespace(verbose=True, json=False, instance='localhost', basedn='dc=example,dc=com', binddn=None, bindpw=None, prompt=False, pwdfile=None, starttls=False, dn='ou=groups,dc=example,dc=com', func=<function get_dn at 0x7fac70e43b80>)
      DEBUG: Instance details: {'uri': 'localhost', 'basedn': 'dc=example,dc=com', 'binddn': None, 'bindpw': None, 'saslmech': None, 'tls_cacertdir': None, 'tls_cert': None, 'tls_key': None, 'tls_reqcert': None, 'starttls': False, 'prompt': False, 'pwdfile': None, 'args': {'ldapurl': 'localhost', 'root-dn': None}}
      DEBUG: Allocate <class 'lib389.DirSrv'> with ldapi://%2frun%2fslapd-localhost.socket
      DEBUG: Allocate <class 'lib389.DirSrv'> with %2frun%2fslapd-localhost.socket
      DEBUG: Allocate <class 'lib389.DirSrv'> with vm.com:389
      DEBUG: Allocate <class 'lib389.DirSrv'> with vm.com:389
      DEBUG: Allocate <class 'lib389.DirSrv'> with ldapi://%2frun%2fslapd-localhost.socket
      DEBUG: Allocate <class 'lib389.DirSrv'> with %2frun%2fslapd-localhost.socket
      DEBUG: Allocate <class 'lib389.DirSrv'> with vm.com:389
      DEBUG: Allocate <class 'lib389.DirSrv'> with vm.com:389
      DEBUG: open(): Connecting to uri ldapi://%2frun%2fslapd-localhost.socket
      DEBUG: Using dirsrv ca certificate /etc/dirsrv/slapd-localhost
      DEBUG: Using external ca certificate /etc/dirsrv/slapd-localhost
      DEBUG: Using /etc/openldap/ldap.conf certificate policy
      DEBUG: ldap.OPT_X_TLS_REQUIRE_CERT = 2
      DEBUG: open(): Using root autobind ...
      DEBUG: open(): bound as None
      DEBUG: Retrieving entry with [('',)]
      DEBUG: Retrieved entry [dn: 
      vendorVersion: 389-Directory/2.5.2 B2024.260.0000]
      DEBUG: _gen_dn filter = (&(objectclass=organizationalunit))
      DEBUG: _gen_dn dn = <function get_dn.<locals>.<lambda> at 0x7fac70c4f670>
      DEBUG: search_ext() argument 1 must be str, not function
      Traceback (most recent call last):
        File "/usr/sbin/dsidm", line 139, in <module>
          result = args.func(inst, basedn, log, args)
        File "/usr/local/lib/python3.9/site-packages/lib389/cli_idm/organizationalunit.py", line 38, in get_dn
          _generic_get_dn(inst, basedn, log.getChild('_generic_get_dn'), MANY, dn, args)
        File "/usr/local/lib/python3.9/site-packages/lib389/cli_idm/__init__.py", line 143, in _generic_get_dn
          o = mc.get(dn=dn)
        File "/usr/local/lib/python3.9/site-packages/lib389/_mapped_object.py", line 1237, in get
          results = self._get_dn(dn)
        File "/usr/local/lib/python3.9/site-packages/lib389/_mapped_object.py", line 1257, in _get_dn
          return _search_ext_s(self._instance,
        File "/usr/local/lib/python3.9/site-packages/lib389/_mapped_object.py", line 92, in _search_ext_s
          return _ldap_op_s(inst, inst.search_ext_s, 'search_ext_s', *args, **kwargs)
        File "/usr/local/lib/python3.9/site-packages/lib389/_mapped_object.py", line 74, in _ldap_op_s
          return f(*args, **kwargs)
        File "/usr/local/lib/python3.9/site-packages/lib389/__init__.py", line 177, in inner
          return f(*args, **kwargs)
        File "/usr/local/lib64/python3.9/site-packages/ldap/ldapobject.py", line 624, in search_ext_s
          msgid = self.search_ext(base,scope,filterstr,attrlist,attrsonly,serverctrls,clientctrls,timeout,sizelimit)
        File "/usr/local/lib/python3.9/site-packages/lib389/__init__.py", line 177, in inner
          return f(*args, **kwargs)
        File "/usr/local/lib64/python3.9/site-packages/ldap/ldapobject.py", line 614, in search_ext
          return self._ldap_call(
        File "/usr/local/lib/python3.9/site-packages/lib389/__init__.py", line 177, in inner
          return f(*args, **kwargs)
        File "/usr/local/lib64/python3.9/site-packages/ldap/ldapobject.py", line 128, in _ldap_call
          result = func(*args,**kwargs)
      TypeError: search_ext() argument 1 must be str, not function
      ERROR: Error: search_ext() argument 1 must be str, not function
      

      Expected results

      Should return the name of the entry

              idm-ds-dev-bugs IdM DS Dev
              lryznaro@redhat.com Lenka Doudova
              IdM DS Dev IdM DS Dev
              IdM DS QE IdM DS QE
              Evgenia Martyniuk Evgenia Martyniuk
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: