diff -u -r kdebase-3.5.13.orig/CMakeLists.txt kdebase-3.5.13.new/CMakeLists.txt
--- kdebase-3.5.13.orig/CMakeLists.txt	2011-10-24 00:08:24.000000000 +0000
+++ kdebase-3.5.13.new/CMakeLists.txt	2011-12-27 08:15:30.000000000 +0000
@@ -70,6 +70,7 @@
 option( WITH_SUDO_KDESU_BACKEND "Use sudo as backend for kdesu (default is su)" OFF )
 option( WITH_PAM "kdm should use PAM" OFF )
 option( WITH_SHADOW "kdm should use shadow passwords" OFF )
+option( WITH_CRYPT "kdm should use crypt()ed passwords" OFF )
 option( WITH_XDMCP "xdmcp support for kdm" OFF )
 option( WITH_XINERAMA "Enable xinerama extension support" OFF )
 option( WITH_ARTS "Enable aRts support" OFF )
diff -u -r kdebase-3.5.13.orig/config.h.cmake kdebase-3.5.13.new/config.h.cmake
--- kdebase-3.5.13.orig/config.h.cmake	2011-10-29 21:02:15.000000000 +0000
+++ kdebase-3.5.13.new/config.h.cmake	2011-12-27 08:21:43.000000000 +0000
@@ -140,8 +140,8 @@
 #cmakedefine USE_PAM 1
 #cmakedefine KDM_PAM_SERVICE "@KDM_PAM_SERVICE@"
 
-#define USESHADOW 1
-#define HAVE_SHADOW 1
+#cmakedefine WITH_SHADOW 1
+#cmakedefine WITH_CRYPT 1
 
 #cmakedefine XDMCP 1
 
diff -u -r kdebase-3.5.13.orig/kdm/backend/CMakeLists.txt kdebase-3.5.13.new/kdm/backend/CMakeLists.txt
--- kdebase-3.5.13.orig/kdm/backend/CMakeLists.txt	2011-09-03 19:32:00.000000000 +0000
+++ kdebase-3.5.13.new/kdm/backend/CMakeLists.txt	2011-12-27 07:54:45.000000000 +0000
@@ -35,6 +35,12 @@
   set( XDMCP_LIBRARIES "" )
 endif()
 
+if ( WITH_CRYPT )
+  set( CRYPT_LIBRARY "crypt" )
+else()
+  set( CRYPT_LIBRARY "" )
+endif()
+
 tde_add_executable( kdm
   SOURCES
     access.c auth.c bootman.c choose.c client.c consolekit.c
@@ -43,6 +49,6 @@
     process.c protodpy.c reset.c resource.c rpcauth.c
     server.c session.c sessreg.c socket.c streams.c
     util.c xdmauth.c xdmcp.c
-  LINK X11 ${XAU_LIBRARIES} ${DBUS_TQT_LIBRARIES} ${PAM_LIBRARY} ${XDMCP_LIBRARIES}
+  LINK X11 ${XAU_LIBRARIES} ${DBUS_TQT_LIBRARIES} ${PAM_LIBRARY} ${XDMCP_LIBRARIES} ${CRYPT_LIBRARY}
   DESTINATION ${BIN_INSTALL_DIR}
 )
diff -u -r kdebase-3.5.13.orig/kdm/backend/client.c kdebase-3.5.13.new/kdm/backend/client.c
--- kdebase-3.5.13.orig/kdm/backend/client.c	2011-08-15 23:07:52.000000000 +0000
+++ kdebase-3.5.13.new/kdm/backend/client.c	2011-12-27 08:47:17.000000000 +0000
@@ -78,8 +78,11 @@
 /* for expiration */
 # include <time.h>
 #endif /* USE_PAM || _AIX */
-#ifdef HAVE_SHADOW
+#ifdef WITH_SHADOW
 # include <shadow.h>
+#ifdef WITH_CRYPT
+#include <crypt.h>
+#endif
 #endif
 #include <signal.h>
 
@@ -129,7 +132,7 @@
 #elif defined(_AIX)
 static char tty[16], hostname[100];
 #else
-# ifdef USESHADOW
+# ifdef WITH_SHADOW
 static struct spwd *sp;
 # endif
 # ifdef KERBEROS
@@ -437,7 +440,7 @@
 AccNoPass( const char *un )
 {
 	struct passwd *pw = 0;
-# ifdef HAVE_SHADOW /* (sic!) - not USESHADOW */
+# ifdef WITH_SHADOW
 	struct spwd *spw;
 # endif
 #else
@@ -465,7 +468,7 @@
 				return 0;
 			if (pw->pw_passwd[0] == '!' || pw->pw_passwd[0] == '*')
 				continue;
-# ifdef HAVE_SHADOW /* (sic!) - not USESHADOW */
+# ifdef WITH_SHADOW
 			if ((spw = getspnam( un )) &&
 			    (spw->sp_pwdp[0] == '!' || spw->sp_pwdp[0] == '*'))
 					continue;
@@ -524,15 +527,16 @@
 # ifdef HAVE_GETUSERSHELL
 	char *s;
 # endif
-# if defined(HAVE_STRUCT_PASSWD_PW_EXPIRE) || defined(USESHADOW)
+# if defined(HAVE_STRUCT_PASSWD_PW_EXPIRE) || defined(WITH_SHADOW)
 	int tim, expir, warntime, quietlog;
 # endif
 #endif
 
 	Debug( "Verify ...\n" );
+ 	Debug("curtype: %s\n", curtype?curtype:"null" );
 
 #ifdef USE_PAM
-
+	Debug( "USE_PAM\n" );
 	pnopass = FALSE;
 	if (!strcmp( curtype, "classic" )) {
 		if (!gconv( GCONV_USER, 0 ))
@@ -561,7 +565,6 @@
 		return 0;
 
 #elif defined(_AIX)
-
 	if ((td->displayType & d_location) == dForeign) {
 		char *tmpch;
 		strncpy( hostname, td->name, sizeof(hostname) - 1 );
@@ -677,7 +680,7 @@
 		V_RET_AUTH;
 	}
 
-# ifdef USESHADOW
+# ifdef WITH_SHADOW
 	if ((sp = getspnam( curuser ))) {
 		p->pw_passwd = sp->sp_pwdp;
 		if (p->pw_passwd[0] == '!' || p->pw_passwd[0] == '*') {
@@ -741,7 +744,7 @@
 
 # if defined(ultrix) || defined(__ultrix__)
 	if (authenticate_user( p, curpass, NULL ) < 0)
-# elif defined(HAVE_CRYPT)
+# elif defined(WITH_CRYPT)
 	if (strcmp( crypt( curpass, p->pw_passwd ), p->pw_passwd ))
 # else
 	if (strcmp( curpass, p->pw_passwd ))
@@ -858,9 +861,9 @@
 # ifndef USE_PAM
 
 /* restrict_expired */
-#  if defined(HAVE_STRUCT_PASSWD_PW_EXPIRE) || defined(USESHADOW)
+#  if defined(HAVE_STRUCT_PASSWD_PW_EXPIRE) || defined(WITH_SHADOW)
 
-#   if !defined(HAVE_STRUCT_PASSWD_PW_EXPIRE) || (!defined(HAVE_SETUSERCONTEXT) && defined(USESHADOW))
+#   if !defined(HAVE_STRUCT_PASSWD_PW_EXPIRE) || (!defined(HAVE_SETUSERCONTEXT) && defined(WITH_SHADOW))
 	if (sp)
 #   endif
 	{
@@ -876,7 +879,7 @@
 		                             DEFAULT_WARN * 86400L ) / 86400L;
 #   else
 		quietlog = 0;
-#    ifdef USESHADOW
+#    ifdef WITH_SHADOW
 		warntime = sp->sp_warn != -1 ? sp->sp_warn : DEFAULT_WARN;
 #    else
 		warntime = DEFAULT_WARN;
@@ -960,7 +963,7 @@
 
 	}
 
-#  endif /* HAVE_STRUCT_PASSWD_PW_EXPIRE || USESHADOW */
+#  endif /* HAVE_STRUCT_PASSWD_PW_EXPIRE */
 
 /* restrict_nologin */
 #  ifndef _PATH_NOLOGIN
@@ -1454,7 +1457,7 @@
 	removeAuth = 1;
 	chownCtrl( &td->ctrl, curuid );
 	endpwent();
-#if !defined(USE_PAM) && defined(USESHADOW) && !defined(_AIX)
+#if !defined(USE_PAM) && defined(WITH_SHADOW) && !defined(_AIX)
 	endspent();
 #endif
 	ClearCloseOnFork( mstrtalk.pipe->wfd );
