Blame SOURCES/openldap-cbinding-Fix-slaptest-in-test077.patch

ef2d9b
From e006994d83af9dcb7813a18253cf4e5beacee043 Mon Sep 17 00:00:00 2001
ef2d9b
From: Ryan Tandy <ryan@nardis.ca>
ef2d9b
Date: Sun, 26 Apr 2020 11:40:23 -0700
ef2d9b
Subject: [PATCH] Fix slaptest in test077
ef2d9b
ef2d9b
The libtool wrapper scripts lose argv[0] when exec'ing the real binary.
ef2d9b
ef2d9b
In the CI Docker container, where the build runs as root, this was
ef2d9b
actually starting a real slapd on the default port.
ef2d9b
ef2d9b
Outside Docker, running as a non-root user, this slapd would just fail
ef2d9b
to start, and wouldn't convert the config either.
ef2d9b
ef2d9b
Using "slapd -Tt" fixes the issue but also prints a warning from
ef2d9b
slaptest since the database hasn't been initialized yet.
ef2d9b
ef2d9b
Dynamic config isn't actually used in this test script, so let's just
ef2d9b
run slapd off the config file directly.
ef2d9b
---
ef2d9b
 tests/scripts/test077-sasl-gssapi | 11 ++---------
ef2d9b
 1 file changed, 2 insertions(+), 9 deletions(-)
ef2d9b
ef2d9b
diff --git a/tests/scripts/test077-sasl-gssapi b/tests/scripts/test077-sasl-gssapi
ef2d9b
index 19f665622..20c414600 100755
ef2d9b
--- a/tests/scripts/test077-sasl-gssapi
ef2d9b
+++ b/tests/scripts/test077-sasl-gssapi
ef2d9b
@@ -21,22 +21,15 @@ if test $WITH_SASL = no ; then
ef2d9b
         exit 0
ef2d9b
 fi
ef2d9b
 
ef2d9b
-SLAPTEST="$TESTWD/../servers/slapd/slaptest"
ef2d9b
-CONFDIR=$TESTDIR/slapd.d
ef2d9b
-
ef2d9b
 mkdir -p $TESTDIR $DBDIR1 $CONFDIR
ef2d9b
 cp -r $DATADIR/tls $TESTDIR
ef2d9b
 
ef2d9b
-cd $TESTWD
ef2d9b
-
ef2d9b
-
ef2d9b
 echo "Starting KDC for SASL/GSSAPI tests..."
ef2d9b
 . $SRCDIR/scripts/setup_kdc.sh
ef2d9b
 
ef2d9b
 echo "Running slapadd to build slapd database..."
ef2d9b
 . $CONFFILTER $BACKEND $MONITORDB < $SASLGSSAPICONF > $CONF1
ef2d9b
-$SLAPTEST -f $CONF1 -F $CONFDIR
ef2d9b
-$SLAPADD -F $CONFDIR -l $LDIFORDERED
ef2d9b
+$SLAPADD -f $CONF1 -l $LDIFORDERED
ef2d9b
 RC=$?
ef2d9b
 if test $RC != 0 ; then
ef2d9b
 	echo "slapadd failed ($RC)!"
ef2d9b
@@ -45,7 +38,7 @@ if test $RC != 0 ; then
ef2d9b
 fi
ef2d9b
 
ef2d9b
 echo "Starting ldap:/// slapd on TCP/IP port $PORT1 and ldaps:/// slapd on $PORT2..."
ef2d9b
-$SLAPD -F $CONFDIR -h "$URI1 $SURI2" -d $LVL $TIMING > $LOG1 2>&1 &
ef2d9b
+$SLAPD -f $CONF1 -h "$URI1 $SURI2" -d $LVL $TIMING > $LOG1 2>&1 &
ef2d9b
 PID=$!
ef2d9b
 if test $WAIT != 0 ; then
ef2d9b
     echo PID $PID
ef2d9b
-- 
ef2d9b
2.26.2
ef2d9b