$NetBSD: patch-am,v 1.4 2005/10/26 15:08:13 jlam Exp $ --- libraries/libldap/cyrus.c.orig 2005-10-05 13:42:19.000000000 -0400 +++ libraries/libldap/cyrus.c @@ -835,7 +835,7 @@ ldap_int_sasl_external( LDAP *ld, LDAPConn *conn, const char * authid, - ber_len_t ssf ) + ber_uint_t ssf ) { int sc; sasl_conn_t *ctx; @@ -977,6 +977,7 @@ int ldap_pvt_sasl_secprops( char **props = ldap_str2charray( in, "," ); unsigned sflags = 0; int got_sflags = 0; + int tmp_ssf; sasl_ssf_t max_ssf = 0; int got_max_ssf = 0; sasl_ssf_t min_ssf = 0; @@ -1002,9 +1003,9 @@ int ldap_pvt_sasl_secprops( if ( next == NULL || next[ 0 ] != '\0' ) continue; switch( sprops[j].ival ) { case GOT_MINSSF: - min_ssf = v; got_min_ssf++; break; + min_ssf = (v >= 0 ? (sasl_ssf_t)v : 0); got_min_ssf++; break; case GOT_MAXSSF: - max_ssf = v; got_max_ssf++; break; + max_ssf = (v >= 0 ? (sasl_ssf_t)v : 0); got_max_ssf++; break; case GOT_MAXBUF: maxbufsize = v; got_maxbufsize++; break; } @@ -1100,7 +1101,7 @@ ldap_int_sasl_get_option( LDAP *ld, int return -1; } - *(ber_len_t *)arg = *ssf; + *(sasl_ssf_t *)arg = *ssf; } break; case LDAP_OPT_X_SASL_SSF_EXTERNAL: @@ -1108,13 +1109,13 @@ ldap_int_sasl_get_option( LDAP *ld, int return -1; case LDAP_OPT_X_SASL_SSF_MIN: - *(ber_len_t *)arg = ld->ld_options.ldo_sasl_secprops.min_ssf; + *(sasl_ssf_t *)arg = ld->ld_options.ldo_sasl_secprops.min_ssf; break; case LDAP_OPT_X_SASL_SSF_MAX: - *(ber_len_t *)arg = ld->ld_options.ldo_sasl_secprops.max_ssf; + *(sasl_ssf_t *)arg = ld->ld_options.ldo_sasl_secprops.max_ssf; break; case LDAP_OPT_X_SASL_MAXBUFSIZE: - *(ber_len_t *)arg = ld->ld_options.ldo_sasl_secprops.maxbufsize; + *(ber_uint_t *)arg = ld->ld_options.ldo_sasl_secprops.maxbufsize; break; case LDAP_OPT_X_SASL_SECPROPS: @@ -1160,7 +1161,7 @@ ldap_int_sasl_set_option( LDAP *ld, int #else memset(&extprops, 0L, sizeof(extprops)); - extprops.ssf = * (ber_len_t *) arg; + extprops.ssf = * (sasl_ssf_t *) arg; sc = sasl_setprop( ctx, SASL_SSF_EXTERNAL, (void *) &extprops ); @@ -1172,13 +1173,13 @@ ldap_int_sasl_set_option( LDAP *ld, int } break; case LDAP_OPT_X_SASL_SSF_MIN: - ld->ld_options.ldo_sasl_secprops.min_ssf = *(ber_len_t *)arg; + ld->ld_options.ldo_sasl_secprops.min_ssf = *(sasl_ssf_t *)arg; break; case LDAP_OPT_X_SASL_SSF_MAX: - ld->ld_options.ldo_sasl_secprops.max_ssf = *(ber_len_t *)arg; + ld->ld_options.ldo_sasl_secprops.max_ssf = *(sasl_ssf_t *)arg; break; case LDAP_OPT_X_SASL_MAXBUFSIZE: - ld->ld_options.ldo_sasl_secprops.maxbufsize = *(ber_len_t *)arg; + ld->ld_options.ldo_sasl_secprops.maxbufsize = *(ber_uint_t *)arg; break; case LDAP_OPT_X_SASL_SECPROPS: { @@ -1277,7 +1278,7 @@ ldap_int_sasl_external( LDAP *ld, LDAPConn *conn, const char * authid, - ber_len_t ssf ) + ber_uint_t ssf ) { return LDAP_SUCCESS; } #endif /* HAVE_CYRUS_SASL */