diff options
author | Pierre Ossman <ossman@cendio.se> | 2018-07-11 15:49:46 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2020-03-12 12:03:32 +0100 |
commit | d80817f101d1b3f1a9b1c5ec268f28fffa2d75f9 (patch) | |
tree | bc08908a2151ba0c2c552410944ee101e563dc31 /common | |
parent | a92aec4fbb287c2ebb79f3d3406668086057ce20 (diff) | |
download | tigervnc-d80817f101d1b3f1a9b1c5ec268f28fffa2d75f9.tar.gz tigervnc-d80817f101d1b3f1a9b1c5ec268f28fffa2d75f9.zip |
Make PAM mandatory
It is present on all UNIX systems anyway, so let's simplify things.
We will need it for more proper session startup anyway.
Diffstat (limited to 'common')
-rw-r--r-- | common/rfb/CMakeLists.txt | 2 | ||||
-rw-r--r-- | common/rfb/SSecurityPlain.cxx | 10 | ||||
-rw-r--r-- | common/rfb/UnixPasswordValidator.cxx | 6 | ||||
-rw-r--r-- | common/rfb/pam.c | 4 | ||||
-rw-r--r-- | common/rfb/pam.h | 8 |
5 files changed, 6 insertions, 24 deletions
diff --git a/common/rfb/CMakeLists.txt b/common/rfb/CMakeLists.txt index 8e532a28..689cdccd 100644 --- a/common/rfb/CMakeLists.txt +++ b/common/rfb/CMakeLists.txt @@ -75,7 +75,7 @@ endif(WIN32) set(RFB_LIBRARIES ${JPEG_LIBRARIES} os rdr Xregion) -if(HAVE_PAM) +if(UNIX AND NOT APPLE) set(RFB_SOURCES ${RFB_SOURCES} UnixPasswordValidator.cxx UnixPasswordValidator.h pam.c pam.h) set(RFB_LIBRARIES ${RFB_LIBRARIES} ${PAM_LIBS}) diff --git a/common/rfb/SSecurityPlain.cxx b/common/rfb/SSecurityPlain.cxx index 6f72432a..f577c0d6 100644 --- a/common/rfb/SSecurityPlain.cxx +++ b/common/rfb/SSecurityPlain.cxx @@ -25,10 +25,10 @@ #include <rfb/SConnection.h> #include <rfb/Exception.h> #include <rdr/InStream.h> -#ifdef HAVE_PAM +#if !defined(WIN32) && !defined(__APPLE__) #include <rfb/UnixPasswordValidator.h> #endif -#ifdef BUILD_WIN +#ifdef WIN32 #include <rfb/WinPasswdValidator.h> #endif @@ -62,10 +62,10 @@ bool PasswordValidator::validUser(const char* username) SSecurityPlain::SSecurityPlain(SConnection* sc) : SSecurity(sc) { -#ifdef HAVE_PAM - valid = new UnixPasswordValidator(); -#elif BUILD_WIN +#ifdef WIN32 valid = new WinPasswdValidator(); +#elif !defined(__APPLE__) + valid = new UnixPasswordValidator(); #else valid = NULL; #endif diff --git a/common/rfb/UnixPasswordValidator.cxx b/common/rfb/UnixPasswordValidator.cxx index d0960794..ee7bc0da 100644 --- a/common/rfb/UnixPasswordValidator.cxx +++ b/common/rfb/UnixPasswordValidator.cxx @@ -25,9 +25,7 @@ #include <rfb/Configuration.h> #include <rfb/Exception.h> #include <rfb/UnixPasswordValidator.h> -#ifdef HAVE_PAM #include <rfb/pam.h> -#endif using namespace rfb; @@ -43,10 +41,6 @@ bool UnixPasswordValidator::validateInternal(SConnection * sc, const char *username, const char *password) { -#ifdef HAVE_PAM CharArray service(strDup(pamService.getData())); return do_pam_auth(service.buf, username, password); -#else - throw AuthFailureException("PAM not supported"); -#endif } diff --git a/common/rfb/pam.c b/common/rfb/pam.c index cb067fda..f9e5ce74 100644 --- a/common/rfb/pam.c +++ b/common/rfb/pam.c @@ -22,10 +22,6 @@ #include <config.h> #endif -#ifndef HAVE_PAM -#error "This source should not be compiled when PAM is unsupported" -#endif - #include <stdlib.h> #include <string.h> #include <security/pam_appl.h> diff --git a/common/rfb/pam.h b/common/rfb/pam.h index 2688f21c..d378d19c 100644 --- a/common/rfb/pam.h +++ b/common/rfb/pam.h @@ -21,14 +21,6 @@ #ifndef __RFB_PAM_H__ #define __RFB_PAM_H__ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#ifndef HAVE_PAM -#error "This header should not be included when PAM is unsupported" -#endif - #ifdef __cplusplus extern "C" { #endif |