Blame SOURCES/mysql-dubious-exports.patch

6f9931
Prefix mysql_ to the real names of several symbols that have to be exported
6f9931
from libmysqlclient because mysql-connector-odbc and/or PHP depend on them.
6f9931
This limits the intrusion on application namespace.
6f9931
6f9931
Also, remove all traces of make_scrambled_password and
6f9931
make_scrambled_password_323, so that references to these functions draw
6f9931
compile-time warnings, per a suggestion from Paul Howarth in bug #690346.
6f9931
It doesn't seem worth trying to get rid of all the internal symbols exposed
6f9931
by mysql.h, but these two are relatively easy to get rid of.
6f9931
6f9931
6f9931
diff -Naur mysql-5.5.14.orig/client/mysqladmin.cc mysql-5.5.14/client/mysqladmin.cc
6f9931
--- mysql-5.5.14.orig/client/mysqladmin.cc	2011-06-21 12:42:41.000000000 -0400
6f9931
+++ mysql-5.5.14/client/mysqladmin.cc	2011-07-12 12:19:59.578066771 -0400
6f9931
@@ -20,6 +20,7 @@
6f9931
 #include <my_pthread.h>				/* because of signal()	*/
6f9931
 #include <sys/stat.h>
6f9931
 #include <mysql.h>
6f9931
+#include <password.h>       /* my_make_scrambled_password_323, my_make_scrambled_password */
6f9931
 #include <sql_common.h>
6f9931
 #include <welcome_copyright_notice.h>           /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
6f9931
 
6f9931
@@ -975,9 +976,9 @@
6f9931
           }
6f9931
         }
6f9931
         if (old)
6f9931
-          make_scrambled_password_323(crypted_pw, typed_password);
6f9931
+          my_make_scrambled_password_323(crypted_pw, typed_password, strlen(typed_password));
6f9931
         else
6f9931
-          make_scrambled_password(crypted_pw, typed_password);
6f9931
+          my_make_scrambled_password(crypted_pw, typed_password, strlen(typed_password));
6f9931
       }
6f9931
       else
6f9931
 	crypted_pw[0]=0;			/* No password */
6f9931
diff -Naur mysql-5.5.14.orig/include/errmsg.h mysql-5.5.14/include/errmsg.h
6f9931
--- mysql-5.5.14.orig/include/errmsg.h	2011-06-21 12:42:39.000000000 -0400
6f9931
+++ mysql-5.5.14/include/errmsg.h	2011-07-12 11:55:29.194204015 -0400
6f9931
@@ -24,6 +24,7 @@
6f9931
 #endif
6f9931
 void	init_client_errs(void);
6f9931
 void	finish_client_errs(void);
6f9931
+#define client_errors mysql_client_errors		/* namespace sanity */
6f9931
 extern const char *client_errors[];	/* Error messages */
6f9931
 #ifdef	__cplusplus
6f9931
 }
6f9931
diff -Naur mysql-5.5.14.orig/include/my_sys.h mysql-5.5.14/include/my_sys.h
6f9931
--- mysql-5.5.14.orig/include/my_sys.h	2011-06-21 12:42:39.000000000 -0400
6f9931
+++ mysql-5.5.14/include/my_sys.h	2011-07-12 11:55:29.195231427 -0400
6f9931
@@ -223,6 +223,7 @@
6f9931
 
6f9931
 /* charsets */
6f9931
 #define MY_ALL_CHARSETS_SIZE 2048
6f9931
+#define default_charset_info mysql_default_charset_info	/* namespace sanity */
6f9931
 extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *default_charset_info;
6f9931
 extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *all_charsets[MY_ALL_CHARSETS_SIZE];
6f9931
 extern CHARSET_INFO compiled_charsets[];
6f9931
@@ -900,6 +901,9 @@
6f9931
 extern uint get_collation_number(const char *name);
6f9931
 extern const char *get_charset_name(uint cs_number);
6f9931
 
6f9931
+#define get_charset mysql_get_charset		/* namespace sanity */
6f9931
+#define get_charset_by_csname mysql_get_charset_by_csname
6f9931
+
6f9931
 extern CHARSET_INFO *get_charset(uint cs_number, myf flags);
6f9931
 extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags);
6f9931
 extern CHARSET_INFO *get_charset_by_csname(const char *cs_name,
6f9931
diff -Naur mysql-5.5.14.orig/include/mysql.h.pp mysql-5.5.14/include/mysql.h.pp
6f9931
--- mysql-5.5.14.orig/include/mysql.h.pp	2011-06-21 12:42:39.000000000 -0400
6f9931
+++ mysql-5.5.14/include/mysql.h.pp	2011-07-12 11:58:43.662068564 -0400
6f9931
@@ -86,7 +86,7 @@
6f9931
 void my_net_local_init(NET *net);
6f9931
 void net_end(NET *net);
6f9931
   void net_clear(NET *net, my_bool clear_buffer);
6f9931
-my_bool net_realloc(NET *net, size_t length);
6f9931
+my_bool mysql_net_realloc(NET *net, size_t length);
6f9931
 my_bool net_flush(NET *net);
6f9931
 my_bool my_net_write(NET *net,const unsigned char *packet, size_t len);
6f9931
 my_bool net_write_command(NET *net,unsigned char command,
6f9931
@@ -128,13 +128,11 @@
6f9931
 double my_rnd(struct rand_struct *);
6f9931
 void create_random_string(char *to, unsigned int length, struct rand_struct *rand_st);
6f9931
 void hash_password(unsigned long *to, const char *password, unsigned int password_len);
6f9931
-void make_scrambled_password_323(char *to, const char *password);
6f9931
 void scramble_323(char *to, const char *message, const char *password);
6f9931
 my_bool check_scramble_323(const unsigned char *reply, const char *message,
6f9931
                            unsigned long *salt);
6f9931
 void get_salt_from_password_323(unsigned long *res, const char *password);
6f9931
 void make_password_from_salt_323(char *to, const unsigned long *salt);
6f9931
-void make_scrambled_password(char *to, const char *password);
6f9931
 void scramble(char *to, const char *message, const char *password);
6f9931
 my_bool check_scramble(const unsigned char *reply, const char *message,
6f9931
                        const unsigned char *hash_stage2);
6f9931
diff -Naur mysql-5.5.14.orig/include/mysql_com.h mysql-5.5.14/include/mysql_com.h
6f9931
--- mysql-5.5.14.orig/include/mysql_com.h	2011-06-21 12:42:39.000000000 -0400
6f9931
+++ mysql-5.5.14/include/mysql_com.h	2011-07-12 11:58:52.166065391 -0400
6f9931
@@ -452,6 +452,7 @@
6f9931
 void	my_net_local_init(NET *net);
6f9931
 void	net_end(NET *net);
6f9931
   void	net_clear(NET *net, my_bool clear_buffer);
6f9931
+#define net_realloc mysql_net_realloc		/* namespace sanity */
6f9931
 my_bool net_realloc(NET *net, size_t length);
6f9931
 my_bool	net_flush(NET *net);
6f9931
 my_bool	my_net_write(NET *net,const unsigned char *packet, size_t len);
6f9931
@@ -533,14 +534,12 @@
6f9931
 void create_random_string(char *to, unsigned int length, struct rand_struct *rand_st);
6f9931
 
6f9931
 void hash_password(unsigned long *to, const char *password, unsigned int password_len);
6f9931
-void make_scrambled_password_323(char *to, const char *password);
6f9931
 void scramble_323(char *to, const char *message, const char *password);
6f9931
 my_bool check_scramble_323(const unsigned char *reply, const char *message,
6f9931
                            unsigned long *salt);
6f9931
 void get_salt_from_password_323(unsigned long *res, const char *password);
6f9931
 void make_password_from_salt_323(char *to, const unsigned long *salt);
6f9931
 
6f9931
-void make_scrambled_password(char *to, const char *password);
6f9931
 void scramble(char *to, const char *message, const char *password);
6f9931
 my_bool check_scramble(const unsigned char *reply, const char *message,
6f9931
                        const unsigned char *hash_stage2);
6f9931
diff -Naur mysql-5.5.14.orig/sql/password.c mysql-5.5.14/sql/password.c
6f9931
--- mysql-5.5.14.orig/sql/password.c	2011-06-21 12:42:40.000000000 -0400
6f9931
+++ mysql-5.5.14/sql/password.c	2011-07-12 11:59:29.194068612 -0400
6f9931
@@ -154,23 +154,6 @@
6f9931
 
6f9931
 
6f9931
 /*
6f9931
-  Wrapper around my_make_scrambled_password_323() to maintain client lib ABI
6f9931
-  compatibility.
6f9931
-  In server code usage of my_make_scrambled_password_323() is preferred to
6f9931
-  avoid strlen().
6f9931
-  SYNOPSIS
6f9931
-    make_scrambled_password_323()
6f9931
-    to        OUT store scrambled password here
6f9931
-    password  IN  NULL-terminated string with user-supplied password
6f9931
-*/
6f9931
-
6f9931
-void make_scrambled_password_323(char *to, const char *password)
6f9931
-{
6f9931
-  my_make_scrambled_password_323(to, password, strlen(password));
6f9931
-}
6f9931
-
6f9931
-
6f9931
-/*
6f9931
     Scramble string with password.
6f9931
     Used in pre 4.1 authentication phase.
6f9931
   SYNOPSIS
6f9931
@@ -433,23 +416,6 @@
6f9931
   
6f9931
 
6f9931
 /*
6f9931
-  Wrapper around my_make_scrambled_password() to maintain client lib ABI
6f9931
-  compatibility.
6f9931
-  In server code usage of my_make_scrambled_password() is preferred to
6f9931
-  avoid strlen().
6f9931
-  SYNOPSIS
6f9931
-    make_scrambled_password()
6f9931
-    buf       OUT buffer of size 2*SHA1_HASH_SIZE + 2 to store hex string
6f9931
-    password  IN  NULL-terminated password string
6f9931
-*/
6f9931
-
6f9931
-void make_scrambled_password(char *to, const char *password)
6f9931
-{
6f9931
-  my_make_scrambled_password(to, password, strlen(password));
6f9931
-}
6f9931
-
6f9931
-
6f9931
-/*
6f9931
     Produce an obscure octet sequence from password and random
6f9931
     string, recieved from the server. This sequence corresponds to the
6f9931
     password, but password can not be easily restored from it. The sequence