diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-06-05 01:05:12 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-06-05 01:05:12 -0500 |
commit | 8e51437b6331c9ebabd7d5f5db93c825eb8509c5 (patch) | |
tree | 9c9248d825e1fe31615687cc681be808f1068df8 /src | |
parent | 24377abde30bc11ba41ce7b206d25f01d79a72e1 (diff) | |
download | kcmldapcontroller-8e51437b6331c9ebabd7d5f5db93c825eb8509c5.tar.gz kcmldapcontroller-8e51437b6331c9ebabd7d5f5db93c825eb8509c5.zip |
Move dns lookup routine to ldap library
Diffstat (limited to 'src')
-rw-r--r-- | src/ldapcontroller.cpp | 29 | ||||
-rw-r--r-- | src/ldapcontroller.h | 4 |
2 files changed, 1 insertions, 32 deletions
diff --git a/src/ldapcontroller.cpp b/src/ldapcontroller.cpp index a345db3..87c6949 100644 --- a/src/ldapcontroller.cpp +++ b/src/ldapcontroller.cpp @@ -103,7 +103,7 @@ LDAPController::LDAPController(TQWidget *parent, const char *name, const TQStrin connect(m_base->systemEnableSupport, TQT_SIGNAL(clicked()), this, TQT_SLOT(processLockouts())); connect(m_base->systemRole, TQT_SIGNAL(activated(const TQString&)), this, TQT_SLOT(systemRoleChanged())); - m_fqdn = getMachineFQDN(); + m_fqdn = LDAPManager::getMachineFQDN(); // FIXME // This assumes Debian! @@ -122,33 +122,6 @@ LDAPController::LDAPController(TQWidget *parent, const char *name, const TQStrin LDAPController::~LDAPController() { } -// FIXME -// This should be moved to a TDE core library -TQString LDAPController::getMachineFQDN() { - struct addrinfo hints, *info, *p; - int gai_result; - - char hostname[1024]; - hostname[1023] = '\0'; - gethostname(hostname, 1023); - - memset(&hints, 0, sizeof hints); - hints.ai_family = AF_UNSPEC; // IPV4 or IPV6 - hints.ai_socktype = SOCK_STREAM; - hints.ai_flags = AI_CANONNAME; - - if ((gai_result = getaddrinfo(hostname, NULL, &hints, &info)) != 0) { - return TQString(hostname); - } - TQString fqdn = TQString(hostname); - for (p=info; p!=NULL; p=p->ai_next) { - fqdn = TQString(p->ai_canonname); - } - freeaddrinfo(info); - - return fqdn; -} - void LDAPController::systemRoleChanged() { if (m_base->systemRole->currentItem() != m_prevRole) { if (m_base->systemRole->currentItem() == ROLE_REALM_CONTROLLER) { diff --git a/src/ldapcontroller.h b/src/ldapcontroller.h index cdf999f..a15c8d2 100644 --- a/src/ldapcontroller.h +++ b/src/ldapcontroller.h @@ -60,10 +60,6 @@ class LDAPController: public KCModule public: int createNewLDAPRealm(TQWidget* dialogparent, LDAPRealmConfig realmconfig, TQString adminUserName, TQString adminGroupName, TQString machineAdminGroupName, const char * adminPassword, TQString rootUserName, const char * rootPassword, TQString adminRealm, TQString *errstr); - // FIXME - // This should be moved to a TDE core library - TQString getMachineFQDN(); - private slots: void systemRoleChanged(); void processLockouts(); |