From 45ce8fc8bbbc8134d30e88bce0941b033332fc13 Mon Sep 17 00:00:00 2001 From: David Faure Date: Sat, 14 May 2016 08:34:41 +0200 Subject: [PATCH] Clean up configure checks, none of the code here use PAM anymore. It has all moved to kscreenlocker. --- ConfigureChecks.cmake | 22 --------- README.pam | 72 ------------------------------ cmake/FindPAM.cmake | 74 ------------------------------- cmake/MacroPushRequiredVars.cmake | 68 ---------------------------- cmake/UnixAuth.cmake | 56 ----------------------- config-unix.h.cmake | 29 ------------ 6 files changed, 321 deletions(-) delete mode 100644 README.pam delete mode 100644 cmake/FindPAM.cmake delete mode 100644 cmake/MacroPushRequiredVars.cmake delete mode 100644 cmake/UnixAuth.cmake diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 2c9b66927..0614c26e1 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -1,29 +1,9 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH} ) -include(UnixAuth) -set_package_properties(PAM PROPERTIES DESCRIPTION "PAM Libraries" - URL "https://www.kernel.org/pub/linux/libs/pam/" - TYPE OPTIONAL - PURPOSE "Required for screen unlocking and optionally used by the KDM log in manager" - ) include(CheckTypeSize) include(FindPkgConfig) # find_package(XKB) # kxkb, kdm -if (PAM_FOUND) - set(KDE4_COMMON_PAM_SERVICE "kde" CACHE STRING "The PAM service to use unless overridden for a particular app.") - - macro(define_pam_service APP) - string(TOUPPER ${APP}_PAM_SERVICE var) - set(cvar KDE4_${var}) - set(${cvar} "${KDE4_COMMON_PAM_SERVICE}" CACHE STRING "The PAM service for ${APP}.") - mark_as_advanced(${cvar}) - set(${var} "\"${${cvar}}\"") - endmacro(define_pam_service) - - define_pam_service(kscreensaver) -endif (PAM_FOUND) - set(KWIN_BIN "kwin_x11" CACHE STRING "Name of the KWin binary") find_program(some_x_program NAMES iceauth xrdb xterm) @@ -36,8 +16,6 @@ get_filename_component(XBINDIR "${proto_xbindir}" ABSOLUTE) get_filename_component(xrootdir "${XBINDIR}" PATH) set(XLIBDIR "${xrootdir}/lib/X11") -check_function_exists(getpassphrase HAVE_GETPASSPHRASE) -check_function_exists(vsyslog HAVE_VSYSLOG) check_function_exists(statvfs HAVE_STATVFS) check_include_files(limits.h HAVE_LIMITS_H) diff --git a/README.pam b/README.pam deleted file mode 100644 index 2e302fe37..000000000 --- a/README.pam +++ /dev/null @@ -1,72 +0,0 @@ -KDE can be configured to support the PAM ("Pluggable Authentication -Modules") system for password checking by the display manager kdm and -by the screen saver kscreensaver (for unlocking the display). - -PAM is a flexible application-transparent configurable user-authentication -system found on FreeBSD, Solaris, and Linux (and maybe other unixes). - -Information about PAM may be found on its homepage - http://www.kernel.org/pub/linux/libs/pam/ -(Despite the location, this information is NOT Linux-specific.) - - -Known Solaris Issues: --------------------- - -For compiling PAM support on Solaris, PAM_MESSAGE_CONST must NOT -be defined. This should now be handled automatically by the -configure script. - - -Using PAM ---------- - -By default, PAM is automatically used, if it is found. Use -./configure --without-pam to disable it. - -If PAM is found, KDE usually uses the PAM service "kde". You may -override it for all KDE programs by using --with-pam= and/or -individually by using --with--pam=, where is -one of kdm, kcp and kss (for kdm, kcheckpass and kscreensaver). - -"make install" will attempt to create suitable service definitions; either -by putting files into /etc/pam.d/ or by adding text to /etc/pam.conf. The -services are just copies of the "login" service. -You may want to edit these definitions to meet your needs. -There are also two example service definitions in this directory - -kde.pamd and kscreensaver.pamd - but don't just copy them! -If the services are misconfigured, you will NOT be able to login via KDM -and/or unlock a locked screen! - -If there is ever any doubt about which PAM service a program was -compiled with, it can be determined by examining the PAM-generated -entries in the system log associated with kdm logins or kscreensaver -authentication failures. - - -PAM configuration files have four types of entries for each service: - -type used by kdm used by kscreensaver ----- ----------- -------------------- -auth x x -account x -password x -session x - -There may be more than one entry of each type. Check existing PAM -configuration files and PAM documentation on your system for guidance as -to what entries to make. If you call a PAM service that is not -configured, the default action of PAM is likely to be denial of service. - -Note: kdm implements PAM "session" support, which is not implemented in -certain PAM-aware xdm's that it may be replacing (e.g., the Red Hat -Linux 5.x xdm did not implement it). This may be configured to carry out -actions when a user opens or closes an kdm session, if a suitable PAM -module is available (e.g., mount and unmount user-specific filesystems). - -Note 2: Screensavers typically only authenticate a user to allow her to -continue working. They may also renew tokens etc., where supported. -See the Linux PAM Administrators guide, which is part of the PAM -distribution, for more details. - - diff --git a/cmake/FindPAM.cmake b/cmake/FindPAM.cmake deleted file mode 100644 index 349983651..000000000 --- a/cmake/FindPAM.cmake +++ /dev/null @@ -1,74 +0,0 @@ -# - Try to find the PAM libraries -# Once done this will define -# -# PAM_FOUND - system has pam -# PAM_INCLUDE_DIR - the pam include directory -# PAM_LIBRARIES - libpam library - -if (PAM_INCLUDE_DIR AND PAM_LIBRARY) - # Already in cache, be silent - set(PAM_FIND_QUIETLY TRUE) -endif (PAM_INCLUDE_DIR AND PAM_LIBRARY) - -find_path(PAM_INCLUDE_DIR NAMES security/pam_appl.h pam/pam_appl.h) -find_library(PAM_LIBRARY pam) -find_library(DL_LIBRARY dl) - -if (PAM_INCLUDE_DIR AND PAM_LIBRARY) - set(PAM_FOUND TRUE) - if (DL_LIBRARY) - set(PAM_LIBRARIES ${PAM_LIBRARY} ${DL_LIBRARY}) - else (DL_LIBRARY) - set(PAM_LIBRARIES ${PAM_LIBRARY}) - endif (DL_LIBRARY) - - if (EXISTS ${PAM_INCLUDE_DIR}/pam/pam_appl.h) - # darwin claims to be something special - set(HAVE_PAM_PAM_APPL_H 1) - endif (EXISTS ${PAM_INCLUDE_DIR}/pam/pam_appl.h) - - if (NOT DEFINED PAM_MESSAGE_CONST) - include(CheckCXXSourceCompiles) - # XXX does this work with plain c? - check_cxx_source_compiles(" -#if ${HAVE_PAM_PAM_APPL_H}+0 -# include -#else -# include -#endif - -static int PAM_conv( - int num_msg, - const struct pam_message **msg, /* this is the culprit */ - struct pam_response **resp, - void *ctx) -{ - return 0; -} - -int main(void) -{ - struct pam_conv PAM_conversation = { - &PAM_conv, /* this bombs out if the above does not match */ - 0 - }; - - return 0; -} -" PAM_MESSAGE_CONST) - endif (NOT DEFINED PAM_MESSAGE_CONST) - set(PAM_MESSAGE_CONST ${PAM_MESSAGE_CONST} CACHE BOOL "PAM expects a conversation function with const pam_message") - -endif (PAM_INCLUDE_DIR AND PAM_LIBRARY) - -if (PAM_FOUND) - if (NOT PAM_FIND_QUIETLY) - message(STATUS "Found PAM: ${PAM_LIBRARIES}") - endif (NOT PAM_FIND_QUIETLY) -else (PAM_FOUND) - if (PAM_FIND_REQUIRED) - message(FATAL_ERROR "PAM was not found") - endif(PAM_FIND_REQUIRED) -endif (PAM_FOUND) - -mark_as_advanced(PAM_INCLUDE_DIR PAM_LIBRARY DL_LIBRARY PAM_MESSAGE_CONST) diff --git a/cmake/MacroPushRequiredVars.cmake b/cmake/MacroPushRequiredVars.cmake deleted file mode 100644 index 54c2b3a96..000000000 --- a/cmake/MacroPushRequiredVars.cmake +++ /dev/null @@ -1,68 +0,0 @@ -# this module defines two macros: -# MACRO_PUSH_REQUIRED_VARS() -# and -# MACRO_POP_REQUIRED_VARS() -# use these if you call cmake macros which use -# any of the CMAKE_REQUIRED_XXX variables -# -# Usage: -# MACRO_PUSH_REQUIRED_VARS() -# SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -DSOME_MORE_DEF) -# CHECK_FUNCTION_EXISTS(...) -# MACRO_POP_REQUIRED_VARS() - -# Copyright (c) 2006, Alexander Neundorf, -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. - -MACRO(MACRO_PUSH_REQUIRED_VARS) - - IF(NOT DEFINED _PUSH_REQUIRED_VARS_COUNTER) - SET(_PUSH_REQUIRED_VARS_COUNTER 0) - ENDIF(NOT DEFINED _PUSH_REQUIRED_VARS_COUNTER) - - MATH(EXPR _PUSH_REQUIRED_VARS_COUNTER "${_PUSH_REQUIRED_VARS_COUNTER}+1") - - SET(_CMAKE_REQUIRED_INCLUDES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER} ${CMAKE_REQUIRED_INCLUDES}) - SET(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS}) - SET(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER} ${CMAKE_REQUIRED_LIBRARIES}) - SET(_CMAKE_REQUIRED_FLAGS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER} ${CMAKE_REQUIRED_FLAGS}) -ENDMACRO(MACRO_PUSH_REQUIRED_VARS) - -MACRO(MACRO_POP_REQUIRED_VARS) - -# don't pop more than we pushed - IF("${_PUSH_REQUIRED_VARS_COUNTER}" GREATER "0") - - SET(CMAKE_REQUIRED_INCLUDES ${_CMAKE_REQUIRED_INCLUDES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}}) - SET(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}}) - SET(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}}) - SET(CMAKE_REQUIRED_FLAGS ${_CMAKE_REQUIRED_FLAGS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}}) - - MATH(EXPR _PUSH_REQUIRED_VARS_COUNTER "${_PUSH_REQUIRED_VARS_COUNTER}-1") - ENDIF("${_PUSH_REQUIRED_VARS_COUNTER}" GREATER "0") - -ENDMACRO(MACRO_POP_REQUIRED_VARS) - diff --git a/cmake/UnixAuth.cmake b/cmake/UnixAuth.cmake deleted file mode 100644 index 6928310c8..000000000 --- a/cmake/UnixAuth.cmake +++ /dev/null @@ -1,56 +0,0 @@ -find_package(PAM) - -include(CheckFunctionExists) -include(CheckLibraryExists) -include(CheckIncludeFiles) -include(CMakePushCheckState) - -set(UNIXAUTH_LIBRARIES) -set(UNIXAUTH_INCLUDE_DIRS) - -set(SHADOW_LIBRARIES) -check_function_exists(getspnam found_getspnam) -if (found_getspnam) - set(HAVE_GETSPNAM 1) -else (found_getspnam) - cmake_push_check_state() - set(CMAKE_REQUIRED_LIBRARIES -lshadow) - check_function_exists(getspnam found_getspnam_shadow) - if (found_getspnam_shadow) - set(HAVE_GETSPNAM 1) - set(SHADOW_LIBRARIES shadow) - check_function_exists(pw_encrypt HAVE_PW_ENCRYPT) # ancient Linux shadow - else (found_getspnam_shadow) - set(CMAKE_REQUIRED_LIBRARIES -lgen) # UnixWare - check_function_exists(getspnam found_getspnam_gen) - if (found_getspnam_gen) - set(HAVE_GETSPNAM 1) - set(SHADOW_LIBRARIES gen) - endif (found_getspnam_gen) - endif (found_getspnam_shadow) - cmake_pop_check_state() -endif (found_getspnam) - -set(CRYPT_LIBRARIES) -check_library_exists(crypt crypt "" HAVE_CRYPT) -if (HAVE_CRYPT) - set(CRYPT_LIBRARIES crypt) - check_include_files(crypt.h HAVE_CRYPT_H) -endif (HAVE_CRYPT) - -if (PAM_FOUND) - - set(HAVE_PAM 1) - set(UNIXAUTH_LIBRARIES ${PAM_LIBRARIES}) - set(UNIXAUTH_INCLUDE_DIRS ${PAM_INCLUDE_DIR}) - -else (PAM_FOUND) - - if (HAVE_GETSPNAM) - set(UNIXAUTH_LIBRARIES ${SHADOW_LIBRARIES}) - endif (HAVE_GETSPNAM) - if (NOT HAVE_PW_ENCRYPT) - set(UNIXAUTH_LIBRARIES ${UNIXAUTH_LIBRARIES} ${CRYPT_LIBRARIES}) - endif (NOT HAVE_PW_ENCRYPT) - -endif (PAM_FOUND) diff --git a/config-unix.h.cmake b/config-unix.h.cmake index 274f6fab3..d1d31812b 100644 --- a/config-unix.h.cmake +++ b/config-unix.h.cmake @@ -1,32 +1,3 @@ -/* Defines if you have PAM (Pluggable Authentication Modules) */ -#cmakedefine HAVE_PAM 1 - -/* Define if your PAM headers are in pam/ instead of security/ */ -#cmakedefine HAVE_PAM_PAM_APPL_H 1 - -/* Define if your PAM expects a conversation function with const pam_message (Solaris) */ -#cmakedefine PAM_MESSAGE_CONST 1 - -/* The PAM service to be used by kscreensaver */ -#cmakedefine KSCREENSAVER_PAM_SERVICE ${KSCREENSAVER_PAM_SERVICE} - -/* Defines if your system has the getspnam function */ -#cmakedefine HAVE_GETSPNAM 1 - -/* Defines if your system has the crypt function */ -#cmakedefine HAVE_CRYPT 1 - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_CRYPT_H 1 - -/* Define to 1 if you have the `pw_encrypt' function. */ -#cmakedefine HAVE_PW_ENCRYPT 1 - -/* Define to 1 if you have the `getpassphrase' function. */ -#cmakedefine HAVE_GETPASSPHRASE 1 - -/* Define to 1 if you have the `vsyslog' function. */ -#cmakedefine HAVE_VSYSLOG 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_LIMITS_H 1