#include <stdio.h>
#include <stdlib.h>
+#include <ac/signal.h>
#include <ac/socket.h>
#include <ac/string.h>
#include <ac/ctype.h>
identity = MAIL500;
}
+#ifdef SIGPIPE
+ (void) SIGNAL( SIGPIPE, SIG_IGN );
+#endif
+
#ifdef LOG_MAIL
openlog( myname, OPENLOG_OPTIONS, LOG_MAIL );
#else
#define DEFAULT_PORT 79
#define DEFAULT_SIZELIMIT 50
-int debug;
+int debug = 0;
char *ldaphost = NULL;
char *base = NULL;
int deref;
break;
case 'd': /* turn on debugging */
- debug = atoi( optarg );
+ debug |= atoi( optarg );
break;
case 'f': /* ldap filter file */
exit( -1 );
}
+ if ( debug ) {
+ lber_debug = ldap_debug = debug;
+ }
+
+#ifdef SIGPIPE
+ (void) SIGNAL( SIGPIPE, SIG_IGN );
+#endif
+
if ( (ld = ldap_open( ldaphost, 0 )) == NULL ) {
perror( "ldap_open" );
exit( -1 );
else
myname = strdup( myname + 1 );
+#ifdef SIGPIPE
+ (void) SIGNAL( SIGPIPE, SIG_IGN );
+#endif
+
if ( dosyslog ) {
#ifdef LOG_LOCAL4
openlog( myname, OPENLOG_OPTIONS, LOG_LOCAL4 );
#include "disptmpl.h"
-int debug;
+int debug = 0;
int dosyslog;
int inetd;
int dtblsize;
break;
case 'd': /* debug level */
- debug = atoi( optarg );
+ debug |= atoi( optarg );
break;
case 'f': /* ldap filter file */
else
myname = strdup( myname + 1 );
+ if ( debug ) {
+ lber_debug = ldap_debug = debug;
+ }
+
+#ifdef SIGPIPE
+ (void) SIGNAL( SIGPIPE, SIG_IGN );
+#endif
+
if ( dosyslog ) {
#ifdef LOG_LOCAL3
openlog( myname, OPENLOG_OPTIONS, LOG_LOCAL3 );
#include "ldapconfig.h"
-int debug;
+int debug = 0;
int dosyslog;
int inetd;
int dtblsize;
break;
case 'd': /* debugging level */
- debug = atoi( optarg );
-#ifdef LDAP_DEBUG
- ldap_debug = debug;
-#else
+ debug |= atoi( optarg );
+#ifndef LDAP_DEBUG
fprintf( stderr, "warning: ldap debugging requires LDAP_DEBUG\n" );
#endif
break;
else
myname = strdup( myname + 1 );
+ if ( debug ) {
+ lber_debug = ldap_debug = debug;
+ }
+
+#ifdef SIGPIPE
+ (void) SIGNAL( SIGPIPE, SIG_IGN );
+#endif
+
if ( dosyslog ) {
#ifdef LOG_LOCAL3
openlog( myname, OPENLOG_OPTIONS, LOG_LOCAL3 );
#include <stdlib.h>
#include <ac/ctype.h>
+#include <ac/signal.h>
#include <ac/string.h>
#include <ac/syslog.h>
#include <ac/time.h>
char *host = NULL;
char *ldaphost = NULL;
int hostlen = 0;
-int debug;
+int debug = 0;
typedef struct errs {
int e_code;
else
myname = strdup( myname + 1 );
+#ifdef SIGPIPE
+ (void) SIGNAL( SIGPIPE, SIG_IGN );
+#endif
+
#ifdef LOG_MAIL
openlog( myname, OPENLOG_OPTIONS, LOG_MAIL );
#else
while ( (i = getopt( argc, argv, "d:f:h:l:m:v:" )) != EOF ) {
switch( i ) {
case 'd': /* turn on debugging */
- debug = atoi( optarg );
+ debug |= atoi( optarg );
break;
case 'f': /* who it's from & where errors should go */
#include <stdlib.h>
#include <ac/ctype.h>
+#include <ac/signal.h>
#include <ac/string.h>
#include <ac/syslog.h>
#include <ac/unistd.h>
exit( 1 );
}
+#ifdef SIGPIPE
+ (void) SIGNAL( SIGPIPE, SIG_IGN );
+#endif
+
if ( dosyslog ) {
/*
* if syslogging requested, initialize
#include <stdlib.h>
#include <ctype.h>
+#include <ac/signal.h>
#include <ac/socket.h>
#include <ac/string.h>
#include <ac/unistd.h>
char *usage = "usage: %s [-n] [-v] [-k] [-W] [-d debug-level] [-f file] [-h ldaphost] [-p ldapport] [-D binddn] [-w passwd] [dn]...\n";
char buf[ 4096 ];
FILE *fp;
- int i, rc, authmethod, want_bindpw;
+ int i, rc, authmethod, want_bindpw, debug;
- not = verbose = contoper = want_bindpw = 0;
+ not = verbose = contoper = want_bindpw = debug = 0;
fp = NULL;
authmethod = LDAP_AUTH_SIMPLE;
break;
case 'd':
#ifdef LDAP_DEBUG
- ldap_debug = lber_debug = atoi( optarg ); /* */
+ debug |= atoi( optarg ); /* */
#else /* LDAP_DEBUG */
fprintf( stderr, "compile with -DLDAP_DEBUG for debugging\n" );
#endif /* LDAP_DEBUG */
}
}
+ if ( debug ) {
+ lber_debug = ldap_debug = debug;
+ }
+
+#ifdef SIGPIPE
+ (void) SIGNAL( SIGPIPE, SIG_IGN );
+#endif
+
if (( ld = ldap_open( ldaphost, ldapport )) == NULL ) {
perror( "ldap_open" );
exit( 1 );
#include <stdlib.h>
#include <ac/ctype.h>
+#include <ac/signal.h>
#include <ac/string.h>
#include <ac/socket.h>
#include <ac/unistd.h>
{
char *infile, *rbuf, *start, *p, *q;
FILE *fp;
- int rc, i, use_ldif, authmethod, want_bindpw;
+ int rc, i, use_ldif, authmethod, want_bindpw, debug;
char *usage = "usage: %s [-abcknrvWF] [-d debug-level] [-h ldaphost] [-p ldapport] [-D binddn] [-w passwd] [ -f file | < entryfile ]\n";
if (( prog = strrchr( argv[ 0 ], '/' )) == NULL ) {
new = ( strcmp( prog, "ldapadd" ) == 0 );
infile = NULL;
- not = verbose = valsfromfiles = want_bindpw = 0;
+ not = verbose = valsfromfiles = want_bindpw = debug = 0;
authmethod = LDAP_AUTH_SIMPLE;
while (( i = getopt( argc, argv, "WFabckKnrtvh:p:D:w:d:f:" )) != EOF ) {
break;
case 'd':
#ifdef LDAP_DEBUG
- ldap_debug = lber_debug = atoi( optarg ); /* */
+ debug |= atoi( optarg );
#else /* LDAP_DEBUG */
fprintf( stderr, "%s: compile with -DLDAP_DEBUG for debugging\n",
prog );
fp = stdin;
}
+ if ( debug ) {
+ lber_debug = ldap_debug = debug;
+ }
+
+#ifdef SIGPIPE
+ (void) SIGNAL( SIGPIPE, SIG_IGN );
+#endif
if ( !not ) {
if (( ld = ldap_open( ldaphost, ldapport )) == NULL ) {
#include <stdlib.h>
#include <ac/ctype.h>
+#include <ac/signal.h>
#include <ac/string.h>
#include <ac/time.h>
#include <ac/unistd.h>
char *usage = "usage: %s [-nvkWc] [-d debug-level] [-h ldaphost] [-p ldapport] [-D binddn] [-w passwd] [ -f file | < entryfile | dn newrdn ]\n";
char *myname,*infile, *entrydn, *rdn, buf[ 4096 ];
FILE *fp;
- int rc, i, remove, havedn, authmethod, want_bindpw;
+ int rc, i, remove, havedn, authmethod, want_bindpw, debug;
infile = NULL;
- not = contoper = verbose = remove = want_bindpw = 0;
+ not = contoper = verbose = remove = want_bindpw = debug = 0;
authmethod = LDAP_AUTH_SIMPLE;
myname = (myname = strrchr(argv[0], '/')) == NULL ? argv[0] : ++myname;
break;
case 'd':
#ifdef LDAP_DEBUG
- ldap_debug = lber_debug = atoi( optarg ); /* */
+ debug |= atoi( optarg );
#else /* LDAP_DEBUG */
fprintf( stderr, "compile with -DLDAP_DEBUG for debugging\n" );
#endif /* LDAP_DEBUG */
fp = stdin;
}
+ if ( debug ) {
+ lber_debug = ldap_debug = debug;
+ }
+
+#ifdef SIGPIPE
+ (void) SIGNAL( SIGPIPE, SIG_IGN );
+#endif
+
if (( ld = ldap_open( ldaphost, ldapport )) == NULL ) {
perror( "ldap_open" );
exit( 1 );
#include <stdlib.h>
#include <sys/time.h>
+#include <ac/signal.h>
#include <ac/string.h>
#include <ac/unistd.h>
lber_debug = ldap_debug = debug;
}
+#ifdef SIGPIPE
+ (void) SIGNAL( SIGPIPE, SIG_IGN );
+#endif
+
/* connect to server */
if ((ld = ldap_open (ldaphost, ldapport)) == NULL)
{
#include <stdlib.h>
#include <ac/ctype.h>
+#include <ac/signal.h>
#include <ac/socket.h>
#include <ac/string.h>
#include <ac/time.h>
{
char *infile, *filtpattern, **attrs, line[ BUFSIZ ];
FILE *fp;
- int rc, i, first, scope, kerberos, deref, attrsonly;
+ int rc, i, first, scope, kerberos, deref, attrsonly, debug;
int ldap_options, timelimit, sizelimit, authmethod;
LDAP *ld;
infile = NULL;
deref = verbose = allow_binary = not = kerberos = vals2tmp =
- attrsonly = ldif = 0;
+ attrsonly = ldif = debug = 0;
#ifdef LDAP_REFERRALS
ldap_options = LDAP_OPT_REFERRALS;
break;
case 'd':
#ifdef LDAP_DEBUG
- ldap_debug = lber_debug = atoi( optarg ); /* */
+ debug |= atoi( optarg );
#else /* LDAP_DEBUG */
fprintf( stderr, "compile with -DLDAP_DEBUG for debugging\n" );
#endif /* LDAP_DEBUG */
printf( "ldap_open( %s, %d )\n", ldaphost, ldapport );
}
+ if ( debug ) {
+ lber_debug = ldap_debug = debug;
+ }
+
+#ifdef SIGPIPE
+ (void) SIGNAL( SIGPIPE, SIG_IGN );
+#endif
+
if (( ld = ldap_open( ldaphost, ldapport )) == NULL ) {
perror( ldaphost );
exit( 1 );
switch (c) {
case 'l' :
#ifdef LDAP_DEBUG
- ldap_debug = (int) strtol(optarg, (char **) NULL, 0);
- lber_debug = ldap_debug;
+ ldap_debug |= (int) strtol(optarg, (char **) NULL, 0);
+ lber_debug |= ldap_debug;
#endif
break;
case 'd' :
printf(Version);
fflush( stdout );
+#ifdef SIGPIPE
+ (void) SIGNAL (SIGPIPE, SIG_IGN);
+#endif
+
initialize_client();
initialize_attribute_strings();
char *bv_val;
};
-#ifdef LDAP_DEBUG
extern int lber_debug;
-#endif
/*
* in bprint.c:
#define LDAP_MAX_ATTR_LEN 100
/* debugging stuff */
+extern int ldap_debug; /* always available */
+
#ifdef LDAP_DEBUG
-extern int ldap_debug;
+
#ifdef LDAP_SYSLOG
extern int ldap_syslog;
extern int ldap_syslog_level;
#include "lber.h"
-#ifdef LDAP_DEBUG
int lber_debug;
-#endif
static int ber_getnint LDAP_P(( BerElement *ber, long *num, int len ));
#include "ldap.h"
#include "ldap-int.h"
-#ifdef LDAP_DEBUG
int ldap_debug;
-#endif
/*