MySQL 8.0.39
Source Code Documentation
|
MySQL Configuration Utility. More...
#include "my_config.h"
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <stdarg.h>
#include <stdlib.h>
#include <sys/types.h>
#include "client/client_priv.h"
#include "my_aes.h"
#include "my_byteorder.h"
#include "my_compiler.h"
#include "my_dbug.h"
#include "my_default.h"
#include "my_dir.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "my_rnd.h"
#include "mysql/service_mysql_alloc.h"
#include "mysys/my_default_priv.h"
#include "print_version.h"
#include "welcome_copyright_notice.h"
Classes | |
struct | my_command_data |
Macros | |
#define | MY_LINE_MAX 4096 |
#define | MAX_COMMAND_LIMIT 100 |
#define | MY_LOGIN_HEADER_LEN (4 + LOGIN_KEY_LEN) |
Functions | |
static int | execute_commands (int command) |
static int | set_command (void) |
Execute 'set' command. More... | |
static int | remove_command (void) |
static int | print_command (void) |
Execute 'print' command. More... | |
static void | print_login_path (DYNAMIC_STRING *file_buf, const char *path_name) |
Print options under the specified login path. More... | |
static void | remove_login_path (DYNAMIC_STRING *file_buf, const char *path_name) |
Remove the specified login path from the login file. More... | |
static char * | locate_login_path (DYNAMIC_STRING *file_buf, const char *path_name) |
Find the specified login path in the login file buffer and return the starting address. More... | |
static bool | check_and_create_login_file (void) |
Create the login file if it does not exist, check and set its permissions and modes. More... | |
static void | mask_password_and_print (char *buf) |
Print the specified buffer by masking the actual password string. More... | |
static int | reset_login_file (bool gen_key) |
Remove all the contents from the login file. More... | |
static int | encrypt_buffer (const char *plain, int plain_len, char cipher[], const int aes_len) |
Encrypt the given plain text. More... | |
static int | decrypt_buffer (const char *cipher, int cipher_len, char plain[]) |
Decrypt the given cipher text. More... | |
static int | encrypt_and_write_file (DYNAMIC_STRING *file_buf) |
Encrypt the file buffer and write it to the login file. More... | |
static int | read_and_decrypt_file (DYNAMIC_STRING *file_buf) |
Read the login file, unscramble its contents and store them into the file buffer. More... | |
static int | do_handle_options (int argc, char *argv[]) |
Handle all the command line arguments. More... | |
static void | remove_options (DYNAMIC_STRING *file_buf, const char *path_name) |
Remove multiple options from a login path. More... | |
static void | remove_option (DYNAMIC_STRING *file_buf, const char *path_name, const char *option_name) |
Remove an option from a login path. More... | |
bool | generate_login_key () |
Algorithm to generate key. More... | |
static int | read_login_key (void) |
Read the stored login key. More... | |
static int | add_header (void) |
Add unused bytes alongwith the to the login key to the login file. More... | |
static void | my_perror (const char *msg) |
static void | verbose_msg (const char *fmt,...) |
static void | usage_program (void) |
static void | usage_command (int command) |
bool | get_one_option (int optid, const struct my_option *opt, char *argument) |
static bool | my_program_get_one_option (int optid, const struct my_option *opt, char *argument) |
static bool | my_set_command_get_one_option (int optid, const struct my_option *, char *) |
static bool | my_remove_command_get_one_option (int optid, const struct my_option *, char *) |
static bool | my_print_command_get_one_option (int optid, const struct my_option *, char *) |
static bool | my_reset_command_get_one_option (int optid, const struct my_option *, char *) |
int | main (int argc, char *argv[]) |
MySQL Configuration Utility.
#define MAX_COMMAND_LIMIT 100 |
#define MY_LINE_MAX 4096 |
#define MY_LOGIN_HEADER_LEN (4 + LOGIN_KEY_LEN) |
enum commands |
|
static |
Add unused bytes alongwith the to the login key to the login file.
|
static |
Create the login file if it does not exist, check and set its permissions and modes.
|
static |
Decrypt the given cipher text.
[in] | cipher | Cipher text to be decrypted. |
[in] | cipher_len | Length of the cipher text. |
[out] | plain | Decrypted plain text. |
|
static |
Handle all the command line arguments.
program_name [program options] [command [command options]]
|
static |
Encrypt the file buffer and write it to the login file.
[in] | file_buf | Buffer storing the unscrambled login file contents. |
|
static |
Encrypt the given plain text.
plain | Plain text to be encrypted | |
plain_len | Length of the plain text | |
[out] | cipher | Encrypted cipher text |
aes_len | Length of the cypher |
|
static |
bool generate_login_key | ( | void | ) |
Algorithm to generate key.
true | error |
false | success |
bool get_one_option | ( | int | optid, |
const struct my_option * | opt, | ||
char * | argument | ||
) |
|
static |
Find the specified login path in the login file buffer and return the starting address.
[in] | file_buf | Buffer storing the unscrambled login file contents. |
[in] | path_name | Path name. |
int main | ( | int | argc, |
char * | argv[] | ||
) |
|
static |
Print the specified buffer by masking the actual password string.
[in] | buf | Buffer to be printed. |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Execute 'print' command.
|
static |
Print options under the specified login path.
If '–all' option is used, print all the optins stored in the login file.
[in] | file_buf | Buffer storing the unscrambled login file contents. |
[in] | path_name | Path name. |
|
static |
Read the login file, unscramble its contents and store them into the file buffer.
[in] | file_buf | Buffer for storing the unscrambled login file contents. |
|
static |
Read the stored login key.
|
static |
|
static |
Remove the specified login path from the login file.
[in] | file_buf | Buffer storing the unscrambled login file contents. |
[in] | path_name | Path name. |
|
static |
Remove an option from a login path.
|
static |
Remove multiple options from a login path.
|
static |
Remove all the contents from the login file.
[in] | gen_key | Flag to control the generation of a new key. |
|
static |
Execute 'set' command.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |