Skip to content

Commit

Permalink
Fix for ld_preload in mysqld_safe.sh to only allow loading of
Browse files Browse the repository at this point in the history
libraries from standard system directories
  • Loading branch information
tplavcic committed Aug 15, 2016
1 parent c04b2e8 commit c14be53
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scripts/mysqld_safe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c14be53

Please sign in to comment.