mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-22 15:49:34 -05:00
Some gcc -W... cleanup
This commit is contained in:
parent
6df9dcc943
commit
a4411a9944
8 changed files with 42 additions and 27 deletions
|
|
@ -27,6 +27,7 @@
|
||||||
#include "ldap.h"
|
#include "ldap.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
|
int
|
||||||
do_abandon(
|
do_abandon(
|
||||||
struct conn *dsaconn,
|
struct conn *dsaconn,
|
||||||
BerElement *ber,
|
BerElement *ber,
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,8 @@ conn_add( struct conn *new )
|
||||||
conns = new;
|
conns = new;
|
||||||
}
|
}
|
||||||
|
|
||||||
static psap_cmp( struct PSAPaddr *a, struct PSAPaddr *b )
|
static int
|
||||||
|
psap_cmp( struct PSAPaddr *a, struct PSAPaddr *b )
|
||||||
{
|
{
|
||||||
return( bcmp( (char *) a, (char *) b, sizeof(struct PSAPaddr) ) );
|
return( bcmp( (char *) a, (char *) b, sizeof(struct PSAPaddr) ) );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@
|
||||||
#include "../../libraries/liblber/lber-int.h" /* get struct sockbuf */
|
#include "../../libraries/liblber/lber-int.h" /* get struct sockbuf */
|
||||||
#include "ldap.h"
|
#include "ldap.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include "lutil.h" /* Get lutil_detach() */
|
||||||
|
|
||||||
#ifdef HAVE_TCPD
|
#ifdef HAVE_TCPD
|
||||||
#include <tcpd.h>
|
#include <tcpd.h>
|
||||||
|
|
@ -49,11 +50,11 @@ int deny_severity = LOG_NOTICE;
|
||||||
#endif /* TCP_WRAPPERS */
|
#endif /* TCP_WRAPPERS */
|
||||||
|
|
||||||
void log_and_exit();
|
void log_and_exit();
|
||||||
static set_socket();
|
static int set_socket();
|
||||||
static do_queries();
|
static void do_queries();
|
||||||
static RETSIGTYPE wait4child();
|
static RETSIGTYPE wait4child();
|
||||||
#ifdef LDAP_CONNECTIONLESS
|
#ifdef LDAP_CONNECTIONLESS
|
||||||
static udp_init();
|
static int udp_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef LDAP_DEBUG
|
#ifdef LDAP_DEBUG
|
||||||
|
|
@ -84,8 +85,8 @@ int RunFromInetd = 0;
|
||||||
|
|
||||||
extern char Versionstr[];
|
extern char Versionstr[];
|
||||||
|
|
||||||
static usage( name )
|
static void
|
||||||
char *name;
|
usage( char *name )
|
||||||
{
|
{
|
||||||
fprintf( stderr, "usage: %s [-d debuglvl] [-p port] [-l] [-c dsa] [-r referraltimeout]", name );
|
fprintf( stderr, "usage: %s [-d debuglvl] [-p port] [-l] [-c dsa] [-r referraltimeout]", name );
|
||||||
#ifdef LDAP_CONNECTIONLESS
|
#ifdef LDAP_CONNECTIONLESS
|
||||||
|
|
@ -100,6 +101,7 @@ char *name;
|
||||||
fprintf( stderr, "\n" );
|
fprintf( stderr, "\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
main (argc, argv)
|
main (argc, argv)
|
||||||
int argc;
|
int argc;
|
||||||
char **argv;
|
char **argv;
|
||||||
|
|
@ -306,7 +308,7 @@ char **argv;
|
||||||
(void) get_syntaxes();
|
(void) get_syntaxes();
|
||||||
if (RunFromInetd) {
|
if (RunFromInetd) {
|
||||||
len = sizeof( socktype );
|
len = sizeof( socktype );
|
||||||
getsockopt( ns, SOL_SOCKET, SO_TYPE, &socktype, &len );
|
getsockopt( ns, SOL_SOCKET, SO_TYPE, (char *)&socktype, &len );
|
||||||
if ( socktype == SOCK_DGRAM ) {
|
if ( socktype == SOCK_DGRAM ) {
|
||||||
#ifdef LDAP_CONNECTIONLESS
|
#ifdef LDAP_CONNECTIONLESS
|
||||||
Debug( LDAP_DEBUG_ARGS,
|
Debug( LDAP_DEBUG_ARGS,
|
||||||
|
|
@ -489,14 +491,14 @@ char **argv;
|
||||||
/* NOT REACHED */
|
/* NOT REACHED */
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static void
|
||||||
do_queries(
|
do_queries(
|
||||||
int clientsock,
|
int clientsock,
|
||||||
int udp /* is this a UDP (CLDAP) request? */
|
int udp /* is this a UDP (CLDAP) request? */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
fd_set readfds;
|
fd_set readfds;
|
||||||
int rc, i;
|
int rc;
|
||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
Sockbuf sb;
|
Sockbuf sb;
|
||||||
#ifdef LDAP_CONNECTIONLESS
|
#ifdef LDAP_CONNECTIONLESS
|
||||||
|
|
@ -545,6 +547,7 @@ do_queries(
|
||||||
|
|
||||||
#ifdef LDAP_DEBUG
|
#ifdef LDAP_DEBUG
|
||||||
if ( ldap_debug & LDAP_DEBUG_CONNS ) {
|
if ( ldap_debug & LDAP_DEBUG_CONNS ) {
|
||||||
|
int i;
|
||||||
Debug( LDAP_DEBUG_CONNS, "FDLIST:", 0, 0, 0 );
|
Debug( LDAP_DEBUG_CONNS, "FDLIST:", 0, 0, 0 );
|
||||||
for ( i = 0; i < dtblsize; i++ ) {
|
for ( i = 0; i < dtblsize; i++ ) {
|
||||||
if ( FD_ISSET( i, &readfds ) ) {
|
if ( FD_ISSET( i, &readfds ) ) {
|
||||||
|
|
@ -603,7 +606,8 @@ do_queries(
|
||||||
/* NOT REACHED */
|
/* NOT REACHED */
|
||||||
}
|
}
|
||||||
|
|
||||||
static set_socket(
|
static int
|
||||||
|
set_socket(
|
||||||
int port,
|
int port,
|
||||||
int udp /* UDP port? */
|
int udp /* UDP port? */
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -96,8 +96,8 @@ del_msg( struct msg *m )
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( cur == NULL ) {
|
if ( cur == NULL ) {
|
||||||
Debug( LDAP_DEBUG_ANY, "delmsg: cannot find msg %x\n", m,
|
Debug( LDAP_DEBUG_ANY, "delmsg: cannot find msg %lx\n",
|
||||||
0, 0 );
|
(unsigned long) m, 0, 0 );
|
||||||
return( -1 );
|
return( -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ extern short ldap_rts_cred_syntax;
|
||||||
extern short ldap_rtl_syntax;
|
extern short ldap_rtl_syntax;
|
||||||
extern short ldap_octetstring_syntax;
|
extern short ldap_octetstring_syntax;
|
||||||
|
|
||||||
|
static int replace_mod( struct entrymod *, Attr_Sequence, Attr_Sequence );
|
||||||
|
|
||||||
#ifdef LDAP_COMPAT20
|
#ifdef LDAP_COMPAT20
|
||||||
extern int ldap_compat;
|
extern int ldap_compat;
|
||||||
|
|
@ -522,7 +523,7 @@ modlist_free( LDAPMod *mods )
|
||||||
* that are not in the new set and by only adding what isn't in old set
|
* that are not in the new set and by only adding what isn't in old set
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
static int
|
||||||
replace_mod(
|
replace_mod(
|
||||||
struct entrymod *rem,
|
struct entrymod *rem,
|
||||||
Attr_Sequence oas,
|
Attr_Sequence oas,
|
||||||
|
|
|
||||||
|
|
@ -135,8 +135,8 @@ client_request(
|
||||||
ttag = ber_skip_tag( &tber, &tlen );
|
ttag = ber_skip_tag( &tber, &tlen );
|
||||||
ttag = ber_peek_tag( &tber, &tlen );
|
ttag = ber_peek_tag( &tber, &tlen );
|
||||||
|
|
||||||
Debug( LDAP_DEBUG_ANY, "checking for 3.0 tag 0x%x\n",
|
Debug( LDAP_DEBUG_ANY, "checking for 3.0 tag 0x%lx\n",
|
||||||
ttag, 0, 0 );
|
ttag, 0, 0 );
|
||||||
if ( ttag == LBER_SEQUENCE ) {
|
if ( ttag == LBER_SEQUENCE ) {
|
||||||
Debug( LDAP_DEBUG_ANY, "version 3.0 detected\n",
|
Debug( LDAP_DEBUG_ANY, "version 3.0 detected\n",
|
||||||
0, 0, 0 );
|
0, 0, 0 );
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,9 @@
|
||||||
#include "ldap.h"
|
#include "ldap.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
static get_filter();
|
static int get_filter();
|
||||||
static get_filter_list();
|
static int get_filter_list();
|
||||||
static get_substring_filter();
|
static int get_substring_filter();
|
||||||
|
|
||||||
#ifdef LDAP_COMPAT
|
#ifdef LDAP_COMPAT
|
||||||
extern int version;
|
extern int version;
|
||||||
|
|
@ -206,7 +206,8 @@ do_search(
|
||||||
return( 1 );
|
return( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
static get_filter( BerElement *ber, Filter *filt )
|
static int
|
||||||
|
get_filter( BerElement *ber, Filter *filt )
|
||||||
{
|
{
|
||||||
unsigned long tag, len;
|
unsigned long tag, len;
|
||||||
int err;
|
int err;
|
||||||
|
|
@ -375,7 +376,7 @@ static get_filter( BerElement *ber, Filter *filt )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Debug( LDAP_DEBUG_ANY, "unknown filter type %d\n", tag, 0, 0 );
|
Debug( LDAP_DEBUG_ANY, "unknown filter type %lu\n", tag, 0, 0 );
|
||||||
free( f );
|
free( f );
|
||||||
return( LDAP_PROTOCOL_ERROR );
|
return( LDAP_PROTOCOL_ERROR );
|
||||||
break;
|
break;
|
||||||
|
|
@ -385,7 +386,8 @@ static get_filter( BerElement *ber, Filter *filt )
|
||||||
return( err );
|
return( err );
|
||||||
}
|
}
|
||||||
|
|
||||||
static get_filter_list( BerElement *ber, Filter f )
|
static int
|
||||||
|
get_filter_list( BerElement *ber, Filter f )
|
||||||
{
|
{
|
||||||
Filter new, tail;
|
Filter new, tail;
|
||||||
int err;
|
int err;
|
||||||
|
|
@ -416,7 +418,8 @@ static get_filter_list( BerElement *ber, Filter f )
|
||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
static get_substring_filter( BerElement *ber, Filter f )
|
static int
|
||||||
|
get_substring_filter( BerElement *ber, Filter f )
|
||||||
{
|
{
|
||||||
unsigned long tag, len;
|
unsigned long tag, len;
|
||||||
char typestr[64];
|
char typestr[64];
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,8 @@ short ldap_dLSubmitPermission_syntax;
|
||||||
static void de_t61( char *s, int t61mark );
|
static void de_t61( char *s, int t61mark );
|
||||||
static int syntax_is_string( short syntax );
|
static int syntax_is_string( short syntax );
|
||||||
|
|
||||||
static get_one_syntax( char *attrib, int required )
|
static int
|
||||||
|
get_one_syntax( char *attrib, int required )
|
||||||
{
|
{
|
||||||
oid_table_attr *p, *name2attr();
|
oid_table_attr *p, *name2attr();
|
||||||
|
|
||||||
|
|
@ -337,7 +338,8 @@ encode_dn(
|
||||||
return( rc );
|
return( rc );
|
||||||
}
|
}
|
||||||
|
|
||||||
static put_jpeg_value( BerElement *ber, AttributeValue av )
|
static int
|
||||||
|
put_jpeg_value( BerElement *ber, AttributeValue av )
|
||||||
{
|
{
|
||||||
PE pe;
|
PE pe;
|
||||||
int len;
|
int len;
|
||||||
|
|
@ -380,7 +382,8 @@ static put_jpeg_value( BerElement *ber, AttributeValue av )
|
||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
static put_audio_value( BerElement *ber, AttributeValue av )
|
static int
|
||||||
|
put_audio_value( BerElement *ber, AttributeValue av )
|
||||||
{
|
{
|
||||||
struct qbuf *qb, *p;
|
struct qbuf *qb, *p;
|
||||||
int rc, len;
|
int rc, len;
|
||||||
|
|
@ -417,7 +420,8 @@ static put_audio_value( BerElement *ber, AttributeValue av )
|
||||||
return( rc );
|
return( rc );
|
||||||
}
|
}
|
||||||
|
|
||||||
static put_photo_value( BerElement *ber, AttributeValue av )
|
static int
|
||||||
|
put_photo_value( BerElement *ber, AttributeValue av )
|
||||||
{
|
{
|
||||||
PE pe;
|
PE pe;
|
||||||
PS ps;
|
PS ps;
|
||||||
|
|
@ -479,7 +483,8 @@ static put_photo_value( BerElement *ber, AttributeValue av )
|
||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
static put_values(
|
static int
|
||||||
|
put_values(
|
||||||
BerElement *ber,
|
BerElement *ber,
|
||||||
PS ps,
|
PS ps,
|
||||||
short syntax,
|
short syntax,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue