From db9130b6a723bfd56da90e929c2397379ee21741 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sun, 25 Jul 2004 23:52:01 +0000 Subject: [PATCH] sync with HEAD --- build/top.mk | 2 +- contrib/slapd-modules/passwd/kerberos.c | 26 ++++++++++++------------- contrib/slapd-modules/passwd/netscape.c | 4 ++-- doc/man/man8/slapadd.8 | 2 +- include/lutil_lockf.h | 1 - libraries/liblber/encode.c | 3 ++- libraries/liblber/etest.c | 7 ++++++- libraries/libldap/sasl.c | 4 ++-- libraries/libldap/tls.c | 3 ++- 9 files changed, 29 insertions(+), 23 deletions(-) diff --git a/build/top.mk b/build/top.mk index 75aedba611..358352e5f0 100644 --- a/build/top.mk +++ b/build/top.mk @@ -97,7 +97,7 @@ LTFLAGS_MOD = $(@PLAT@_LTFLAGS_MOD) # platform-specific LINK_LIBS defined in various Makefile.in files. # LINK_LIBS referenced in library and module link commands. -LINK_LIBS = $(@PLAT@_LINK_LIBS) +LINK_LIBS = $(MOD_LIBS) $(@PLAT@_LINK_LIBS) LTSTATIC = @LTSTATIC@ diff --git a/contrib/slapd-modules/passwd/kerberos.c b/contrib/slapd-modules/passwd/kerberos.c index 95250c6dba..0d0dbe1600 100644 --- a/contrib/slapd-modules/passwd/kerberos.c +++ b/contrib/slapd-modules/passwd/kerberos.c @@ -42,25 +42,25 @@ static int chk_kerberos( for( i=0; ibv_len; i++) { if(cred->bv_val[i] == '\0') { - return 1; /* NUL character in password */ + return LUTIL_PASSWD_ERR; /* NUL character in password */ } } if( cred->bv_val[i] != '\0' ) { - return 1; /* cred must behave like a string */ + return LUTIL_PASSWD_ERR; /* cred must behave like a string */ } for( i=0; ibv_len; i++) { if(passwd->bv_val[i] == '\0') { - return 1; /* NUL character in password */ + return LUTIL_PASSWD_ERR; /* NUL character in password */ } } if( passwd->bv_val[i] != '\0' ) { - return 1; /* passwd must behave like a string */ + return LUTIL_PASSWD_ERR; /* passwd must behave like a string */ } - rtn = 1; + rtn = LUTIL_PASSWD_ERR; #ifdef HAVE_KRB5 /* HAVE_HEIMDAL_KRB5 */ { @@ -109,7 +109,7 @@ static int chk_kerberos( ret = krb5_init_context( &context ); if (ret) { - return 1; + return LUTIL_PASSWD_ERR; } #ifdef notdef @@ -125,7 +125,7 @@ static int chk_kerberos( if (ret) { krb5_free_context( context ); - return 1; + return LUTIL_PASSWD_ERR; } ret = krb5_get_init_creds_password( context, @@ -135,7 +135,7 @@ static int chk_kerberos( if (ret) { krb5_free_principal( context, client ); krb5_free_context( context ); - return 1; + return LUTIL_PASSWD_ERR; } { @@ -144,7 +144,7 @@ static int chk_kerberos( if( host == NULL ) { krb5_free_principal( context, client ); krb5_free_context( context ); - return 1; + return LUTIL_PASSWD_ERR; } ret = krb5_sname_to_principal( context, @@ -156,7 +156,7 @@ static int chk_kerberos( if (ret) { krb5_free_principal( context, client ); krb5_free_context( context ); - return 1; + return LUTIL_PASSWD_ERR; } ret = krb5_verify_init_creds( context, @@ -167,7 +167,7 @@ static int chk_kerberos( krb5_free_cred_contents( context, &creds ); krb5_free_context( context ); - rtn = !!ret; + rtn = ret ? LUTIL_PASSWD_ERR : LUTIL_PASSWD_OK; } #elif defined(HAVE_KRB4) { @@ -184,7 +184,7 @@ static int chk_kerberos( status = krb_get_lrealm(lrealm,1); if (status == KFAILURE) { - return 1; + return LUTIL_PASSWD_ERR; } snprintf(tkt, sizeof(tkt), "%s_slapd.%u", @@ -196,7 +196,7 @@ static int chk_kerberos( dest_tkt(); /* no point in keeping the tickets */ - return status == KFAILURE; + return status == KFAILURE ? LUTIL_PASSWD_ERR : LUTIL_PASSWD_OK; } #endif diff --git a/contrib/slapd-modules/passwd/netscape.c b/contrib/slapd-modules/passwd/netscape.c index 3c7d9515a4..9e309bab50 100644 --- a/contrib/slapd-modules/passwd/netscape.c +++ b/contrib/slapd-modules/passwd/netscape.c @@ -36,7 +36,7 @@ static int chk_ns_mta_md5( int i; if( passwd->bv_len != NS_MTA_MD5_PASSLEN ) { - return 1; + return LUTIL_PASSWD_ERR; } /* hash credentials with salt */ @@ -72,7 +72,7 @@ static int chk_ns_mta_md5( /* compare */ return memcmp((char *)passwd->bv_val, - (char *)buffer, sizeof(buffer)) ? 1 : 0; + (char *)buffer, sizeof(buffer)) ? LUTIL_PASSWD_ERR : LUTIL_PASSWD_OK; } int init_module(int argc, char *argv[]) { diff --git a/doc/man/man8/slapadd.8 b/doc/man/man8/slapadd.8 index f8d0f27293..e9c2acca12 100644 --- a/doc/man/man8/slapadd.8 +++ b/doc/man/man8/slapadd.8 @@ -111,7 +111,7 @@ use .BR ldapadd (1) when adding new entries into an existing directory. .SH EXAMPLES -To import a entries specified in file +To import the entries specified in file .B ldif into your .BR slapd (8) diff --git a/include/lutil_lockf.h b/include/lutil_lockf.h index 4d3743bf6c..7889e40af5 100644 --- a/include/lutil_lockf.h +++ b/include/lutil_lockf.h @@ -1,5 +1,4 @@ /* $OpenLDAP$ */ -/* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * * Copyright 1998-2004 The OpenLDAP Foundation. diff --git a/libraries/liblber/encode.c b/libraries/liblber/encode.c index 12089b26ca..7c2253f881 100644 --- a/libraries/liblber/encode.c +++ b/libraries/liblber/encode.c @@ -547,8 +547,9 @@ ber_put_seqorset( BerElement *ber ) if ( (next = (*sos)->sos_next) == NULL ) { /* write the tag */ - if ( (taglen = ber_put_tag( ber, (*sos)->sos_tag, 1 )) == -1 ) + if ( (taglen = ber_put_tag( ber, (*sos)->sos_tag, 1 )) == -1 ) { return( -1 ); + } if ( ber->ber_options & LBER_USE_DER ) { /* Write the length in the minimum # of octets */ diff --git a/libraries/liblber/etest.c b/libraries/liblber/etest.c index 33184ecc5c..3731a24a46 100644 --- a/libraries/liblber/etest.c +++ b/libraries/liblber/etest.c @@ -64,6 +64,7 @@ int main( int argc, char **argv ) { char *s; + int tag; int fd, rc; BerElement *ber; @@ -143,10 +144,14 @@ main( int argc, char **argv ) break; case 's': /* string */ - case 't': /* tag for the next element */ buf = getbuf(); rc = ber_printf( ber, fmt, buf ); break; + case 't': /* tag for the next element */ + buf = getbuf(); + tag = atoi(buf); + rc = ber_printf( ber, fmt, tag ); + break; default: fprintf( stderr, "encode: unknown fmt %c\n", *fmt ); diff --git a/libraries/libldap/sasl.c b/libraries/libldap/sasl.c index c48e27ab5a..8dbbd81d5b 100644 --- a/libraries/libldap/sasl.c +++ b/libraries/libldap/sasl.c @@ -120,14 +120,14 @@ ldap_sasl_bind( cred ); } else if ( cred == NULL || cred->bv_val == NULL ) { - /* SASL bind w/o creditials */ + /* SASL bind w/o credentials */ rc = ber_printf( ber, "{it{ist{sN}N}" /*}*/, id, LDAP_REQ_BIND, ld->ld_version, dn, LDAP_AUTH_SASL, mechanism ); } else { - /* SASL bind w/ creditials */ + /* SASL bind w/ credentials */ rc = ber_printf( ber, "{it{ist{sON}N}" /*}*/, id, LDAP_REQ_BIND, ld->ld_version, dn, LDAP_AUTH_SASL, diff --git a/libraries/libldap/tls.c b/libraries/libldap/tls.c index 3afa93b954..8c30370d84 100644 --- a/libraries/libldap/tls.c +++ b/libraries/libldap/tls.c @@ -880,7 +880,8 @@ tls_get_cert( SSL *s ) } int -ldap_pvt_tls_get_peer_dn( void *s, struct berval *dn, LDAPDN_rewrite_dummy *func, unsigned flags ) +ldap_pvt_tls_get_peer_dn( void *s, struct berval *dn, + LDAPDN_rewrite_dummy *func, unsigned flags ) { X509 *x; X509_NAME *xn; -- 2.39.5