Skip to content

Commit

Permalink
MDEV-17292 Package the pam_user_map module
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Jan 21, 2020
1 parent 42049f9 commit 8870f18
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmake/cpack_rpm.cmake
Expand Up @@ -100,8 +100,11 @@ SET(ignored
"%ignore /etc"
"%ignore /etc/init.d"
"%ignore /etc/logrotate.d"
"%ignore /etc/security"
"%ignore /etc/systemd"
"%ignore /etc/systemd/system"
"%ignore /lib"
"%ignore /lib/security"
"%ignore ${CMAKE_INSTALL_PREFIX}"
"%ignore ${CMAKE_INSTALL_PREFIX}/bin"
"%ignore ${CMAKE_INSTALL_PREFIX}/include"
Expand Down
6 changes: 6 additions & 0 deletions cmake/install_layout.cmake
Expand Up @@ -163,6 +163,7 @@ SET(INSTALL_UNIX_ADDRDIR_RPM "${INSTALL_MYSQLDATADIR_RPM}/mysql.sock"
SET(INSTALL_SYSTEMD_UNITDIR_RPM "/usr/lib/systemd/system")
SET(INSTALL_SYSTEMD_SYSUSERSDIR_RPM "/usr/lib/sysusers.d")
SET(INSTALL_SYSTEMD_TMPFILESDIR_RPM "/usr/lib/tmpfiles.d")
SET(INSTALL_PAMDIR_RPM "/lib/security")

#
# DEB layout
Expand Down Expand Up @@ -195,6 +196,11 @@ SET(INSTALL_UNIX_ADDRDIR_DEB "/var/run/mysqld/mysqld.sock")
SET(INSTALL_SYSTEMD_UNITDIR_DEB "/lib/systemd/system")
SET(INSTALL_SYSTEMD_SYSUSERSDIR_DEB "/usr/lib/sysusers.d")
SET(INSTALL_SYSTEMD_TMPFILESDIR_DEB "/usr/lib/tmpfiles.d")
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(INSTALL_PAMDIR_DEB "/lib/x86_64-linux-gnu/security")
ELSE()
SET(INSTALL_PAMDIR_DEB "/lib/i386-linux-gnu/security")
ENDIF()

#
# SVR4 layout
Expand Down
2 changes: 2 additions & 0 deletions debian/mariadb-server-10.2.install
Expand Up @@ -3,7 +3,9 @@ debian/additions/debian-start.inc.sh usr/share/mysql
debian/additions/echo_stderr usr/share/mysql
debian/additions/mysqld_safe_syslog.cnf etc/mysql/conf.d
etc/apparmor.d/usr.sbin.mysqld
etc/security/user_map.conf
lib/systemd/system/mariadb@bootstrap.service.d/use_galera_new_cluster.conf
lib/*/security/pam_user_map.so
usr/bin/aria_chk
usr/bin/aria_dump_log
usr/bin/aria_ftdump
Expand Down
10 changes: 10 additions & 0 deletions plugin/auth_pam/CMakeLists.txt
Expand Up @@ -10,5 +10,15 @@ IF(HAVE_PAM_APPL_H)
ENDIF(HAVE_STRNDUP)
FIND_LIBRARY(PAM_LIBRARY pam)
MYSQL_ADD_PLUGIN(auth_pam auth_pam.c LINK_LIBRARIES pam MODULE_ONLY)

IF(TARGET auth_pam)
ADD_LIBRARY(pam_user_map MODULE mapper/pam_user_map.c)
TARGET_LINK_LIBRARIES(pam_user_map pam)
SET_TARGET_PROPERTIES (pam_user_map PROPERTIES PREFIX "")
IF(INSTALL_PAMDIR)
INSTALL(TARGETS pam_user_map DESTINATION ${INSTALL_PAMDIR} COMPONENT Server)
INSTALL(FILES mapper/user_map.conf DESTINATION /etc/security COMPONENT Server)
ENDIF()
ENDIF()
ENDIF(HAVE_PAM_APPL_H)

13 changes: 13 additions & 0 deletions plugin/auth_pam/mapper/user_map.conf
@@ -0,0 +1,13 @@
#
# Configuration file for pam_user_map.so
#
# defines mapping in the form
#
# orig_user_name: mapped_user_name
#
# or (to map all users in a specific group)
#
# @group_name: mapped_user_name
#
# comments and empty lines are ignored
#

0 comments on commit 8870f18

Please sign in to comment.