summaryrefslogtreecommitdiffstats
path: root/tdm
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2016-09-06 15:08:26 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2016-09-06 15:08:26 -0500
commita7afe91e652b20b764c78ca9508cdd8f0a27dd8f (patch)
treedfc424a94af940f4495eae44acef610c5cb7042c /tdm
parent3252800255e59562f401ad0df2cf37cd50d0b1a4 (diff)
downloadtdebase-a7afe91e652b20b764c78ca9508cdd8f0a27dd8f.tar.gz
tdebase-a7afe91e652b20b764c78ca9508cdd8f0a27dd8f.zip
Do not start card authentication unless PKCS logins were enabled
Rename UserList class in kgreeter.cpp to avoid conflict with TDE LDAP library class name
Diffstat (limited to 'tdm')
-rw-r--r--tdm/kfrontend/CMakeLists.txt4
-rw-r--r--tdm/kfrontend/kgreeter.cpp21
2 files changed, 19 insertions, 6 deletions
diff --git a/tdm/kfrontend/CMakeLists.txt b/tdm/kfrontend/CMakeLists.txt
index ab2ddc69..1de0d14f 100644
--- a/tdm/kfrontend/CMakeLists.txt
+++ b/tdm/kfrontend/CMakeLists.txt
@@ -22,11 +22,13 @@ include_directories(
${CMAKE_SOURCE_DIR}/kcontrol/background
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
+ ${KRB5_INCLUDE_DIRS}
)
link_directories(
${TQT_LIBRARY_DIRS}
${LIBART_LIBRARY_DIRS}
+ ${TDE_LIB_DIR}
)
@@ -68,7 +70,7 @@ tde_add_executable( tdm_greet AUTOMOC
kfdialog.cpp kgdialog.cpp kchooser.cpp kgverify.cpp
tdmshutdown.cpp tdmadmindialog.cpp kgreeter.cpp
kgapp.cpp sakdlg.cc
- LINK tdmthemer-static tdeui-shared tdeio-shared dmctl-static Xtst ${TDMGREET_OPTIONAL_LINK}
+ LINK tdmthemer-static tdeui-shared tdeio-shared dmctl-static Xtst ${LIBTDELDAP_LIBRARIES} ${TDMGREET_OPTIONAL_LINK}
DESTINATION ${BIN_INSTALL_DIR}
)
diff --git a/tdm/kfrontend/kgreeter.cpp b/tdm/kfrontend/kgreeter.cpp
index e2791d43..1143a860 100644
--- a/tdm/kfrontend/kgreeter.cpp
+++ b/tdm/kfrontend/kgreeter.cpp
@@ -99,6 +99,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <X11/Xlib.h>
+#ifdef HAVE_KRB5
+#include <tde/libtdeldap.h>
+#endif
+
#define FIFO_DIR "/tmp/tdesocket-global/tdm"
#define FIFO_FILE "/tmp/tdesocket-global/tdm/tdmctl-%1"
#define FIFO_SAK_FILE "/tmp/tdesocket-global/tdm/tdmctl-sak-%1"
@@ -437,9 +441,9 @@ class KCStringList : public TQValueList<TQCString> {
}
};
-class UserList {
+class KGreeterUserList {
public:
- UserList( char **in );
+ KGreeterUserList( char **in );
bool hasUser( const char *str ) const { return users.contains( str ); }
bool hasGroup( gid_t gid ) const
{ return groups.find( gid ) != groups.end(); }
@@ -450,7 +454,7 @@ class UserList {
TQValueList<gid_t> groups;
};
-UserList::UserList( char **in )
+KGreeterUserList::KGreeterUserList( char **in )
{
struct group *grp;
@@ -485,7 +489,7 @@ KGreeter::insertUsers(int limit_users)
default_pix.convertDepth( 32 ).smoothScale( ns, TQ_ScaleMin );
}
if (_showUsers == SHOW_ALL) {
- UserList noUsers( _noUsers );
+ KGreeterUserList noUsers( _noUsers );
TQDict<int> dupes( 1000 ); // Potential crash risk with buffer overrun?
TQStringList toinsert;
int count = 0;
@@ -551,7 +555,7 @@ KGreeter::insertUsers(int limit_users)
insertUser( default_pix, *it, ps );
}
} else {
- UserList users( _users );
+ KGreeterUserList users( _users );
if (users.hasGroups()) {
TQDict<int> dupes( 1000 );
for (setpwent(); (ps = getpwent()) != 0;) {
@@ -856,6 +860,13 @@ 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()) {
+ return;
+ }
+#endif
+
TQString login_name = TQString::null;
X509CertificatePtrList certList = cdevice->cardX509Certificates();
if (certList.count() > 0) {