]> git.sur5r.net Git - openldap/commitdiff
ITS#7271 Don't clobber SASL_NOCANON in clients/tools/common.c
authorW. Trevor King <wking@tremily.us>
Wed, 30 May 2012 16:39:54 +0000 (09:39 -0700)
committerQuanah Gibson-Mount <quanah@openldap.org>
Wed, 30 May 2012 20:39:15 +0000 (13:39 -0700)
clients/tools/common.c

index 398c4f5d83c9ea223d5bc842b1fc7fb08b955cef..05430415fa8c3fd638abd3107d8f5153a6247ecc 100644 (file)
@@ -1340,12 +1340,13 @@ dnssrv_free:;
 
 #ifdef HAVE_CYRUS_SASL
                /* canon */
-               if( ldap_set_option( ld, LDAP_OPT_X_SASL_NOCANON,
-                       nocanon ? LDAP_OPT_ON : LDAP_OPT_OFF ) != LDAP_OPT_SUCCESS )
-               {
-                       fprintf( stderr, "Could not set LDAP_OPT_X_SASL_NOCANON %s\n",
-                               nocanon ? "on" : "off" );
-                       tool_exit( ld, EXIT_FAILURE );
+               if( nocanon ) {
+                       if( ldap_set_option( ld, LDAP_OPT_X_SASL_NOCANON,
+                               LDAP_OPT_ON ) != LDAP_OPT_SUCCESS )
+                       {
+                               fprintf( stderr, "Could not set LDAP_OPT_X_SASL_NOCANON on\n" );
+                               tool_exit( ld, EXIT_FAILURE );
+                       }
                }
 #endif
                if( ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &protocol )