diff --git a/configure.ac b/configure.ac index 29151d3e..6f8c4a4b 100644 --- a/configure.ac +++ b/configure.ac @@ -263,9 +263,9 @@ then AC_DEFINE([XRDP_ENABLE_IPV6],1,[Enable IPv6]) fi -if test "x$enable_pam" != "xyes" +if test "x$enable_pam" = "xyes" then - AC_DEFINE([USE_NOPAM],1,[Disable PAM]) + AC_DEFINE([USE_PAM],1,[Enable PAM]) fi AS_IF( [test "x$enable_neutrinordp" = "xyes"] , [PKG_CHECK_MODULES(FREERDP, freerdp >= 1.0.0)] ) diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c index e8e2bf8a..e35c8ae2 100644 --- a/xrdp/xrdp_mm.c +++ b/xrdp/xrdp_mm.c @@ -25,7 +25,7 @@ #include "log.h" #include "string_calls.h" -#ifndef USE_NOPAM +#ifdef USE_PAM #if defined(HAVE__PAM_TYPES_H) #define LINUXPAM 1 #include @@ -33,7 +33,7 @@ #define OPENPAM 1 #include #endif -#endif /* USE_NOPAM */ +#endif /* USE_PAM */ #include "xrdp_encoder.h" #include "xrdp_sockets.h" @@ -1789,7 +1789,7 @@ xrdp_mm_sesman_data_in(struct trans *trans) return error; } -#ifndef USE_NOPAM +#ifdef USE_PAM /*********************************************************************/ /* return 0 on success */ static int @@ -1932,7 +1932,7 @@ cleanup_states(struct xrdp_mm *self) } } -#ifndef USE_NOPAM +#ifdef USE_PAM static const char * getPAMError(const int pamError, char *text, int text_bytes) { @@ -2183,7 +2183,7 @@ xrdp_mm_connect(struct xrdp_mm *self) char ip[256]; char port[8]; char chansrvport[256]; -#ifndef USE_NOPAM +#ifdef USE_PAM int use_pam_auth = 0; char pam_auth_sessionIP[256]; char pam_auth_password[256]; @@ -2221,7 +2221,7 @@ xrdp_mm_connect(struct xrdp_mm *self) } } -#ifndef USE_NOPAM +#ifdef USE_PAM else if (g_strcasecmp(name, "pamusername") == 0) { use_pam_auth = 1; @@ -2251,7 +2251,7 @@ xrdp_mm_connect(struct xrdp_mm *self) } } -#ifndef USE_NOPAM +#ifdef USE_PAM if (use_pam_auth) { int reply;