From 8e51437b6331c9ebabd7d5f5db93c825eb8509c5 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 5 Jun 2012 01:05:12 -0500 Subject: Move dns lookup routine to ldap library --- src/ldapcontroller.cpp | 29 +---------------------------- src/ldapcontroller.h | 4 ---- 2 files changed, 1 insertion(+), 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(); -- cgit v1.2.1