Uploaded image for project: 'Red Hat Directory Server'
  1. Red Hat Directory Server
  2. DIRSRV-394

WebUI: Database Suffix is not validated properly [dirsrv-12.6]

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Minor Minor
    • dirsrv-12.6
    • None
    • cockpit-389-ds
    • None
    • rhel-idm-ds
    • 0
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None

      This is a clone from DIRSRV-161:


      Description of a problem

      The console crashes after an attempt to create an instance with an invalid Database Suffix, because dscreate returns not just a JSON error, but also plain text during the installation.

      Version-Release number of the selected component

      rpm -q 389-ds-base cockpit-389-ds

      389-ds-base-2.5.2-1.el9.x86_64
      cockpit-389-ds-2.5.1-2.module+el9dsrv+22071+e756ccfb.noarch

      Browser (if applicable)

      Chrome

      Steps to reproduce

      1. Create a new instance and use `dc=test > /tmp/test` as a Database Suffix
      2.
      3.
      

      Actual results

      `dc=test > /tmp/test` passes input validation as a Valid DN, while it's not. Later dscreate crashes with both plain text error and JSON error. But the plain text error confuses WebUI
      
      CMD: handleCreateInstance: Creating instance... ==> dscreate -j from-file /tmp/389-setup-1726222060154.inf
      VM746:1 Uncaught SyntaxError: Unexpected token 'N', "No such in"... is not valid JSON
          at JSON.parse (<anonymous>)
          at Function.<anonymous> (index.js:670:1411)
          at l (index.js:13:5715)
          at index.js:13:5914
          at i (index.js:13:4753)
      
      
      
      # cat inst.inf
      [general]
      config_version = 2
      full_machine_name = server.example.com
      
      [slapd]
      user = dirsrv
      group = dirsrv
      instance_name = localhost
      port = 389
      root_dn = cn=Directory Manager
      secure_port = 636
      self_sign_cert = True[backend-user]
      suffix = dc=> /tmp/test
      sample_entries = yes
      
      # dscreate -j from-file inst.inf > /dev/null No such instance to remove localhost {     "desc": "Instance creation failed!  Unable to normalize DN 'dc=> /tmp/test'" }

      Expected results

      dscreate -j should not print plain text

      Additional information

       

              Unassigned Unassigned
              vashirov@redhat.com Viktor Ashirov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: