]> git.sur5r.net Git - openldap/commitdiff
Import misc changes from devel including client/tools
authorKurt Zeilenga <kurt@openldap.org>
Tue, 4 Jul 2000 22:14:08 +0000 (22:14 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 4 Jul 2000 22:14:08 +0000 (22:14 +0000)
ldap_result() call fixes

18 files changed:
clients/tools/ldapdelete.c
clients/tools/ldapmodrdn.c
clients/tools/ldappasswd.c
clients/tools/ldapsearch.c
doc/rfc/INDEX
include/ldap.h
libraries/libldap/error.c
libraries/libldap/result.c
tests/scripts/test001-slapadd
tests/scripts/test002-populate
tests/scripts/test003-search
tests/scripts/test004-modify
tests/scripts/test005-modrdn
tests/scripts/test006-acls
tests/scripts/test007-replication
tests/scripts/test008-concurrency
tests/scripts/test009-referral
tests/scripts/test010-passwd

index 14fb9459698a5237f986dbadf52d7964318951da..200d9f2a21fc90033c61c781dcfc1c6b112d7381 100644 (file)
@@ -456,25 +456,29 @@ static int dodelete(
 
        rc = ldap_delete_ext( ld, dn, NULL, NULL, &id );
        if ( rc != LDAP_SUCCESS ) {
-               ldap_perror( ld, "ldap_delete_ext" );
+               fprintf( stderr, "ldapdelete: ldap_delete_ext: %s (%d)\n",
+                       ldap_err2string( rc ), rc );
                return rc;
        }
 
-       rc = ldap_result( ld, LDAP_RES_ANY, 0, NULL, &res );
-       if ( rc != LDAP_SUCCESS ) {
-               ldap_perror( ld, "ldap_result" );
+       rc = ldap_result( ld, LDAP_RES_ANY, LDAP_MSG_ALL, NULL, &res );
+       if ( rc < 0 ) {
+               ldap_perror( ld, "ldapdelete: ldap_result" );
                return rc;
        }
 
        rc = ldap_parse_result( ld, res, &code, &matcheddn, &text, &refs, NULL, 1 );
 
        if( rc != LDAP_SUCCESS ) {
-               ldap_perror( ld, "ldap_parse_result" );
+               fprintf( stderr, "ldapdelete: ldap_parse_result: %s (%d)\n",
+                       ldap_err2string( rc ), rc );
                return rc;
        }
 
-       if( verbose || code != LDAP_SUCCESS || matcheddn || text || refs ) {
-               printf( "Result: %s (%d)\n", ldap_err2string( code ), code );
+       if( verbose || code != LDAP_SUCCESS ||
+               (matcheddn && *matcheddn) || (text && *text) || (refs && *refs) )
+       {
+               printf( "Delete Result: %s (%d)\n", ldap_err2string( code ), code );
 
                if( text && *text ) {
                        printf( "Additional info: %s\n", text );
@@ -494,7 +498,7 @@ static int dodelete(
 
        ber_memfree( text );
        ber_memfree( matcheddn );
-       ber_memvfree( refs );
+       ber_memvfree( (void **) refs );
 
        return code;
 }
index b29e17cd0c4f763e11bc2769274f8320b450933e..142efb62dcce355aec30748eb494c2e36c317290 100644 (file)
@@ -509,25 +509,30 @@ static int domodrdn(
                NULL, NULL, &id );
 
        if ( rc != LDAP_SUCCESS ) {
-               ldap_perror( ld, "ldap_rename" );
+               fprintf( stderr, "ldapmodrdn: ldap_rename: %s (%d)\n",
+                       ldap_err2string( rc ), rc );
                return rc;
        }
 
-       rc = ldap_result( ld, LDAP_RES_ANY, 0, NULL, &res );
-       if ( rc != LDAP_SUCCESS ) {
-               ldap_perror( ld, "ldap_result" );
+       rc = ldap_result( ld, LDAP_RES_ANY, LDAP_MSG_ALL, NULL, &res );
+       if ( rc < 0 ) {
+               ldap_perror( ld, "ldapmodrdn: ldap_result" );
                return rc;
        }
 
        rc = ldap_parse_result( ld, res, &code, &matcheddn, &text, &refs, NULL, 1 );
 
        if( rc != LDAP_SUCCESS ) {
-               ldap_perror( ld, "ldap_parse_result" );
+               fprintf( stderr, "ldapmodrdn: ldap_parse_result: %s (%d)\n",
+                       ldap_err2string( rc ), rc );
                return rc;
        }
 
-       if( verbose || code != LDAP_SUCCESS || matcheddn || text || refs ) {
-               printf( "Result: %s (%d)\n", ldap_err2string( code ), code );
+       if( verbose || code != LDAP_SUCCESS ||
+               (matcheddn && *matcheddn) || (text && *text) || (refs && *refs) )
+       {
+               printf( "Rename Result: %s (%d)\n",
+                       ldap_err2string( code ), code );
 
                if( text && *text ) {
                        printf( "Additional info: %s\n", text );
@@ -547,7 +552,7 @@ static int domodrdn(
 
        ber_memfree( text );
        ber_memfree( matcheddn );
-       ber_memvfree( refs );
+       ber_memvfree( (void **) refs );
 
        return code;
 }
index 96e898afd2a33c3ad99a51cc1dfbbe7b10fd29a7..5385aa1d584e8e0ce1006d0bb8330a08ca5b5f0c 100644 (file)
@@ -449,9 +449,9 @@ main( int argc, char *argv[] )
                return EXIT_FAILURE;
        }
 
-       rc = ldap_result( ld, LDAP_RES_ANY, 0, NULL, &res );
-       if ( rc != LDAP_SUCCESS ) {
-               ldap_perror( ld, "ldap_result" );
+       rc = ldap_result( ld, LDAP_RES_ANY, LDAP_MSG_ALL, NULL, &res );
+       if ( rc < 0 ) {
+               ldap_perror( ld, "ldappasswd: ldap_result" );
                return rc;
        }
 
@@ -514,7 +514,7 @@ main( int argc, char *argv[] )
 
        ber_memfree( text );
        ber_memfree( matcheddn );
-       ber_memvfree( refs );
+       ber_memvfree( (void **) refs );
        ber_memfree( retoid );
        ber_bvfree( retdata );
 
index 0bd21c266fd1700d45b08eca72abaf28a8589ff7..0b8ca33c31b2bf02c06620970912aa79d8a24251 100644 (file)
@@ -713,15 +713,18 @@ static int dosearch(
                sctrls, cctrls, timelimit, sizelimit, &msgid );
 
        if( rc != LDAP_SUCCESS ) {
-               ldap_perror( ld, "ldap_search" );
+               fprintf( stderr, "ldapsearch: ldap_search_ext: %s (%d)",
+                       ldap_err2string( rc ), rc );
                return( rc );
        }
 
        nresponses = nentries = nreferences = nextended = npartial = 0;
 
        res = NULL;
+
        while ((rc = ldap_result( ld, LDAP_RES_ANY,
-               sortattr ? 1 : 0, NULL, &res )) > 0 )
+               sortattr ? LDAP_MSG_ALL : LDAP_MSG_ONE,
+               NULL, &res )) > 0 )
        {
                if( sortattr ) {
                        (void) ldap_sort_entries( ld, &res,
index 58b0101f76152efb3270396bbb99ea1ab5be9a5d..297dcc719406f41ceede26fb89fb3b16b374f4af 100644 (file)
@@ -28,7 +28,7 @@ rfc2164.txt X.500/LDAP MIXER address mapping (PS)
 rfc2218.txt Common Schema for the Internet White Pages Service (PS)
 rfc2222.txt Simple Authentication and Security Layer (PS)
 rfc2247.txt Using Domains in LDAP DNs (PS)
-rfc2251.txt    LDAPv3 Protocol (PS)
+rfc2251.txt LDAPv3 Protocol (PS)
 rfc2252.txt LDAPv3 Attribute Types (PS)
 rfc2253.txt LDAPv3 Disinguished Name (PS)
 rfc2254.txt LDAPv3 Search Filters (PS)
@@ -52,6 +52,6 @@ rfc2798.txt LDAP inetOrgPerson schema (I)
 rfc2829.txt LDAPv3/Authentication Methods (PS)
 rfc2830.txt LDAPv3/StartTLS (PS)
 rfc2831.txt SASL/DIGEST-MD5 (PS)
-rfc2849.txt    LDIFv1 (PS)
+rfc2849.txt LDIFv1 (PS)
 
 $OpenLDAP$
index ccb0f4aa285d27e13181b9c1f51ecb9502b55a0a..a46f0858ba8f89f6afb4310d2b68552d42cbeb39 100644 (file)
@@ -266,8 +266,8 @@ typedef struct ldapcontrol {
 #define LDAP_RES_EXTENDED              ((ber_tag_t) 0x78U)     /* V3: application + constructed */
 #define LDAP_RES_EXTENDED_PARTIAL      ((ber_tag_t) 0x79U)     /* V3+: application + constructed */
 
-#define LDAP_RES_ANY                   ((ber_tag_t)(-1))
-#define LDAP_RES_UNSOLICITED   ((ber_tag_t)(0))
+#define LDAP_RES_ANY                   (-1)
+#define LDAP_RES_UNSOLICITED   (0)
 
 
 /* sasl methods */
index 8594c849afe69e5644254432f95d0c57703a4e80..90fcac082fdf876cb01a3c70b07fe833bede303c 100644 (file)
@@ -211,7 +211,6 @@ ldap_parse_result(
        LDAPMessage     *lm;
        ber_int_t errcode = LDAP_SUCCESS;
 
-       int rc;
        ber_tag_t tag;
        BerElement      *ber;
 
@@ -307,7 +306,7 @@ ldap_parse_result(
                }
 
                if( tag != LBER_ERROR ) {
-                       rc = ldap_int_get_controls( ber, serverctrls );
+                       int rc = ldap_int_get_controls( ber, serverctrls );
 
                        if( rc != LDAP_SUCCESS ) {
                                tag = LBER_ERROR;
index 3d326ca7c5c4d040309ee50ee96fedf774437bd3..5ef39bb8cd2cc820f569fc99e3c265726d552111 100644 (file)
@@ -67,12 +67,14 @@ static void merge_error_info LDAP_P(( LDAP *ld, LDAPRequest *parentr, LDAPReques
 
 /*
  * ldap_result - wait for an ldap result response to a message from the
- * ldap server.  If msgid is -1, any message will be accepted, otherwise
- * ldap_result will wait for a response with msgid.  If all is 0 the
- * first message with id msgid will be accepted, otherwise, ldap_result
- * will wait for all responses with id msgid and then return a pointer to
- * the entire list of messages.  This is only useful for search responses,
- * which can be of two message types (zero or more entries, followed by an
+ * ldap server.  If msgid is LDAP_RES_ANY (-1), any message will be
+ * accepted.  If msgid is LDAP_RES_UNSOLICITED (0), any unsolicited
+ * message is accepted.  Otherwise ldap_result will wait for a response
+ * with msgid.  If all is LDAP_MSG_ONE (0) the first message with id
+ * msgid will be accepted, otherwise, ldap_result will wait for all
+ * responses with id msgid and then return a pointer to the entire list
+ * of messages.  This is only useful for search responses, which can be
+ * of two message types (zero or more entries, followed by an
  * ldap result).  The type of the first message received is returned.
  * When waiting, any messages that have been abandoned are discarded.
  *
index 9a2a28301927009882ef9dd0d6b61543a80c20c4..efe811eae7663c5852145224385c617648f6fd5f 100755 (executable)
@@ -24,7 +24,7 @@ echo "Running slapadd to build slapd database..."
 $LDIF2LDBM -f $CONF -l $LDIF
 RC=$?
 if test $RC != 0 ; then
-       echo "slapadd failed!"
+       echo "slapadd failed ($RC)!"
        exit $RC
 fi
 
@@ -46,7 +46,7 @@ done
 kill -HUP $PID
 
 if test $RC != 0 ; then
-       echo "ldapsearch failed!"
+       echo "ldapsearch failed ($RC)!"
        exit $RC
 fi
 
index 1f59703832b1efc995080c8483e61308fc062f7b..fdf62cb97d4267c3e0c889207f34d92e0e43d33c 100755 (executable)
@@ -37,7 +37,7 @@ $LDAPADD -D "$MANAGERDN" -h localhost -p $PORT -w $PASSWD < \
        $LDIFORDERED > $TESTOUT 2>&1
 RC=$?
 if test $RC != 0 ; then
-       echo "ldapadd failed!"
+       echo "ldapadd failed ($RC)!"
        kill -HUP $PID
        exit $RC
 fi
@@ -49,7 +49,7 @@ $LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $PORT \
 kill -HUP $PID
 
 if test $RC != 0 ; then
-       echo "ldapsearch failed!"
+       echo "ldapsearch failed ($RC)!"
        exit $RC
 fi
 
index eb79e876d36c206bc67175a14257815e2d68ceeb..bced8e1fbb5b7ed2204d4ca8a2c05a58a7cc458a 100755 (executable)
@@ -21,7 +21,7 @@ echo "Running slapadd to build slapd database..."
 $LDIF2LDBM -f $CONF -l $LDIF
 RC=$?
 if test $RC != 0 ; then
-       echo "slapadd failed!"
+       echo "slapadd failed ($RC)!"
        exit $RC
 fi
 
@@ -41,7 +41,7 @@ for i in 0 1 2 3 4 5; do
 done
 
 if test $RC != 0 ; then
-       echo "ldapsearch failed!"
+       echo "ldapsearch failed ($RC)!"
        kill -HUP $PID
        exit $RC
 fi
@@ -52,7 +52,7 @@ echo "Testing exact searching..."
 $LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $PORT \
        'sn=jensen' >> $SEARCHOUT 2>&1
 if test $RC != 0 ; then
-       echo "ldapsearch failed!"
+       echo "ldapsearch failed ($RC)!"
        kill -HUP $PID
        exit $RC
 fi
@@ -61,7 +61,7 @@ echo "Testing OR searching..."
 $LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $PORT \
        '(|(objectclass=groupofnames)(sn=jones))' >> $SEARCHOUT 2>&1
 if test $RC != 0 ; then
-       echo "ldapsearch failed!"
+       echo "ldapsearch failed ($RC)!"
        kill -HUP $PID
        exit $RC
 fi
@@ -70,7 +70,7 @@ echo "Testing AND matching and ends-with searching..."
 $LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $PORT \
        '(&(objectclass=groupofnames)(cn=A*))' >> $SEARCHOUT 2>&1
 if test $RC != 0 ; then
-       echo "ldapsearch failed!"
+       echo "ldapsearch failed ($RC)!"
        kill -HUP $PID
        exit $RC
 fi
@@ -79,7 +79,7 @@ echo "Testing NOT searching..."
 $LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $PORT \
        '(!(objectclass=person))' >> $SEARCHOUT 2>&1
 if test $RC != 0 ; then
-       echo "ldapsearch failed!"
+       echo "ldapsearch failed ($RC)!"
        kill -HUP $PID
        exit $RC
 fi
index 59db1498a6e8bde07fc419b8d04e93ce57de8bb4..f485007de75ed098c3081187c3ed79466268343a 100755 (executable)
@@ -21,7 +21,7 @@ echo "Running slapadd to build slapd database..."
 $LDIF2LDBM -f $CONF -l $LDIF
 RC=$?
 if test $RC != 0 ; then
-       echo "slapadd failed!"
+       echo "slapadd failed ($RC)!"
        exit $RC
 fi
 
@@ -41,7 +41,7 @@ for i in 0 1 2 3 4 5; do
 done
 
 if test $RC != 0 ; then
-       echo "ldapsearch failed!"
+       echo "ldapsearch failed ($RC)!"
        kill -HUP $PID
        exit $RC
 fi
@@ -113,7 +113,7 @@ EOMODS
 
 RC=$?
 if test $RC != 0 ; then
-       echo "ldapmodify failed!"
+       echo "ldapmodify failed ($RC)!"
        kill -HUP $PID
        exit $RC
 fi
@@ -124,7 +124,7 @@ $LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $PORT \
 RC=$?
 kill -HUP $PID
 if test $RC != 0 ; then
-       echo "ldapsearch failed!"
+       echo "ldapsearch failed ($RC)!"
        exit $RC
 fi
 
index ca5b98bea14b499620a5119bb6cc587e0278788e..f72ccfdf6adec3ce34da6f0c62eba7f07d3df9ac 100755 (executable)
@@ -21,7 +21,7 @@ echo "Running slapadd to build slapd database..."
 $LDIF2LDBM -f $CONF -l $LDIF
 RC=$?
 if test $RC != 0 ; then
-       echo "slapadd failed!"
+       echo "slapadd failed ($RC)!"
        exit $RC
 fi
 
@@ -42,7 +42,7 @@ for i in 0 1 2 3 4 5; do
 done
 
 if test $RC != 0 ; then
-       echo "ldapsearch failed!"
+       echo "ldapsearch failed ($RC)!"
        kill -HUP $PID
        exit $RC
 fi
@@ -50,23 +50,23 @@ fi
 # -r used to do remove of old rdn
 
 echo "Testing modrdn(deleteoldrdn=0)..."
-$LDAPMODRDN -v -D "$MANAGERDN" -h localhost -p $PORT -w $PASSWD > \
+$LDAPMODRDN -D "$MANAGERDN" -h localhost -p $PORT -w $PASSWD > \
        $TESTOUT 2>&1 'cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US' 'cn=James A Jones III'
 
 RC=$?
 if test $RC != 0 ; then
-       echo "ldapmodrdn failed!"
+       echo "ldapmodrdn failed ($RC)!"
        kill -HUP $PID
        exit $RC
 fi
 
 echo "Testing modrdn(deleteoldrdn=1)..."
-$LDAPMODRDN -v -D "$MANAGERDN" -r -h localhost -p $PORT -w $PASSWD >> \
+$LDAPMODRDN -D "$MANAGERDN" -r -h localhost -p $PORT -w $PASSWD >> \
        $TESTOUT 2>&1 'cn=James A Jones 2, ou=Information Technology Division, ou=People, o=University of Michigan, c=US' 'cn=James A Jones II'
 
 RC=$?
 if test $RC != 0 ; then
-       echo "ldapmodrdn failed!"
+       echo "ldapmodrdn failed ($RC)!"
        kill -HUP $PID
        exit $RC
 fi
@@ -78,7 +78,7 @@ $LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $PORT \
            'cn=James A Jones III' > $SEARCHOUT 2>&1
 RC=$?
 if test $RC != 0 ; then
-       echo "ldapsearch failed!"
+       echo "ldapsearch failed ($RC)!"
        kill -HUP $PID
        exit $RC
 fi
@@ -105,7 +105,7 @@ $LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $PORT \
            'cn=James A Jones II' > $SEARCHOUT 2>&1
 RC=$?
 if test $RC != 0 ; then
-       echo "ldapsearch failed!"
+       echo "ldapsearch failed ($RC)!"
        kill -HUP $PID
        exit $RC
 fi
@@ -135,7 +135,7 @@ $LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $PORT \
 RC=$?
 if test $RC != 0 ; then
        kill -HUP $PID
-       echo "ldapsearch failed!"
+       echo "ldapsearch failed ($RC)!"
        exit $RC
 fi
 $CMP $SEARCHOUT /dev/null
@@ -151,7 +151,7 @@ $LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $PORT \
 RC=$?
 if test $RC != 0 ; then
        kill -HUP $PID
-       echo "ldapsearch failed!"
+       echo "ldapsearch failed ($RC)!"
        exit $RC
 fi
 
@@ -172,12 +172,12 @@ fi
 
 
 echo "Testing modrdn(deleteoldrdn=1), modrdn with new rdn already an att val..."
-$LDAPMODRDN -v -D "$MANAGERDN" -r -h localhost -p $PORT -w $PASSWD > \
+$LDAPMODRDN -D "$MANAGERDN" -r -h localhost -p $PORT -w $PASSWD > \
        /dev/null 2>&1 'cn=James A Jones III, ou=Alumni Association, ou=People, o=University of Michigan, c=US' 'cn=James A Jones 1'
 
 RC=$?
 if test $RC != 0 ; then
-       echo "ldapmodrdn failed!"
+       echo "ldapmodrdn failed ($RC)!"
        kill -HUP $PID
        exit $RC
 fi
@@ -190,7 +190,7 @@ $LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $PORT \
            'cn=James A Jones 1' > $SEARCHOUT 2>&1
 RC=$?
 if test $RC != 0 ; then
-       echo "ldapsearch failed!"
+       echo "ldapsearch failed ($RC)!"
        kill -HUP $PID
        exit $RC
 fi
index 63557bd79ba918acd0515baf96b5c3404d4619b9..a9defa4414a573f149aa24fa47954abb78bcd5f1 100755 (executable)
@@ -21,7 +21,7 @@ echo "Running slapadd to build slapd database..."
 $LDIF2LDBM -f $CONF -l $LDIF
 RC=$?
 if test $RC != 0 ; then
-       echo "slapadd failed!"
+       echo "slapadd failed ($RC)!"
        exit $RC
 fi
 
@@ -41,7 +41,7 @@ for i in 0 1 2 3 4 5; do
 done
 
 if test $RC != 0 ; then
-       echo "ldapsearch failed!"
+       echo "ldapsearch failed ($RC)!"
        kill -HUP $PID
        exit $RC
 fi
@@ -120,7 +120,7 @@ $LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $PORT \
 RC=$?
 kill -HUP $PID
 if test $RC != 0 ; then
-       echo "ldapsearch failed!"
+       echo "ldapsearch failed ($RC)!"
        exit $RC
 fi
 
index 07b60921abf6b1902c159bb32903a3867282b35d..f71a002120478966c48aaad01df0bd37a4a48fed 100755 (executable)
@@ -73,7 +73,7 @@ $LDAPADD -D "$MANAGERDN" -h localhost -p $PORT -w $PASSWD < \
        $LDIFORDERED > /dev/null 2>&1
 RC=$?
 if test $RC != 0 ; then
-       echo "ldapadd failed!"
+       echo "ldapadd failed ($RC)!"
        kill -HUP $PID $SLAVEPID $SLURPPID
        exit $RC
 fi
@@ -148,7 +148,7 @@ $LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $PORT \
        'objectclass=*' > $MASTEROUT 2>&1
 
 if test $RC != 0 ; then
-       echo "ldapsearch failed!"
+       echo "ldapsearch failed ($RC)!"
        kill -HUP $PID $SLAVEPID $SLURPPID
        exit $RC
 fi
@@ -158,7 +158,7 @@ $LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $SLAVEPORT \
        'objectclass=*' > $SLAVEOUT 2>&1
 
 if test $RC != 0 ; then
-       echo "ldapsearch failed!"
+       echo "ldapsearch failed ($RC)!"
        kill -HUP $PID $SLAVEPID $SLURPPID
        exit $RC
 fi
index 753bcc357a9fa03e0dcd3bd9cdb2a70f638e5d5e..8110d37e6182aca0bb04d37da531f4e1b18c2e36 100755 (executable)
@@ -24,7 +24,7 @@ echo "Running slapadd to build slapd database..."
 $LDIF2LDBM -f $CONF -l $LDIF
 RC=$?
 if test $RC != 0 ; then
-       echo "slapadd failed!"
+       echo "slapadd failed ($RC)!"
        exit $RC
 fi
 
@@ -51,7 +51,7 @@ $SLAPDTESTER -b "$BASEDN" -P "$PROGDIR" -d "$DATADIR" -h localhost -p $PORT -D "
 RC=$?
 
 if test $RC != 0 ; then
-       echo "slapd-tester failed!"
+       echo "slapd-tester failed ($RC)!"
        exit $RC
 fi 
 
@@ -63,7 +63,7 @@ RC=$?
 kill -HUP $PID
 
 if test $RC != 0 ; then
-       echo "ldapsearch failed!"
+       echo "ldapsearch failed ($RC)!"
        exit $RC
 fi
 
index 9cc30645e247c3ca087e3854274926ab48eb92b1..745c9cff996a20757ea6dc37f88fb1e900775496 100755 (executable)
@@ -26,7 +26,7 @@ echo "Running slapadd to build slapd database..."
 $LDIF2LDBM -f $CONF -l $LDIF
 RC=$?
 if test $RC != 0 ; then
-       echo "slapadd failed!"
+       echo "slapadd failed ($RC)!"
        exit $RC
 fi
 
@@ -50,7 +50,7 @@ for i in 0 1 2 3 4 5; do
 done
 
 if test $RC != 0 ; then
-       echo "ldapsearch failed!"
+       echo "ldapsearch failed ($RC)!"
        kill -HUP $PID
        exit $RC
 fi
@@ -72,7 +72,7 @@ echo "Testing exact searching..."
 $LDAPSEARCH -C -S "" -b "$BASEDN" -h localhost -p $SLAVEPORT \
        'sn=jensen' >> $SEARCHOUT 2>&1
 if test $RC != 0 ; then
-       echo "ldapsearch failed!"
+       echo "ldapsearch failed ($RC)!"
        kill -HUP $PID $SLAVEPID
        exit $RC
 fi
@@ -81,7 +81,7 @@ echo "Testing OR searching..."
 $LDAPSEARCH -C -S "" -b "$BASEDN" -h localhost -p $SLAVEPORT \
        '(|(objectclass=groupofnames)(sn=jones))' >> $SEARCHOUT 2>&1
 if test $RC != 0 ; then
-       echo "ldapsearch failed!"
+       echo "ldapsearch failed ($RC)!"
        kill -HUP $PID $SLAVEPID
        exit $RC
 fi
@@ -90,7 +90,7 @@ echo "Testing AND matching and ends-with searching..."
 $LDAPSEARCH -C -S "" -b "$BASEDN" -h localhost -p $SLAVEPORT \
        '(&(objectclass=groupofnames)(cn=A*))' >> $SEARCHOUT 2>&1
 if test $RC != 0 ; then
-       echo "ldapsearch failed!"
+       echo "ldapsearch failed ($RC)!"
        kill -HUP $PID $SLAVEPID
        exit $RC
 fi
@@ -99,7 +99,7 @@ echo "Testing NOT searching..."
 $LDAPSEARCH -C -S "" -b "$BASEDN" -h localhost -p $SLAVEPORT \
        '(!(objectclass=person))' >> $SEARCHOUT 2>&1
 if test $RC != 0 ; then
-       echo "ldapsearch failed!"
+       echo "ldapsearch failed ($RC)!"
        kill -HUP $PID $SLAVEPID
        exit $RC
 fi
index 3d71698224efb1c90138d327daac6409bf2e10c5..7c8c12c2360c4f4b4416c096c116110e4a4ef305 100755 (executable)
@@ -37,7 +37,7 @@ $LDAPADD -D "$MANAGERDN" -h localhost -p $PORT -w $PASSWD < \
        $LDIFPASSWD > $TESTOUT 2>&1
 RC=$?
 if test $RC != 0 ; then
-       echo "ldapadd failed!"
+       echo "ldapadd failed ($RC)!"
        kill -HUP $PID
        exit $RC
 fi
@@ -59,7 +59,7 @@ $LDAPPASSWD -h localhost -p $PORT \
        "cn=md5, $BASEDN" >> $TESTOUT 2>&1
 RC=$?
 if test $RC != 0 ; then
-       echo "ldappasswd failed!"
+       echo "ldappasswd failed ($RC)!"
        kill -HUP $PID
        exit $RC
 fi
@@ -67,7 +67,7 @@ $LDAPPASSWD -h localhost -p $PORT \
        -w secret -s newsecret \
        "cn=smd5, $BASEDN" >> $TESTOUT 2>&1
 if test $RC != 0 ; then
-       echo "ldappasswd failed!"
+       echo "ldappasswd failed ($RC)!"
        kill -HUP $PID
        exit $RC
 fi
@@ -75,7 +75,7 @@ $LDAPPASSWD -h localhost -p $PORT \
        -w secret -s newsecret \
        "cn=sha, $BASEDN" >> $TESTOUT 2>&1
 if test $RC != 0 ; then
-       echo "ldappasswd failed!"
+       echo "ldappasswd failed ($RC)!"
        kill -HUP $PID
        exit $RC
 fi
@@ -83,7 +83,7 @@ $LDAPPASSWD -h localhost -p $PORT \
        -w secret -s newsecret \
        "cn=ssha, $BASEDN" >> $TESTOUT 2>&1
 if test $RC != 0 ; then
-       echo "ldappasswd failed!"
+       echo "ldappasswd failed ($RC)!"
        kill -HUP $PID
        exit $RC
 fi
@@ -95,7 +95,7 @@ $LDAPPASSWD -h localhost -p $PORT \
        -w newsecret \
        "cn=md5, $BASEDN" >> $TESTOUT 2>&1
 if test $RC != 0 ; then
-       echo "ldappasswd failed!"
+       echo "ldappasswd failed ($RC)!"
        kill -HUP $PID
        exit $RC
 fi
@@ -103,7 +103,7 @@ $LDAPPASSWD -h localhost -p $PORT \
        -w newsecret \
        "cn=smd5, $BASEDN" >> $TESTOUT 2>&1
 if test $RC != 0 ; then
-       echo "ldappasswd failed!"
+       echo "ldappasswd failed ($RC)!"
        kill -HUP $PID
        exit $RC
 fi
@@ -111,7 +111,7 @@ $LDAPPASSWD -h localhost -p $PORT \
        -w newsecret \
        "cn=sha, $BASEDN" >> $TESTOUT 2>&1
 if test $RC != 0 ; then
-       echo "ldappasswd failed!"
+       echo "ldappasswd failed ($RC)!"
        kill -HUP $PID
        exit $RC
 fi
@@ -119,7 +119,7 @@ $LDAPPASSWD -h localhost -p $PORT \
        -w newsecret \
        "cn=ssha, $BASEDN" >> $TESTOUT 2>&1
 if test $RC != 0 ; then
-       echo "ldappasswd failed!"
+       echo "ldappasswd failed ($RC)!"
        kill -HUP $PID
        exit $RC
 fi