- run slaptest with the -u flag if no id2entry db files are found, because

you can't read-write access a non-existent database (#156787)
This commit is contained in:
Nalin Dahyabhai 2005-05-19 17:22:14 +00:00
parent e466757d0d
commit 704e3ceec0
2 changed files with 15 additions and 3 deletions

View File

@ -94,10 +94,18 @@ function configtest() {
prog=`basename ${slapd}`
ldapuid=`id -u $user`
# Unaccessible database files.
for dbdir in `grep ^directory /etc/openldap/slapd.conf | sed s,^directory,,` ; do
slaptestflags=
for dbdir in `LANG=C egrep '^directory[[:space:]]+[[:print:]]+$' /etc/openldap/slapd.conf | sed s,^directory,,` ; do
for file in `find ${dbdir}/ -not -uid $ldapuid -and \( -name "*.dbb" -or -name "*.gdbm" -or -name "*.bdb" \)` ; do
echo -n $"$file is not owned by \"$user\"" ; warning ; echo
done
if ! test -s ${dbdir}/id2entry.dbb ; then
if ! test -s ${dbdir}/id2entry.bdb ; then
if ! test -s ${dbdir}/id2entry.gdbm ; then
slaptestflags=-u
fi
fi
fi
done
# Unaccessible keytab with an "ldap" key.
if checkkeytab $user ldap ; then
@ -112,7 +120,7 @@ function configtest() {
fi
done
# Check the configuration file.
if ! action $"Checking configuration files for $prog: " $slaptest ; then
if ! action $"Checking configuration files for $prog: " $slaptest $slaptestflags ; then
if $slaptest -u > /dev/null 2> /dev/null ; then
dirs=`LANG=C egrep '^directory[[:space:]]+[[:print:]]+$' /etc/openldap/slapd.conf | awk '{print $2}'`
for directory in $dirs ; do

View File

@ -709,7 +709,11 @@ fi
%endif
%changelog
* Wed May 4 2005 Nalin Dahyabhai <nalin@redhat.com> 2.2.26-1
* Thu May 19 2005 Nalin Dahyabhai <nalin@redhat.com>
- run slaptest with the -u flag if no id2entry db files are found, because
you can't read-write access a non-existent database (#156787)
* Wed May 4 2005 Nalin Dahyabhai <nalin@redhat.com>
- update to 2.2.26 (stable 20050429)
- enable the lmpasswd scheme
- print a warning if slaptest fails, slaptest -u succeeds, and one of the