From 0573dbda0afe67a81c27cd0adbccc14d90759b7d Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sun, 2 Dec 2018 22:40:32 +0900 Subject: Adapted to new KPasswordEdit::password() signature. This relates to bug 2961. Signed-off-by: Michele Calgaro --- src/ldapcontroller.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/ldapcontroller.cpp') diff --git a/src/ldapcontroller.cpp b/src/ldapcontroller.cpp index dfc4286..8572b2f 100644 --- a/src/ldapcontroller.cpp +++ b/src/ldapcontroller.cpp @@ -782,11 +782,12 @@ void LDAPController::btnChangeLDAPRootPassword() { bool ret = false; - TQCString rootPassword; + TQString rootPassword; int result = KPasswordDialog::getNewPassword(rootPassword, i18n("Please enter the new LDAP root password:")); if (result == KPasswordDialog::Accepted) { 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 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() { - TQCString adminPassword; + TQString adminPassword; int result = KPasswordDialog::getNewPassword(adminPassword, i18n("Please enter the new realm administrator password:")); if (result == KPasswordDialog::Accepted) { TQString realmname = m_defaultRealm.upper(); @@ -853,7 +854,7 @@ void LDAPController::btnChangeRealmAdminPassword() { ldap_mgr->setPasswordForUser(adminuserinfo, &errorstring); m_systemconfig->setGroup("Replication"); - m_systemconfig->writeEntry("Password", adminPassword.data()); + m_systemconfig->writeEntry("Password", adminPassword); m_systemconfig->setGroup(NULL); m_systemconfig->sync(); } @@ -1609,7 +1610,7 @@ int LDAPController::setKerberosPasswordForUser(LDAPCredentials user, TQString *e } else if ((prompt.endsWith(" Password:")) && (prompt.startsWith(TQString(user.username + "@")))) { kadminProc.enableLocalEcho(false); - kadminProc.writeLine(user.password, true); + kadminProc.writeLine(user.password.utf8(), true); do { // Discard our own input prompt = LDAPManager::readFullLineFromPtyProcess(&kadminProc); printf("(kadmin) '%s'\n\r", prompt.ascii()); @@ -1617,7 +1618,7 @@ int LDAPController::setKerberosPasswordForUser(LDAPCredentials user, TQString *e prompt = prompt.stripWhiteSpace(); if ((prompt.endsWith(" Password:")) && (prompt.startsWith("Verify"))) { kadminProc.enableLocalEcho(false); - kadminProc.writeLine(user.password, true); + kadminProc.writeLine(user.password.utf8(), true); do { // Discard our own input prompt = LDAPManager::readFullLineFromPtyProcess(&kadminProc); printf("(kadmin) '%s'\n\r", prompt.ascii()); -- cgit v1.2.3