From 040f945d3697b4860e3fbde491adf9a51aac65b1 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sun, 15 Feb 2009 21:59:16 +0000 Subject: [PATCH] fix misc warnings --- include/ldap.h | 16 ++++++++++++++++ include/ldap_pvt.h | 5 +++++ libraries/libldap/abandon.c | 3 --- libraries/libldap/gssapi.c | 8 ++++---- libraries/libldap/ldap-int.h | 10 ++++++++++ libraries/libldap/os-ip.c | 2 +- libraries/libldap/os-local.c | 2 +- libraries/libldap/result.c | 2 -- libraries/libldap/tls2.c | 5 +---- libraries/liblutil/meter.c | 1 - 10 files changed, 38 insertions(+), 16 deletions(-) diff --git a/include/ldap.h b/include/ldap.h index 19e25fb7a7..17f48982fa 100644 --- a/include/ldap.h +++ b/include/ldap.h @@ -1345,6 +1345,22 @@ ldap_perror LDAP_P(( /* deprecated, use ldap_err2string */ #endif +/* + * gssapi.c: + */ +LDAP_F( int ) +ldap_gssapi_bind LDAP_P(( + LDAP *ld, + LDAP_CONST char *dn, + LDAP_CONST char *creds )); + +LDAP_F( int ) +ldap_gssapi_bind_s LDAP_P(( + LDAP *ld, + LDAP_CONST char *dn, + LDAP_CONST char *creds )); + + /* * in modify.c: */ diff --git a/include/ldap_pvt.h b/include/ldap_pvt.h index a75bc3edd5..4913812563 100644 --- a/include/ldap_pvt.h +++ b/include/ldap_pvt.h @@ -286,6 +286,11 @@ LDAP_F (int) ldap_open_internal_connection LDAP_P(( LDAP_F (int) ldap_init_fd LDAP_P(( ber_socket_t fd, int proto, LDAP_CONST char *url, struct ldap **ldp )); +/* sasl.c */ +LDAP_F (int) ldap_pvt_sasl_generic_install LDAP_P(( Sockbuf *sb, + struct sb_sasl_generic_install *install_arg )); +LDAP_F (void) ldap_pvt_sasl_generic_remove LDAP_P(( Sockbuf *sb )); + /* search.c */ LDAP_F( int ) ldap_pvt_put_filter LDAP_P(( BerElement *ber, diff --git a/libraries/libldap/abandon.c b/libraries/libldap/abandon.c index bc7e5fe4a1..e8b32a0f3e 100644 --- a/libraries/libldap/abandon.c +++ b/libraries/libldap/abandon.c @@ -349,7 +349,6 @@ ldap_int_bisect_find( ber_int_t *v, ber_len_t n, ber_int_t id, int *idxp ) end, rc = 0; - assert( n >= 0 ); assert( id >= 0 ); begin = 0; @@ -410,7 +409,6 @@ ldap_int_bisect_insert( ber_int_t **vp, ber_len_t *np, int id, int idx ) assert( vp != NULL ); assert( np != NULL ); - assert( *np >= 0 ); assert( idx >= 0 ); assert( (unsigned) idx <= *np ); @@ -451,7 +449,6 @@ ldap_int_bisect_delete( ber_int_t **vp, ber_len_t *np, int id, int idx ) assert( vp != NULL ); assert( np != NULL ); - assert( *np >= 0 ); assert( idx >= 0 ); assert( (unsigned) idx < *np ); diff --git a/libraries/libldap/gssapi.c b/libraries/libldap/gssapi.c index 2f1385f327..c80ca2f8e7 100644 --- a/libraries/libldap/gssapi.c +++ b/libraries/libldap/gssapi.c @@ -351,8 +351,6 @@ map_gsserr2ldap( int gss_rc, OM_uint32 minor_status ) { - OM_uint32 min2; - OM_uint32 msg_ctx = 0; char msg[256]; Debug( LDAP_DEBUG_ANY, "%s\n", @@ -561,7 +559,7 @@ guess_service_principal( } ret = snprintf( svc_principal, svc_principal_size - 1, principal_fmt, str); - if (ret < 0 || ret >= svc_principal_size - 1) { + if (ret < 0 || (size_t)ret + 1 >= svc_principal_size) { ld->ld_errno = LDAP_LOCAL_ERROR; return ld->ld_errno; } @@ -996,7 +994,9 @@ ldap_gssapi_bind( LDAP *ld, LDAP_CONST char *dn, LDAP_CONST char *creds ) -{ return LDAP_NOT_SUPPORTED; } +{ + return LDAP_NOT_SUPPORTED; +} int ldap_gssapi_bind_s( diff --git a/libraries/libldap/ldap-int.h b/libraries/libldap/ldap-int.h index 81c4e6e1d1..f079753ed3 100644 --- a/libraries/libldap/ldap-int.h +++ b/libraries/libldap/ldap-int.h @@ -694,6 +694,16 @@ LDAP_F (void) ldap_int_tls_destroy LDAP_P(( struct ldapoptions *lo )); LDAP_F (char **) ldap_value_dup LDAP_P(( char *const *vals )); +/* + * in gssapi.c + */ +#ifdef HAVE_GSSAPI +LDAP_F(int) ldap_int_gssapi_get_option LDAP_P(( LDAP *ld, int option, void *arg )); +LDAP_F(int) ldap_int_gssapi_set_option LDAP_P(( LDAP *ld, int option, void *arg )); +LDAP_F(int) ldap_int_gssapi_config LDAP_P(( struct ldapoptions *lo, int option, const char *arg )); +LDAP_F(void) ldap_int_gssapi_close LDAP_P(( LDAP *ld, LDAPConn *lc )); +#endif + LDAP_END_DECL #endif /* _LDAP_INT_H */ diff --git a/libraries/libldap/os-ip.c b/libraries/libldap/os-ip.c index 3fc414564b..a3a3306f93 100644 --- a/libraries/libldap/os-ip.c +++ b/libraries/libldap/os-ip.c @@ -207,7 +207,7 @@ ldap_pvt_is_socket_ready(LDAP *ld, int s) == AC_SOCKET_ERROR ) { /* XXX: needs to be replace with ber_stream_read() */ - int rc = read(s, &ch, 1); + (void)read(s, &ch, 1); TRACE; return -1; } diff --git a/libraries/libldap/os-local.c b/libraries/libldap/os-local.c index 3c643c774a..aafce8b8e2 100644 --- a/libraries/libldap/os-local.c +++ b/libraries/libldap/os-local.c @@ -149,7 +149,7 @@ ldap_pvt_is_socket_ready(LDAP *ld, int s) == AC_SOCKET_ERROR ) { /* XXX: needs to be replace with ber_stream_read() */ - int rc = read(s, &ch, 1); + (void)read(s, &ch, 1); TRACE; return -1; } diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index 21f02c9831..ad62a02d30 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -106,7 +106,6 @@ ldap_result( struct timeval *timeout, LDAPMessage **result ) { - LDAPMessage *lm; int rc; assert( ld != NULL ); @@ -1384,7 +1383,6 @@ ldap_abandoned( LDAP *ld, ber_int_t msgid, int *idxp ) assert( idxp != NULL ); assert( msgid >= 0 ); - assert( ld->ld_nabandoned >= 0 ); return ldap_int_bisect_find( ld->ld_abandoned, ld->ld_nabandoned, msgid, idxp ); } diff --git a/libraries/libldap/tls2.c b/libraries/libldap/tls2.c index baadb1375d..e73ace5ce0 100644 --- a/libraries/libldap/tls2.c +++ b/libraries/libldap/tls2.c @@ -143,7 +143,6 @@ void ldap_pvt_tls_destroy( void ) { struct ldapoptions *lo = LDAP_INT_GLOBAL_OPT(); - int i; ldap_int_tls_destroy( lo ); @@ -179,8 +178,6 @@ tls_init(tls_impl *impl ) int ldap_pvt_tls_init( void ) { - struct ldapoptions *lo = LDAP_INT_GLOBAL_OPT(); - return tls_init( tls_imp ); } @@ -190,7 +187,7 @@ ldap_pvt_tls_init( void ) static int ldap_int_tls_init_ctx( struct ldapoptions *lo, int is_server ) { - int i, rc = 0; + int rc = 0; tls_impl *ti = tls_imp; struct ldaptls lts = lo->ldo_tls_info; diff --git a/libraries/liblutil/meter.c b/libraries/liblutil/meter.c index 6c631c7bd7..0bbbdc0307 100644 --- a/libraries/liblutil/meter.c +++ b/libraries/liblutil/meter.c @@ -141,7 +141,6 @@ lutil_meter_update ( int rc; assert( meter != NULL ); - assert( position >= 0 ); lutil_get_now( &now ); -- 2.39.5