return EXIT_FAILURE;
}
+ ber_printf( ber, "{" /*}*/ );
+
if( dn != NULL ) {
ber_printf( ber, "ts",
LDAP_TAG_EXOP_X_MODIFY_PASSWD_ID, dn );
free(newpw);
}
+ ber_printf( ber, /*{*/ "}" );
+
rc = ber_flatten( ber, &bv );
if( rc < 0 ) {
}
/* we should check the tag */
- tag = ber_scanf( ber, "a", &s);
+ tag = ber_scanf( ber, "{a}", &s);
if( tag == LBER_ERROR ) {
perror( "ber_scanf" );
#define LDAP_TAG_EXOP_X_MODIFY_PASSWD_ID ((ber_tag_t) 0x80U)
#define LDAP_TAG_EXOP_X_MODIFY_PASSWD_OLD ((ber_tag_t) 0x81U)
#define LDAP_TAG_EXOP_X_MODIFY_PASSWD_NEW ((ber_tag_t) 0x82U)
+#define LDAP_TAG_EXOP_X_MODIFY_PASSWD_GEN ((ber_tag_t) 0x80U)
/*
* specific LDAP instantiations of BER types we know about
return LDAP_PROTOCOL_ERROR;
}
- tag = ber_peek_tag( ber, &len );
+ tag = ber_scanf( ber, "{" /*}*/ );
+
+ if( tag != LBER_ERROR ) {
+ tag = ber_peek_tag( ber, &len );
+ }
if( tag == LDAP_TAG_EXOP_X_MODIFY_PASSWD_ID ) {
if( id == NULL ) {
if( ber == NULL ) return NULL;
- rc = ber_printf( ber, "tO",
- LDAP_TAG_EXOP_X_MODIFY_PASSWD_NEW, cred );
+ rc = ber_printf( ber, "{tO}",
+ LDAP_TAG_EXOP_X_MODIFY_PASSWD_GEN, cred );
if( rc == -1 ) {
ber_free( ber, 1 );
struct berval * slap_passwd_generate( void )
{
Debug( LDAP_DEBUG_TRACE, "slap_passwd_generate\n", 0, 0, 0 );
+
+ /*
+ * generate passwords of only 8 characters as some getpass(3)
+ * implementations truncate at 8 characters.
+ */
return lutil_passwd_generate( 8 );
}