From: Kurt Zeilenga Date: Fri, 6 Nov 1998 01:32:41 +0000 (+0000) Subject: Update with latest NT mods. X-Git-Tag: OPENLDAP_REL_ENG_1_1_ALPHA2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=904f6d113ece2db099659f16dca4887825f6a528;p=thirdparty%2Fopenldap.git Update with latest NT mods. --- diff --git a/clients/tools/ldapdelete.c b/clients/tools/ldapdelete.c index 3054cfb54f..93b9f0de61 100644 --- a/clients/tools/ldapdelete.c +++ b/clients/tools/ldapdelete.c @@ -1,17 +1,22 @@ /* ldapdelete.c - simple program to delete an entry using LDAP */ +#include "portable.h" + #include -#include #include #include + +#include +#include + #include #include #include "ldapconfig.h" static char *binddn = LDAPDELETE_BINDDN; +static char *passwd = LDAPDELETE_BIND_CRED; static char *base = LDAPDELETE_BASE; -static char *passwd = NULL; static char *ldaphost = LDAPHOST; static int ldapport = LDAP_PORT; static int not, verbose, contoper; @@ -24,15 +29,18 @@ extern int ldap_debug, lber_debug; #define safe_realloc( ptr, size ) ( ptr == NULL ? malloc( size ) : \ realloc( ptr, size )) +static int dodelete LDAP_P(( + LDAP *ld, + char *dn)); main( argc, argv ) int argc; char **argv; { char *usage = "usage: %s [-n] [-v] [-k] [-d debug-level] [-f file] [-h ldaphost] [-p ldapport] [-D binddn] [-w passwd] [dn]...\n"; - char *p, buf[ 4096 ]; + char buf[ 4096 ]; FILE *fp; - int i, rc, kerberos, linenum, authmethod; + int i, rc, kerberos, authmethod; extern char *optarg; extern int optind; @@ -130,12 +138,15 @@ main( argc, argv ) ldap_unbind( ld ); exit( rc ); + + /* UNREACHABLE */ + return(0); } -dodelete( ld, dn ) - LDAP *ld; - char *dn; +static int dodelete( + LDAP *ld, + char *dn) { int rc; diff --git a/clients/tools/ldapmodify.c b/clients/tools/ldapmodify.c index fa87c3d571..2d3506eff1 100644 --- a/clients/tools/ldapmodify.c +++ b/clients/tools/ldapmodify.c @@ -226,6 +226,9 @@ main( int argc, char **argv ) } exit( rc ); + + /* UNREACHABLE */ + return(0); } diff --git a/clients/tools/ldapmodrdn.c b/clients/tools/ldapmodrdn.c index aaffe4c170..a00d259d34 100644 --- a/clients/tools/ldapmodrdn.c +++ b/clients/tools/ldapmodrdn.c @@ -172,6 +172,9 @@ main( argc, argv ) ldap_unbind( ld ); exit( rc ); + + /* UNREACHABLE */ + return(0); } static int domodrdn( diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index d96aff1317..baa67d649b 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -1,6 +1,13 @@ +#include "portable.h" + #include -#include #include + +#include +#include +#include +#include + #include #include #include @@ -14,7 +21,7 @@ extern int ldap_debug, lber_debug; #endif /* LDAP_DEBUG */ -usage( s ) +static void usage( s ) char *s; { fprintf( stderr, "usage: %s [options] filter [attributes...]\nwhere:\n", s ); @@ -43,7 +50,7 @@ char *s; fprintf( stderr, " -z size lim\tsize limit (in entries) for search\n" ); fprintf( stderr, " -D binddn\tbind dn\n" ); fprintf( stderr, " -w passwd\tbind passwd (for simple authentication)\n" ); -#ifdef KERBEROS +#ifdef HAVE_KERBEROS fprintf( stderr, " -k\t\tuse Kerberos instead of Simple Password authentication\n" ); #endif fprintf( stderr, " -h host\tldap server\n" ); @@ -51,8 +58,27 @@ char *s; exit( 1 ); } +static void print_entry LDAP_P(( + LDAP *ld, + LDAPMessage *entry, + int attrsonly)); + +static int write_ldif_value LDAP_P(( + char *type, + char *value, + unsigned long vallen )); + +static int dosearch LDAP_P(( + LDAP *ld, + char *base, + int scope, + char **attrs, + int attrsonly, + char *filtpatt, + char *value)); + static char *binddn = LDAPSEARCH_BINDDN; -static char *passwd = NULL; +static char *passwd = LDAPSEARCH_BIND_CRED; static char *base = LDAPSEARCH_BASE; static char *ldaphost = LDAPHOST; static int ldapport = LDAP_PORT; @@ -85,7 +111,7 @@ char **argv; scope = LDAP_SCOPE_SUBTREE; while (( i = getopt( argc, argv, -#ifdef KERBEROS +#ifdef HAVE_KERBEROS "KknuvtRABLD:s:f:h:b:d:p:F:a:w:l:z:S:" #else "nuvtRABLD:s:f:h:b:d:p:F:a:w:l:z:S:" @@ -105,7 +131,7 @@ char **argv; fprintf( stderr, "compile with -DLDAP_DEBUG for debugging\n" ); #endif /* LDAP_DEBUG */ break; -#ifdef KERBEROS +#ifdef HAVE_KERBEROS case 'k': /* use kerberos bind */ kerberos = 2; break; @@ -291,19 +317,22 @@ char **argv; ldap_unbind( ld ); exit( rc ); + + /* UNREACHABLE */ + return(0); } -dosearch( ld, base, scope, attrs, attrsonly, filtpatt, value ) - LDAP *ld; - char *base; - int scope; - char **attrs; - int attrsonly; - char *filtpatt; - char *value; +static int dosearch( + LDAP *ld, + char *base, + int scope, + char **attrs, + int attrsonly, + char *filtpatt, + char *value) { - char filter[ BUFSIZ ], **val; + char filter[ BUFSIZ ]; int rc, first, matches; LDAPMessage *res, *e; @@ -371,10 +400,10 @@ dosearch( ld, base, scope, attrs, attrsonly, filtpatt, value ) } -print_entry( ld, entry, attrsonly ) - LDAP *ld; - LDAPMessage *entry; - int attrsonly; +void print_entry( + LDAP *ld, + LDAPMessage *entry, + int attrsonly) { char *a, *dn, *ufn, tmpfname[ 64 ]; int i, j, notascii; @@ -436,7 +465,7 @@ print_entry( ld, entry, attrsonly ) } else { notascii = 0; if ( !allow_binary ) { - for ( j = 0; j < bvals[ i ]->bv_len; ++j ) { + for ( j = 0; (unsigned long) j < bvals[ i ]->bv_len; ++j ) { if ( !isascii( bvals[ i ]->bv_val[ j ] )) { notascii = 1; break; diff --git a/clients/tools/ldapsearch.dsp b/clients/tools/ldapsearch.dsp index 9927479c89..986dd35c5e 100644 --- a/clients/tools/ldapsearch.dsp +++ b/clients/tools/ldapsearch.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /Ze /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe