From e5eb270e6c04102f42545d34efdce318b439f5ab Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 17 Dec 2001 22:42:55 +0000 Subject: [PATCH] from jon@symas.com - misc Windows cleanup --- libraries/liblber/decode.c | 2 +- libraries/libldap/getdn.c | 2 +- libraries/libldap/ldap-int.h | 10 ++++++++-- libraries/libldap/test.c | 2 +- libraries/liblutil/entropy.c | 3 --- libraries/liblutil/passwd.c | 3 +++ libraries/liblutil/uuid.c | 3 ++- 7 files changed, 16 insertions(+), 9 deletions(-) diff --git a/libraries/liblber/decode.c b/libraries/liblber/decode.c index 482834ed5c..eede1508d1 100644 --- a/libraries/liblber/decode.c +++ b/libraries/liblber/decode.c @@ -143,7 +143,7 @@ ber_skip_tag( BerElement *ber, ber_len_t *len ) } /* BER element should have enough data left */ - if( *len > ber_pvt_ber_remaining( ber ) ) { + if( *len > (ber_len_t) ber_pvt_ber_remaining( ber ) ) { return LBER_DEFAULT; } diff --git a/libraries/libldap/getdn.c b/libraries/libldap/getdn.c index 0b90709ac4..e4bb1b1504 100644 --- a/libraries/libldap/getdn.c +++ b/libraries/libldap/getdn.c @@ -2060,7 +2060,7 @@ end_of_value:; len = ( ( endPos ? endPos : p ) - startPos ) / 2; /* must be even! */ - assert( 2 * len == ( endPos ? endPos : p ) - startPos ); + assert( 2 * len == (ber_len_t) (( endPos ? endPos : p ) - startPos )); *val = LDAP_MALLOC( sizeof( struct berval ) ); if ( *val == NULL ) { diff --git a/libraries/libldap/ldap-int.h b/libraries/libldap/ldap-int.h index 8609ce2768..e4b4983177 100644 --- a/libraries/libldap/ldap-int.h +++ b/libraries/libldap/ldap-int.h @@ -18,6 +18,14 @@ #include "../liblber/lber-int.h" +/* + * Windows does not preprocess correctly unless + * this #include precedes queue.h + */ +#ifdef LDAP_R_COMPILE +#include +#endif + #include #ifdef HAVE_CYRUS_SASL @@ -306,8 +314,6 @@ struct ldap { #define LDAP_VALID(ld) ( (ld)->ld_valid == LDAP_VALID_SESSION ) #ifdef LDAP_R_COMPILE -#include - #ifdef HAVE_RES_QUERY LDAP_V ( ldap_pvt_thread_mutex_t ) ldap_int_resolv_mutex; #endif diff --git a/libraries/libldap/test.c b/libraries/libldap/test.c index 77aca1e036..29cdf49409 100644 --- a/libraries/libldap/test.c +++ b/libraries/libldap/test.c @@ -237,7 +237,7 @@ bind_prompt( LDAP *ld, static char dn[256], passwd[256]; int authmethod; - printf("rebind for request=%d msgid=%ld url=%s\n", + printf("rebind for request=%ld msgid=%ld url=%s\n", request, (long) msgid, url ); #ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND diff --git a/libraries/liblutil/entropy.c b/libraries/liblutil/entropy.c index 1460913012..4a16c5dd1b 100644 --- a/libraries/liblutil/entropy.c +++ b/libraries/liblutil/entropy.c @@ -10,9 +10,6 @@ #include #include -#ifdef HAVE_WINCRYPT_H -#include -#endif #ifdef HAVE_PROCESS_H #include #endif diff --git a/libraries/liblutil/passwd.c b/libraries/liblutil/passwd.c index cae60fbd1c..739c833bc6 100644 --- a/libraries/liblutil/passwd.c +++ b/libraries/liblutil/passwd.c @@ -373,6 +373,8 @@ struct berval * lutil_passwd_hash( return (sc->hash_fn)( sc, passwd ); } +/* pw_string is only called when SLAPD_LMHASH or SLAPD_CRYPT is defined */ +#if defined(SLAPD_LMHASH) || defined(SLAPD_CRYPT) static struct berval * pw_string( const struct pw_scheme *sc, const struct berval *passwd ) @@ -394,6 +396,7 @@ static struct berval * pw_string( pw->bv_val[pw->bv_len] = '\0'; return pw; } +#endif /* SLAPD_LMHASH || SLAPD_CRYPT */ static struct berval * pw_string64( const struct pw_scheme *sc, diff --git a/libraries/liblutil/uuid.c b/libraries/liblutil/uuid.c index 0bb664a0dc..afebf2cca9 100644 --- a/libraries/liblutil/uuid.c +++ b/libraries/liblutil/uuid.c @@ -42,7 +42,8 @@ #include -#ifndef HAVE_SYS_UUID_H +/* not needed for Windows */ +#if !defined(HAVE_SYS_UUID_H) && !defined(_WIN32) static unsigned char * lutil_eaddr( void ) { -- 2.39.5