]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#10279 Let client notify when LDAP_DEBUG is disabled but -d specified
authorOndřej Kuzník <ondra@mistotebe.net>
Thu, 16 Jan 2025 15:35:06 +0000 (15:35 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Wed, 19 Feb 2025 16:51:05 +0000 (16:51 +0000)
clients/tools/common.c

index 362ea78fc61db6d52ac0d1fe3668234ecd9f6c4c..8249a960bf6a1870ee47bed15d20afccb80bf6d0 100644 (file)
@@ -1180,6 +1180,7 @@ tool_conn_setup( int dont, void (*private_setup)( LDAP * ) )
        LDAP *ld = NULL;
 
        if ( debug ) {
+#ifdef LDAP_DEBUG
                if( ber_set_option( NULL, LBER_OPT_DEBUG_LEVEL, &debug )
                        != LBER_OPT_SUCCESS )
                {
@@ -1192,6 +1193,10 @@ tool_conn_setup( int dont, void (*private_setup)( LDAP * ) )
                        fprintf( stderr,
                                "Could not set LDAP_OPT_DEBUG_LEVEL %d\n", debug );
                }
+#else /* !LDAP_DEBUG */
+               fprintf( stderr,
+                               "Must compile with LDAP_DEBUG for debugging\n", prog );
+#endif /* !LDAP_DEBUG */
        }
 
 #ifdef SIGPIPE