diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2020-03-11 17:52:49 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2020-03-11 17:52:49 +0100 |
commit | fad47df9957d754bec12d4d327c77ae04f71d903 (patch) | |
tree | 58aaf6077adcb0bc0003228d30bed59687527650 /plugin | |
parent | 9d7ed94f6a526748eff29dae2939a3fd341f118b (diff) | |
parent | b7362d5fbc37dec340aeacd1fb0967c4226c022a (diff) | |
download | mariadb-git-fad47df9957d754bec12d4d327c77ae04f71d903.tar.gz |
Merge branch '10.4' into 10.5
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/auth_pam/CMakeLists.txt | 14 | ||||
-rw-r--r-- | plugin/auth_pam/mapper/pam_user_map.c | 30 | ||||
-rw-r--r-- | plugin/win_auth_client/CMakeLists.txt | 3 |
3 files changed, 38 insertions, 9 deletions
diff --git a/plugin/auth_pam/CMakeLists.txt b/plugin/auth_pam/CMakeLists.txt index a556b870719..89d5cc6a8af 100644 --- a/plugin/auth_pam/CMakeLists.txt +++ b/plugin/auth_pam/CMakeLists.txt @@ -1,10 +1,24 @@ INCLUDE (CheckIncludeFiles) INCLUDE (CheckFunctionExists) +CHECK_INCLUDE_FILES (security/pam_ext.h HAVE_PAM_EXT_H) CHECK_INCLUDE_FILES (security/pam_appl.h HAVE_PAM_APPL_H) CHECK_FUNCTION_EXISTS (strndup HAVE_STRNDUP) +SET(CMAKE_REQUIRED_LIBRARIES pam) +CHECK_FUNCTION_EXISTS(pam_syslog HAVE_PAM_SYSLOG) +SET(CMAKE_REQUIRED_LIBRARIES) + +IF(HAVE_PAM_SYSLOG) + ADD_DEFINITIONS(-DHAVE_PAM_SYSLOG) +ENDIF() + +IF(HAVE_PAM_EXT_H) + ADD_DEFINITIONS(-DHAVE_PAM_EXT_H) +ENDIF() + IF(HAVE_PAM_APPL_H) + ADD_DEFINITIONS(-DHAVE_PAM_APPL_H) IF(HAVE_STRNDUP) ADD_DEFINITIONS(-DHAVE_STRNDUP) ENDIF(HAVE_STRNDUP) diff --git a/plugin/auth_pam/mapper/pam_user_map.c b/plugin/auth_pam/mapper/pam_user_map.c index e1d11acabb9..9d7ed53f8b1 100644 --- a/plugin/auth_pam/mapper/pam_user_map.c +++ b/plugin/auth_pam/mapper/pam_user_map.c @@ -2,7 +2,7 @@ Pam module to change user names arbitrarily in the pam stack. Compile as - + gcc pam_user_map.c -shared -lpam -fPIC -o pam_user_map.so Install as appropriate (for example, in /lib/security/). @@ -39,14 +39,36 @@ and usually end up in /var/log/secure file. #include <grp.h> #include <pwd.h> +#ifdef HAVE_PAM_EXT_H #include <security/pam_ext.h> +#endif + +#ifdef HAVE_PAM_APPL_H +#include <unistd.h> +#include <security/pam_appl.h> +#endif + #include <security/pam_modules.h> +#ifndef HAVE_PAM_SYSLOG +#include <stdarg.h> +static void +pam_syslog (const pam_handle_t *pamh, int priority, + const char *fmt, ...) +{ + va_list args; + va_start (args, fmt); + vsyslog (priority, fmt, args); + va_end (args); +} +#endif + #define FILENAME "/etc/security/user_map.conf" #define skip(what) while (*s && (what)) s++ +#define SYSLOG_DEBUG if (mode_debug) pam_syslog #define GROUP_BUFFER_SIZE 100 - +static const char debug_keyword[]= "debug"; static int populate_user_groups(const char *user, gid_t **groups) { @@ -128,10 +150,6 @@ static void print_groups(pam_handle_t *pamh, const gid_t *user_groups, int ng) ng, (ng == 1) ? "group" : "groups", buf+1); } - -static const char debug_keyword[]= "debug"; -#define SYSLOG_DEBUG if (mode_debug) pam_syslog - int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char *argv[]) { diff --git a/plugin/win_auth_client/CMakeLists.txt b/plugin/win_auth_client/CMakeLists.txt index 435c5b8966a..8c7696347aa 100644 --- a/plugin/win_auth_client/CMakeLists.txt +++ b/plugin/win_auth_client/CMakeLists.txt @@ -31,7 +31,4 @@ IF(WIN32) LINK_LIBRARIES Secur32 MODULE_ONLY COMPONENT ClientPlugins) - #IF(MSVC) - # INSTALL_DEBUG_TARGET(auth_win_client DESTINATION ${INSTALL_LIBDIR}/debug) - #ENDIF() ENDIF(WIN32) |