@ -782,11 +782,12 @@ void LDAPController::btnChangeLDAPRootPassword() {
bool ret = false ;
bool ret = false ;
TQ C String rootPassword ;
TQ String rootPassword ;
int result = KPasswordDialog : : getNewPassword ( rootPassword , i18n ( " Please enter the new LDAP root password: " ) ) ;
int result = KPasswordDialog : : getNewPassword ( rootPassword , i18n ( " Please enter the new LDAP root password: " ) ) ;
if ( result = = KPasswordDialog : : Accepted ) {
if ( result = = KPasswordDialog : : Accepted ) {
SHA1 sha ;
SHA1 sha ;
sha . process ( rootPassword , strlen ( rootPassword ) ) ;
TQCString rootPassword2 = rootPassword . utf8 ( ) ; // utf8 length could be different from TQString length
sha . process ( rootPassword2 , rootPassword2 . length ( ) ) ;
TQString rootpw_hash = sha . base64Hash ( ) ;
TQString rootpw_hash = sha . base64Hash ( ) ;
TQString oldconfigfilename = " /etc/ldap/slapd.d/cn=config/ " + TQString ( " olcDatabase={%1}hdb.ldif.bkp " ) . arg ( 1 ) ;
TQString oldconfigfilename = " /etc/ldap/slapd.d/cn=config/ " + TQString ( " olcDatabase={%1}hdb.ldif.bkp " ) . arg ( 1 ) ;
@ -835,7 +836,7 @@ void LDAPController::btnChangeLDAPRootPassword() {
}
}
void LDAPController : : btnChangeRealmAdminPassword ( ) {
void LDAPController : : btnChangeRealmAdminPassword ( ) {
TQ C String adminPassword ;
TQ String adminPassword ;
int result = KPasswordDialog : : getNewPassword ( adminPassword , i18n ( " Please enter the new realm administrator password: " ) ) ;
int result = KPasswordDialog : : getNewPassword ( adminPassword , i18n ( " Please enter the new realm administrator password: " ) ) ;
if ( result = = KPasswordDialog : : Accepted ) {
if ( result = = KPasswordDialog : : Accepted ) {
TQString realmname = m_defaultRealm . upper ( ) ;
TQString realmname = m_defaultRealm . upper ( ) ;
@ -853,7 +854,7 @@ void LDAPController::btnChangeRealmAdminPassword() {
ldap_mgr - > setPasswordForUser ( adminuserinfo , & errorstring ) ;
ldap_mgr - > setPasswordForUser ( adminuserinfo , & errorstring ) ;
m_systemconfig - > setGroup ( " Replication " ) ;
m_systemconfig - > setGroup ( " Replication " ) ;
m_systemconfig - > writeEntry ( " Password " , adminPassword .data ( ) );
m_systemconfig - > writeEntry ( " Password " , adminPassword );
m_systemconfig - > setGroup ( NULL ) ;
m_systemconfig - > setGroup ( NULL ) ;
m_systemconfig - > sync ( ) ;
m_systemconfig - > sync ( ) ;
}
}
@ -1609,7 +1610,7 @@ int LDAPController::setKerberosPasswordForUser(LDAPCredentials user, TQString *e
}
}
else if ( ( prompt . endsWith ( " Password: " ) ) & & ( prompt . startsWith ( TQString ( user . username + " @ " ) ) ) ) {
else if ( ( prompt . endsWith ( " Password: " ) ) & & ( prompt . startsWith ( TQString ( user . username + " @ " ) ) ) ) {
kadminProc . enableLocalEcho ( false ) ;
kadminProc . enableLocalEcho ( false ) ;
kadminProc . writeLine ( user . password , true ) ;
kadminProc . writeLine ( user . password .utf8 ( ) , true ) ;
do { // Discard our own input
do { // Discard our own input
prompt = LDAPManager : : readFullLineFromPtyProcess ( & kadminProc ) ;
prompt = LDAPManager : : readFullLineFromPtyProcess ( & kadminProc ) ;
printf ( " (kadmin) '%s' \n \r " , prompt . ascii ( ) ) ;
printf ( " (kadmin) '%s' \n \r " , prompt . ascii ( ) ) ;
@ -1617,7 +1618,7 @@ int LDAPController::setKerberosPasswordForUser(LDAPCredentials user, TQString *e
prompt = prompt . stripWhiteSpace ( ) ;
prompt = prompt . stripWhiteSpace ( ) ;
if ( ( prompt . endsWith ( " Password: " ) ) & & ( prompt . startsWith ( " Verify " ) ) ) {
if ( ( prompt . endsWith ( " Password: " ) ) & & ( prompt . startsWith ( " Verify " ) ) ) {
kadminProc . enableLocalEcho ( false ) ;
kadminProc . enableLocalEcho ( false ) ;
kadminProc . writeLine ( user . password , true ) ;
kadminProc . writeLine ( user . password .utf8 ( ) , true ) ;
do { // Discard our own input
do { // Discard our own input
prompt = LDAPManager : : readFullLineFromPtyProcess ( & kadminProc ) ;
prompt = LDAPManager : : readFullLineFromPtyProcess ( & kadminProc ) ;
printf ( " (kadmin) '%s' \n \r " , prompt . ascii ( ) ) ;
printf ( " (kadmin) '%s' \n \r " , prompt . ascii ( ) ) ;