Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
23dae617
Commit
23dae617
authored
Jan 24, 2019
by
Geoff Montee
Committed by
Andrew Hutchings
Jul 26, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-18374: Add SELinux policy to cracklib_password_check packages
parent
515ba857
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
0 deletions
+48
-0
cmake/cpack_rpm.cmake
cmake/cpack_rpm.cmake
+2
-0
plugin/cracklib_password_check/CMakeLists.txt
plugin/cracklib_password_check/CMakeLists.txt
+25
-0
plugin/cracklib_password_check/policy/selinux/mariadb-plugin-cracklib-password-check.te
.../policy/selinux/mariadb-plugin-cracklib-password-check.te
+13
-0
plugin/cracklib_password_check/support-files/rpm/mariadb-plugin-cracklib-password-check-postin.sh
...iles/rpm/mariadb-plugin-cracklib-password-check-postin.sh
+8
-0
No files found.
cmake/cpack_rpm.cmake
View file @
23dae617
...
@@ -229,6 +229,8 @@ SET(CPACK_RPM_shared_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/
...
@@ -229,6 +229,8 @@ SET(CPACK_RPM_shared_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/
SET
(
CPACK_RPM_shared_POST_UNINSTALL_SCRIPT_FILE
${
CMAKE_SOURCE_DIR
}
/support-files/rpm/shared-post.sh
)
SET
(
CPACK_RPM_shared_POST_UNINSTALL_SCRIPT_FILE
${
CMAKE_SOURCE_DIR
}
/support-files/rpm/shared-post.sh
)
SET
(
CPACK_RPM_compat_POST_INSTALL_SCRIPT_FILE
${
CMAKE_SOURCE_DIR
}
/support-files/rpm/shared-post.sh
)
SET
(
CPACK_RPM_compat_POST_INSTALL_SCRIPT_FILE
${
CMAKE_SOURCE_DIR
}
/support-files/rpm/shared-post.sh
)
SET
(
CPACK_RPM_compat_POST_UNINSTALL_SCRIPT_FILE
${
CMAKE_SOURCE_DIR
}
/support-files/rpm/shared-post.sh
)
SET
(
CPACK_RPM_compat_POST_UNINSTALL_SCRIPT_FILE
${
CMAKE_SOURCE_DIR
}
/support-files/rpm/shared-post.sh
)
SET
(
CPACK_RPM_cracklib-password-check_POST_INSTALL_SCRIPT_FILE
${
CMAKE_SOURCE_DIR
}
/plugin/cracklib_password_check/support-files/rpm/mariadb-plugin-cracklib-password-check-postin.sh
)
MACRO
(
ALTERNATIVE_NAME real alt
)
MACRO
(
ALTERNATIVE_NAME real alt
)
IF
(
${
ARGC
}
GREATER 2
)
IF
(
${
ARGC
}
GREATER 2
)
...
...
plugin/cracklib_password_check/CMakeLists.txt
View file @
23dae617
...
@@ -14,4 +14,29 @@ IF (HAVE_ALLOCA_H AND HAVE_CRACK_H AND HAVE_LIBCRACK AND HAVE_MEMCPY)
...
@@ -14,4 +14,29 @@ IF (HAVE_ALLOCA_H AND HAVE_CRACK_H AND HAVE_LIBCRACK AND HAVE_MEMCPY)
MYSQL_ADD_PLUGIN
(
cracklib_password_check cracklib_password_check.c
MYSQL_ADD_PLUGIN
(
cracklib_password_check cracklib_password_check.c
LINK_LIBRARIES crack MODULE_ONLY
LINK_LIBRARIES crack MODULE_ONLY
COMPONENT cracklib-password-check
)
COMPONENT cracklib-password-check
)
IF
(
RPM
)
SET
(
inst_location
${
INSTALL_SUPPORTFILESDIR
}
)
INSTALL
(
DIRECTORY policy DESTINATION
${
inst_location
}
COMPONENT cracklib-password-check
)
FIND_PROGRAM
(
CHECKMODULE checkmodule
)
FIND_PROGRAM
(
SEMODULE_PACKAGE semodule_package
)
MARK_AS_ADVANCED
(
CHECKMODULE SEMODULE_PACKAGE
)
# Build pp files in policy/selinux
IF
(
CHECKMODULE AND SEMODULE_PACKAGE
)
FOREACH
(
pol mariadb-plugin-cracklib-password-check
)
SET
(
src
${
CMAKE_CURRENT_SOURCE_DIR
}
/policy/selinux/
${
pol
}
.te
)
SET
(
tmp
${
CMAKE_CURRENT_BINARY_DIR
}${
CMAKE_FILES_DIRECTORY
}
/
${
pol
}
-pp.dir/
${
pol
}
.mod
)
SET
(
out
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
pol
}
.pp
)
ADD_CUSTOM_COMMAND
(
OUTPUT
${
out
}
COMMAND
${
CHECKMODULE
}
-M -m
${
src
}
-o
${
tmp
}
COMMAND
${
SEMODULE_PACKAGE
}
-m
${
tmp
}
-o
${
out
}
DEPENDS
${
src
}
)
ADD_CUSTOM_TARGET
(
${
pol
}
-pp ALL DEPENDS
${
out
}
)
INSTALL
(
FILES
${
out
}
DESTINATION
${
inst_location
}
/policy/selinux COMPONENT cracklib-password-check
)
ENDFOREACH
()
ENDIF
()
ENDIF
()
ENDIF
()
ENDIF
()
plugin/cracklib_password_check/policy/selinux/mariadb-plugin-cracklib-password-check.te
0 → 100644
View file @
23dae617
module mariadb-plugin-cracklib-password-check 1.0;
require {
type mysqld_t;
type crack_db_t;
class file { execute setattr read create getattr execute_no_trans write ioctl open append unlink };
class dir { write search getattr add_name read remove_name open };
}
allow mysqld_t crack_db_t:dir { search read open };
allow mysqld_t crack_db_t:file { getattr read open };
plugin/cracklib_password_check/support-files/rpm/mariadb-plugin-cracklib-password-check-postin.sh
0 → 100644
View file @
23dae617
SETARGETDIR
=
/etc/selinux/targeted/src/policy
SEDOMPROG
=
$SETARGETDIR
/domains/program
SECONPROG
=
$SETARGETDIR
/file_contexts/program
if
[
-x
/usr/sbin/semodule
]
;
then
/usr/sbin/semodule
-i
/usr/share/mysql/policy/selinux/mariadb-plugin-cracklib-password-check.pp
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment