]> git.sur5r.net Git - openldap/commitdiff
check for timeout allowed by options (ITS#6282)
authorPierangelo Masarati <ando@openldap.org>
Tue, 8 Sep 2009 07:55:57 +0000 (07:55 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 8 Sep 2009 07:55:57 +0000 (07:55 +0000)
clients/tools/common.c

index d0f39b2813e7910b2cef80876018fdfe1ea27894..d8fb6ac66f62162c580a0e7b55a1e5a468d503ce 100644 (file)
@@ -1438,11 +1438,17 @@ tool_bind( LDAP *ld )
                        }
                }
 
-               if ( ldap_result( ld, msgid, LDAP_MSG_ALL, NULL, &result ) == -1 ) {
+               rc = ldap_result( ld, msgid, LDAP_MSG_ALL, NULL, &result );
+               if ( rc == -1 ) {
                        tool_perror( "ldap_result", -1, NULL, NULL, NULL, NULL );
                        exit( LDAP_LOCAL_ERROR );
                }
 
+               if ( rc == 0 ) {
+                       tool_perror( "ldap_result", LDAP_TIMEOUT, NULL, NULL, NULL, NULL );
+                       exit( LDAP_LOCAL_ERROR );
+               }
+
                rc = ldap_parse_result( ld, result, &err, &matched, &info, &refs,
                        &ctrls, 1 );
                if ( rc != LDAP_SUCCESS ) {