tag = ber_scanf( ber, "{" /*}*/ );
if( tag == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "slap_passwd_parse: decoding error\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"slap_passwd_parse: decoding error\n", 0, 0, 0 );
-#endif
rc = LDAP_PROTOCOL_ERROR;
goto done;
}
tag = ber_peek_tag( ber, &len );
if( tag == LDAP_TAG_EXOP_MODIFY_PASSWD_ID ) {
if( id == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "slap_passwd_parse: ID not allowed.\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "slap_passwd_parse: ID not allowed.\n",
0, 0, 0 );
-#endif
*text = "user must change own password";
rc = LDAP_UNWILLING_TO_PERFORM;
tag = ber_scanf( ber, "m", id );
if( tag == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "slap_passwd_parse: ID parse failed.\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "slap_passwd_parse: ID parse failed.\n",
0, 0, 0 );
-#endif
goto decoding_error;
}
if( tag == LDAP_TAG_EXOP_MODIFY_PASSWD_OLD ) {
if( oldpass == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "slap_passwd_parse: OLD not allowed.\n" , 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "slap_passwd_parse: OLD not allowed.\n",
0, 0, 0 );
-#endif
*text = "use bind to verify old password";
rc = LDAP_UNWILLING_TO_PERFORM;
tag = ber_scanf( ber, "m", oldpass );
if( tag == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "slap_passwd_parse: ID parse failed.\n" , 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "slap_passwd_parse: ID parse failed.\n",
0, 0, 0 );
-#endif
goto decoding_error;
}
if( tag == LDAP_TAG_EXOP_MODIFY_PASSWD_NEW ) {
if( newpass == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "slap_passwd_parse: NEW not allowed.\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "slap_passwd_parse: NEW not allowed.\n",
0, 0, 0 );
-#endif
*text = "user specified passwords disallowed";
rc = LDAP_UNWILLING_TO_PERFORM;
tag = ber_scanf( ber, "m", newpass );
if( tag == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "slap_passwd_parse: OLD parse failed.\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "slap_passwd_parse: OLD parse failed.\n",
0, 0, 0 );
-#endif
goto decoding_error;
}
if( len != 0 ) {
decoding_error:
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "slap_passwd_parse: decoding error, len=%ld\n", (long)len, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"slap_passwd_parse: decoding error, len=%ld\n",
(long) len, 0, 0 );
-#endif
*text = "data decoding error";
rc = LDAP_PROTOCOL_ERROR;
assert( cred != NULL );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY,
- "slap_passwd_return: %ld\n",(long)cred->bv_len, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "slap_passwd_return: %ld\n",
(long) cred->bv_len, 0, 0 );
-#endif
ber_init_w_nullc( ber, LBER_USE_DER );
void
slap_passwd_generate( struct berval *pass )
{
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY, "slap_passwd_generate: begin\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "slap_passwd_generate\n", 0, 0, 0 );
-#endif
pass->bv_val = NULL;
pass->bv_len = 0;