#include "globals.h"
-static int
+static void
usage( char *name )
{
fprintf( stderr, "usage: %s\t[-d debug-level] [-s syslog-level]\n", name );
char *new;
if ( (new = (char *) malloc( size )) == NULL ) {
- fprintf( stderr, "malloc of %d bytes failed\n", size );
+ fprintf( stderr, "malloc of %lu bytes failed\n", size );
exit( 1 );
}
}
if ( (new = (char *) realloc( block, size )) == NULL ) {
- fprintf( stderr, "realloc of %d bytes failed\n", size );
+ fprintf( stderr, "realloc of %lu bytes failed\n", size );
exit( 1 );
}
char *new;
if ( (new = (char *) calloc( nelem, size )) == NULL ) {
- fprintf( stderr, "calloc of %d elems of %d bytes failed\n",
+ fprintf( stderr, "calloc of %lu elems of %lu bytes failed\n",
nelem, size );
exit( 1 );
}
#include <ac/string.h>
#include <ac/socket.h>
+#include <ac/ctype.h>
#include <lber.h>
#include <ldap.h>
)
{
FILE *fp;
- char buf[BUFSIZ];
- char *line, *p;
+ char *line;
int cargc;
char *cargv[MAXARGS];
*p = '\0';
}
lineno++;
- if ( ! isspace( buf[0] ) ) {
+ if ( ! isspace( (unsigned char) buf[0] ) ) {
return( line );
}
#include <ac/errno.h>
#include <ac/string.h>
+#include <ac/ctype.h>
#include <ac/time.h>
#include <ac/krb.h>
#include "slurp.h"
/* Forward references */
-static int get_changetype LDAP_P(( char * ));
static struct berval **make_singlevalued_berval LDAP_P(( char *, int ));
static int op_ldap_add LDAP_P(( Ri *, Re *, char ** ));
static int op_ldap_modify LDAP_P(( Ri *, Re *, char ** ));
int rc = 0;
int lderr = LDAP_SUCCESS;
int retry = 2;
- char *msg;
*errmsg = NULL;
int state; /* This code is a simple-minded state machine */
int nvals; /* Number of values we're modifying */
int nops; /* Number of LDAPMod structs in ldmarr */
- LDAPMod *ldm, *nldm, **ldmarr;
+ LDAPMod *ldm, **ldmarr;
int i, len;
char *type, *value;
int rc = 0;
int *lderr
)
{
- int rc;
int ldrc;
- char msgbuf[ 1024];
#ifdef HAVE_KERBEROS
+ int rc;
int retval = 0;
int kni, got_tgt;
char **krbnames;
if ( ldm->mod_bvalues != NULL ) {
for ( j = 0; ( b = ldm->mod_bvalues[ j ] ) != NULL; j++ ) {
msgbuf = ch_malloc( b->bv_len + 512 );
- sprintf( msgbuf, "***** bv[ %d ] len = %d, val = <%s>",
+ sprintf( msgbuf, "***** bv[ %d ] len = %ld, val = <%s>",
j, b->bv_len, b->bv_val );
Debug( LDAP_DEBUG_TRACE,
"Trace (%d):%s\n", getpid(), msgbuf, 0 );
char *p;
for ( p = s; ( p != NULL ) && ( *p != '\0' ); p++ ) {
- if ( islower( *p )) {
- *p = toupper( *p );
+ if ( islower( (unsigned char) *p )) {
+ *p = toupper( (unsigned char) *p );
}
}
}
#include <stdio.h>
+#include <ac/string.h>
#include <ac/socket.h>
#include <ac/time.h>
#include <ac/unistd.h>
extern void start_lwp_scheduler();
#endif /* HAVE_LWP */
+int
main(
int argc,
char **argv
)
{
- pthread_attr_t attr;
- int status;
- int i;
-
#ifdef NO_THREADS
/* Haven't yet written the non-threaded version */
- fprintf( stderr, "slurpd currently requires threads support\n" );
- exit( 1 );
+ fputs( "slurpd currently requires threads support\n", stderr );
+ return( 1 );
#else
+ pthread_attr_t attr;
+ int status;
+ int i;
+
/*
* Create and initialize globals. init_globals() also initializes
* the main replication queue.
#include <ac/errno.h>
#include <ac/socket.h>
#include <ac/string.h>
+#include <ac/ctype.h>
#include "../slapd/slap.h"
#include "slurp.h"
*p++ = '\0';
}
re->re_timestamp = strdup( value );
- if ( p != NULL && isdigit( *p )) {
+ if ( p != NULL && isdigit( (unsigned char) *p )) {
re->re_seq = atoi( p );
}
state |= GOT_TIME;
int i;
char *s;
int rc = 0;
- Rh *rh;
if ( re == NULL || fp == NULL ) {
Debug( LDAP_DEBUG_ANY, "Internal error: Re_write: NULL argument\n",
Ri *ri
)
{
- int i;
- unsigned long seq;
-
Debug( LDAP_DEBUG_ARGS, "begin replication thread for %s:%d\n",
ri->ri_hostname, ri->ri_port, 0 );
{
Rq *rq = sglob->rq;
Re *re, *new_re;
- int i;
int rc ;
char *errmsg;