]> source.dussan.org Git - tigervnc.git/commitdiff
Detect and enable PAM authentication support
authorDRC <dcommander@users.sourceforge.net>
Wed, 22 Jun 2011 00:18:17 +0000 (00:18 +0000)
committerDRC <dcommander@users.sourceforge.net>
Wed, 22 Jun 2011 00:18:17 +0000 (00:18 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4513 3789f03b-4d11-0410-bbf8-ca57d06f2519

CMakeLists.txt
common/rfb/CMakeLists.txt
config.h.cmake.in

index 1f9d9578ff9d486de2335d3c148749c75b553ab9..fb4e7135f2eb0f1d7e0d728277a92b61a9ec41f3 100644 (file)
@@ -253,6 +253,21 @@ if(ENABLE_GNUTLS)
   endif()
 endif()
 
+# Check for PAM library
+option(ENABLE_PAM "Enable PAM authentication support" ON)
+if(ENABLE_PAM)
+  check_include_files(security/pam_appl.h HAVE_PAM_H)
+  set(CMAKE_REQUIRED_LIBRARIES -lpam)
+  check_function_exists(pam_start HAVE_PAM_START)
+  set(CMAKE_REQUIRED_LIBRARIES)
+  if(HAVE_PAM_H AND HAVE_PAM_START)
+    set(PAM_LIBS pam)
+  else()
+    set(ENABLE_PAM 0)
+  endif()
+endif()
+set(HAVE_PAM ${ENABLE_PAM})
+
 # Check for socket functions
 if(WIN32)
   set(CMAKE_EXTRA_INCLUDE_FILES winsock2.h ws2tcpip.h)
index 4ca9349971ef5bcd0c48b8e2758640785fb78f50..eddbaea4f6ee4d2ab95be2b8a4c202d733a0000a 100644 (file)
@@ -72,6 +72,12 @@ endif(WIN32)
 
 set(RFB_LIBRARIES ${JPEG_LIBRARIES} os)
 
+if(HAVE_PAM)
+  set(RFB_SOURCES ${RFB_SOURCES} UnixPasswordValidator.cxx
+    UnixPasswordValidator.h pam.c pam.h)
+  set(RFB_LIBRARIES ${RFB_LIBRARIES} ${PAM_LIBS})
+endif()
+
 if(GNUTLS_FOUND)
   set(RFB_SOURCES
     ${RFB_SOURCES}
index bce755fe3ea33316d30d170cadb1928894824110..5f7a4c710cb4da721f19fc1cf40f8637e48c1040 100644 (file)
@@ -17,6 +17,7 @@
 #cmakedefine HAVE_FLTK_FULLSCREEN
 #cmakedefine HAVE_FLTK_CURSOR
 #cmakedefine ENABLE_NLS 1
+#cmakedefine HAVE_PAM
 
 /* MS Visual Studio 2008 and newer doesn't know ssize_t */
 #if defined(HAVE_GNUTLS) && defined(WIN32) && !defined(__MINGW32__)