Use upstream's layout for symbols version in client library

Related: #1045013
This commit is contained in:
Honza Horák 2014-01-06 12:00:39 +01:00
parent de206ed6cd
commit 36b8db2178
3 changed files with 3 additions and 194 deletions

View File

@ -1,169 +0,0 @@
Prefix mysql_ to the real names of several symbols that have to be exported
from libmysqlclient because mysql-connector-odbc and/or PHP depend on them.
This limits the intrusion on application namespace.
Also, remove all traces of make_scrambled_password and
make_scrambled_password_323, so that references to these functions draw
compile-time warnings, per a suggestion from Paul Howarth in bug #690346.
It doesn't seem worth trying to get rid of all the internal symbols exposed
by mysql.h, but these two are relatively easy to get rid of.
diff -up mariadb-5.5.28a/client/mysqladmin.cc.p6 mariadb-5.5.28a/client/mysqladmin.cc
--- mariadb-5.5.28a/client/mysqladmin.cc.p6 2012-11-28 16:49:36.000000000 +0100
+++ mariadb-5.5.28a/client/mysqladmin.cc 2013-01-30 16:30:55.047537674 +0100
@@ -22,6 +22,7 @@
#include <my_pthread.h> /* because of signal() */
#include <sys/stat.h>
#include <mysql.h>
+#include <password.h> /* my_make_scrambled_password_323, my_make_scrambled_password */
#include <sql_common.h>
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
@@ -1065,9 +1066,9 @@ static int execute_commands(MYSQL *mysql
}
}
if (old)
- make_scrambled_password_323(crypted_pw, typed_password);
+ my_make_scrambled_password_323(crypted_pw, typed_password, strlen(typed_password));
else
- make_scrambled_password(crypted_pw, typed_password);
+ my_make_scrambled_password(crypted_pw, typed_password, strlen(typed_password));
}
else
crypted_pw[0]=0; /* No password */
diff -up mariadb-5.5.28a/include/errmsg.h.p6 mariadb-5.5.28a/include/errmsg.h
--- mariadb-5.5.28a/include/errmsg.h.p6 2012-11-28 16:49:43.000000000 +0100
+++ mariadb-5.5.28a/include/errmsg.h 2013-01-30 16:30:55.047537674 +0100
@@ -24,6 +24,7 @@ extern "C" {
#endif
void init_client_errs(void);
void finish_client_errs(void);
+#define client_errors mysql_client_errors /* namespace sanity */
extern const char *client_errors[]; /* Error messages */
#ifdef __cplusplus
}
diff -up mariadb-5.5.28a/include/mysql_com.h.p6 mariadb-5.5.28a/include/mysql_com.h
--- mariadb-5.5.28a/include/mysql_com.h.p6 2012-11-28 16:49:38.000000000 +0100
+++ mariadb-5.5.28a/include/mysql_com.h 2013-01-30 16:30:55.047537674 +0100
@@ -467,6 +467,7 @@ my_bool my_net_init(NET *net, Vio* vio);
void my_net_local_init(NET *net);
void net_end(NET *net);
void net_clear(NET *net, my_bool clear_buffer);
+#define net_realloc mysql_net_realloc /* namespace sanity */
my_bool net_realloc(NET *net, size_t length);
my_bool net_flush(NET *net);
my_bool my_net_write(NET *net,const unsigned char *packet, size_t len);
@@ -545,14 +546,12 @@ void create_random_string(char *to, unsi
struct my_rnd_struct *rand_st);
void hash_password(unsigned long *to, const char *password, unsigned int password_len);
-void make_scrambled_password_323(char *to, const char *password);
void scramble_323(char *to, const char *message, const char *password);
my_bool check_scramble_323(const unsigned char *reply, const char *message,
unsigned long *salt);
void get_salt_from_password_323(unsigned long *res, const char *password);
void make_password_from_salt_323(char *to, const unsigned long *salt);
-void make_scrambled_password(char *to, const char *password);
void scramble(char *to, const char *message, const char *password);
my_bool check_scramble(const unsigned char *reply, const char *message,
const unsigned char *hash_stage2);
diff -up mariadb-5.5.28a/include/mysql.h.pp.p6 mariadb-5.5.28a/include/mysql.h.pp
--- mariadb-5.5.28a/include/mysql.h.pp.p6 2012-11-28 16:49:47.000000000 +0100
+++ mariadb-5.5.28a/include/mysql.h.pp 2013-01-30 16:30:55.048537674 +0100
@@ -84,7 +84,7 @@ my_bool my_net_init(NET *net, Vio* vio);
void my_net_local_init(NET *net);
void net_end(NET *net);
void net_clear(NET *net, my_bool clear_buffer);
-my_bool net_realloc(NET *net, size_t length);
+my_bool mysql_net_realloc(NET *net, size_t length);
my_bool net_flush(NET *net);
my_bool my_net_write(NET *net,const unsigned char *packet, size_t len);
my_bool net_write_command(NET *net,unsigned char command,
@@ -124,13 +124,11 @@ typedef struct st_udf_init
void create_random_string(char *to, unsigned int length,
struct my_rnd_struct *rand_st);
void hash_password(unsigned long *to, const char *password, unsigned int password_len);
-void make_scrambled_password_323(char *to, const char *password);
void scramble_323(char *to, const char *message, const char *password);
my_bool check_scramble_323(const unsigned char *reply, const char *message,
unsigned long *salt);
void get_salt_from_password_323(unsigned long *res, const char *password);
void make_password_from_salt_323(char *to, const unsigned long *salt);
-void make_scrambled_password(char *to, const char *password);
void scramble(char *to, const char *message, const char *password);
my_bool check_scramble(const unsigned char *reply, const char *message,
const unsigned char *hash_stage2);
diff -up mariadb-5.5.28a/include/my_sys.h.p6 mariadb-5.5.28a/include/my_sys.h
--- mariadb-5.5.28a/include/my_sys.h.p6 2013-01-30 16:30:54.980537678 +0100
+++ mariadb-5.5.28a/include/my_sys.h 2013-01-30 16:31:38.510534702 +0100
@@ -211,6 +211,7 @@ extern uint my_large_page_size;
/* charsets */
#define MY_ALL_CHARSETS_SIZE 2048
+#define default_charset_info mysql_default_charset_info /* namespace sanity */
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *default_charset_info;
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *all_charsets[MY_ALL_CHARSETS_SIZE];
extern struct charset_info_st compiled_charsets[];
@@ -943,6 +944,9 @@ extern uint get_charset_number(const cha
extern uint get_collation_number(const char *name);
extern const char *get_charset_name(uint cs_number);
+#define get_charset mysql_get_charset /* namespace sanity */
+#define get_charset_by_csname mysql_get_charset_by_csname
+
extern CHARSET_INFO *get_charset(uint cs_number, myf flags);
extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags);
extern CHARSET_INFO *get_charset_by_csname(const char *cs_name,
diff -up mariadb-5.5.28a/sql/password.c.p6 mariadb-5.5.28a/sql/password.c
--- mariadb-5.5.28a/sql/password.c.p6 2012-11-28 16:49:48.000000000 +0100
+++ mariadb-5.5.28a/sql/password.c 2013-01-30 16:30:55.048537674 +0100
@@ -127,23 +127,6 @@ void my_make_scrambled_password_323(char
/*
- Wrapper around my_make_scrambled_password_323() to maintain client lib ABI
- compatibility.
- In server code usage of my_make_scrambled_password_323() is preferred to
- avoid strlen().
- SYNOPSIS
- make_scrambled_password_323()
- to OUT store scrambled password here
- password IN NULL-terminated string with user-supplied password
-*/
-
-void make_scrambled_password_323(char *to, const char *password)
-{
- my_make_scrambled_password_323(to, password, strlen(password));
-}
-
-
-/*
Scramble string with password.
Used in pre 4.1 authentication phase.
SYNOPSIS
@@ -407,23 +390,6 @@ void my_make_scrambled_password(char *to
/*
- Wrapper around my_make_scrambled_password() to maintain client lib ABI
- compatibility.
- In server code usage of my_make_scrambled_password() is preferred to
- avoid strlen().
- SYNOPSIS
- make_scrambled_password()
- buf OUT buffer of size 2*SHA1_HASH_SIZE + 2 to store hex string
- password IN NULL-terminated password string
-*/
-
-void make_scrambled_password(char *to, const char *password)
-{
- my_make_scrambled_password(to, password, strlen(password));
-}
-
-
-/*
Produce an obscure octet sequence from password and random
string, recieved from the server. This sequence corresponds to the
password, but password can not be easily restored from it. The sequence

View File

@ -1,18 +0,0 @@
The symbol versioning solution for libmysqlclient in mysql 5.1 was pretty
awful (export everything) and as of 5.5.8 the cmake build scripts have
forgotten the issue entirely. So we now maintain our own list of exported
symbols and jam it into the build with this hack.
diff -up mariadb-5.5.29/libmysql/CMakeLists.txt.p5 mariadb-5.5.29/libmysql/CMakeLists.txt
--- mariadb-5.5.29/libmysql/CMakeLists.txt.p5 2013-01-29 15:12:46.000000000 +0100
+++ mariadb-5.5.29/libmysql/CMakeLists.txt 2013-02-01 10:44:28.449544405 +0100
@@ -363,7 +363,7 @@ IF(NOT DISABLE_SHARED)
SET(libmysql_link_flags)
ENDIF()
SET_TARGET_PROPERTIES(libmysql PROPERTIES LINK_FLAGS
- "${libmysql_link_flags} ${LINK_FLAG_NO_UNDEFINED} ${VERSION_SCRIPT_LINK_FLAGS}")
+ "${libmysql_link_flags} -Wl,--version-script=libmysql.version ${LINK_FLAG_NO_UNDEFINED}")
ENDIF()
# clean direct output needs to be set several targets have the same name
#(mysqlclient in this case)

View File

@ -56,8 +56,6 @@ Patch1: mariadb-errno.patch
Patch2: mariadb-strmov.patch
Patch3: mariadb-install-test.patch
Patch4: mariadb-expired-certs.patch
Patch5: mariadb-versioning.patch
Patch6: mariadb-dubious-exports.patch
Patch7: mariadb-s390-tsc.patch
Patch8: mariadb-logrotate.patch
Patch9: mariadb-cipherspec.patch
@ -260,8 +258,6 @@ MariaDB is a community developed branch of MySQL.
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
@ -277,9 +273,6 @@ MariaDB is a community developed branch of MySQL.
# workaround for upstream bug #56342
rm -f mysql-test/t/ssl_8k_key-master.opt
# upstream has fallen down badly on symbol versioning, do it ourselves
cp -p %{SOURCE8} libmysql/libmysql.version
# generate a list of tests that fail, but are not disabled by upstream
cat %{SOURCE14} > mysql-test/rh-skipped-tests.list
# disable some tests failing on ARM architectures
@ -323,6 +316,7 @@ export LDFLAGS
cmake . -DBUILD_CONFIG=mysql_release \
-DFEATURE_SET="community" \
-DINSTALL_LAYOUT=RPM \
-DRPM="%{?rhel:rhel%{rhel}}%{?fedora:fedora}" \
-DCMAKE_INSTALL_PREFIX="%{_prefix}" \
%if 0%{?fedora} >= 20
-DINSTALL_DOCDIR=share/doc/mariadb \
@ -805,6 +799,8 @@ fi
- Don't test EDH-RSA-DES-CBC-SHA cipher, it seems to be removed from openssl
which now makes mariadb/mysql FTBFS because openssl_1 test fails
Related: #1044565
- Use upstream's layout for symbols version in client library
Related: #1045013
* Wed Nov 27 2013 Honza Horak <hhorak@redhat.com> 1:5.5.34-2
- Fix mariadb-wait-ready script