From ba97e2dc25f533f7942493e7f7d1203fdb64fc33 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Wed, 21 Apr 2021 23:35:09 +0900 Subject: [PATCH] Avoid direct usage of tdeldap library. This allows to remove hard dependency between packages. Signed-off-by: Michele Calgaro --- ConfigureChecks.cmake | 1 - kdesktop/lock/CMakeLists.txt | 2 +- kdesktop/lock/lockdlg.cpp | 11 +++++++---- tdm/kfrontend/CMakeLists.txt | 2 +- tdm/kfrontend/kgreeter.cpp | 10 ++++++---- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index fb3f4c3f2..0bbf183a1 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -467,7 +467,6 @@ if( WITH_KRB5 ) endif( NOT HAVE_KRB_KADM_H ) endif( NOT KRB5_FOUND ) set( HAVE_KRB5 1 ) - set( LIBTDELDAP_LIBRARIES "tdeldap" ) endif( ) # check for libr diff --git a/kdesktop/lock/CMakeLists.txt b/kdesktop/lock/CMakeLists.txt index 0a8f5603c..cc95489f9 100644 --- a/kdesktop/lock/CMakeLists.txt +++ b/kdesktop/lock/CMakeLists.txt @@ -41,7 +41,7 @@ set( ${target}_SRCS tde_add_executable( ${target} AUTOMOC SOURCES ${${target}_SRCS} LINK kdesktopsettings-static dmctl-static tdeio-shared Xext - pthread ${GL_LIBRARIES} ${LIBTDELDAP_LIBRARIES} + pthread ${GL_LIBRARIES} "${LINKER_IMMEDIATE_BINDING_FLAGS}" DESTINATION ${BIN_INSTALL_DIR} ) diff --git a/kdesktop/lock/lockdlg.cpp b/kdesktop/lock/lockdlg.cpp index d4b456a9e..e8d3c19b7 100644 --- a/kdesktop/lock/lockdlg.cpp +++ b/kdesktop/lock/lockdlg.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -58,9 +59,6 @@ #include #include -#ifdef HAVE_KRB5 -#include -#endif #ifndef AF_LOCAL # define AF_LOCAL AF_UNIX @@ -976,7 +974,12 @@ void PasswordDlg::capsLocked() void PasswordDlg::attemptCardLogin() { #ifdef HAVE_KRB5 // Make sure card logins are enabled before attempting one - if (!LDAPManager::pkcsLoginEnabled()) { + KSimpleConfig *systemconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" )); + systemconfig->setGroup(NULL); + bool enabled = systemconfig->readBoolEntry("EnablePKCS11Login", false); + delete systemconfig; + if (!enabled) + { return; } #else diff --git a/tdm/kfrontend/CMakeLists.txt b/tdm/kfrontend/CMakeLists.txt index bd8cc29b2..fa95542df 100644 --- a/tdm/kfrontend/CMakeLists.txt +++ b/tdm/kfrontend/CMakeLists.txt @@ -71,7 +71,7 @@ tde_add_executable( tdm_greet AUTOMOC kfdialog.cpp kgdialog.cpp kchooser.cpp kgverify.cpp tdmshutdown.cpp tdmadmindialog.cpp kgreeter.cpp kgapp.cpp sakdlg.cpp - LINK tdmthemer-static tdeui-shared tdeio-shared dmctl-static Xtst ${LIBTDELDAP_LIBRARIES} ${TDMGREET_OPTIONAL_LINK} + LINK tdmthemer-static tdeui-shared tdeio-shared dmctl-static Xtst ${TDMGREET_OPTIONAL_LINK} DESTINATION ${BIN_INSTALL_DIR} ) diff --git a/tdm/kfrontend/kgreeter.cpp b/tdm/kfrontend/kgreeter.cpp index 7f45ca197..cd61aa857 100644 --- a/tdm/kfrontend/kgreeter.cpp +++ b/tdm/kfrontend/kgreeter.cpp @@ -99,9 +99,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include -#ifdef HAVE_KRB5 -#include -#endif #define FIFO_DIR "/tmp/tdesocket-global/tdm" #define FIFO_FILE "/tmp/tdesocket-global/tdm/tdmctl-%1" @@ -863,7 +860,12 @@ KGreeter::verifySetUser( const TQString &user ) void KGreeter::cryptographicCardInserted(TDECryptographicCardDevice* cdevice) { #ifdef HAVE_KRB5 // Make sure card logins are enabled before attempting one - if (!LDAPManager::pkcsLoginEnabled()) { + KSimpleConfig *systemconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" )); + systemconfig->setGroup(NULL); + bool enabled = systemconfig->readBoolEntry("EnablePKCS11Login", false); + delete systemconfig; + if (!enabled) + { return; } #else