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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
d19c8519
Commit
d19c8519
authored
Oct 12, 2005
by
gluh@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
4.1->5.0 merge
parents
5513ab69
8d01ea1b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
98 additions
and
1 deletion
+98
-1
sql/mysqld.cc
sql/mysqld.cc
+97
-0
sql/sql_parse.cc
sql/sql_parse.cc
+1
-1
No files found.
sql/mysqld.cc
View file @
d19c8519
...
@@ -579,8 +579,22 @@ HANDLE smem_event_connect_request= 0;
...
@@ -579,8 +579,22 @@ HANDLE smem_event_connect_request= 0;
#include "sslopt-vars.h"
#include "sslopt-vars.h"
#ifdef HAVE_OPENSSL
#ifdef HAVE_OPENSSL
#include <openssl/crypto.h>
typedef
struct
CRYPTO_dynlock_value
{
rw_lock_t
lock
;
}
openssl_lock_t
;
char
*
des_key_file
;
char
*
des_key_file
;
struct
st_VioSSLAcceptorFd
*
ssl_acceptor_fd
;
struct
st_VioSSLAcceptorFd
*
ssl_acceptor_fd
;
static
openssl_lock_t
*
openssl_stdlocks
;
static
openssl_lock_t
*
openssl_dynlock_create
(
const
char
*
,
int
);
static
void
openssl_dynlock_destroy
(
openssl_lock_t
*
,
const
char
*
,
int
);
static
void
openssl_lock_function
(
int
,
int
,
const
char
*
,
int
);
static
void
openssl_lock
(
int
,
openssl_lock_t
*
,
const
char
*
,
int
);
static
unsigned
long
openssl_id_function
();
#endif
/* HAVE_OPENSSL */
#endif
/* HAVE_OPENSSL */
...
@@ -1170,6 +1184,9 @@ static void clean_up_mutexes()
...
@@ -1170,6 +1184,9 @@ static void clean_up_mutexes()
(
void
)
pthread_mutex_destroy
(
&
LOCK_user_conn
);
(
void
)
pthread_mutex_destroy
(
&
LOCK_user_conn
);
#ifdef HAVE_OPENSSL
#ifdef HAVE_OPENSSL
(
void
)
pthread_mutex_destroy
(
&
LOCK_des_key_file
);
(
void
)
pthread_mutex_destroy
(
&
LOCK_des_key_file
);
for
(
int
i
=
0
;
i
<
CRYPTO_num_locks
();
++
i
)
(
void
)
rwlock_destroy
(
&
openssl_stdlocks
[
i
].
lock
);
OPENSSL_free
(
openssl_stdlocks
);
#endif
#endif
#ifdef HAVE_REPLICATION
#ifdef HAVE_REPLICATION
(
void
)
pthread_mutex_destroy
(
&
LOCK_rpl_status
);
(
void
)
pthread_mutex_destroy
(
&
LOCK_rpl_status
);
...
@@ -2754,10 +2771,90 @@ static int init_thread_environment()
...
@@ -2754,10 +2771,90 @@ static int init_thread_environment()
sql_print_error
(
"Can't create thread-keys"
);
sql_print_error
(
"Can't create thread-keys"
);
return
1
;
return
1
;
}
}
#ifdef HAVE_OPENSSL
openssl_stdlocks
=
(
openssl_lock_t
*
)
OPENSSL_malloc
(
CRYPTO_num_locks
()
*
sizeof
(
openssl_lock_t
));
for
(
int
i
=
0
;
i
<
CRYPTO_num_locks
();
++
i
)
(
void
)
my_rwlock_init
(
&
openssl_stdlocks
[
i
].
lock
,
NULL
);
CRYPTO_set_dynlock_create_callback
(
openssl_dynlock_create
);
CRYPTO_set_dynlock_destroy_callback
(
openssl_dynlock_destroy
);
CRYPTO_set_dynlock_lock_callback
(
openssl_lock
);
CRYPTO_set_locking_callback
(
openssl_lock_function
);
CRYPTO_set_id_callback
(
openssl_id_function
);
#endif
return
0
;
return
0
;
}
}
#ifdef HAVE_OPENSSL
static
unsigned
long
openssl_id_function
()
{
return
(
unsigned
long
)
pthread_self
();
}
static
openssl_lock_t
*
openssl_dynlock_create
(
const
char
*
file
,
int
line
)
{
openssl_lock_t
*
lock
=
new
openssl_lock_t
;
my_rwlock_init
(
&
lock
->
lock
,
NULL
);
return
lock
;
}
static
void
openssl_dynlock_destroy
(
openssl_lock_t
*
lock
,
const
char
*
file
,
int
line
)
{
rwlock_destroy
(
&
lock
->
lock
);
delete
lock
;
}
static
void
openssl_lock_function
(
int
mode
,
int
n
,
const
char
*
file
,
int
line
)
{
if
(
n
<
0
||
n
>
CRYPTO_num_locks
())
{
/* Lock number out of bounds. */
sql_print_error
(
"Fatal: OpenSSL interface problem (n = %d)"
,
n
);
abort
();
}
openssl_lock
(
mode
,
&
openssl_stdlocks
[
n
],
file
,
line
);
}
static
void
openssl_lock
(
int
mode
,
openssl_lock_t
*
lock
,
const
char
*
file
,
int
line
)
{
int
err
;
char
const
*
what
;
switch
(
mode
)
{
case
CRYPTO_LOCK
|
CRYPTO_READ
:
what
=
"read lock"
;
err
=
rw_rdlock
(
&
lock
->
lock
);
break
;
case
CRYPTO_LOCK
|
CRYPTO_WRITE
:
what
=
"write lock"
;
err
=
rw_wrlock
(
&
lock
->
lock
);
break
;
case
CRYPTO_UNLOCK
|
CRYPTO_READ
:
case
CRYPTO_UNLOCK
|
CRYPTO_WRITE
:
what
=
"unlock"
;
err
=
rw_unlock
(
&
lock
->
lock
);
break
;
default:
/* Unknown locking mode. */
sql_print_error
(
"Fatal: OpenSSL interface problem (mode=0x%x)"
,
mode
);
abort
();
}
if
(
err
)
{
sql_print_error
(
"Fatal: can't %s OpenSSL %s lock"
,
what
);
abort
();
}
}
#endif
/* HAVE_OPENSSL */
static
void
init_ssl
()
static
void
init_ssl
()
{
{
#ifdef HAVE_OPENSSL
#ifdef HAVE_OPENSSL
...
...
sql/sql_parse.cc
View file @
d19c8519
...
@@ -2402,7 +2402,7 @@ mysql_execute_command(THD *thd)
...
@@ -2402,7 +2402,7 @@ mysql_execute_command(THD *thd)
}
}
#endif
#endif
}
}
#endif
/*
!
HAVE_REPLICATION */
#endif
/* HAVE_REPLICATION */
/*
/*
When option readonly is set deny operations which change tables.
When option readonly is set deny operations which change tables.
...
...
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