MySQL  8.0.28
Source Code Documentation
multi_factor_passwordopt-vars.h
Go to the documentation of this file.
1 /* Copyright (c) 2021, Oracle and/or its affiliates.
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License, version 2.0,
5  as published by the Free Software Foundation.
6 
7  This program is also distributed with certain software (including
8  but not limited to OpenSSL) that is licensed under separate terms,
9  as designated in a particular file or component or in included license
10  documentation. The authors of MySQL hereby grant you an additional
11  permission to link the program and your derivative works with the
12  separately licensed software that they have included with MySQL.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License, version 2.0, for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22 
23 /**
24  @file include/multi_factor_passwordopt-vars.h
25 */
26 
27 #ifndef MULTI_FACTOR_PASSWORDOPT_VARS_H
28 #define MULTI_FACTOR_PASSWORDOPT_VARS_H
29 
30 #include "mysql.h"
31 
32 extern char *opt_password[MAX_AUTH_FACTORS];
33 extern bool tty_password[MAX_AUTH_FACTORS];
34 
35 /** parse passwords for --password or --password<N> option where N = 1,2,3 */
36 void parse_command_line_password_option(const struct my_option *opt,
37  char *argument);
38 /**
39  If --password<N> option is not specified with an argument, get password from
40  prompt
41 */
43 /** Set password in mysql->options */
45 /** Release memory for opt_password */
46 void free_passwords();
47 
48 #define PARSE_COMMAND_LINE_PASSWORD_OPTION \
49  case 'p': \
50  parse_command_line_password_option(opt, argument); \
51  break; \
52  case MYSQL_OPT_USER_PASSWORD: \
53  parse_command_line_password_option(opt, argument); \
54  break;
55 
56 #endif // MULTI_FACTOR_PASSWORDOPT_VARS_H
bool tty_password[MAX_AUTH_FACTORS]
Definition: multi_factor_passwordopt-vars.cc:34
void set_tty_password(MYSQL *mysql)
If –password<N> option is not specified with an argument, get password from prompt.
Definition: multi_factor_passwordopt-vars.cc:75
char * opt_password[MAX_AUTH_FACTORS]
Definition: multi_factor_passwordopt-vars.cc:33
void set_password_options(MYSQL *mysql)
Set password in mysql->options.
Definition: multi_factor_passwordopt-vars.cc:88
void free_passwords()
Release memory for opt_password.
Definition: multi_factor_passwordopt-vars.cc:100
void parse_command_line_password_option(const struct my_option *opt, char *argument)
parse passwords for –password or –password<N> option where N = 1,2,3
Definition: multi_factor_passwordopt-vars.cc:44
static MYSQL mysql
Definition: mysql.cc:153
This file defines the client API to MySQL and also the ABI of the dynamically linked libmysqlclient.
#define MAX_AUTH_FACTORS
Definition: mysql_com.h:86
Definition: mysql.h:297
Definition: my_getopt.h:90