|
|
@ -35,7 +35,7 @@
|
|
|
|
#include <tdemessagebox.h>
|
|
|
|
#include <tdemessagebox.h>
|
|
|
|
#include <klineedit.h>
|
|
|
|
#include <klineedit.h>
|
|
|
|
#include <kpassdlg.h>
|
|
|
|
#include <kpassdlg.h>
|
|
|
|
#include <tdesimpleconfig.h>
|
|
|
|
#include <ksimpleconfig.h>
|
|
|
|
#include <tdesu/process.h>
|
|
|
|
#include <tdesu/process.h>
|
|
|
|
#include <ksslcertificate.h>
|
|
|
|
#include <ksslcertificate.h>
|
|
|
|
#include <krfcdate.h>
|
|
|
|
#include <krfcdate.h>
|
|
|
@ -1081,7 +1081,7 @@ int LDAPManager::updateUserInfo(LDAPUserInfo user, TQString *errstr) {
|
|
|
|
KSSLCertificate* cert = KSSLCertificate::fromString(ssldata);
|
|
|
|
KSSLCertificate* cert = KSSLCertificate::fromString(ssldata);
|
|
|
|
if (cert) {
|
|
|
|
if (cert) {
|
|
|
|
bool expired = false;
|
|
|
|
bool expired = false;
|
|
|
|
if (TQDateTime::currentDateTime(TQt::UTC) > cert->getQDTNotAfter()) {
|
|
|
|
if (TQDateTime::currentDateTime(Qt::UTC) > cert->getQDTNotAfter()) {
|
|
|
|
expired = true;
|
|
|
|
expired = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1592,7 +1592,7 @@ KerberosTicketInfoList LDAPManager::getKerberosTicketList(TQString cache, TQStri
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (line.startsWith(KLIST_FLAGS_STRING)) {
|
|
|
|
else if (line.startsWith(KLIST_FLAGS_STRING)) {
|
|
|
|
line.remove(0, strlen(KLIST_FLAGS_STRING));
|
|
|
|
line.remove(0, strlen(KLIST_FLAGS_STRING));
|
|
|
|
TQStringList flags = TQStringList::split(",", line, false);
|
|
|
|
TQStringList flags = TQStringList::split(",", line, FALSE);
|
|
|
|
for (TQStringList::Iterator it = flags.begin(); it != flags.end(); ++it) {
|
|
|
|
for (TQStringList::Iterator it = flags.begin(); it != flags.end(); ++it) {
|
|
|
|
if ((*it) == KLIST_KRB5_TICKET_RESERVED) {
|
|
|
|
if ((*it) == KLIST_KRB5_TICKET_RESERVED) {
|
|
|
|
ticket.flags = ticket.flags | KRB5_TICKET_RESERVED;
|
|
|
|
ticket.flags = ticket.flags | KRB5_TICKET_RESERVED;
|
|
|
@ -1663,7 +1663,7 @@ KerberosTicketInfoList LDAPManager::getKerberosTicketList(TQString cache, TQStri
|
|
|
|
|
|
|
|
|
|
|
|
LDAPRealmConfigList LDAPManager::fetchAndReadTDERealmList(TQString *defaultRealm)
|
|
|
|
LDAPRealmConfigList LDAPManager::fetchAndReadTDERealmList(TQString *defaultRealm)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TDESimpleConfig* systemconfig = new TDESimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" ));
|
|
|
|
KSimpleConfig* systemconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" ));
|
|
|
|
systemconfig->setGroup(NULL);
|
|
|
|
systemconfig->setGroup(NULL);
|
|
|
|
if (defaultRealm != NULL) {
|
|
|
|
if (defaultRealm != NULL) {
|
|
|
|
*defaultRealm = systemconfig->readEntry("DefaultRealm", TQString::null);
|
|
|
|
*defaultRealm = systemconfig->readEntry("DefaultRealm", TQString::null);
|
|
|
@ -1728,7 +1728,7 @@ int LDAPManager::obtainKerberosTicket(LDAPCredentials creds, TQString principal,
|
|
|
|
QCStringList args;
|
|
|
|
QCStringList args;
|
|
|
|
if (creds.use_smartcard) {
|
|
|
|
if (creds.use_smartcard) {
|
|
|
|
// Get PKCS#11 slot number from the LDAP configuration file
|
|
|
|
// Get PKCS#11 slot number from the LDAP configuration file
|
|
|
|
TDESimpleConfig* systemconfig = new TDESimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" ));
|
|
|
|
KSimpleConfig* systemconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" ));
|
|
|
|
systemconfig->setGroup(NULL);
|
|
|
|
systemconfig->setGroup(NULL);
|
|
|
|
int pkcs11_login_card_slot = systemconfig->readNumEntry("PKCS11LoginCardSlot", 0);
|
|
|
|
int pkcs11_login_card_slot = systemconfig->readNumEntry("PKCS11LoginCardSlot", 0);
|
|
|
|
delete systemconfig;
|
|
|
|
delete systemconfig;
|
|
|
@ -3296,7 +3296,7 @@ int LDAPManager::moveKerberosEntries(TQString newSuffix, TQString* errstr) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int LDAPManager::writeLDAPConfFile(LDAPRealmConfig realmcfg, LDAPMachineRole machineRole, TQString *errstr) {
|
|
|
|
int LDAPManager::writeLDAPConfFile(LDAPRealmConfig realmcfg, LDAPMachineRole machineRole, TQString *errstr) {
|
|
|
|
TDESimpleConfig* systemconfig;
|
|
|
|
KSimpleConfig* systemconfig;
|
|
|
|
TQString m_defaultRealm;
|
|
|
|
TQString m_defaultRealm;
|
|
|
|
int m_ldapVersion;
|
|
|
|
int m_ldapVersion;
|
|
|
|
int m_ldapTimeout;
|
|
|
|
int m_ldapTimeout;
|
|
|
@ -3306,7 +3306,7 @@ int LDAPManager::writeLDAPConfFile(LDAPRealmConfig realmcfg, LDAPMachineRole mac
|
|
|
|
TQString m_ignoredUsers;
|
|
|
|
TQString m_ignoredUsers;
|
|
|
|
TQCString command;
|
|
|
|
TQCString command;
|
|
|
|
|
|
|
|
|
|
|
|
systemconfig = new TDESimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" ));
|
|
|
|
systemconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" ));
|
|
|
|
systemconfig->setGroup(NULL);
|
|
|
|
systemconfig->setGroup(NULL);
|
|
|
|
m_defaultRealm = systemconfig->readEntry("DefaultRealm", TQString::null);
|
|
|
|
m_defaultRealm = systemconfig->readEntry("DefaultRealm", TQString::null);
|
|
|
|
|
|
|
|
|
|
|
@ -3491,7 +3491,7 @@ LDAPMasterReplicationInfo LDAPManager::parseLDAPMasterReplicationRecord(LDAPMast
|
|
|
|
if (ldap_field == "olcServerID") {
|
|
|
|
if (ldap_field == "olcServerID") {
|
|
|
|
i=0;
|
|
|
|
i=0;
|
|
|
|
while (vals[i] != NULL) {
|
|
|
|
while (vals[i] != NULL) {
|
|
|
|
TQStringList serverIDMapping = TQStringList::split(" ", TQString(vals[i]->bv_val), false);
|
|
|
|
TQStringList serverIDMapping = TQStringList::split(" ", TQString(vals[i]->bv_val), FALSE);
|
|
|
|
LDAPMasterReplicationMapping mapping;
|
|
|
|
LDAPMasterReplicationMapping mapping;
|
|
|
|
mapping.id = serverIDMapping[0].toInt();
|
|
|
|
mapping.id = serverIDMapping[0].toInt();
|
|
|
|
mapping.fqdn = serverIDMapping[1];
|
|
|
|
mapping.fqdn = serverIDMapping[1];
|
|
|
@ -4301,7 +4301,7 @@ int LDAPManager::installCACertificateInHostCAStore(TQString *errstr) {
|
|
|
|
int LDAPManager::retrieveAndInstallCaCrl(LDAPManager* manager, TQString *errstr) {
|
|
|
|
int LDAPManager::retrieveAndInstallCaCrl(LDAPManager* manager, TQString *errstr) {
|
|
|
|
int retcode = 0;
|
|
|
|
int retcode = 0;
|
|
|
|
LDAPManager* ldap_mgr = manager;
|
|
|
|
LDAPManager* ldap_mgr = manager;
|
|
|
|
TDESimpleConfig* systemconfig = new TDESimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" ));
|
|
|
|
KSimpleConfig* systemconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" ));
|
|
|
|
LDAPRealmConfigList realms = LDAPManager::readTDERealmList(systemconfig, false);
|
|
|
|
LDAPRealmConfigList realms = LDAPManager::readTDERealmList(systemconfig, false);
|
|
|
|
|
|
|
|
|
|
|
|
if (!ldap_mgr) {
|
|
|
|
if (!ldap_mgr) {
|
|
|
@ -4336,7 +4336,7 @@ int LDAPManager::retrieveAndInstallCaCrl(LDAPManager* manager, TQString *errstr)
|
|
|
|
return retcode;
|
|
|
|
return retcode;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
LDAPRealmConfigList LDAPManager::readTDERealmList(TDESimpleConfig* config, bool disableAllBonds) {
|
|
|
|
LDAPRealmConfigList LDAPManager::readTDERealmList(KSimpleConfig* config, bool disableAllBonds) {
|
|
|
|
LDAPRealmConfigList realms;
|
|
|
|
LDAPRealmConfigList realms;
|
|
|
|
|
|
|
|
|
|
|
|
TQStringList cfgRealms = config->groupList();
|
|
|
|
TQStringList cfgRealms = config->groupList();
|
|
|
@ -4375,7 +4375,7 @@ LDAPRealmConfigList LDAPManager::readTDERealmList(TDESimpleConfig* config, bool
|
|
|
|
return realms;
|
|
|
|
return realms;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int LDAPManager::writeTDERealmList(LDAPRealmConfigList realms, TDESimpleConfig* config, TQString *errstr) {
|
|
|
|
int LDAPManager::writeTDERealmList(LDAPRealmConfigList realms, KSimpleConfig* config, TQString *errstr) {
|
|
|
|
Q_UNUSED(errstr)
|
|
|
|
Q_UNUSED(errstr)
|
|
|
|
|
|
|
|
|
|
|
|
LDAPRealmConfigList::Iterator it;
|
|
|
|
LDAPRealmConfigList::Iterator it;
|
|
|
@ -4766,7 +4766,7 @@ int LDAPManager::generatePKICRL(int expirydays, LDAPRealmConfig realmcfg, TQStri
|
|
|
|
KSSLCertificate* cert = KSSLCertificate::fromString(ssldata);
|
|
|
|
KSSLCertificate* cert = KSSLCertificate::fromString(ssldata);
|
|
|
|
if (cert) {
|
|
|
|
if (cert) {
|
|
|
|
bool expired = false;
|
|
|
|
bool expired = false;
|
|
|
|
if (TQDateTime::currentDateTime(TQt::UTC) > cert->getQDTNotAfter()) {
|
|
|
|
if (TQDateTime::currentDateTime(Qt::UTC) > cert->getQDTNotAfter()) {
|
|
|
|
expired = true;
|
|
|
|
expired = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -4860,7 +4860,7 @@ TQString LDAPManager::getMachineFQDN() {
|
|
|
|
return fqdn;
|
|
|
|
return fqdn;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
LDAPClientRealmConfig LDAPManager::loadClientRealmConfig(TDESimpleConfig* config, bool useDefaults) {
|
|
|
|
LDAPClientRealmConfig LDAPManager::loadClientRealmConfig(KSimpleConfig* config, bool useDefaults) {
|
|
|
|
LDAPClientRealmConfig clientRealmConfig;
|
|
|
|
LDAPClientRealmConfig clientRealmConfig;
|
|
|
|
|
|
|
|
|
|
|
|
config->setReadDefaults(useDefaults);
|
|
|
|
config->setReadDefaults(useDefaults);
|
|
|
@ -4894,7 +4894,7 @@ LDAPClientRealmConfig LDAPManager::loadClientRealmConfig(TDESimpleConfig* config
|
|
|
|
return clientRealmConfig;
|
|
|
|
return clientRealmConfig;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int LDAPManager::saveClientRealmConfig(LDAPClientRealmConfig clientRealmConfig, TDESimpleConfig* config, TQString *errstr) {
|
|
|
|
int LDAPManager::saveClientRealmConfig(LDAPClientRealmConfig clientRealmConfig, KSimpleConfig* config, TQString *errstr) {
|
|
|
|
Q_UNUSED(errstr)
|
|
|
|
Q_UNUSED(errstr)
|
|
|
|
|
|
|
|
|
|
|
|
config->setGroup(NULL);
|
|
|
|
config->setGroup(NULL);
|
|
|
@ -4936,7 +4936,7 @@ int LDAPManager::writeClientKrb5ConfFile(LDAPClientRealmConfig clientRealmConfig
|
|
|
|
stream << "\n";
|
|
|
|
stream << "\n";
|
|
|
|
|
|
|
|
|
|
|
|
// Get PKCS#11 slot number from the LDAP configuration file
|
|
|
|
// Get PKCS#11 slot number from the LDAP configuration file
|
|
|
|
TDESimpleConfig* systemconfig = new TDESimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" ));
|
|
|
|
KSimpleConfig* systemconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" ));
|
|
|
|
systemconfig->setGroup(NULL);
|
|
|
|
systemconfig->setGroup(NULL);
|
|
|
|
int pkcs11_login_card_slot = systemconfig->readNumEntry("PKCS11LoginCardSlot", 0);
|
|
|
|
int pkcs11_login_card_slot = systemconfig->readNumEntry("PKCS11LoginCardSlot", 0);
|
|
|
|
delete systemconfig;
|
|
|
|
delete systemconfig;
|
|
|
@ -5560,7 +5560,7 @@ int LDAPManager::writeOpenSSLConfigurationFile(LDAPRealmConfig realmcfg, LDAPUse
|
|
|
|
bool LDAPManager::pkcsLoginEnabled() {
|
|
|
|
bool LDAPManager::pkcsLoginEnabled() {
|
|
|
|
bool enabled;
|
|
|
|
bool enabled;
|
|
|
|
|
|
|
|
|
|
|
|
TDESimpleConfig* systemconfig = new TDESimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" ));
|
|
|
|
KSimpleConfig* systemconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" ));
|
|
|
|
systemconfig->setGroup(NULL);
|
|
|
|
systemconfig->setGroup(NULL);
|
|
|
|
enabled = systemconfig->readBoolEntry("EnablePKCS11Login", false);
|
|
|
|
enabled = systemconfig->readBoolEntry("EnablePKCS11Login", false);
|
|
|
|
delete systemconfig;
|
|
|
|
delete systemconfig;
|
|
|
|