summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2020-03-11 13:27:10 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2020-03-11 13:27:10 +0100
commitb8c0e4967098fa40094229775e3560fa9052005e (patch)
treed2b4f2914776aaecbbc5d3d4aba0c826f8f3b49e /plugin
parent5c6c4b13952b0b832b3480bbb1cc9c9889244d33 (diff)
parent440452628d95476674922c6c097825509a002d8d (diff)
downloadmariadb-git-b8c0e4967098fa40094229775e3560fa9052005e.tar.gz
Merge commit '10.3' into 10.4
Diffstat (limited to 'plugin')
-rw-r--r--plugin/auth_pam/CMakeLists.txt14
-rw-r--r--plugin/auth_pam/mapper/pam_user_map.c30
-rw-r--r--plugin/win_auth_client/CMakeLists.txt3
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)