Bug 1947469 - dsconf fails to add a PTA URL due to an invalid check.
Summary: dsconf fails to add a PTA URL due to an invalid check.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Directory Server
Classification: Red Hat
Component: 389-ds-base
Version: 11.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: DS11.3
: dirsrv-11.4
Assignee: mreynolds
QA Contact: RHDS QE
Marc Muehlfeld
URL:
Whiteboard: sync-to-jira
: 1947457 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-04-08 14:21 UTC by Têko Mihinto
Modified: 2023-07-11 11:00 UTC (History)
8 users (show)

Fixed In Version: redhat-ds-11-8050020210803164248.d3df4063
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-10-25 06:36:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:3955 0 None None None 2021-10-25 06:36:33 UTC

Description Têko Mihinto 2021-04-08 14:21:57 UTC
Description of problem:
When trying to configure the PTA plugin by adding an URL, the dsconf command fails.

Version-Release number of selected component (if applicable):
# cat /etc/redhat-release
Red Hat Enterprise Linux release 8.3 (Ootpa)
#
# rpm -qa | grep 389-ds-base-1
389-ds-base-1.4.3.13-1.module+el8dsrv+8334+69a46a2e.x86_64
#

How reproducible:
Always.

Steps to Reproduce:
Launch the command in verbose mode. It fails since it considers the DN as invalid:

# dsconf --verbose -D "cn=Directory Manager" ldap://localhost:10389 plugin pass-through-auth url add "ldap://localhost:7389/o=redhat"

...

DEBUG: Subtree is an invalid DN
Traceback (most recent call last):
  File "/usr/sbin/dsconf", line 134, in <module>
    result = args.func(inst, None, log, args)
  File "/usr/lib/python3.6/site-packages/lib389/cli_conf/plugins/passthroughauth.py", line 88, in pta_add
    new_url_l = _validate_url(args.URL.lower())
  File "/usr/lib/python3.6/site-packages/lib389/cli_conf/plugins/passthroughauth.py", line 58, in _validate_url
    raise ValueError("Subtree is an invalid DN")
ValueError: Subtree is an invalid DN
ERROR: Error: Subtree is an invalid DN
#

Actual results:
The command fails.

Expected results:
The command should work.

Additional info

Comment 2 mreynolds 2021-04-08 14:54:07 UTC
Upstream ticket:

https://github.com/389ds/389-ds-base/issues/4719

Comment 3 Juan Pablo Firrincieli 2021-05-22 01:10:41 UTC
I can confirm this bug.

We are trying to configure a bind passthru to another LDAP to a DN subtree that doesn't exist in this RHDS and always get the same error of Invalid DN:

# cat /etc/redhat-release
Red Hat Enterprise Linux release 8.1 (Ootpa)

# rpm -qa | grep 389-ds-base-1
389-ds-base-1.4.3.21-3.module+el8dsrv+10401+3d549418.x86_64

# dsconf --verbose -D "cn=Directory Manager" ldap://localhost:10389 plugin pass-through-auth url add ldap://ldaporig:10389/ou=People,c=arg,O=BBVA
DEBUG: The 389 Directory Server Configuration Tool
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-ldap://localhost:10389
DEBUG: Called with: Namespace(URL='ldap://ldaporig:10389/ou=People,c=arg,O=BBVA', basedn=None, binddn='cn=Directory Manager', bindpw=None, func=<function pta_add at 0x7f68e927e8c8>, instance='ldap://localhost:10389', json=False, prompt=>
DEBUG: Instance details: {'uri': 'ldap://localhost:10389', 'basedn': None, 'binddn': 'cn=Directory Manager', 'bindpw': None, 'saslmech': None, 'tls_cacertdir': None, 'tls_cert': None, 'tls_key': None, 'tls_reqcert': None, 'starttls': Fa>
DEBUG: SER_SERVERID_PROP not provided, assuming non-local instance
DEBUG: Allocate <class 'lib389.DirSrv'> with ldap://localhost:10389
DEBUG: Allocate <class 'lib389.DirSrv'> with localhost:389
DEBUG: Allocate <class 'lib389.DirSrv'> with localhost:389
Enter password for cn=Directory Manager on ldap://localhost:10389:
DEBUG: SER_SERVERID_PROP not provided, assuming non-local instance
DEBUG: Allocate <class 'lib389.DirSrv'> with ldap://localhost:10389
DEBUG: Allocate <class 'lib389.DirSrv'> with localhost:389
DEBUG: Allocate <class 'lib389.DirSrv'> with localhost:389
DEBUG: open(): Connecting to uri ldap://localhost:10389
DEBUG: Using dirsrv ca certificate /etc/dirsrv/slapd-{instance_name}
DEBUG: Using external ca certificate /etc/dirsrv/slapd-{instance_name}
DEBUG: Using external ca certificate /etc/dirsrv/slapd-{instance_name}
DEBUG: Using /etc/openldap/ldap.conf certificate policy
DEBUG: ldap.OPT_X_TLS_REQUIRE_CERT = 2
DEBUG: open(): bound as cn=Directory Manager
DEBUG: Retrieving entry with [('',)]
DEBUG: Retrieved entry [dn:
vendorVersion: 389-Directory/1.4.3.21 B2021.077.1932

]
DEBUG: Subtree is an invalid DN
Traceback (most recent call last):
  File "/usr/sbin/dsconf", line 134, in <module>
    result = args.func(inst, None, log, args)
  File "/usr/lib/python3.6/site-packages/lib389/cli_conf/plugins/passthroughauth.py", line 88, in pta_add
    new_url_l = _validate_url(args.URL.lower())
  File "/usr/lib/python3.6/site-packages/lib389/cli_conf/plugins/passthroughauth.py", line 58, in _validate_url
    raise ValueError("Subtree is an invalid DN")
ValueError: Subtree is an invalid DN
ERROR: Error: Subtree is an invalid DN

Comment 4 Juan Pablo Firrincieli 2021-05-22 01:39:23 UTC
If I comment out the raise error there the url adds without any issue and the PTA works like a expected

Comment 5 mreynolds 2021-05-22 16:06:21 UTC
Fixed this in https://github.com/389ds/389-ds-base/pull/4774

Comment 6 thierry bordaz 2021-06-16 15:23:13 UTC
Fix pushed upstream => POST

Comment 14 errata-xmlrpc 2021-10-25 06:36:13 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 (Low: redhat-ds:11 security, 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/RHSA-2021:3955

Comment 15 Petr Čech 2022-05-24 14:10:34 UTC
*** Bug 1947457 has been marked as a duplicate of this bug. ***


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