MySQL 9.0.0
Source Code Documentation
multi_factor_passwordopt-vars.cc File Reference

Functions

void parse_command_line_password_option (const struct my_option *opt, char *argument)
 Helper method used by clients to parse password set as part of command line. More...
 
void set_password_options (MYSQL *mysql)
 Helper method used by clients to set password in mysql->options. More...
 
void free_passwords ()
 Release memory for opt_password. More...
 

Variables

char * opt_password [MAX_AUTH_FACTORS] = {nullptr}
 
bool tty_password [MAX_AUTH_FACTORS] = {false}
 

Function Documentation

◆ free_passwords()

void free_passwords ( )

Release memory for opt_password.

◆ parse_command_line_password_option()

void parse_command_line_password_option ( const struct my_option opt,
char *  argument 
)

Helper method used by clients to parse password set as part of command line.

parse passwords for –password or –password<N> option where N = 1,2,3

This method checks if password value is specified or not. If not then a flag is set to let client accept password from terminal.

Parameters
optpassword option
argumentvalue specified for –password<1,2,3> or –password

◆ set_password_options()

void set_password_options ( MYSQL mysql)

Helper method used by clients to set password in mysql->options.

Set password in mysql->options.

If tty_password is true get password from terminal and update in opt_password and set tty_password to false

If opt_password is populated call mysql_options4()

Variable Documentation

◆ opt_password

char* opt_password[MAX_AUTH_FACTORS] = {nullptr}

◆ tty_password

bool tty_password[MAX_AUTH_FACTORS] = {false}