mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 20:07:13 +02:00
MDEV-31461 mariadb SIGSEGV when built with -DCLIENT_PLUGIN_DIALOG=STATIC
This commit is contained in:
parent
f5dceafd0b
commit
d32fc5b8e0
16 changed files with 25 additions and 21 deletions
|
|
@ -1958,7 +1958,7 @@ static int get_options(int argc, char **argv)
|
|||
current_db= my_strdup(*argv, MYF(MY_WME));
|
||||
}
|
||||
if (tty_password)
|
||||
opt_password= get_tty_password(NullS);
|
||||
opt_password= my_get_tty_password(NullS);
|
||||
if (debug_info_flag)
|
||||
my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;
|
||||
if (debug_check_flag)
|
||||
|
|
@ -4659,7 +4659,7 @@ char *mysql_authentication_dialog_ask(MYSQL *mysql, int type,
|
|||
|
||||
if (type == 2) /* password */
|
||||
{
|
||||
s= get_tty_password("");
|
||||
s= my_get_tty_password("");
|
||||
strnmov(buf, s, buf_len);
|
||||
buf[buf_len-1]= 0;
|
||||
my_free(s);
|
||||
|
|
|
|||
|
|
@ -1350,7 +1350,7 @@ int main(int argc, char **argv)
|
|||
|
||||
if (tty_password)
|
||||
{
|
||||
opt_password= get_tty_password(NullS);
|
||||
opt_password= my_get_tty_password(NullS);
|
||||
/* add password to defaults file */
|
||||
add_one_option_cnf_file(&ds_args, "password", opt_password);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ int main(int argc,char *argv[])
|
|||
}
|
||||
commands = temp_argv;
|
||||
if (tty_password)
|
||||
opt_password = get_tty_password(NullS);
|
||||
opt_password = my_get_tty_password(NullS);
|
||||
|
||||
(void) signal(SIGINT,endprog); /* Here if abort */
|
||||
(void) signal(SIGTERM,endprog); /* Here if abort */
|
||||
|
|
@ -1128,8 +1128,8 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
|||
else if (argc == 1)
|
||||
{
|
||||
/* prompt for password */
|
||||
typed_password= get_tty_password("New password: ");
|
||||
verified= get_tty_password("Confirm new password: ");
|
||||
typed_password= my_get_tty_password("New password: ");
|
||||
verified= my_get_tty_password("Confirm new password: ");
|
||||
if (strcmp(typed_password, verified) != 0)
|
||||
{
|
||||
my_printf_error(0,"Passwords don't match",MYF(ME_BELL));
|
||||
|
|
|
|||
|
|
@ -2095,7 +2095,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||
break;
|
||||
}
|
||||
if (tty_password)
|
||||
pass= get_tty_password(NullS);
|
||||
pass= my_get_tty_password(NullS);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -458,7 +458,7 @@ static int get_options(int *argc, char ***argv)
|
|||
DBUG_RETURN(1);
|
||||
}
|
||||
if (tty_password)
|
||||
opt_password = get_tty_password(NullS);
|
||||
opt_password = my_get_tty_password(NullS);
|
||||
if (debug_info_flag)
|
||||
my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;
|
||||
if (debug_check_flag)
|
||||
|
|
|
|||
|
|
@ -1233,7 +1233,7 @@ static int get_options(int *argc, char ***argv)
|
|||
return EX_USAGE;
|
||||
}
|
||||
if (tty_password)
|
||||
opt_password=get_tty_password(NullS);
|
||||
opt_password=my_get_tty_password(NullS);
|
||||
return(0);
|
||||
} /* get_options */
|
||||
|
||||
|
|
|
|||
|
|
@ -299,7 +299,7 @@ static int get_options(int *argc, char ***argv)
|
|||
current_db= *((*argv)++);
|
||||
(*argc)--;
|
||||
if (tty_password)
|
||||
opt_password=get_tty_password(NullS);
|
||||
opt_password=my_get_tty_password(NullS);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -352,7 +352,7 @@ get_options(int *argc,char ***argv)
|
|||
exit(ho_error);
|
||||
|
||||
if (tty_password)
|
||||
opt_password=get_tty_password(NullS);
|
||||
opt_password=my_get_tty_password(NullS);
|
||||
if (opt_count)
|
||||
{
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1523,7 +1523,7 @@ get_options(int *argc,char ***argv)
|
|||
}
|
||||
|
||||
if (tty_password)
|
||||
opt_password= get_tty_password(NullS);
|
||||
opt_password= my_get_tty_password(NullS);
|
||||
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7293,7 +7293,7 @@ int parse_args(int argc, char **argv)
|
|||
if (argc == 1)
|
||||
opt_db= *argv;
|
||||
if (tty_password)
|
||||
opt_pass= get_tty_password(NullS); /* purify tested */
|
||||
opt_pass= my_get_tty_password(NullS); /* purify tested */
|
||||
if (debug_info_flag)
|
||||
my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;
|
||||
if (debug_check_flag)
|
||||
|
|
|
|||
|
|
@ -1058,7 +1058,7 @@ extern void add_compiled_collation(struct charset_info_st *cs);
|
|||
extern size_t escape_string_for_mysql(CHARSET_INFO *charset_info,
|
||||
char *to, size_t to_length,
|
||||
const char *from, size_t length);
|
||||
extern char *get_tty_password(const char *opt_message);
|
||||
extern char *my_get_tty_password(const char *opt_message);
|
||||
#ifdef __WIN__
|
||||
#define BACKSLASH_MBTAIL
|
||||
/* File system character set */
|
||||
|
|
|
|||
|
|
@ -226,3 +226,7 @@ error:
|
|||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
char *get_tty_password(const char *opt_message)
|
||||
{
|
||||
return my_get_tty_password(opt_message);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,11 +60,11 @@
|
|||
/* were just going to fake it here and get input from
|
||||
the keyboard */
|
||||
|
||||
char *get_tty_password(const char *opt_message)
|
||||
char *my_get_tty_password(const char *opt_message)
|
||||
{
|
||||
char to[80];
|
||||
char *pos=to,*end=to+sizeof(to)-1;
|
||||
DBUG_ENTER("get_tty_password");
|
||||
DBUG_ENTER("my_get_tty_password");
|
||||
_cputs(opt_message ? opt_message : "Enter password: ");
|
||||
for (;;)
|
||||
{
|
||||
|
|
@ -145,7 +145,7 @@ static void get_password(char *to,uint length,int fd, my_bool echo)
|
|||
#endif /* ! HAVE_GETPASS */
|
||||
|
||||
|
||||
char *get_tty_password(const char *opt_message)
|
||||
char *my_get_tty_password(const char *opt_message)
|
||||
{
|
||||
#ifdef HAVE_GETPASS
|
||||
char *passbuff;
|
||||
|
|
@ -154,7 +154,7 @@ char *get_tty_password(const char *opt_message)
|
|||
#endif /* HAVE_GETPASS */
|
||||
char buff[80];
|
||||
|
||||
DBUG_ENTER("get_tty_password");
|
||||
DBUG_ENTER("my_get_tty_password");
|
||||
|
||||
#ifdef HAVE_GETPASS
|
||||
passbuff = getpass(opt_message ? opt_message : "Enter password: ");
|
||||
|
|
|
|||
|
|
@ -371,7 +371,7 @@ main(int argc, char *argv[])
|
|||
if (err)
|
||||
exit(err);
|
||||
if (tty_password)
|
||||
opt_password= get_tty_password(NullS);
|
||||
opt_password= my_get_tty_password(NullS);
|
||||
|
||||
if (opt_query_file)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1362,7 +1362,7 @@ static void get_options(int *argc, char ***argv)
|
|||
exit(ho_error);
|
||||
|
||||
if (tty_password)
|
||||
opt_password= get_tty_password(NullS);
|
||||
opt_password= my_get_tty_password(NullS);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ static void get_options(int argc, char **argv)
|
|||
|
||||
free_defaults(argv);
|
||||
if (tty_password)
|
||||
password=get_tty_password(NullS);
|
||||
password=my_get_tty_password(NullS);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue