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

dsctl should report error when the ldif to import doesn't have permissions to be read by dirsrv.

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

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • rhel-10.2
    • None
    • 389-ds-base
    • None
    • None
    • Low
    • rhel-idm-ds
    • 0
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Directory Server
    • None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • None

      Description of a problem

      When dirsrv user doesn't have permissions to access the file /tmp/test.ldif, dsctl shows successful with skipped entries. 
      
      
      [root@master ~]# ll /tmp/test.ldif 
      -rw-------. 1 root root 587908 Jul 22 15:37 /tmp/test.ldif
      [root@master ~]# 
      [root@master ~]# 
      
      
      
      [root@master ~]# dsctl -v IPA-TEST ldif2db userroot /tmp/test.ldif 
      DEBUG: The 389 Directory Server Administration Tool
      DEBUG: Inspired by works of: ITS, The University of Adelaide
      DEBUG: Called with: Namespace(verbose=True, instance='IPA-TEST', json=False, list=False, remove_all=False, backend='userroot', ldif='/tmp/test.ldif', encrypted=False, func=<function dbtasks_ldif2db at 0x7f73c5c23550>)
      DEBUG: Allocate local instance <class 'lib389.DirSrv'> with None
      DEBUG: Instance allocated
      DEBUG: OK group dirsrv exists
      DEBUG: OK user dirsrv exists
      DEBUG: systemd status -> True
      DEBUG: Command: /usr/sbin/ns-slapd ldif2db -D /etc/dirsrv/slapd-IPA-TEST -i /tmp/test.ldif -n userroot skipped import entry warning 8
      WARNING: ldif2db successful with skipped entries
      
      
      
      We see above error like "ldif2db successful with skipped entries" 
      
      
      And when I check error logs, I can see below : 
      
      
      ~~~~
      [22/Jul/2025:15:38:25.329928778 -0400] - INFO - bdb_public_bdb_import_main - import userRoot: Beginning import job...
      [22/Jul/2025:15:38:25.348968813 -0400] - INFO - bdb_public_bdb_import_main - import userRoot: Index buffering enabled with bucket size 57
      [22/Jul/2025:15:38:25.550071986 -0400] - ERR - bdb_import_producer - import userRoot: Could not open LDIF file "/tmp/test.ldif", errno 13 (Permission denied)
      [22/Jul/2025:15:38:25.570245497 -0400] - ERR - bdb_import_run_pass - import userRoot: Thread monitoring returned: -23
      ~~~~

       

       

      Expected Result : 

       

       

      dsctl command should display the error on terminal directly : 
       
      "Could not open LDIF file "/tmp/test.ldif", errno 13 (Permission denied)" 
      

       

              idm-ds-dev-bugs IdM DS Dev
              rhn-support-apeddire AbhinayReddy Peddireddy
              IdM DS Dev IdM DS Dev
              IdM DS QE IdM DS QE
              Evgenia Martyniuk Evgenia Martyniuk
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: