Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
704898bf
Commit
704898bf
authored
Aug 08, 2012
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
undo the fix for MySQL Bug#12998841
parent
1877016c
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
14 additions
and
120 deletions
+14
-120
client/client_priv.h
client/client_priv.h
+0
-1
client/mysql.cc
client/mysql.cc
+0
-13
client/mysqladmin.cc
client/mysqladmin.cc
+0
-13
client/mysqlslap.c
client/mysqlslap.c
+0
-12
client/mysqltest.cc
client/mysqltest.cc
+1
-7
include/mysql.h
include/mysql.h
+1
-2
include/mysql.h.pp
include/mysql.h.pp
+1
-2
include/sql_common.h
include/sql_common.h
+0
-2
mysql-test/t/plugin_auth.test
mysql-test/t/plugin_auth.test
+2
-2
sql-common/client.c
sql-common/client.c
+9
-61
sql-common/client_plugin.c
sql-common/client_plugin.c
+0
-5
No files found.
client/client_priv.h
View file @
704898bf
...
...
@@ -87,7 +87,6 @@ enum options_client
OPT_PLUGIN_DIR
,
OPT_DEFAULT_AUTH
,
OPT_DEFAULT_PLUGIN
,
OPT_ENABLE_CLEARTEXT_PLUGIN
,
OPT_MAX_CLIENT_OPTION
};
...
...
client/mysql.cc
View file @
704898bf
...
...
@@ -148,8 +148,6 @@ static my_bool column_types_flag;
static
my_bool
preserve_comments
=
0
;
static
ulong
opt_max_allowed_packet
,
opt_net_buffer_length
;
static
uint
verbose
=
0
,
opt_silent
=
0
,
opt_mysql_port
=
0
,
opt_local_infile
=
0
;
static
uint
opt_enable_cleartext_plugin
=
0
;
static
my_bool
using_opt_enable_cleartext_plugin
=
0
;
static
uint
my_end_arg
;
static
char
*
opt_mysql_unix_port
=
0
;
static
int
connect_flag
=
CLIENT_INTERACTIVE
;
...
...
@@ -1411,10 +1409,6 @@ static struct my_option my_long_options[] =
&
default_charset
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"delimiter"
,
OPT_DELIMITER
,
"Delimiter to be used."
,
&
delimiter_str
,
&
delimiter_str
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"enable_cleartext_plugin"
,
OPT_ENABLE_CLEARTEXT_PLUGIN
,
"Enable/disable the clear text authentication plugin."
,
&
opt_enable_cleartext_plugin
,
&
opt_enable_cleartext_plugin
,
0
,
GET_BOOL
,
OPT_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"execute"
,
'e'
,
"Execute command and quit. (Disables --force and history file.)"
,
0
,
0
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"vertical"
,
'E'
,
"Print the output of a query (rows) vertically."
,
...
...
@@ -1642,9 +1636,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case
OPT_LOCAL_INFILE
:
using_opt_local_infile
=
1
;
break
;
case
OPT_ENABLE_CLEARTEXT_PLUGIN
:
using_opt_enable_cleartext_plugin
=
TRUE
;
break
;
case
OPT_TEE
:
if
(
argument
==
disabled_my_option
)
{
...
...
@@ -4330,10 +4321,6 @@ sql_real_connect(char *host,char *database,char *user,char *password,
if
(
opt_default_auth
&&
*
opt_default_auth
)
mysql_options
(
&
mysql
,
MYSQL_DEFAULT_AUTH
,
opt_default_auth
);
if
(
using_opt_enable_cleartext_plugin
)
mysql_options
(
&
mysql
,
MYSQL_ENABLE_CLEARTEXT_PLUGIN
,
(
char
*
)
&
opt_enable_cleartext_plugin
);
if
(
!
mysql_real_connect
(
&
mysql
,
host
,
user
,
password
,
database
,
opt_mysql_port
,
opt_mysql_unix_port
,
connect_flag
|
CLIENT_MULTI_STATEMENTS
))
...
...
client/mysqladmin.cc
View file @
704898bf
...
...
@@ -43,8 +43,6 @@ static uint opt_count_iterations= 0, my_end_arg;
static
ulong
opt_connect_timeout
,
opt_shutdown_timeout
;
static
char
*
unix_port
=
0
;
static
char
*
opt_plugin_dir
=
0
,
*
opt_default_auth
=
0
;
static
uint
opt_enable_cleartext_plugin
=
0
;
static
my_bool
using_opt_enable_cleartext_plugin
=
0
;
#ifdef HAVE_SMEM
static
char
*
shared_memory_base_name
=
0
;
...
...
@@ -214,10 +212,6 @@ static struct my_option my_long_options[] =
"Default authentication client-side plugin to use."
,
&
opt_default_auth
,
&
opt_default_auth
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"enable_cleartext_plugin"
,
OPT_ENABLE_CLEARTEXT_PLUGIN
,
"Enable/disable the clear text authentication plugin."
,
&
opt_enable_cleartext_plugin
,
&
opt_enable_cleartext_plugin
,
0
,
GET_BOOL
,
OPT_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
0
,
0
,
0
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
}
};
...
...
@@ -288,9 +282,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt_protocol
=
find_type_or_exit
(
argument
,
&
sql_protocol_typelib
,
opt
->
name
);
break
;
case
OPT_ENABLE_CLEARTEXT_PLUGIN
:
using_opt_enable_cleartext_plugin
=
TRUE
;
break
;
}
if
(
error
)
{
...
...
@@ -363,10 +354,6 @@ int main(int argc,char *argv[])
if
(
opt_default_auth
&&
*
opt_default_auth
)
mysql_options
(
&
mysql
,
MYSQL_DEFAULT_AUTH
,
opt_default_auth
);
if
(
using_opt_enable_cleartext_plugin
)
mysql_options
(
&
mysql
,
MYSQL_ENABLE_CLEARTEXT_PLUGIN
,
(
char
*
)
&
opt_enable_cleartext_plugin
);
if
(
sql_connect
(
&
mysql
,
option_wait
))
{
/*
...
...
client/mysqlslap.c
View file @
704898bf
...
...
@@ -125,8 +125,6 @@ static char *host= NULL, *opt_password= NULL, *user= NULL,
*
post_system
=
NULL
,
*
opt_mysql_unix_port
=
NULL
;
static
char
*
opt_plugin_dir
=
0
,
*
opt_default_auth
=
0
;
static
uint
opt_enable_cleartext_plugin
=
0
;
static
my_bool
using_opt_enable_cleartext_plugin
=
0
;
const
char
*
delimiter
=
"
\n
"
;
...
...
@@ -350,9 +348,6 @@ int main(int argc, char **argv)
if
(
opt_default_auth
&&
*
opt_default_auth
)
mysql_options
(
&
mysql
,
MYSQL_DEFAULT_AUTH
,
opt_default_auth
);
if
(
using_opt_enable_cleartext_plugin
)
mysql_options
(
&
mysql
,
MYSQL_ENABLE_CLEARTEXT_PLUGIN
,
(
char
*
)
&
opt_enable_cleartext_plugin
);
if
(
!
opt_only_print
)
{
if
(
!
(
mysql_real_connect
(
&
mysql
,
host
,
user
,
opt_password
,
...
...
@@ -608,10 +603,6 @@ static struct my_option my_long_options[] =
"Detach (close and reopen) connections after X number of requests."
,
&
detach_rate
,
&
detach_rate
,
0
,
GET_UINT
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"enable_cleartext_plugin"
,
OPT_ENABLE_CLEARTEXT_PLUGIN
,
"Enable/disable the clear text authentication plugin."
,
&
opt_enable_cleartext_plugin
,
&
opt_enable_cleartext_plugin
,
0
,
GET_BOOL
,
OPT_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"engine"
,
'e'
,
"Storage engine to use for creating the table."
,
&
default_engine
,
&
default_engine
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
...
...
@@ -770,9 +761,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case
'I'
:
/* Info */
usage
();
exit
(
0
);
case
OPT_ENABLE_CLEARTEXT_PLUGIN
:
using_opt_enable_cleartext_plugin
=
TRUE
;
break
;
}
DBUG_RETURN
(
0
);
}
...
...
client/mysqltest.cc
View file @
704898bf
...
...
@@ -5456,7 +5456,7 @@ void do_connect(struct st_command *command)
int
con_port
=
opt_port
;
char
*
con_options
;
my_bool
con_ssl
=
0
,
con_compress
=
0
;
my_bool
con_pipe
=
0
,
con_shm
=
0
,
con_cleartext_enable
=
0
;
my_bool
con_pipe
=
0
,
con_shm
=
0
;
struct
st_connection
*
con_slot
;
static
DYNAMIC_STRING
ds_connection_name
;
...
...
@@ -5546,8 +5546,6 @@ void do_connect(struct st_command *command)
con_pipe
=
1
;
else
if
(
!
strncmp
(
con_options
,
"SHM"
,
3
))
con_shm
=
1
;
else
if
(
!
strncmp
(
con_options
,
"CLEARTEXT"
,
9
))
con_cleartext_enable
=
1
;
else
die
(
"Illegal option to connect: %.*s"
,
(
int
)
(
end
-
con_options
),
con_options
);
...
...
@@ -5644,10 +5642,6 @@ void do_connect(struct st_command *command)
if
(
ds_default_auth
.
length
)
mysql_options
(
&
con_slot
->
mysql
,
MYSQL_DEFAULT_AUTH
,
ds_default_auth
.
str
);
if
(
con_cleartext_enable
)
mysql_options
(
&
con_slot
->
mysql
,
MYSQL_ENABLE_CLEARTEXT_PLUGIN
,
(
char
*
)
&
con_cleartext_enable
);
/* Special database to allow one to connect without a database name */
if
(
ds_database
.
length
&&
!
strcmp
(
ds_database
.
str
,
"*NO-ONE*"
))
dynstr_set
(
&
ds_database
,
""
);
...
...
include/mysql.h
View file @
704898bf
...
...
@@ -166,8 +166,7 @@ enum mysql_option
MYSQL_OPT_USE_REMOTE_CONNECTION
,
MYSQL_OPT_USE_EMBEDDED_CONNECTION
,
MYSQL_OPT_GUESS_CONNECTION
,
MYSQL_SET_CLIENT_IP
,
MYSQL_SECURE_AUTH
,
MYSQL_REPORT_DATA_TRUNCATION
,
MYSQL_OPT_RECONNECT
,
MYSQL_OPT_SSL_VERIFY_SERVER_CERT
,
MYSQL_PLUGIN_DIR
,
MYSQL_DEFAULT_AUTH
,
MYSQL_ENABLE_CLEARTEXT_PLUGIN
MYSQL_OPT_SSL_VERIFY_SERVER_CERT
,
MYSQL_PLUGIN_DIR
,
MYSQL_DEFAULT_AUTH
};
/**
...
...
include/mysql.h.pp
View file @
704898bf
...
...
@@ -262,8 +262,7 @@ enum mysql_option
MYSQL_OPT_USE_REMOTE_CONNECTION
,
MYSQL_OPT_USE_EMBEDDED_CONNECTION
,
MYSQL_OPT_GUESS_CONNECTION
,
MYSQL_SET_CLIENT_IP
,
MYSQL_SECURE_AUTH
,
MYSQL_REPORT_DATA_TRUNCATION
,
MYSQL_OPT_RECONNECT
,
MYSQL_OPT_SSL_VERIFY_SERVER_CERT
,
MYSQL_PLUGIN_DIR
,
MYSQL_DEFAULT_AUTH
,
MYSQL_ENABLE_CLEARTEXT_PLUGIN
MYSQL_OPT_SSL_VERIFY_SERVER_CERT
,
MYSQL_PLUGIN_DIR
,
MYSQL_DEFAULT_AUTH
};
struct
st_mysql_options_extention
;
struct
st_mysql_options
{
...
...
include/sql_common.h
View file @
704898bf
...
...
@@ -31,7 +31,6 @@ extern const char *not_error_sqlstate;
struct
st_mysql_options_extention
{
char
*
plugin_dir
;
char
*
default_auth
;
my_bool
enable_cleartext_plugin
;
};
typedef
struct
st_mysql_methods
...
...
@@ -105,7 +104,6 @@ int mysql_client_plugin_init();
void
mysql_client_plugin_deinit
();
struct
st_mysql_client_plugin
;
extern
struct
st_mysql_client_plugin
*
mysql_client_builtins
[];
extern
my_bool
libmysql_cleartext_plugin_enabled
;
#ifdef __cplusplus
}
...
...
mysql-test/t/plugin_auth.test
View file @
704898bf
...
...
@@ -422,10 +422,10 @@ CREATE USER uplain@localhost IDENTIFIED WITH 'cleartext_plugin_server'
--
echo
## test plugin auth
--
disable_query_log
--
error
ER_ACCESS_DENIED_ERROR
:
this
should
fail
:
no
grant
connect
(
cleartext_fail_con
,
localhost
,
uplain
,
cleartext_test2
,,,,
CLEARTEXT
);
connect
(
cleartext_fail_con
,
localhost
,
uplain
,
cleartext_test2
);
--
enable_query_log
connect
(
cleartext_con
,
localhost
,
uplain
,
cleartext_test
,,,,
CLEARTEXT
);
connect
(
cleartext_con
,
localhost
,
uplain
,
cleartext_test
);
connection
cleartext_con
;
select
USER
(),
CURRENT_USER
();
...
...
sql-common/client.c
View file @
704898bf
...
...
@@ -1136,8 +1136,7 @@ static const char *default_options[]=
"connect-timeout"
,
"local-infile"
,
"disable-local-infile"
,
"ssl-cipher"
,
"max-allowed-packet"
,
"protocol"
,
"shared-memory-base-name"
,
"multi-results"
,
"multi-statements"
,
"multi-queries"
,
"secure-auth"
,
"report-data-truncation"
,
"plugin-dir"
,
"default-auth"
,
"enable-cleartext-plugin"
,
"report-data-truncation"
,
"plugin-dir"
,
"default-auth"
,
NullS
};
enum
option_id
{
...
...
@@ -1149,7 +1148,6 @@ enum option_id {
OPT_ssl_cipher
,
OPT_max_allowed_packet
,
OPT_protocol
,
OPT_shared_memory_base_name
,
OPT_multi_results
,
OPT_multi_statements
,
OPT_multi_queries
,
OPT_secure_auth
,
OPT_report_data_truncation
,
OPT_plugin_dir
,
OPT_default_auth
,
OPT_enable_cleartext_plugin
,
OPT_keep_this_one_last
};
...
...
@@ -1182,27 +1180,14 @@ static int add_init_command(struct st_mysql_options *options, const char *cmd)
return
0
;
}
#define ALLOCATE_EXTENSIONS(OPTS) \
#define EXTENSION_SET_STRING(OPTS, X, STR) \
if ((OPTS)->extension) \
my_free((OPTS)->extension->X); \
else \
(OPTS)->extension= (struct st_mysql_options_extention *) \
my_malloc(sizeof(struct st_mysql_options_extention), \
MYF(MY_WME | MY_ZEROFILL)) \
#define ENSURE_EXTENSIONS_PRESENT(OPTS) \
do { \
if (!(OPTS)->extension) \
ALLOCATE_EXTENSIONS(OPTS); \
} while (0)
#define EXTENSION_SET_STRING(OPTS, X, STR) \
do { \
if ((OPTS)->extension) \
my_free((OPTS)->extension->X); \
else \
ALLOCATE_EXTENSIONS(OPTS); \
(OPTS)->extension->X= ((STR) != NULL) ? \
my_strdup((STR), MYF(MY_WME)) : NULL; \
} while (0)
MYF(MY_WME | MY_ZEROFILL)); \
(OPTS)->extension->X= my_strdup((STR), MYF(MY_WME));
void
mysql_read_default_options
(
struct
st_mysql_options
*
options
,
const
char
*
filename
,
const
char
*
group
)
...
...
@@ -1401,13 +1386,6 @@ void mysql_read_default_options(struct st_mysql_options *options,
case
OPT_default_auth
:
EXTENSION_SET_STRING
(
options
,
default_auth
,
opt_arg
);
break
;
case
OPT_enable_cleartext_plugin
:
ENSURE_EXTENSIONS_PRESENT
(
options
);
options
->
extension
->
enable_cleartext_plugin
=
(
!
opt_arg
||
atoi
(
opt_arg
)
!=
0
)
?
TRUE
:
FALSE
;
break
;
default:
DBUG_PRINT
(
"warning"
,(
"unknown option: %s"
,
option
[
0
]));
}
...
...
@@ -2804,27 +2782,6 @@ static void client_mpvio_info(MYSQL_PLUGIN_VIO *vio,
mpvio_info
(
mpvio
->
mysql
->
net
.
vio
,
info
);
}
my_bool
libmysql_cleartext_plugin_enabled
=
0
;
static
my_bool
check_plugin_enabled
(
MYSQL
*
mysql
,
auth_plugin_t
*
plugin
)
{
if
(
plugin
==
&
clear_password_client_plugin
&&
(
!
libmysql_cleartext_plugin_enabled
&&
(
!
mysql
->
options
.
extension
||
!
mysql
->
options
.
extension
->
enable_cleartext_plugin
)))
{
set_mysql_extended_error
(
mysql
,
CR_AUTH_PLUGIN_CANNOT_LOAD
,
unknown_sqlstate
,
ER
(
CR_AUTH_PLUGIN_CANNOT_LOAD
),
clear_password_client_plugin
.
name
,
"plugin not enabled"
);
return
TRUE
;
}
return
FALSE
;
}
/**
Client side of the plugin driver authentication.
...
...
@@ -2867,9 +2824,6 @@ int run_plugin_auth(MYSQL *mysql, char *data, uint data_len,
auth_plugin_name
=
auth_plugin
->
name
;
}
if
(
check_plugin_enabled
(
mysql
,
auth_plugin
))
DBUG_RETURN
(
1
);
DBUG_PRINT
(
"info"
,
(
"using plugin %s"
,
auth_plugin_name
));
mysql
->
net
.
last_errno
=
0
;
/* just in case */
...
...
@@ -2961,9 +2915,6 @@ int run_plugin_auth(MYSQL *mysql, char *data, uint data_len,
auth_plugin_name
,
MYSQL_CLIENT_AUTHENTICATION_PLUGIN
)))
DBUG_RETURN
(
1
);
if
(
check_plugin_enabled
(
mysql
,
auth_plugin
))
DBUG_RETURN
(
1
);
mpvio
.
plugin
=
auth_plugin
;
res
=
auth_plugin
->
authenticate_user
((
struct
st_plugin_vio
*
)
&
mpvio
,
mysql
);
...
...
@@ -4172,11 +4123,6 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg)
case
MYSQL_DEFAULT_AUTH
:
EXTENSION_SET_STRING
(
&
mysql
->
options
,
default_auth
,
arg
);
break
;
case
MYSQL_ENABLE_CLEARTEXT_PLUGIN
:
ENSURE_EXTENSIONS_PRESENT
(
&
mysql
->
options
);
mysql
->
options
.
extension
->
enable_cleartext_plugin
=
(
*
(
my_bool
*
)
arg
)
?
TRUE
:
FALSE
;
break
;
default:
DBUG_RETURN
(
1
);
}
...
...
@@ -4396,3 +4342,5 @@ static int clear_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
return
res
?
CR_ERROR
:
CR_OK
;
}
sql-common/client_plugin.c
View file @
704898bf
...
...
@@ -197,10 +197,6 @@ add_plugin(MYSQL *mysql, struct st_mysql_client_plugin *plugin, void *dlhandle,
static
void
load_env_plugins
(
MYSQL
*
mysql
)
{
char
*
plugs
,
*
free_env
,
*
s
=
getenv
(
"LIBMYSQL_PLUGINS"
);
char
*
enable_cleartext_plugin
=
getenv
(
"LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN"
);
if
(
enable_cleartext_plugin
&&
strchr
(
"1Yy"
,
enable_cleartext_plugin
[
0
]))
libmysql_cleartext_plugin_enabled
=
1
;
/* no plugins to load */
if
(
!
s
)
...
...
@@ -216,7 +212,6 @@ static void load_env_plugins(MYSQL *mysql)
}
while
(
s
);
my_free
(
free_env
);
}
/********** extern functions to be used by libmysql *********************/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment