Permalink
Browse files

Fix for ld_preload in mysqld_safe.sh to only allow loading of

libraries from standard system directories
  • Loading branch information...
tplavcic committed Aug 15, 2016
1 parent c04b2e8 commit c14be53e029442f576cced1fb8ff96b58e89f2e0
Showing with 10 additions and 0 deletions.
  1. +10 −0 scripts/mysqld_safe.sh
@@ -258,6 +258,16 @@ add_mysqld_ld_preload() {
lib_to_add="$1"
log_notice "Adding '$lib_to_add' to LD_PRELOAD for mysqld"

# Check if the library is in the reduced number of standard system directories
case "$lib_to_add" in
/usr/lib64/* | /usr/lib/* | ${MY_BASEDIR_VERSION}/lib/*)
;;
*)
log_error "ld_preload libraries can only be loaded from system directories (/usr/lib64, /usr/lib, ${MY_BASEDIR_VERSION}/lib)"
exit 1
;;
esac

case "$lib_to_add" in
*' '*)
# Must strip path from lib, and add it to LD_LIBRARY_PATH

0 comments on commit c14be53

Please sign in to comment.