Begin Project Dependency
Project_Dep_Name liblber
End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name libldif
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name libldap
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name liblutil
+ End Project Dependency
}}}
###############################################################################
#include <sys/resource.h>
#endif
-#include "lber.h"
-#include "ldap.h"
+#include <ldap.h>
#include "fax500.h"
-
-#include <ldap_defaults.h>
+#include "ldap_defaults.h"
#define USER 0
#define GROUP_ERRORS 1
#include <ldap.h>
#include "fax500.h"
-
-#include <ldap_defaults.h>
+#include "ldap_defaults.h"
#define DEFAULT_PORT 79
#define DEFAULT_SIZELIMIT 50
if ( fgets( buf, sizeof(buf), stdin ) == NULL
|| buf[0] == '\n' ) {
- exit( 1 );
+ exit( EXIT_FAILURE );
}
i = atoi( buf ) - 1;
e = ldap_first_entry( ld, result );
}
if ( e == NULL ) {
fprintf( stderr, "Invalid choice!\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
print_entry( ld, e );
} else if ( matches == 0 ) {
fprintf( stderr, "No matches found for \"%s\"\n", key );
- exit( 1 );
+ exit( EXIT_FAILURE );
} else {
fprintf( stderr, "Error return from ldap_count_entries\n" );
exit( -1 );
if ( (fax = ldap_get_values( ld, e, "facsimileTelephoneNumber" ))
== NULL ) {
fprintf( stderr, "Entry \"%s\" has no fax number.\n", dn );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
faxmail = faxtotpc( fax[0], NULL );
title = ldap_get_values( ld, e, "title" );
#include <sys/resource.h>
#endif
-#include "lber.h"
-#include "ldap.h"
-
-#include "disptmpl.h"
+#include <ldap.h>
+#include <disptmpl.h>
#include "ldap_defaults.h"
usage( char *name )
{
fprintf( stderr, "usage: %s [-l] [-x ldaphost] [-p ldapport] [-f filterfile] [-t templatefile] [-c rdncount]\r\n", name );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
int
if ( getpeername( 0, (struct sockaddr *)&peername,
&peernamelen ) != 0 ) {
perror( "getpeername" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
if ( (ld = ldap_init( ldaphost, ldapport )) == NULL ) {
fprintf( stderr, FINGER_UNAVAILABLE );
perror( "ldap_init" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
{
{
fprintf( stderr, FINGER_UNAVAILABLE );
ldap_perror( ld, "ldap_simple_bind_s" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
#ifdef HAVE_SYSCONF
perror( "select" );
else
fprintf( stderr, "connection timed out on input\r\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
if ( fgets( buf, sizeof(buf), stdin ) == NULL )
- exit( 1 );
+ exit( EXIT_FAILURE );
len = strlen( buf );
!= LDAP_SUCCESS && rc != LDAP_SIZELIMIT_EXCEEDED ) {
fprintf( stderr, FINGER_UNAVAILABLE );
ldap_perror( ld, "ldap_search_st" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
matches = ldap_count_entries( ld, result );
== NULL ) {
fprintf( stderr, "Cannot open filter file (%s)\n",
filterfile );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
for ( fi = ldap_getfirstfilter( fd, "finger", buf );
{
fprintf( stderr, FINGER_UNAVAILABLE );
ldap_perror( ld, "ldap_search_st" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
if ( (matches = ldap_count_entries( ld, result )) != 0 )
fflush( stdout );
} else if ( matches < 0 ) {
fprintf( stderr, "error return from ldap_count_entries\r\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
} else if ( matches <= FINGER_LISTLIMIT ) {
printf( "%d %s match%s found for \"%s\":\r\n", matches,
ufn ? "UFN" : fi->lfi_desc, matches > 1 ? "es" : "", buf );
defvals, entry2textwrite, (void *)stdout, "\r\n", rdncount,
LDAP_DISP_OPT_DOSEARCHACTIONS ) != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_entry2text_search" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
if ( tmpllist != NULL ) {
#include <sys/resource.h>
#endif
+#include <ldap.h>
+#include <disptmpl.h>
+
#include "ldap_defaults.h"
-#include "lber.h"
-#include "ldap.h"
#define ldap_debug debug
#include "ldap_log.h"
#include "lutil.h"
-#include "disptmpl.h"
int debug;
int dosyslog;
usage( char *name )
{
fprintf( stderr, "usage: %s [-d debuglevel] [-f filterfile] [-t templatefile]\r\n\t[-a] [-l] [-p port] [-x ldaphost] [-b searchbase] [-c rdncount]\r\n", name );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
int
if ( myhost[0] == '\0' && gethostname( myhost, sizeof(myhost) )
== -1 ) {
perror( "gethostname" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
#endif
do_queries( 0 );
- exit( 0 );
+ exit( EXIT_SUCCESS );
}
for ( ;; ) {
if ( (ns = accept( s, (struct sockaddr *) &from, &fromlen ))
== -1 ) {
if ( debug ) perror( "accept" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
hp = gethostbyaddr( (char *) &(from.sin_addr.s_addr),
if ( (s = socket( AF_INET, SOCK_STREAM, 0 )) == -1 ) {
perror( "socket" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
/* set option so clients can't keep us from coming back up */
if ( setsockopt( s, SOL_SOCKET, SO_REUSEADDR, (char *) &one,
sizeof(one) ) < 0 ) {
perror( "setsockopt" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
/* bind to a name */
addr.sin_port = htons( port );
if ( bind( s, (struct sockaddr *) &addr, sizeof(addr) ) ) {
perror( "bind" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
/* listen for connections */
if ( listen( s, 5 ) == -1 ) {
perror( "listen" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
if ( debug ) printf("tcp socket allocated, bound, and listening\n");
LDAP *ld;
if ( (fp = fdopen( s, "a+")) == NULL ) {
- exit( 1 );
+ exit( EXIT_FAILURE );
}
timeout.tv_sec = GO500_TIMEOUT;
FD_SET( fileno( fp ), &readfds );
if ( (rc = select( dtblsize, &readfds, 0, 0, &timeout )) <= 0 )
- exit( 1 );
+ exit( EXIT_FAILURE );
if ( fgets( buf, sizeof(buf), fp ) == NULL )
- exit( 1 );
+ exit( EXIT_FAILURE );
len = strlen( buf );
if ( debug ) {
LDAP_SERVER_DOWN, myhost, myport );
fprintf( fp, ".\r\n" );
rewind(fp);
- exit( 1 );
+ exit( EXIT_FAILURE );
} else {
int deref = GO500_DEREF;
ldap_set_option(ld, LDAP_OPT_DEREF, &deref);
rc, myhost, myport );
fprintf( fp, ".\r\n" );
rewind(fp);
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
ldap_unbind( ld );
}
- exit( 1 );
+ exit( EXIT_FAILURE );
/* NOT REACHED */
}
if ( (filtd = ldap_init_getfilter( filterfile )) == NULL ) {
fprintf( stderr, "Cannot open filter file (%s)\n",
filterfile );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
tv.tv_sec = GO500_TIMEOUT;
entry2textwrite, (void *) fp, "\r\n", rdncount,
LDAP_DISP_OPT_DOSEARCHACTIONS ) != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_entry2text_search" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
if ( tmpllist != NULL ) {
#endif
-#include "lber.h"
-#include "ldap.h"
+#include <ldap.h>
+#include <disptmpl.h>
#define ldap_debug debug
#include "ldap_log.h"
#include "lutil.h"
-#include "disptmpl.h"
#include "ldap_defaults.h"
usage( char *name )
{
fprintf( stderr, "usage: %s [-d debuglevel] [-I] [-p port] [-P ldapport] [-l]\r\n\t[-x ldaphost] [-a] [-h helpfile] [-f filterfile] [-t templatefile] [-c rdncount]\r\n", name );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
int
if ( myhost[0] == '\0' && gethostname( myhost, sizeof(myhost) )
== -1 ) {
perror( "gethostname" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
#endif
tcp_close( 0 );
- exit( 0 );
+ exit( EXIT_SUCCESS );
}
for ( ;; ) {
if ( (ns = accept( s, (struct sockaddr *) &from, &fromlen ))
== -1 ) {
if ( debug ) perror( "accept" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
hp = gethostbyaddr( (char *) &(from.sin_addr.s_addr),
if ( (s = socket( AF_INET, SOCK_STREAM, 0 )) == -1 ) {
perror( "socket" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
/* set option so clients can't keep us from coming back up */
if ( setsockopt( s, SOL_SOCKET, SO_REUSEADDR, (char *) &one,
sizeof(one) ) < 0 ) {
perror( "setsockopt" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
/* bind to a name */
addr.sin_port = htons( port );
if ( bind( s, (struct sockaddr *) &addr, sizeof(addr) ) ) {
perror( "bind" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
/* listen for connections */
if ( listen( s, 5 ) == -1 ) {
perror( "listen" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
if ( debug )
if ( (fp = fdopen( s, "a+")) == NULL ) {
perror( "fdopen" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
timeout.tv_sec = GO500GW_TIMEOUT;
FD_SET( fileno( fp ), &readfds );
if ( (rc = select( dtblsize, &readfds, 0, 0, &timeout )) <= 0 )
- exit( 1 );
+ exit( EXIT_FAILURE );
if ( fgets( buf, sizeof(buf), fp ) == NULL )
- exit( 1 );
+ exit( EXIT_FAILURE );
len = strlen( buf );
if ( debug ) {
fprintf( fp, ".\r\n" );
rewind(fp);
- exit( 0 );
+ exit( EXIT_SUCCESS );
/* NOT REACHED */
}
LDAP_SERVER_DOWN, myhost, myport );
fprintf( fp, ".\r\n" );
rewind(fp);
- exit( 1 );
+ exit( EXIT_FAILURE );
}
deref = LDAP_DEREF_ALWAYS;
rc, myhost, myport );
fprintf( fp, ".\r\n" );
rewind(fp);
- exit( 1 );
+ exit( EXIT_FAILURE );
}
switch ( *query++ ) {
fprintf( fp, ".\r\n" );
rewind(fp);
- exit( 0 );
+ exit( EXIT_SUCCESS );
/* NOT REACHED */
}
if ( (filter = strchr( query, '\t' )) == NULL ) {
fprintf( fp, "3Missing filter!\r\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
*filter++ = '\0';
base = query;
#endif
if ( (scope = make_scope( ld, base )) == -1 ) {
fprintf( fp, "3Bad scope\r\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
filtertype = (scope == LDAP_SCOPE_ONELEVEL ?
if ( (filtd = ldap_init_getfilter( filterfile )) == NULL ) {
fprintf( stderr, "Cannot open filter file (%s)\n",
filterfile );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
count = 0;
#include <sys/resource.h>
#endif
-#include "lber.h"
-#include "ldap.h"
+#include <ldap.h>
#include "ldap_defaults.h"
}
if ( errflg || optind < argc ) {
fprintf( stderr, usage, prog );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
#ifdef SIGPIPE
if ( dosyslog ) {
syslog( LOG_ERR, "strdup: %m" );
}
- exit( 1 );
+ exit( EXIT_FAILURE );
}
while ( 1 ) {
if ( dosyslog ) {
syslog( LOG_ERR, "realloc: %m" );
}
- exit( 1 );
+ exit( EXIT_FAILURE );
}
strcat( hdr, "\n" );
strcat( hdr, *linep );
#include "portable.h"
-#include <stdio.h>
-
#include <ac/stdlib.h>
#include <ac/ctype.h>
#include <ac/syslog.h>
#include <ac/time.h>
-#include "lber.h"
-#include "ldap.h"
+#include <stdio.h>
-#include "disptmpl.h"
+#include <ldap.h>
+#include <disptmpl.h>
#include "rcpt500.h"
#include "ldap_defaults.h"
case 'f': /* read DNs from a file */
if (( fp = fopen( optarg, "r" )) == NULL ) {
perror( optarg );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
break;
case 'd':
#include <lber.h>
#include <ldap.h>
-#include <ldif.h>
-#include <ldap_defaults.h>
+#include "ldif.h"
+#include "ldap_defaults.h"
static char *prog;
static char *binddn = NULL;
} else if ( strcasecmp( type, T_DN_STR ) == 0 ) {
if (( dn = strdup( value )) == NULL ) {
perror( "strdup" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
expect_ct = 1;
}
if ( strcasecmp( type, T_NEWRDNSTR ) == 0 ) {
if (( newrdn = strdup( value )) == NULL ) {
perror( "strdup" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
expect_deleteoldrdn = 1;
expect_newrdn = 0;
if ( strcasecmp( type, T_NEWSUPSTR ) == 0 ) {
if (( newsup = strdup( value )) == NULL ) {
perror( "strdup" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
expect_newsup = 0;
} else {
if ( dn == NULL ) { /* first line contains DN */
if (( dn = strdup( line )) == NULL ) {
perror( "strdup" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
} else {
if (( p = strchr( line, '=' )) == NULL ) {
if (( pmods = (LDAPMod **)ber_memrealloc( pmods, (i + 2) *
sizeof( LDAPMod * ))) == NULL ) {
perror( "realloc" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
*pmodsp = pmods;
pmods[ i + 1 ] = NULL;
if (( pmods[ i ] = (LDAPMod *)ber_memcalloc( 1, sizeof( LDAPMod )))
== NULL ) {
perror( "calloc" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
pmods[ i ]->mod_op = modop;
if (( pmods[ i ]->mod_type = ber_strdup( attr )) == NULL ) {
perror( "strdup" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
(struct berval **)ber_memrealloc( pmods[ i ]->mod_bvalues,
(j + 2) * sizeof( struct berval * ))) == NULL ) {
perror( "ber_realloc" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
pmods[ i ]->mod_bvalues[ j + 1 ] = NULL;
if (( bvp = (struct berval *)ber_memalloc( sizeof( struct berval )))
== NULL ) {
perror( "ber_memalloc" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
pmods[ i ]->mod_bvalues[ j ] = bvp;
if ( valsfromfiles && *value == '/' ) { /* get value from file */
if ( fromfile( value, bvp ) < 0 ) {
- exit( 1 );
+ exit( EXIT_FAILURE );
}
} else {
bvp->bv_len = vlen;
if (( bvp->bv_val = (char *)ber_memalloc( vlen + 1 )) == NULL ) {
perror( "malloc" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
SAFEMEMCPY( bvp->bv_val, value, vlen );
bvp->bv_val[ vlen ] = '\0';
if (( buf = (char *)realloc( buf, lmax )) == NULL ) {
perror( "realloc" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
###############################################################################
+Project: "setup"=..\..\include\setup.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
Global:
Package=<5>
fprintf (stderr, " -Y saltlen\tsalt length to use\n");
/* fprintf (stderr, " -y salt\tsalt to use\n"); */
fprintf (stderr, " -z size\tsize limit\n");
- exit (1);
+ exit( EXIT_FAILURE );
}
int
#include <ac/unistd.h>
#include <ldap.h>
-#include <ldif.h>
+#include "ldif.h"
#include "ldap_defaults.h"
#define DEFSEP "="
#include <lber.h>
#include <ldap.h>
-#include <ldap_defaults.h>
+#include "ldap_defaults.h"
#include "ud.h"
#ifdef HAVE_KERBEROS
#include <lber.h>
#include <ldap.h>
-#include <ldap_defaults.h>
+
+#include "ldap_defaults.h"
#include "ud.h"
static int load_editor( void );
#include <lber.h>
#include <ldap.h>
-#include <ldap_defaults.h>
+
+#include "ldap_defaults.h"
#include "ud.h"
static char * bind_and_fetch(char *name);
#include <lber.h>
#include <ldap.h>
-#include <ldap_defaults.h>
+#include "ldap_defaults.h"
#include "ud.h"
/*
printf(" 64 authentication information\n");
printf(" 128 initialization information\n\n");
format("These are masks, and may be added to form multiple debug levels. For example, '-d 35' would perform a function trace, print out information about the find() function, and would print out information about the output routines too.", 75, 2);
- exit(0);
+ exit( EXIT_SUCCESS );
default:
fprintf(stderr, "Usage: %s [-c filter-config-file] [-d debug-level] [-l ldap-debug-level] [-s server] [-p port] [-V]\n", argv[0]);
- exit(-1);
+ exit( EXIT_FAILURE);
/* NOTREACHED */
}
}
#ifdef HAVE_KERBEROS
destroy_tickets();
#endif
- exit(0);
+ exit( EXIT_SUCCESS );
/* NOTREACHED */
}
*/
if ((ld = ldap_init(server, ldap_port)) == NULL) {
fprintf(stderr, " Initialization of LDAP session failed.\n");
- exit(0);
+ exit( EXIT_FAILURE );
/* NOTREACHED */
}
if (ldap_bind_s(ld, (char *) default_bind_object, NULL,
fprintf(stderr, " The LDAP Directory is temporarily unavailable. Please try again later.\n");
if (ld_errno != LDAP_UNAVAILABLE)
ldap_perror(ld, " ldap_bind_s");
- exit(0);
+ exit( EXIT_FAILURE );
/* NOTREACHED */
}
{
#include <lber.h>
#include <ldap.h>
-#include <ldap_defaults.h>
+#include "ldap_defaults.h"
#include "ud.h"
void
#ifdef HAVE_KERBEROS
destroy_tickets();
#endif
- exit(-1);
+ exit( EXIT_FAILURE );
}
int
void_ptr = (void *) malloc(size);
if (void_ptr == NULL) {
perror("malloc");
- exit(-1);
+ exit( EXIT_FAILURE );
/*NOTREACHED*/
}
return(void_ptr);
if (error_flag) {
fprintf(stderr, "usage: %s [-h host] [-p portnumber] [-u X500UserName]\n\t[-c credentials] [-d debug-level]\n",
progname);
- exit(2);
+ exit( EXIT_FAILURE );
}
rc = user_tailor();
if (!(ld = ldap_init(hostname, portnum))) {
fprintf(stderr, "%s: unable to initialize LDAP session (%s:%d)\n",
progname, hostname, portnum);
- exit(2);
+ exit( EXIT_FAILURE );
}
if (!bind_user())
#include <lber.h>
#include <ldap.h>
-#include <ldif.h>
+#include "ldif.h"
#include "maint_form.h" /* for HTML Form manipulations */
/* default values */
if (strcompare(getenv("REQUEST_METHOD"),"POST"))
{
printf("<p>++ Error - This script should be referenced with a METHOD of POST.\n");
- exit(1);
+ exit( EXIT_FAILURE );
}
if (strcompare(getenv("CONTENT_TYPE"),"application/x-www-form-urlencoded"))
{
printf("<p>++ Error - This script can only be used to decode form results. \n");
- exit(1);
+ exit( EXIT_FAILURE );
}
cl = atoi(getenv("CONTENT_LENGTH"));
printf("%s%s%s", "This script expected a 'FORM' value returned ",
"and did not get one. Make sure the HTML used for this ",
"script is correct.");
- exit(1);
+ exit( EXIT_FAILURE );
}
/* Looking for:
}
}
printf("</body>\n</html>\n");
- exit(1);
+ exit( EXIT_FAILURE );
}
/*authenticate as nobody */
}
}
printf("</body>\n</html>\n");
- exit(1);
+ exit( EXIT_FAILURE );
}
printf("<b>Directory Lookup Results</b>\n<pre>\n");
#include <sys/time.h>
#include <netinet/in.h>
#include "syslog.h"
-#include "lber.h"
-#include "ldap.h"
+#include <ldap.h>
#define EQ(x,y) (strcasecmp(x,y) == 0)
#ifndef _AC_STDLIB_H
#define _AC_STDLIB_H
-# include <stdlib.h>
+#include <stdlib.h>
- /* Not sure if !STDC_HEADERS is needed */
-# if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
-# include <malloc.h>
-# endif
+/* Ignore malloc.h if we have STDC_HEADERS */
+#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
+# include <malloc.h>
+#endif
-# ifndef EXIT_SUCCESS
-# define EXIT_SUCCESS 0
-# define EXIT_FAILURE 1
-# endif
+#ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
+# define EXIT_FAILURE 1
+#endif
#endif /* _AC_STDLIB_H */
char *str,
char *brkstr ));
+/* url.c */
+void ldap_pvt_hex_unescape LDAP_P(( char *s ));
+int ldap_pvt_unhex( int c );
+
LDAP_END_DECL
#endif
#define ROTATERIGHT(x) { \
Avlnode *tmp;\
if ( *(x) == NULL || (*(x))->avl_left == NULL ) {\
- (void) fputs("RR error\n", stderr); exit(1); \
+ (void) fputs("RR error\n", stderr); exit( EXIT_FAILURE ); \
}\
tmp = (*(x))->avl_left;\
(*(x))->avl_left = tmp->avl_right;\
#define ROTATELEFT(x) { \
Avlnode *tmp;\
if ( *(x) == NULL || (*(x))->avl_right == NULL ) {\
- (void) fputs("RL error\n", stderr); exit(1); \
+ (void) fputs("RL error\n", stderr); exit( EXIT_FAILURE ); \
}\
tmp = (*(x))->avl_right;\
(*(x))->avl_right = tmp->avl_left;\
case 'f': /* find */
printf( "data? " );
if ( fgets( name, sizeof( name ), stdin ) == NULL )
- exit( 0 );
+ exit( EXIT_SUCCESS );
name[ strlen( name ) - 1 ] = '\0';
if ( (p = (char *) avl_find( tree, name, (AVL_CMP) strcmp ))
== NULL )
case 'i': /* insert */
printf( "data? " );
if ( fgets( name, sizeof( name ), stdin ) == NULL )
- exit( 0 );
+ exit( EXIT_SUCCESS );
name[ strlen( name ) - 1 ] = '\0';
if ( avl_insert( &tree, strdup( name ), (AVL_CMP) strcmp,
avl_dup_error ) != 0 )
case 'd': /* delete */
printf( "data? " );
if ( fgets( name, sizeof( name ), stdin ) == NULL )
- exit( 0 );
+ exit( EXIT_SUCCESS );
name[ strlen( name ) - 1 ] = '\0';
if ( avl_delete( &tree, name, (AVL_CMP) strcmp ) == NULL )
printf( "\nNot found!\n" );
break;
case 'q': /* quit */
- exit( 0 );
+ exit( EXIT_SUCCESS );
break;
case '\n':
break;
/* read the pe from standard in */
if ( (psin = ps_alloc( std_open )) == NULLPS ) {
perror( "ps_alloc" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
if ( std_setup( psin, stdin ) == NOTOK ) {
perror( "std_setup" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
/* write the pe to standard out */
if ( (psout = ps_alloc( std_open )) == NULLPS ) {
perror( "ps_alloc" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
if ( std_setup( psout, stdout ) == NOTOK ) {
perror( "std_setup" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
/* pretty print it to standard error */
if ( (pserr = ps_alloc( std_open )) == NULLPS ) {
perror( "ps_alloc" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
if ( std_setup( pserr, stderr ) == NOTOK ) {
perror( "std_setup" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
while ( (pe = ps2pe( psin )) != NULLPE ) {
pe2ps( psout, pe );
}
- exit( 0 );
+ exit( EXIT_SUCCESS );
#else
fprintf(stderr, "requires ISODE X.500 distribution.\n");
return( EXIT_FAILURE );
*/
#include "portable.h"
-#include <stdio.h>
-
#include <ac/stdlib.h>
-#include "lber.h"
-#include "ldap.h"
+#include <stdio.h>
+
+#include <ldap.h>
int
main(int argc, char **argv)
* DIGEST-MD5 routines
*/
-#include <portable.h>
+#include "portable.h"
#include <ac/ctype.h>
#include <ac/string.h>
#include <ac/time.h>
#include "ldap-int.h"
-#include <ldap_pvt.h>
+#include "ldap_pvt.h"
#define TK_NOENDQUOTE -2
#define TK_OUTOFMEM -1
if ( errflg || optind < argc - 1 ) {
fprintf( stderr, usage, argv[ 0 ] );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
printf( "%s( %s, %d )\n",
if ( ld == NULL ) {
perror( cldapflg ? "cldap_open" : "ldap_init" );
- exit(1);
+ exit( EXIT_FAILURE );
}
if ( copyfname != NULL ) {
if ( (ld->ld_sb.sb_fd = open( copyfname, O_WRONLY | O_CREAT,
0600 )) == -1 ) {
perror( copyfname );
- exit ( 1 );
+ exit ( EXIT_FAILURE );
}
ld->ld_sb.sb_options = copyoptions;
}
if ( !cldapflg ) {
ldap_unbind( ld );
}
- exit( 0 );
+ exit( EXIT_SUCCESS );
break;
case 'r': /* result or remove */
#include <sys/file.h>
#endif
-#include "lber.h"
-#include "ldap.h"
+#include <ldap.h>
+#include <disptmpl.h>
#include "ldap_log.h"
-#include "disptmpl.h"
#include "ldap-int.h"
#include "ldap_defaults.h"
#ifdef HAVE_CONSOLE_H
#include <console.h>
-#endif /* MACOS */
+#endif /* HAVE_CONSOLE_H */
-#include "lber.h"
-#include "ldap.h"
-#include "disptmpl.h"
-#include "srchpref.h"
+#include <ldap.h>
+#include <disptmpl.h>
+#include <srchpref.h>
static void dump_tmpl ( struct ldap_disptmpl *tmpl );
static void dump_srchpref( struct ldap_searchobj *sp );
if (( err = ldap_init_templates( "ldaptemplates.conf", &templates ))
!= 0 ) {
fprintf( stderr, "ldap_init_templates failed (%d)\n", err );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
if (( err = ldap_init_searchprefs( "ldapsearchprefs.conf", &so ))
!= 0 ) {
fprintf( stderr, "ldap_init_searchprefs failed (%d)\n", err );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
if ( argc == 1 ) {
ldap_free_templates( templates );
ldap_free_searchprefs( so );
- exit( 0 );
+ exit( EXIT_SUCCESS );
}
const char *url,
int *enclosedp,
int *ldaps ));
-static void hex_unescape LDAP_P(( char *s ));
-static int unhex( char c );
int
if (( q = strchr( url, ':' )) != NULL ) {
*q++ = '\0';
- hex_unescape( q );
+ ldap_pvt_hex_unescape( q );
if( *q == '\0' ) {
LDAP_FREE( url );
ludp->lud_port = atoi( q );
}
- hex_unescape( url );
+ ldap_pvt_hex_unescape( url );
ludp->lud_host = LDAP_STRDUP( url );
if( ludp->lud_host == NULL ) {
if( *p != '\0' ) {
/* parse dn part */
- hex_unescape( p );
+ ldap_pvt_hex_unescape( p );
ludp->lud_dn = LDAP_STRDUP( p );
} else {
ludp->lud_dn = LDAP_STRDUP( "" );
if( *p != '\0' ) {
/* parse attributes */
- hex_unescape( p );
+ ldap_pvt_hex_unescape( p );
ludp->lud_attrs = ldap_str2charray( p, "," );
if( ludp->lud_attrs == NULL ) {
if( *p != '\0' ) {
/* parse the scope */
- hex_unescape( p );
+ ldap_pvt_hex_unescape( p );
ludp->lud_scope = str2scope( p );
if( ludp->lud_scope == -1 ) {
if( *p != '\0' ) {
/* parse the filter */
- hex_unescape( p );
+ ldap_pvt_hex_unescape( p );
if( ! *p ) {
/* missing filter */
}
for( i=0; ludp->lud_exts[i] != NULL; i++ ) {
- hex_unescape( ludp->lud_exts[i] );
+ ldap_pvt_hex_unescape( ludp->lud_exts[i] );
}
if( i == 0 ) {
}
-static void
-hex_unescape( char *s )
+void
+ldap_pvt_hex_unescape( char *s )
{
/*
* Remove URL hex escapes from s... done in place. The basic concept for
for ( p = s; *s != '\0'; ++s ) {
if ( *s == '%' ) {
if ( *++s != '\0' ) {
- *p = unhex( *s ) << 4;
+ *p = ldap_pvt_unhex( *s ) << 4;
}
if ( *++s != '\0' ) {
- *p++ += unhex( *s );
+ *p++ += ldap_pvt_unhex( *s );
}
} else {
*p++ = *s;
}
-static int
-unhex( char c )
+int
+ldap_pvt_unhex( int c )
{
return( c >= '0' && c <= '9' ? c - '0'
: c >= 'A' && c <= 'F' ? c - 'A' + 10
#include "ldap_log.h"
#include "lber_pvt.h"
+#include "ldap_pvt.h"
#include "ldif.h"
int
ber_len_t *vlenp
)
{
-#ifdef HAVE_FETCH
- FILE *url = fetchGetURL( (char*) urlstr, "" );
+ FILE *url;
char buffer[1024];
char *p = NULL;
size_t total;
size_t bytes;
+ *valuep = NULL;
+ *vlenp = 0;
+
+#ifdef HAVE_FETCH
+ url = fetchGetURL( (char*) urlstr, "" );
+
+#else
+ if( strncasecmp( "file://", urlstr, sizeof("file://")-1 ) == 0 ) {
+ p = strchr( &urlstr[sizeof("file://")-1], '/' );
+ if( p == NULL ) {
+ return -1;
+ }
+
+ if( *p != *LDAP_DIRSEP ) {
+ /* skip over false root */
+ p++;
+ }
+
+ p = ber_strdup( p );
+ ldap_pvt_hex_unescape( p );
+
+ url = fopen( p, "r" );
+
+ } else {
+ return -1;
+ }
+#endif
+
if( url == NULL ) {
return -1;
}
*vlenp = total;
return 0;
-
-#else
- *valuep = NULL;
- *vlenp = 0;
- return -1;
-#endif
}
# Name "libldif - Win32 Single Release"
# Begin Source File
+SOURCE=.\fetch.c
+# End Source File
+# Begin Source File
+
SOURCE=..\..\include\ldif.h
# End Source File
# Begin Source File
break;
default:
- _exit( 0 );
+ _exit( EXIT_SUCCESS );
}
break;
}
if ( (sd = open( "/dev/null", O_RDWR )) == -1 ) {
perror( "/dev/null" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
for ( i = 0; i < 3; i++ )
if ( sd != i && isatty( i ) )
#include <lber.h>
#include <ldap.h>
-#include <ldap_defaults.h>
+
+#include "ldap_defaults.h"
char *
getpass( const char *prompt )
if (argc < 2)
{
fprintf (stderr, "usage: %s string-to-hash\n", argv[0]);
- exit (1);
+ return EXIT_FAILURE;
}
for (j = 1; j < argc; ++j)
{
}
printf ("\n");
}
- return 0;
+ return EXIT_SUCCESS;
}
#endif /* TEST */
#include <windows.h>
#include <winsvc.h>
-#include "ldap.h"
+#include <ldap.h>
#define ldap_debug slap_debug
extern int slap_debug;
"\t[domain=<regex>] [sockurl=<regex>]\n"
"<access> ::= [self]{none|auth|compare|search|read|write}\n"
);
- exit( 1 );
+ exit( EXIT_FAILURE );
}
static void
struct berval bv;
struct berval *bvals[2];
Attribute *a;
- Attribute *tmp;
struct tm *ltm;
time_t currenttime;
if ( code ) {
fprintf( stderr, "%s: line %d: %s %s\n",
fname, lineno, scherr2str(code), err);
- exit( 1 );
+ exit( EXIT_FAILURE );
}
ldap_memfree(at);
}
if ( open ) {
pthread_kill( pthread_self(), LDAP_SIGUSR1 );
} else {
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
fprintf( stderr,
"ldbm_back_startup(): FATAL error in db_appinit() : %s\n",
error );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
#endif
if ( return_code != 0 ) {
fprintf( stderr,
"Unknown perl backeng config: %s\n", argv[0]);
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
close( c2p[0] );
if ( dup2( p2c[0], 0 ) == -1 || dup2( c2p[1], 1 ) == -1 ) {
Debug( LDAP_DEBUG_ANY, "dup2 failed\n", 0, 0, 0 );
- exit( -1 );
+ exit( EXIT_FAILURE );
}
execv( args[0], args );
Debug( LDAP_DEBUG_ANY, "execv failed\n", 0, 0, 0 );
- exit( -1 );
+ exit( EXIT_FAILURE );
case -1: /* trouble */
Debug( LDAP_DEBUG_ANY, "fork failed\n", 0, 0, 0 );
if ( (new = (void *) ber_memalloc( size )) == NULL ) {
Debug( LDAP_DEBUG_ANY, "ch_malloc of %lu bytes failed\n",
(long) size, 0, 0 );
- exit( 1 );
+ exit( EXIT_SUCCESS );
}
return( new );
if ( (new = (void *) ber_memrealloc( block, size )) == NULL ) {
Debug( LDAP_DEBUG_ANY, "ch_realloc of %lu bytes failed\n",
(long) size, 0, 0 );
- exit( 1 );
+ exit( EXIT_SUCCESS );
}
return( new );
if ( (new = (void *) ber_memcalloc( nelem, size )) == NULL ) {
Debug( LDAP_DEBUG_ANY, "ch_calloc of %lu elems of %lu bytes failed\n",
(long) nelem, (long) size, 0 );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
return( new );
if ( (new = ber_strdup( string )) == NULL ) {
Debug( LDAP_DEBUG_ANY, "ch_strdup(%s) failed\n", string, 0, 0 );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
return( new );
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing filename in \"loadmodule <filename>\" line\n",
fname, lineno, 0 );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
if (!load_module(cargv[1], cargc - 2, (cargc > 2) ? cargv + 2 : NULL)) {
Debug( LDAP_DEBUG_ANY,
"%s: line %d: failed to load or initialize module %s\n",
fname, lineno, cargv[1]);
- exit( 1 );
+ exit( EXIT_FAILURE );
}
#endif /*SLAPD_MODULES*/
{
ber_socket_t rd;
int is_listener = 0;
- int rc;
#ifdef HAVE_WINSOCK
rd = readfds.fd_array[i];
case 'c': /* do connectionless (udp) */
/* udp = 1; */
fprintf( stderr, "connectionless support not supported");
- exit( -1 );
+ exit( EXIT_FAILURE );
break;
#endif
#ifdef HAVE_CYRUS_SASL
+#include <ac/stdlib.h>
#include <stdio.h>
#include "slap.h"
if( rc != SASL_OK ) {
Debug( LDAP_DEBUG_ANY, "sasl_server_init failed\n",
0, 0, 0 );
- exit(-1);
+ return EXIT_FAILURE;
}
rc = sasl_server_new( "ldap", NULL, NULL, NULL,
if( rc != SASL_OK ) {
Debug( LDAP_DEBUG_ANY, "sasl_server_new failed\n",
0, 0, 0 );
- exit(-1);
+ return EXIT_FAILURE;
}
memset(&secprops, 0, sizeof(secprops));
if( rc != SASL_OK ) {
Debug( LDAP_DEBUG_ANY, "sasl_setprop failed\n",
0, 0, 0 );
- exit(-1);
+ return EXIT_FAILURE;
}
rc = sasl_listmech( server, NULL, NULL, ",", NULL,
if( rc != SASL_OK ) {
Debug( LDAP_DEBUG_ANY, "sasl_listmech failed: %d\n",
rc, 0, 0 );
- exit(-1);
+ return EXIT_FAILURE;
}
Debug( LDAP_DEBUG_TRACE, "SASL mechanisms: %s\n",
data, 0, 0 );
- return 0;
+ return EXIT_SUCCESS;
}
int sasl_destory( void )
if ( res ) {
fprintf( stderr, "schema_init: Error registering syntax %s\n",
syntax_defs[i].sd_desc );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
for ( i=0; mrule_defs[i].mrd_desc != NULL; i++ ) {
if ( res ) {
fprintf( stderr, "schema_init: Error registering matching rule %s\n",
mrule_defs[i].mrd_desc );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
schema_init_done = 1;
if ( code ) {
fprintf( stderr, "%s: line %d: %s %s\n",
fname, lineno, scherr2str(code), *namep);
- exit( 1 );
+ exit( EXIT_FAILURE );
}
namep++;
}
if ( code ) {
fprintf( stderr, "%s: line %d: %s %s\n",
fname, lineno, scherr2str(code), *namep);
- exit( 1 );
+ exit( EXIT_FAILURE );
}
namep++;
}
if ( code ) {
fprintf( stderr, "%s: line %d: %s %s\n",
fname, lineno, scherr2str(code), err);
- exit( 1 );
+ exit( EXIT_FAILURE );
}
ldap_memfree(oc);
}
if ( code ) {
fprintf( stderr, "%s: line %d: %s %s\n",
fname, lineno, scherr2str(code), err);
- exit( 1 );
+ exit( EXIT_FAILURE );
}
ldap_memfree(oc);
}
fprintf( stderr, " [ \"MUST\" oids ] ; AttributeTypes\n");
fprintf( stderr, " [ \"MAY\" oids ] ; AttributeTypes\n");
fprintf( stderr, "whsp \")\"\n");
- exit( 1 );
+ exit( EXIT_FAILURE );
}
static void
fprintf( stderr, "<oc clause> ::= objectclass <ocname>\n" );
fprintf( stderr, " [ requires <attrlist> ]\n" );
fprintf( stderr, " [ allows <attrlist> ]\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
static void
fprintf( stderr, " ; distributedOperation\n");
fprintf( stderr, " ; dSAOperation\n");
fprintf( stderr, "whsp \")\"\n");
- exit( 1 );
+ exit( EXIT_FAILURE );
}
void
if ( code ) {
fprintf( stderr, "%s: line %d: %s %s\n",
fname, lineno, scherr2str(code), err);
- exit( 1 );
+ exit( EXIT_FAILURE );
}
ldap_memfree(at);
}
if ( errflg || optind < argc ) {
fprintf( stderr, "usage: %s [-d]\n", progname );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
debug_printf( "started\n" );
(void) memset( (char *)&op, '\0', sizeof( op ));
if ( parse_input( stdin, stdout, &op ) < 0 ) {
- exit( 0 );
+ exit( EXIT_SUCCESS );
}
if ( op.ldop_op != LDOP_SEARCH ) {
write_result( stdout, LDAP_UNWILLING_TO_PERFORM, NULL,
"Command Not Implemented" );
- exit( 0 );
+ exit( EXIT_SUCCESS );
}
#ifdef LDAP_DEBUG
pwdfile_search( &op, stdout );
- exit( 0 );
+ exit( EXIT_SUCCESS );
}
if (( p = strdup( s )) == NULL ) {
debug_printf( "strdup failed\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
return( p );
if ( p == NULL ) {
debug_printf( "realloc( p, %d ) failed\n", size );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
return( p );
if (( p = calloc( nelem, elsize )) == NULL ) {
debug_printf( "calloc( %d, %d ) failed\n", nelem, elsize );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
return( p );
#include "ldap_log.h"
-#include "lber.h"
-#include "ldap.h"
-
-#include "ldap_schema.h"
+#include <ldap.h>
+#include <ldap_schema.h>
#include "ldap_pvt_thread.h"
#include "ldif.h"
} else {
fprintf( stderr, "%s: unknown auth method\n", optarg );
fputs( "expecting \"simple\" or \"kerberos\"\n", stderr );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
break;
} else {
fprintf( stderr, "%s: unknown auth method\n", optarg );
fputs( "expecting \"simple\" or \"kerberos\"\n", stderr );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
break;
default:
usage( argv[0] );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
if ( optind == argc || ldapsrcurl == NULL || ldapdesturl == NULL ) {
usage( argv[0] );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
attrs = &argv[optind];
if ( (ld = start_ldap_search( ldapsrcurl, ldapfilter, attrs )) == NULL ) {
fprintf( stderr, "could not initiate ldap search\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
if ( create_tmp_files( attrs, &tmpfile, &ldbm ) != 0 ) {
fprintf( stderr, "could not create temp files\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
/*
if ( (count = generate_new_centroids( ld, attrs, ldbm )) < 1 ) {
if ( count == 0 ) {
fprintf( stderr, "no entries matched\n" );
- exit( 0 );
+ exit( EXIT_SUCCESS );
} else {
fprintf( stderr, "could not generate new centroid\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
if ( (ld = bind_to_destination_ldap( ldapsrcurl, ldapdesturl )) == NULL ) {
fprintf( stderr,
"could not bind to index server, or could not create index entry\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
for ( i = 0; ldbm[i] != NULL; i++ ) {
free( ldbm );
free( tmpfile );
- exit( 0 );
+ exit( EXIT_SUCCESS );
}
/*
(vals[0] = (char *) malloc( 20 )) == NULL )
{
perror( "malloc" );
- exit( -1 );
+ exit( EXIT_FAILURE );
}
/* add values in mods[0] */
mods[0]->mod_op = LDAP_MOD_ADD;
(vals[0] = (char *) malloc( 20 )) == NULL )
{
perror( "malloc" );
- exit( -1 );
+ exit( EXIT_FAILURE );
}
mods[0]->mod_op = LDAP_MOD_REPLACE;
mods[0]->mod_type = attr;
break;
default:
usage( progname );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
if (( dn_suffix == NULL ) || ( nreplicas == 0 )) {
usage( progname );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
if ( ofile == NULL ) {
if (( std_ps = ps_alloc( std_open )) == NULLPS ||
std_setup( std_ps, ofp ) != OK ) {
fprintf( stderr, "std_ps setup failed - help!\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
if (( rps = ps_alloc( str_open )) == NULLPS ||
str_setup( rps, NULLCP, 0, 0 ) != OK ) {
fprintf( stderr, "rps setup failed - help!\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
if ( ofile != NULL ) {
if (( ofp = lock_fopen( ofile, "a", &lfp )) == NULL ) {
perror( "open" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
/*
sprintf( nbuf, "%s.lock", ofile );
(void) unlink( nbuf );
}
- exit( 0 );
+ exit( EXIT_SUCCESS );
}
} else if (( always_addvals = read_file( optarg, &always_addlen ))
== NULL ) {
print_err( optarg );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
break;
}
if ( file_attr_directory == NULL ) {
print_err( "malloc" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
#else /* HAVE_FILE_ATTR_DIR */
fprintf( stderr, "Ignoring -f: this option requires a newer version of ISODE.\n" );
}
if ( ignore_attr == NULL ) {
print_err( "malloc/realloc" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
ignore_attr[ ignore_count ] = optarg;
ignore_attr[ ++ignore_count ] = NULL;
if ( errflg ) {
fprintf( stderr, usage, progname );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
if ( basedn == NULL ) {
if ( init_syntaxes() < 0 ) {
fprintf( stderr, "%s: init_syntaxes failed -- check your oid tables \n",
progname );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
fprintf( stderr, "edb2ldif: exit( %d )\n", ( rc < 0 ) ? 1 : 0 );
#endif
- exit( ( rc < 0 ) ? 1 : 0 );
+ exit( ( rc < 0 ) ? EXIT_FAILURE : EXIT_SUCCESS );
}
/* #include <quipu/dap2.h> */
#include <quipu/dua.h>
-#include "lber.h"
-#include "ldap.h"
+#include <ldap.h>
+
#include "ldif.h"
#include "ldapsyntax.h"
fprintf( stderr,
"usage: %s [-d level] [-f slapdconfigfile]\n",
argv[0] );
- exit( -1 );
- break;
+ exit( EXIT_FAILURE );
}
}
printf( "suffix: " );
fflush( stdout );
if ( fgets( buf, sizeof(buf), stdin ) == NULL ) {
- exit( 0 );
+ exit( EXIT_SUCCESS );
} else {
buf[strlen( buf ) - 1] = '\0';
}
}
execl( editor, editor, tmpname, NULL );
perror( "execl" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
fclose( fp );
if ( c == 'f' ) {
printf( " file: " );
if ( fgets( name, namesiz, stdin ) == NULL )
- exit( 0 );
+ exit( EXIT_SUCCESS );
name[strlen( name ) - 1] = '\0';
} else {
printf( " attr: " );
if ( fgets( name, namesiz, stdin ) == NULL )
- exit( 0 );
+ exit( EXIT_SUCCESS );
name[strlen( name ) - 1] = '\0';
}
}
if ( tty )
printf( " dn: " );
if ( fgets( kbuf, sizeof(kbuf), fp ) == NULL ) {
- exit( 0 );
+ exit( EXIT_SUCCESS );
}
kbuf[strlen( kbuf ) - 1] = '\0';
key->dptr = strdup( kbuf );
if ( tty )
printf( " dnid: " );
if ( fgets( dbuf, sizeof(dbuf), fp ) == NULL ) {
- exit( 0 );
+ exit( EXIT_SUCCESS );
}
n = atol( dbuf );
data->dptr = (char *) malloc( sizeof(n) );
if ( tty )
printf( " dnid: " );
if ( fgets( kbuf, sizeof(kbuf), fp ) == NULL ) {
- exit( 0 );
+ exit( EXIT_SUCCESS );
}
n = atol( kbuf );
key->dptr = (char *) malloc( sizeof(n) );
if ( tty )
printf( " key: " );
if ( fgets( kbuf, sizeof(kbuf), fp ) == NULL ) {
- exit( 0 );
+ exit( EXIT_SUCCESS );
}
kbuf[strlen( kbuf ) - 1] = '\0';
key->dptr = strdup( kbuf );
#include <io.h>
#endif
-#include "lber.h"
-#include "ldap.h"
+#include <ldap.h>
+
#include "ldif.h"
static void
usage( char *name )
{
fprintf( stderr, "usage: %s [-b] <attrtype>\n", name );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
int
if (( val = (char *) malloc( BUFSIZ )) == NULL ) {
perror( "malloc" );
- exit( 1 );
+ return EXIT_FAILURE;
}
max = BUFSIZ;
cur = 0;
if (( val = (char *) realloc( val, max )) ==
NULL ) {
perror( "realloc" );
- exit( 1 );
+ return EXIT_FAILURE;
}
}
memcpy( val + cur, buf, nread );
}
if (( out = ldif_put( LDIF_PUT_BINARY, type, val, cur )) == NULL ) {
- perror( "ldif_type_and_value" );
- exit( 1 );
+ perror( "ldif_type_and_value" );
+ return EXIT_FAILURE;
}
fputs( out, stdout );
ber_memfree( out );
free( val );
- exit( 0 );
+ return EXIT_SUCCESS;
}
/* not binary: one value per line... */
if (( out = ldif_put( LDIF_PUT_VALUE, type, buf, strlen( buf ) ))
== NULL ) {
perror( "ldif_type_and_value" );
- exit( 1 );
+ return EXIT_FAILURE;
}
fputs( out, stdout );
ber_memfree( out );
}
- exit( 0 );
- return( 0 ); /* NOT REACHED */
+ return EXIT_SUCCESS;
}
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 oldif32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\libraries\Release"
+# ADD LINK32 hs_regex.lib libdb.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\libraries\Release"
!ELSEIF "$(CFG)" == "ldif - Win32 Debug"
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 oldif32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\libraries\Debug"
+# ADD LINK32 hs_regex.lib libdb.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\libraries\Debug"
!ELSEIF "$(CFG)" == "ldif - Win32 Single Debug"
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 oldif32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\libraries\Debug"
-# ADD LINK32 oldif32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\libraries\Debug"
+# ADD LINK32 hs_regex.lib libdbs.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\libraries\Debug"
!ELSEIF "$(CFG)" == "ldif - Win32 Single Release"
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 oldif32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\libraries\Release"
-# ADD LINK32 oldif32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\libraries\Release"
+# ADD LINK32 hs_regex.lib libdbs.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\libraries\Release"
!ENDIF
usage( char *name )
{
fprintf( stderr, "usage: %s -i inputfile [-d debuglevel] [-f configfile] [-n databasenumber]\n", name );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
int
} else {
if ( freopen( inputfile, "r", stdin ) == NULL ) {
perror( inputfile );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
}
if ( dbnum == nbackends ) {
fprintf( stderr, "No bdb2 database found in config file\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
} else if ( dbnum < 0 || dbnum > (nbackends-1) ) {
fprintf( stderr, "Database number selected via -n is out of range\n" );
fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends );
- exit( 1 );
+ exit( EXIT_FAILURE );
} else if ( strcasecmp( backends[dbnum].be_type, "bdb2" ) != 0 ) {
fprintf( stderr, "Database number %d selected via -n is not an bdb2 database\n", dbnum );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
slap_startup(dbnum);
if ( (db = bdb2i_cache_open( be, "dn2id", BDB2_SUFFIX, LDBM_NEWDB ))
== NULL ) {
perror( "dn2id file" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
id = 0;
if ( ldbm_store( db->dbc_db, key, data,
LDBM_REPLACE ) != 0 ) {
perror( "dn2id ldbm_store..." );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
}
if ( (db2 = bdb2i_cache_open( be, "id2children", BDB2_SUFFIX,
LDBM_NEWDB )) == NULL ) {
perror( "id2children file" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
rewind( stdin );
if ( bdb2i_idl_insert_key( be, db2, key, id )
!= 0 ) {
perror( "bdb2i_idl_insert_key" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
}
slap_shutdown(dbnum);
slap_destroy();
- exit( 0 );
+ exit( EXIT_SUCCESS );
}
usage( char *name )
{
fprintf( stderr, "usage: %s -i inputfile [-d debuglevel] [-f configfile] [-n databasenumber]\n", name );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
int
} else {
if ( freopen( inputfile, "r", stdin ) == NULL ) {
perror( inputfile );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
}
if ( dbnum == nbackends ) {
fprintf( stderr, "No ldbm database found in config file\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
} else if ( dbnum < 0 || dbnum > (nbackends-1) ) {
fprintf( stderr, "Database number selected via -n is out of range\n" );
fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends );
- exit( 1 );
+ exit( EXIT_FAILURE );
} else if ( strcasecmp( backends[dbnum].be_type, "ldbm" ) != 0 ) {
fprintf( stderr, "Database number %d selected via -n is not an ldbm database\n", dbnum );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
slap_startup(dbnum);
if ( (db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX, LDBM_NEWDB ))
== NULL ) {
perror( "dn2id file" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
id = 0;
if ( ldbm_store( db->dbc_db, key, data,
LDBM_REPLACE ) != 0 ) {
perror( "dn2id ldbm_store" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
}
if ( (db2 = ldbm_cache_open( be, "id2children", LDBM_SUFFIX,
LDBM_NEWDB )) == NULL ) {
perror( "id2children file" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
rewind( stdin );
if ( idl_insert_key( be, db2, key, id )
!= 0 ) {
perror( "idl_insert_key" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
}
usage( char *name )
{
fprintf( stderr, "usage: %s -i inputfile [-d debuglevel] [-f configfile] [-n databasenumber]\n", name );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
int
} else {
if ( freopen( inputfile, "r", stdin ) == NULL ) {
perror( inputfile );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
}
if ( dbnum == nbackends ) {
fprintf( stderr, "No bdb2 database found in config file\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
} else if ( dbnum < 0 || dbnum > (nbackends-1) ) {
fprintf( stderr, "Database number selected via -n is out of range\n" );
fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends );
- exit( 1 );
+ exit( EXIT_FAILURE );
} else if ( strcasecmp( backends[dbnum].be_type, "bdb2" ) != 0 ) {
fprintf( stderr, "Database number %d selected via -n is not an bdb2 database\n", dbnum );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
slap_startup(dbnum);
if ( (db = bdb2i_cache_open( be, "id2entry", BDB2_SUFFIX, LDBM_NEWDB ))
== NULL ) {
perror( "id2entry file" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
id = 0;
LDBM_INSERT ) != 0 ) {
fputs("id2entry ldbm_store failed\n",
stderr);
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
*buf = '\0';
slap_destroy();
- exit( 0 );
+ exit( EXIT_SUCCESS );
}
usage( char *name )
{
fprintf( stderr, "usage: %s -i inputfile [-d debuglevel] [-f configfile] [-n databasenumber]\n", name );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
int
} else {
if ( freopen( inputfile, "r", stdin ) == NULL ) {
perror( inputfile );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
}
if ( dbnum == nbackends ) {
fprintf( stderr, "No ldbm database found in config file\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
} else if ( dbnum < 0 || dbnum > (nbackends-1) ) {
fprintf( stderr, "Database number selected via -n is out of range\n" );
fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends );
- exit( 1 );
+ exit( EXIT_FAILURE );
} else if ( strcasecmp( backends[dbnum].be_type, "ldbm" ) != 0 ) {
fprintf( stderr, "Database number %d selected via -n is not an ldbm database\n", dbnum );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
slap_startup(dbnum);
if ( (db = ldbm_cache_open( be, "id2entry", LDBM_SUFFIX, LDBM_NEWDB ))
== NULL ) {
perror( "id2entry file" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
id = 0;
LDBM_INSERT ) != 0 ) {
fputs("id2entry ldbm_store failed\n",
stderr);
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
*buf = '\0';
usage( char *name )
{
fprintf( stderr, "usage: %s -i inputfile [-d debuglevel] [-f configfile] [-n databasenumber] attr\n", name );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
int
} else {
if ( freopen( inputfile, "r", stdin ) == NULL ) {
perror( inputfile );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
}
if ( dbnum == nbackends ) {
fprintf( stderr, "No bdb2 database found in config file\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
} else if ( dbnum < 0 || dbnum > (nbackends-1) ) {
fprintf( stderr, "Database number selected via -n is out of range\n" );
fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends );
- exit( 1 );
+ exit( EXIT_FAILURE );
} else if ( strcasecmp( backends[dbnum].be_type, "bdb2" ) != 0 ) {
fprintf( stderr, "Database number %d selected via -n is not an bdb2 database\n", dbnum );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
slap_startup(dbnum);
bdb2i_attr_masks( be->be_private, attr, &indexmask, &syntaxmask );
if ( indexmask == 0 ) {
- exit( 0 );
+ exit( EXIT_SUCCESS );
}
id = 0;
slap_shutdown(dbnum);
slap_destroy();
- exit( 0 );
+ exit( EXIT_SUCCESS );
}
usage( char *name )
{
fprintf( stderr, "usage: %s -i inputfile [-d debuglevel] [-f configfile] [-n databasenumber] attr\n", name );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
int
} else {
if ( freopen( inputfile, "r", stdin ) == NULL ) {
perror( inputfile );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
}
if ( dbnum == nbackends ) {
fprintf( stderr, "No ldbm database found in config file\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
} else if ( dbnum < 0 || dbnum > (nbackends-1) ) {
fprintf( stderr, "Database number selected via -n is out of range\n" );
fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends );
- exit( 1 );
+ exit( EXIT_FAILURE );
} else if ( strcasecmp( backends[dbnum].be_type, "ldbm" ) != 0 ) {
fprintf( stderr, "Database number %d selected via -n is not an ldbm database\n", dbnum );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
slap_startup(dbnum);
attr_masks( be->be_private, attr, &indexmask, &syntaxmask );
if ( indexmask == 0 ) {
- exit( 0 );
+ exit( EXIT_SUCCESS );
}
id = 0;
usage( char *name )
{
fprintf( stderr, "usage: %s -i inputfile [-d debuglevel] [-f configfile] [-j #jobs] [-n databasenumber] [-s sbindir]\n", name );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
int
} else {
if ( freopen( inputfile, "r", stdin ) == NULL ) {
perror( inputfile );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
rc = slap_init(SLAP_TOOL_MODE, "ldif2ldbm");
if (rc != 0 ) {
fprintf( stderr, "ldif2ldbm: slap_init failed!\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
read_config( tailorfile );
}
if ( dbnum == nbackends ) {
fprintf( stderr, "No bdb2 database found in config file\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
} else if ( dbnum < 0 || dbnum > (nbackends-1) ) {
fprintf( stderr, "Database number selected via -n is out of range\n" );
fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends );
- exit( 1 );
+ exit( EXIT_FAILURE );
} else if ( strcasecmp( backends[dbnum].be_type, "bdb2" ) != 0 ) {
fprintf( stderr, "Database number %d selected via -n is not an bdb2 database\n", dbnum );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
slap_startup(dbnum);
slap_destroy();
- exit( 0 );
+ exit( EXIT_SUCCESS );
}
static void
execvp( prog, args );
fprintf( stderr, "%s: ", prog );
perror( "execv" );
- exit( -1 );
+ exit( EXIT_FAILURE );
break;
case -1: /* trouble */
usage( char *name )
{
fprintf( stderr, "usage: %s -i inputfile [-d debuglevel] [-f configfile] [-j #jobs] [-n databasenumber] [-s sbindir]\n", name );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
int
} else {
if ( freopen( inputfile, "r", stdin ) == NULL ) {
perror( inputfile );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
rc = slap_init(SLAP_TOOL_MODE, "ldif2ldbm");
if (rc != 0 ) {
fprintf( stderr, "ldif2ldbm: slap_init failed!\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
read_config( tailorfile );
}
if ( dbnum == nbackends ) {
fprintf( stderr, "No ldbm database found in config file\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
} else if ( dbnum < 0 || dbnum > (nbackends-1) ) {
fprintf( stderr, "Database number selected via -n is out of range\n" );
fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends );
- exit( 1 );
+ exit( EXIT_FAILURE );
} else if ( strcasecmp( backends[dbnum].be_type, "ldbm" ) != 0 ) {
fprintf( stderr, "Database number %d selected via -n is not an ldbm database\n", dbnum );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
slap_startup(dbnum);
{
fprintf( stderr, "Could not create %s: ", prog );
perror( "CreateProcess" );
- exit (-1);
+ exit (EXIT_FAILURE);
}
processes[nkids] = proc_info.hProcess;
execvp( prog, args );
fprintf( stderr, "%s: ", prog );
perror( "execv" );
- exit( -1 );
+ exit( EXIT_FAILURE );
break;
case -1: /* trouble */
*/
if ( (ld = ldap_init( "vertigo:5555", 0 )) == NULL ) {
perror( "ldap_init" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
if ( ldap_search( ld, "cn=index", LDAP_SCOPE_ONELEVEL, "(objectclass=*)",
attrs, 0 ) == -1 ) {
ldap_perror( ld, "ldap_search" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
printf( "attr\tdn\tnentries\tvcount\tvsize\twcount\twsize\tpcount\tpsize\tscount\tssize\n" );
DB_FLAGS, MODE, CACHE_SIZE )) == NULL || (sldbm = ldbm_open(
"scount.ldbm", DB_FLAGS, MODE, CACHE_SIZE )) == NULL ) {
perror( "ldbm_open" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
vcount = 0; vsize = 0;
wcount = 0; wsize = 0;
(void) unlink( "pcount.ldbm" );
(void) unlink( "scount.ldbm" );
- exit( 0 );
+ exit( EXIT_SUCCESS );
}
static void
if ( pwd == NULL ) {
Debug( LDAP_DEBUG_ANY, "No passwd entry for user %s\n",
user, 0, 0 );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
if ( got_uid ) {
free( user );
if ( grp == NULL ) {
Debug( LDAP_DEBUG_ANY, "No group entry for group %s\n",
group, 0, 0 );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
free( group );
if ( getuid() == 0 && initgroups( user, gid ) != 0 ) {
Debug( LDAP_DEBUG_ANY,
"Could not set the group access (gid) list\n", 0, 0, 0 );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
free( user );
}
if ( setgid( gid ) != 0 ) {
Debug( LDAP_DEBUG_ANY, "Could not set real group id to %d\n",
gid, 0, 0 );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
#ifdef HAVE_SETEGID
if ( setegid( gid ) != 0 ) {
Debug( LDAP_DEBUG_ANY, "Could not set effective group id to %d\n",
gid, 0, 0 );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
#endif
}
if ( setuid( uid ) != 0 ) {
Debug( LDAP_DEBUG_ANY, "Could not set real user id to %d\n",
uid, 0, 0 );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
#ifdef HAVE_SETEUID
if ( seteuid( uid ) != 0 ) {
Debug( LDAP_DEBUG_ANY, "Could not set effective user id to %d\n",
uid, 0, 0 );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
#endif
}
if ( (new = (void *) ber_memalloc( size )) == NULL ) {
fprintf( stderr, "malloc of %lu bytes failed\n",
(long) size );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
return( new );
if ( (new = (void *) ber_memrealloc( block, size )) == NULL ) {
fprintf( stderr, "realloc of %lu bytes failed\n",
(long) size );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
return( new );
if ( (new = (void *) ber_memcalloc( nelem, size )) == NULL ) {
fprintf( stderr, "calloc of %lu elems of %lu bytes failed\n",
(long) nelem, (long) size );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
return( new );
if ( (fp = fopen( fname, "r" )) == NULL ) {
perror( fname );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
lineno = 0;
"line %d: missing filename in \"replogfile ",
lineno );
fprintf( stderr, "<filename>\" line\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
} else if ( cargc > 2 && *cargv[2] != '#' ) {
fprintf( stderr,
"line %d: extra cruft at the end of \"replogfile %s\"",
( nr + 1 ) * sizeof( Re * ));
if ( sglob->replicas == NULL ) {
fprintf( stderr, "out of memory, add_replica\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
sglob->replicas[ nr ] = NULL;
if ( Ri_init( &(sglob->replicas[ nr - 1 ])) < 0 ) {
fprintf( stderr, "out of memory, Ri_init\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
if ( parse_replica_line( cargv, cargc,
sglob->replicas[ nr - 1] ) < 0 ) {
sglob->replicas[ nr - 1 ] );
if ( sglob->replicas[ nr - 1]->ri_stel == NULL ) {
fprintf( stderr, "Failed to add status element structure\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
}
fprintf( stderr, "You must rebuild the LDAP release with\n" );
fprintf( stderr, "kerberos support if you wish to use\n" );
fprintf( stderr, "bindmethod=kerberos\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
#endif /* HAVE_KERBEROS */
} else if ( !strcasecmp( val, SIMPLESTR )) {
ri->ri_bind_method = AUTH_SIMPLE;
g->srpos = 0L;
if ( St_init( &(g->st)) < 0 ) {
fprintf( stderr, "Cannot initialize status data\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
ldap_pvt_thread_mutex_init( &(g->rej_mutex) );
if ( Rq_init( &(g->rq)) < 0 ) {
fprintf( stderr, "Cannot initialize queue\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
#ifdef HAVE_KERBEROS
g->default_srvtab = SRVTAB;
*/
if (( sglob = init_globals()) == NULL ) {
fprintf( stderr, "Out of memory initializing globals\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
/*
* Process command-line args and fill in globals.
*/
if ( doargs( argc, argv, sglob ) < 0 ) {
- exit( 1 );
+ exit( EXIT_FAILURE );
}
/*
fprintf( stderr,
"Errors encountered while processing config file \"%s\"\n",
sglob->slapd_configfile );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
/*
if ( sglob->st->st_read( sglob->st )) {
fprintf( stderr, "Malformed slurpd status file \"%s\"\n",
sglob->slurpd_status_file, 0, 0 );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
/*
* Check for any fatal error conditions before we get started
*/
if ( sanity() < 0 ) {
- exit( 1 );
+ exit( EXIT_FAILURE );
}
/*
{
Debug( LDAP_DEBUG_ANY, "file manager ldap_pvt_thread_create failed\n",
0, 0, 0 );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
#endif
#include <sys/types.h>
-#include "lber.h"
-#include "ldap.h"
+#include <ldap.h>
#define ldap_debug slurp_debug
#include "ldap_log.h"
#include <sys/param.h>
#endif
-#include "lber.h"
-#include "ldap.h"
+#include <ldap.h>
#define LOOPS 100
{
fprintf( stderr, "usage: %s [-h <host>] -p port -D <managerDN> -w <passwd> -f <addfile> [-l <loops>]\n",
name );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
int
fprintf( stderr, "%s: invalid entry DN in file \"%s\".\n",
argv[0], filename );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
fprintf( stderr, "%s: invalid attrs in file \"%s\".\n",
argv[0], filename );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
do_addel( host, port, manager, passwd, entry, attrs, loops );
- exit( 0 );
+ exit( EXIT_SUCCESS );
}
if (( pmods = (LDAPMod **)realloc( pmods, (i + 2) *
sizeof( LDAPMod * ))) == NULL ) {
perror( "realloc" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
*pmodsp = pmods;
pmods[ i + 1 ] = NULL;
if (( pmods[ i ] = (LDAPMod *)calloc( 1, sizeof( LDAPMod )))
== NULL ) {
perror( "calloc" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
pmods[ i ]->mod_op = modop;
if (( pmods[ i ]->mod_type = strdup( attr )) == NULL ) {
perror( "strdup" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
}
(struct berval **)ber_memrealloc( pmods[ i ]->mod_bvalues,
(j + 2) * sizeof( struct berval * ))) == NULL ) {
perror( "ber_realloc" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
pmods[ i ]->mod_bvalues[ j + 1 ] = NULL;
if (( bvp = (struct berval *)ber_memalloc( sizeof( struct berval )))
== NULL ) {
perror( "malloc" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
pmods[ i ]->mod_bvalues[ j ] = bvp;
bvp->bv_len = vlen;
if (( bvp->bv_val = (char *)malloc( vlen + 1 )) == NULL ) {
perror( "malloc" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
SAFEMEMCPY( bvp->bv_val, value, vlen );
bvp->bv_val[ vlen ] = '\0';
if (( ld = ldap_init( host, port )) == NULL ) {
perror( "ldap_init" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
if ( ldap_bind_s( ld, manager, passwd, LDAP_AUTH_SIMPLE )
!= LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_bind" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
#include <sys/param.h>
#endif
-#include "lber.h"
-#include "ldap.h"
+#include <ldap.h>
#define LOOPS 100
{
fprintf( stderr, "usage: %s [-h <host>] -p port -e <entry> [-l <loops>]\n",
name );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
int
fprintf( stderr, "%s: invalid EMPTY entry DN.\n",
argv[0] );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
do_read( host, port, entry, ( 4 * loops ));
- exit( 0 );
+ exit( EXIT_SUCCESS );
}
if (( ld = ldap_init( host, port )) == NULL ) {
perror( "ldap_init" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
if ( ldap_bind_s( ld, NULL, NULL, LDAP_AUTH_SIMPLE ) != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_bind" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
#include <sys/param.h>
#endif
-#include "lber.h"
-#include "ldap.h"
+#include <ldap.h>
#define LOOPS 100
{
fprintf( stderr, "usage: %s [-h <host>] -p port -b <searchbase> -f <searchfiter> [-l <loops>]\n",
name );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
int
fprintf( stderr, "%s: invalid EMPTY search filter.\n",
argv[0] );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
do_search( host, port, sbase, filter, ( 4 * loops ));
- exit( 0 );
+ exit( EXIT_SUCCESS );
}
if (( ld = ldap_init( host, port )) == NULL ) {
perror( "ldap_init" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
if ( ldap_bind_s( ld, NULL, NULL, LDAP_AUTH_SIMPLE ) != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_bind" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
usage( char *name )
{
fprintf( stderr, "usage: %s [-h <host>] -p <port> -D <manager> -w <passwd> -d <datadir> -b <baseDN> [-j <maxchild>] [-l <loops>] -P <progdir>\n", name );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
int
fprintf( stderr, "%s: couldn't open data directory \"%s\".\n",
argv[0], dirname );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
wait4kids( -1 );
- exit( 0 );
+ exit( EXIT_SUCCESS );
}
static char *
execvp( prog, args );
fprintf( stderr, "%s: ", prog );
perror( "execv" );
- exit( -1 );
+ exit( EXIT_FAILURE );
break;
case -1: /* trouble */