https://github.com/inteliense/lib_mysqludf_secure_shell
This library will allow mysql to run scripts on your system using a secure restricted shell.
https://github.com/inteliense/lib_mysqludf_secure_shell
database database-management linux mysql mysql-functions mysql-plugin mysql-server user-defined-functions
Last synced: 9 months ago
JSON representation
This library will allow mysql to run scripts on your system using a secure restricted shell.
- Host: GitHub
- URL: https://github.com/inteliense/lib_mysqludf_secure_shell
- Owner: inteliense
- Created: 2023-04-10T23:27:27.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-04-26T00:42:30.000Z (over 2 years ago)
- Last Synced: 2025-02-13T21:47:45.073Z (11 months ago)
- Topics: database, database-management, linux, mysql, mysql-functions, mysql-plugin, mysql-server, user-defined-functions
- Language: C++
- Homepage:
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lib_mysqludf_secure_shell
This library will allow mysql to run scripts on your system using a secure restricted shell (recommended/default).
There is an option to disable security features which adds the `sys_run` function to MySQL and removes the use of `/bin/rbash` in Linux. This new function basically just lets you do what you want & takes two arguments: the executable and the arguments. By default, you will have one function: `sys_shell`. `sys_shell` will run any shell command. All functions return the exit status. Keep in mind that by using the restricted shell and .bash_profile you'll need to have your shell scripts installed in the mysql user's home directory (`/home/mysql-client` if using the install script)
Note If you can't get it working check system log for AppArmor or SELinux denials or switch to the less secure method by uncommenting the return value in the `lib_mysqludf_secure_shell.cc` file to return the `system(...)` function call result.
This is completely untested on Windows and Fedora based distros. The code in general should work fine, but there may need to be minor modifications made to get it working for your use case.
# Requirements
MySQL `>=8.0`
libmysqlclient-dev `apt-get install default-libmysqlclient-dev`
cmake `>=3.21`
# Installation
- Change to the source directory
- run `./install.sh`