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
e64ee41c
Commit
e64ee41c
authored
Jun 20, 2012
by
Kent Boortz
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
51abe0fa
13617a20
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
60 deletions
+5
-60
configure.in
configure.in
+1
-1
sql/hostname.cc
sql/hostname.cc
+0
-9
sql/sql_connect.cc
sql/sql_connect.cc
+4
-50
No files found.
configure.in
View file @
e64ee41c
...
...
@@ -12,7 +12,7 @@ dnl
dnl When changing the major version number please also check the switch
dnl statement
in
mysqlbinlog::check_master_version
()
.
You may also need
dnl to update version.c
in
ndb.
AC_INIT
([
MySQL Server],
[
5.1.6
4
],
[]
,
[
mysql]
)
AC_INIT
([
MySQL Server],
[
5.1.6
5
],
[]
,
[
mysql]
)
AC_CONFIG_SRCDIR
([
sql/mysqld.cc]
)
AC_CANONICAL_SYSTEM
...
...
sql/hostname.cc
View file @
e64ee41c
...
...
@@ -214,15 +214,6 @@ char * ip_to_hostname(struct in_addr *in, uint *errors)
}
my_gethostbyname_r_free
();
#else
DBUG_EXECUTE_IF
(
"addr_fake_ipv4"
,
{
const
char
*
fake_host
=
"santa.claus.ipv4.example.com"
;
name
=
my_strdup
(
fake_host
,
MYF
(
0
));
add_hostname
(
in
,
name
);
DBUG_RETURN
(
name
);
};);
VOID
(
pthread_mutex_lock
(
&
LOCK_hostname
));
if
(
!
(
hp
=
gethostbyaddr
((
char
*
)
in
,
sizeof
(
*
in
),
AF_INET
)))
{
...
...
sql/sql_connect.cc
View file @
e64ee41c
...
...
@@ -360,6 +360,7 @@ check_user(THD *thd, enum enum_server_command command,
if
(
send_old_password_request
(
thd
)
||
my_net_read
(
net
)
!=
SCRAMBLE_LENGTH_323
+
1
)
{
inc_host_errors
(
&
thd
->
remote
.
sin_addr
);
my_error
(
ER_HANDSHAKE_ERROR
,
MYF
(
0
));
DBUG_RETURN
(
1
);
}
...
...
@@ -831,19 +832,6 @@ static int check_connection(THD *thd)
my_error
(
ER_BAD_HOST_ERROR
,
MYF
(
0
));
return
1
;
}
/* BEGIN : DEBUG */
DBUG_EXECUTE_IF
(
"addr_fake_ipv4"
,
{
struct
sockaddr
*
sa
=
(
sockaddr
*
)
&
net
->
vio
->
remote
;
sa
->
sa_family
=
AF_INET
;
struct
in_addr
*
ip4
=
&
((
struct
sockaddr_in
*
)
sa
)
->
sin_addr
;
/* See RFC 5737, 192.0.2.0/23 is reserved */
const
char
*
fake
=
"192.0.2.4"
;
ip4
->
s_addr
=
inet_addr
(
fake
);
strcpy
(
ip
,
fake
);
};);
/* END : DEBUG */
if
(
!
(
thd
->
main_security_ctx
.
ip
=
my_strdup
(
ip
,
MYF
(
MY_WME
))))
return
1
;
/* The error is set by my_strdup(). */
thd
->
main_security_ctx
.
host_or_ip
=
thd
->
main_security_ctx
.
ip
;
...
...
@@ -947,6 +935,8 @@ static int check_connection(THD *thd)
#ifdef _CUSTOMCONFIG_
#include "_cust_sql_parse.h"
#endif
if
(
connect_errors
)
reset_host_errors
(
&
thd
->
remote
.
sin_addr
);
if
(
thd
->
packet
.
alloc
(
thd
->
variables
.
net_buffer_length
))
return
1
;
/* The error is set by alloc(). */
...
...
@@ -963,10 +953,6 @@ static int check_connection(THD *thd)
Peek ahead on the client capability packet and determine which version of
the protocol should be used.
*/
DBUG_EXECUTE_IF
(
"host_error_packet_length"
,
{
bytes_remaining_in_packet
=
0
;
};);
if
(
bytes_remaining_in_packet
<
2
)
goto
error
;
...
...
@@ -1025,10 +1011,6 @@ static int check_connection(THD *thd)
skip_to_ssl:
DBUG_EXECUTE_IF
(
"host_error_charset"
,
{
goto
error
;
};);
DBUG_PRINT
(
"info"
,
(
"client_character_set: %u"
,
charset_code
));
if
(
thd_init_client_charset
(
thd
,
charset_code
))
goto
error
;
...
...
@@ -1097,10 +1079,6 @@ static int check_connection(THD *thd)
bytes_remaining_in_packet
-=
AUTH_PACKET_HEADER_SIZE_PROTO_40
;
}
DBUG_EXECUTE_IF
(
"host_error_SSL_layering"
,
{
packet_has_required_size
=
0
;
};);
if
(
!
packet_has_required_size
)
goto
error
;
}
...
...
@@ -1126,11 +1104,6 @@ static int check_connection(THD *thd)
get_string
=
get_40_protocol_string
;
user
=
get_string
(
&
end
,
&
bytes_remaining_in_packet
,
&
user_len
);
DBUG_EXECUTE_IF
(
"host_error_user"
,
{
user
=
NULL
;
};);
if
(
user
==
NULL
)
goto
error
;
...
...
@@ -1158,11 +1131,6 @@ static int check_connection(THD *thd)
passwd
=
get_string
(
&
end
,
&
bytes_remaining_in_packet
,
&
passwd_len
);
}
DBUG_EXECUTE_IF
(
"host_error_password"
,
{
passwd
=
NULL
;
};);
if
(
passwd
==
NULL
)
goto
error
;
...
...
@@ -1223,21 +1191,7 @@ static int check_connection(THD *thd)
if
(
!
(
thd
->
main_security_ctx
.
user
=
my_strdup
(
user
,
MYF
(
MY_WME
))))
return
1
;
/* The error is set by my_strdup(). */
if
(
!
check_user
(
thd
,
COM_CONNECT
,
passwd
,
passwd_len
,
db
,
TRUE
))
{
/*
Call to reset_host_errors() should be made only when all sanity checks
are done and connection is going to be a successful.
*/
reset_host_errors
(
&
thd
->
remote
.
sin_addr
);
return
0
;
}
else
{
inc_host_errors
(
&
thd
->
remote
.
sin_addr
);
return
1
;
}
return
check_user
(
thd
,
COM_CONNECT
,
passwd
,
passwd_len
,
db
,
TRUE
);
error:
inc_host_errors
(
&
thd
->
remote
.
sin_addr
);
...
...
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