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

Useradd opens /etc/login.defs.d/ but ignores test.conf despite correct permissions and content

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

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Undefined Undefined
    • None
    • rhel-10.0
    • libeconf
    • None
    • No
    • None
    • rhel-idm-sssd
    • ssg_idm
    • 1
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • Manual
    • Unspecified
    • Unspecified
    • Unspecified
    • All
    • None

      There are two potential issue:

      1. Useradd opens /etc/login.defs.d/ but ignores test.conf despite correct permissions and content.
      2. The incorrect /login.defs.d path in strace suggests a potential bug in libeconf or shadow-utils.

      shadow-utils-4.15.0-6.el10.x86_64
      libeconf-0.6.2-4.el10.x86_64

      Is shadow-utils is linked with libeconf:

      [root@clientrhel10 ~]# ldd /usr/sbin/useradd | grep libeconf
      libeconf.so.0 => /lib64/libeconf.so.0 (0x00007f75d9901000)
      [root@clientrhel10 ~]#

      Steps to Reproduce with exped behaviour:

      1. Ensure no existing users interfere: for user in $(getent passwd | awk -F: '$3 >= 1000 && $3 < 6000 {print $1}

        '); do userdel -r $user; done

      1. Create snippet
        mkdir -p /etc/login.defs.d
        echo 'UID_MIN 5000' > /etc/login.defs.d/test.conf
        chmod 644 /etc/login.defs.d/test.conf
        cat /etc/login.defs.d/test.conf # Should output: UID_MIN 5000
        ls l /etc/login.defs.d/test.conf # Should show: -rw-rr-
      1. Run useradd and check UID
        useradd testuser_manual
        id u testuser_manual # Expected: >= 5000 (But getting 1000) <--- This is the issue
        userdel -r testuser_manual

      Logs:
      Attached : strace -o /tmp/trace.log useradd testuser_snippet

              aborah@redhat.com Anuj Borah
              aborah@redhat.com Anuj Borah
              Iker Pedrosa Iker Pedrosa
              Anuj Borah Anuj Borah
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: