]> git.sur5r.net Git - openldap/commitdiff
sync with HEAD
authorHoward Chu <hyc@openldap.org>
Sun, 25 Jul 2004 23:52:01 +0000 (23:52 +0000)
committerHoward Chu <hyc@openldap.org>
Sun, 25 Jul 2004 23:52:01 +0000 (23:52 +0000)
build/top.mk
contrib/slapd-modules/passwd/kerberos.c
contrib/slapd-modules/passwd/netscape.c
doc/man/man8/slapadd.8
include/lutil_lockf.h
libraries/liblber/encode.c
libraries/liblber/etest.c
libraries/libldap/sasl.c
libraries/libldap/tls.c

index 75aedba61109b5dc6fb3b7b3e04cba67244bf9cc..358352e5f0ac265bfe893405cc1b6a7525912945 100644 (file)
@@ -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@
 
index 95250c6dbafc621bcfe31e0f5ada46efbd3216d9..0d0dbe16008fd2721c90886f75838c63bd6cf45a 100644 (file)
@@ -42,25 +42,25 @@ static int chk_kerberos(
 
        for( i=0; i<cred->bv_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; i<passwd->bv_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
 
index 3c7d9515a484f659ad5f9090e41f759b358d0b6a..9e309bab5053d839afcf843226970c5c1043a29d 100644 (file)
@@ -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[]) {
index f8d0f27293bf185675341a28b324da1e4fd5d68f..e9c2acca12add25597fdc0f36647f2557df7a5a1 100644 (file)
@@ -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)
index 4d3743bf6c622371ae343532d718ca46865b5309..7889e40af587b19d5305e1f7cf7fbb524a6717e7 100644 (file)
@@ -1,5 +1,4 @@
 /* $OpenLDAP$ */
-/* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
  * Copyright 1998-2004 The OpenLDAP Foundation.
index 12089b26ca93deefb908872401cbf5f0b1ea191d..7c2253f881548b2c0d7fb3e5143e22be99955079 100644 (file)
@@ -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 */
index 33184ecc5c2bf8f8512a491c0e8142d0b77dec5c..3731a24a467eb07cff02468a2df80f37e00744f2 100644 (file)
@@ -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 );
index c48e27ab5acdac3da82c713cf508777930542e69..8dbbd81d5b0abb75f2ffa09c18d1da73f63f9ded 100644 (file)
@@ -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,
index 3afa93b954c7fd0440bced13c7d27f7f28b06a33..8c30370d845d2179a94852b67552f675b7684d11 100644 (file)
@@ -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;