Description of problem:
The /usr/libexec/openldap/convert-config.sh doesn't take SLAPD_OPTIONS arguments set in the /etc/sysconfig/slapd file.
The load_sysconfig function in the /usr/libexec/openldap/functions calls the parse_config_options in /usr/libexec/openldap/functions with SLAPD_OPTIONS as arguments:
[ -r "$SLAPD_SYSCONFIG_FILE" ] || return
[ -n "$SLAPD_OPTIONS" ] && parse_config_options $SLAPD_OPTIONS
The parse_config_options uses getopts to parse these arguments and the valid options are:
while getopts :u:f:F: opt; do
case "$opt" in
Version-Release number of selected component (if applicable):
I can easily reproduce the issue on openldap-servers-2.4.44-5.el7.x86_64.
Steps to Reproduce:
1. Specify the SLAPD_OPTIONS in the /etc/sysconfig/slapd file:
# grep SLAPD_OPTIONS /etc/sysconfig/slapd
2. Attempt to run the script:
# /usr/libexec/openldap/convert-config.sh -f /var/openldap/legacy/slapd.conf
usage: convert-config.sh [-f config-file] [-F config-dir]
The customer's workaround is to add "unset OPTIND" in the function parse_config_options in the /usr/libexec/openldap/functions file, i.e
unset OPTIND <<<<<<<<<<<
if [ -n "$user" ]; then
The workaround actually seems to be the correct way to fix this as it is doing a clean up as soon as possible after getopts usage. Setting the bug's status to POST as we seem to have a fix, then.
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, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.