summaryrefslogtreecommitdiffstats
path: root/src/ldapcontroller.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2018-12-02 22:40:32 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2018-12-02 22:40:32 +0900
commit0573dbda0afe67a81c27cd0adbccc14d90759b7d (patch)
tree01a6bebc9200153fa860b990d2ea788a46f71997 /src/ldapcontroller.cpp
parent7a5ac493f1c47740eba8bac1f4c026471bd1b845 (diff)
downloadkcmldapcontroller-0573dbda0afe67a81c27cd0adbccc14d90759b7d.tar.gz
kcmldapcontroller-0573dbda0afe67a81c27cd0adbccc14d90759b7d.zip
Adapted to new KPasswordEdit::password() signature. This relates to bug 2961.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'src/ldapcontroller.cpp')
-rw-r--r--src/ldapcontroller.cpp13
1 files changed, 7 insertions, 6 deletions
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());