# 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@
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 */
{
ret = krb5_init_context( &context );
if (ret) {
- return 1;
+ return LUTIL_PASSWD_ERR;
}
#ifdef notdef
if (ret) {
krb5_free_context( context );
- return 1;
+ return LUTIL_PASSWD_ERR;
}
ret = krb5_get_init_creds_password( context,
if (ret) {
krb5_free_principal( context, client );
krb5_free_context( context );
- return 1;
+ return LUTIL_PASSWD_ERR;
}
{
if( host == NULL ) {
krb5_free_principal( context, client );
krb5_free_context( context );
- return 1;
+ return LUTIL_PASSWD_ERR;
}
ret = krb5_sname_to_principal( context,
if (ret) {
krb5_free_principal( context, client );
krb5_free_context( context );
- return 1;
+ return LUTIL_PASSWD_ERR;
}
ret = krb5_verify_init_creds( context,
krb5_free_cred_contents( context, &creds );
krb5_free_context( context );
- rtn = !!ret;
+ rtn = ret ? LUTIL_PASSWD_ERR : LUTIL_PASSWD_OK;
}
#elif defined(HAVE_KRB4)
{
status = krb_get_lrealm(lrealm,1);
if (status == KFAILURE) {
- return 1;
+ return LUTIL_PASSWD_ERR;
}
snprintf(tkt, sizeof(tkt), "%s_slapd.%u",
dest_tkt(); /* no point in keeping the tickets */
- return status == KFAILURE;
+ return status == KFAILURE ? LUTIL_PASSWD_ERR : LUTIL_PASSWD_OK;
}
#endif
int i;
if( passwd->bv_len != NS_MTA_MD5_PASSLEN ) {
- return 1;
+ return LUTIL_PASSWD_ERR;
}
/* hash credentials with salt */
/* 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[]) {
.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)
/* $OpenLDAP$ */
-/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2004 The OpenLDAP Foundation.
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 */
main( int argc, char **argv )
{
char *s;
+ int tag;
int fd, rc;
BerElement *ber;
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 );
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,
}
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;