[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: Cyrus SASL 2.1



In slapd/sasl.c something looks funny here, "sc = ';';" should be "*p =
';';" ?

 	/* create new SASL context */
+#ifdef HAVE_CYRUS_SASL2
+	if ( conn->c_sock_name.bv_len != 0 &&
+	     strncmp( conn->c_sock_name.bv_val, "IP=", 3 ) == 0) {
+		char *p;
+
+		iplocalport = ch_strdup( conn->c_sock_name.bv_val + 3 );
+		/* Convert IPv6 addresses to address;port syntax. */
+		p = strrchr( iplocalport, ' ' );
+		if ( p != NULL ) sc = ';';
+	}
+	if ( conn->c_peer_name.bv_len != 0 &&
+	     strncmp( conn->c_peer_name.bv_val, "IP=", 3 ) == 0) {
+		char *p;
+
+		ipremoteport = ch_strdup( conn->c_peer_name.bv_val + 3 );
+		/* Convert IPv6 addresses to address;port syntax. */
+		p = strrchr( ipremoteport, ' ' );
+		if ( p != NULL ) sc = ';';
+	}
 	sc = sasl_server_new( "ldap", global_host, global_realm,
+		iplocalport, ipremoteport, session_callbacks, 0, &ctx );
+	if ( iplocalport != NULL ) {
+		ch_free( iplocalport );
+	}
+	if ( ipremoteport != NULL ) {
+		ch_free( ipremoteport );
+	}
+#else
+	sc = sasl_server_new( "ldap", global_host, global_realm,
 		session_callbacks, SASL_SECURITY_LAYER, &ctx );
+#endif

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support

> -----Original Message-----
> From: owner-openldap-devel@OpenLDAP.org
> [mailto:owner-openldap-devel@OpenLDAP.org]On Behalf Of Luke Howard
> Sent: Saturday, February 09, 2002 11:17 AM
> To: lukeh@PADL.COM
> Cc: openldap-devel@OpenLDAP.org
> Subject: Re: Cyrus SASL 2.1
>
>
>
> Not sure I've got the memory management for sasl_encode/sasl_decode
> right yet. I'll look at it tomorrow morning.
>
> -- Luke
>
> >From: Luke Howard <lukeh@PADL.COM>
> >Subject: Cyrus SASL 2.1
> >To: openldap-devel@OpenLDAP.org
> >Date: Sun, 10 Feb 2002 01:13:09 +1100
> >Organization: PADL Software Pty Ltd
> >Versions: dmail (bsd44) 2.2g/makemail 2.9a
> >
> >
> >Here are some diffs for review for Cyrus SASL 2.1 support in HEAD:
> >
> >	http://www.padl.com/~lukeh/cyrus-2.1.diff
> >
> >Please note that this patch is completely untested presently.
> >
> >cheers,
> >
> >-- Luke
> >
> >--
> >Luke Howard | lukehoward.com
> >PADL Software | www.padl.com
>
> --
> Luke Howard | lukehoward.com
> PADL Software | www.padl.com