Skip to content

Commit ad88f2a

Browse files
harinvadodariabkandasa
authored andcommitted
Bug#25942414: SSL VARIABLES USAGE WHEN LIBMYSQL IS COMPILED WITH WITH_SSL=NO
Description: If libmysql is compiled with WITH_SSL=NO, --ssl-* are not useful. Solution: 1. Restricted WITH_SSL to values : bundled | yes | system 2. Made "bundled" as default value for WITH_SSL. Also, not specifying WITH_SSL or even specifying WITH_SSL=no will be treated as/converted to WITH_SSL=bundled. Reviewed-By: Tor Didriksen <[email protected]> Reviewed-By: Georgi Kodinov <[email protected]> (cherry picked from commit 3eb2058be34d1a21771fe89ff1a0c08f156899bc)
1 parent c230d3a commit ad88f2a

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

cmake/build_configurations/mysql_release.cmake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by
@@ -169,7 +169,6 @@ IF(UNIX)
169169
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "+O2 ${COMMON_CXX_FLAGS}")
170170
ENDIF()
171171
ENDIF()
172-
SET(WITH_SSL no)
173172
ENDIF()
174173

175174
# Linux flags
@@ -185,7 +184,6 @@ IF(UNIX)
185184
SET(CMAKE_CXX_FLAGS_DEBUG "${COMMON_CXX_FLAGS}")
186185
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -unroll2 -ip ${COMMON_C_FLAGS}")
187186
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -unroll2 -ip ${COMMON_CXX_FLAGS}")
188-
SET(WITH_SSL no)
189187
ENDIF()
190188
ENDIF()
191189

cmake/ssl.cmake

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by
@@ -11,10 +11,16 @@
1111
#
1212
# You should have received a copy of the GNU General Public License
1313
# along with this program; if not, write to the Free Software
14-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
14+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
15+
16+
SET(WITH_SSL_DOC "bundled (use yassl)")
17+
SET(WITH_SSL_DOC
18+
"${WITH_SSL_DOC}, yes (prefer os library if present, otherwise use bundled)")
19+
SET(WITH_SSL_DOC
20+
"${WITH_SSL_DOC}, system (use os library)")
1521

1622
MACRO (CHANGE_SSL_SETTINGS string)
17-
SET(WITH_SSL ${string} CACHE STRING "Options are : no, bundled, yes (prefer os library if present otherwise use bundled), system (use os library)" FORCE)
23+
SET(WITH_SSL ${string} CACHE STRING ${WITH_SSL_DOC} FORCE)
1824
ENDMACRO()
1925

2026
MACRO (MYSQL_USE_BUNDLED_SSL)
@@ -50,14 +56,12 @@ ENDMACRO()
5056
# MYSQL_CHECK_SSL
5157
#
5258
# Provides the following configure options:
53-
# WITH_SSL=[yes|no|bundled]
59+
# WITH_SSL=[bundled|yes|system]
5460
MACRO (MYSQL_CHECK_SSL)
5561
IF(NOT WITH_SSL)
56-
IF(WIN32)
5762
CHANGE_SSL_SETTINGS("bundled")
58-
ELSE()
59-
CHANGE_SSL_SETTINGS("no")
60-
ENDIF()
63+
MESSAGE(STATUS "Found WITH_SSL set to no. "
64+
"Changing it to bundled")
6165
ENDIF()
6266

6367
IF(WITH_SSL STREQUAL "bundled")
@@ -80,11 +84,12 @@ MACRO (MYSQL_CHECK_SSL)
8084
CHANGE_SSL_SETTINGS("system")
8185
ELSE()
8286
IF(WITH_SSL STREQUAL "system")
83-
MESSAGE(SEND_ERROR "Cannot find appropriate system libraries for SSL. Use WITH_SSL=bundled to enable SSL support")
87+
MESSAGE(SEND_ERROR "Cannot find appropriate system libraries for SSL. Use WITH_SSL=bundled to enable SSL support")
8488
ENDIF()
8589
MYSQL_USE_BUNDLED_SSL()
8690
ENDIF()
87-
ELSEIF(NOT WITH_SSL STREQUAL "no")
88-
MESSAGE(SEND_ERROR "Wrong option for WITH_SSL. Valid values are : yes, no, bundled")
91+
ELSE()
92+
MESSAGE(SEND_ERROR "Wrong option for WITH_SSL. "
93+
"Valid options are : ${WITH_SSL_DOC}")
8994
ENDIF()
9095
ENDMACRO()

0 commit comments

Comments
 (0)