7a5573f
Prefix mysql_ to the real names of several symbols that have to be exported
7a5573f
from libmysqlclient because mysql-connector-odbc and/or PHP depend on them.
7a5573f
This limits the intrusion on application namespace.
7a5573f
7a5573f
Also, remove all traces of make_scrambled_password and
7a5573f
make_scrambled_password_323, so that references to these functions draw
7a5573f
compile-time warnings, per a suggestion from Paul Howarth in bug #690346.
7a5573f
It doesn't seem worth trying to get rid of all the internal symbols exposed
7a5573f
by mysql.h, but these two are relatively easy to get rid of.
7a5573f
7a5573f
7a5573f
diff -up mysql-5.5.28/client/mysqladmin.cc.p8 mysql-5.5.28/client/mysqladmin.cc
7a5573f
--- mysql-5.5.28/client/mysqladmin.cc.p8	2012-08-29 10:50:46.000000000 +0200
7a5573f
+++ mysql-5.5.28/client/mysqladmin.cc	2012-12-06 14:16:14.598520859 +0100
7a5573f
@@ -21,6 +21,7 @@
7a5573f
 #include <my_pthread.h>				/* because of signal()	*/
7a5573f
 #include <sys/stat.h>
7a5573f
 #include <mysql.h>
7a5573f
+#include <password.h>       /* my_make_scrambled_password_323, my_make_scrambled_password */
7a5573f
 #include <sql_common.h>
7a5573f
 #include <welcome_copyright_notice.h>           /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
7a5573f
 
7a5573f
@@ -989,9 +990,9 @@ static int execute_commands(MYSQL *mysql
7a5573f
           }
7a5573f
         }
7a5573f
         if (old)
7a5573f
-          make_scrambled_password_323(crypted_pw, typed_password);
7a5573f
+          my_make_scrambled_password_323(crypted_pw, typed_password, strlen(typed_password));
7a5573f
         else
7a5573f
-          make_scrambled_password(crypted_pw, typed_password);
7a5573f
+          my_make_scrambled_password(crypted_pw, typed_password, strlen(typed_password));
7a5573f
       }
7a5573f
       else
7a5573f
 	crypted_pw[0]=0;			/* No password */
7a5573f
diff -up mysql-5.5.28/include/errmsg.h.p8 mysql-5.5.28/include/errmsg.h
7a5573f
--- mysql-5.5.28/include/errmsg.h.p8	2012-08-29 10:50:46.000000000 +0200
7a5573f
+++ mysql-5.5.28/include/errmsg.h	2012-12-06 14:16:14.598520859 +0100
7a5573f
@@ -24,6 +24,7 @@ extern "C" {
7a5573f
 #endif
7a5573f
 void	init_client_errs(void);
7a5573f
 void	finish_client_errs(void);
7a5573f
+#define client_errors mysql_client_errors		/* namespace sanity */
7a5573f
 extern const char *client_errors[];	/* Error messages */
7a5573f
 #ifdef	__cplusplus
7a5573f
 }
7a5573f
diff -up mysql-5.5.28/include/mysql_com.h.p8 mysql-5.5.28/include/mysql_com.h
7a5573f
--- mysql-5.5.28/include/mysql_com.h.p8	2012-08-29 10:50:46.000000000 +0200
7a5573f
+++ mysql-5.5.28/include/mysql_com.h	2012-12-06 14:16:14.599520860 +0100
7a5573f
@@ -452,6 +452,7 @@ my_bool	my_net_init(NET *net, Vio* vio);
7a5573f
 void	my_net_local_init(NET *net);
7a5573f
 void	net_end(NET *net);
7a5573f
   void	net_clear(NET *net, my_bool clear_buffer);
7a5573f
+#define net_realloc mysql_net_realloc		/* namespace sanity */
7a5573f
 my_bool net_realloc(NET *net, size_t length);
7a5573f
 my_bool	net_flush(NET *net);
7a5573f
 my_bool	my_net_write(NET *net,const unsigned char *packet, size_t len);
7a5573f
@@ -533,14 +534,12 @@ double my_rnd(struct rand_struct *);
7a5573f
 void create_random_string(char *to, unsigned int length, struct rand_struct *rand_st);
7a5573f
 
7a5573f
 void hash_password(unsigned long *to, const char *password, unsigned int password_len);
7a5573f
-void make_scrambled_password_323(char *to, const char *password);
7a5573f
 void scramble_323(char *to, const char *message, const char *password);
7a5573f
 my_bool check_scramble_323(const unsigned char *reply, const char *message,
7a5573f
                            unsigned long *salt);
7a5573f
 void get_salt_from_password_323(unsigned long *res, const char *password);
7a5573f
 void make_password_from_salt_323(char *to, const unsigned long *salt);
7a5573f
 
7a5573f
-void make_scrambled_password(char *to, const char *password);
7a5573f
 void scramble(char *to, const char *message, const char *password);
7a5573f
 my_bool check_scramble(const unsigned char *reply, const char *message,
7a5573f
                        const unsigned char *hash_stage2);
7a5573f
diff -up mysql-5.5.28/include/mysql.h.pp.p8 mysql-5.5.28/include/mysql.h.pp
7a5573f
--- mysql-5.5.28/include/mysql.h.pp.p8	2012-08-29 10:50:46.000000000 +0200
7a5573f
+++ mysql-5.5.28/include/mysql.h.pp	2012-12-06 14:16:14.598520859 +0100
7a5573f
@@ -86,7 +86,7 @@ my_bool my_net_init(NET *net, Vio* vio);
7a5573f
 void my_net_local_init(NET *net);
7a5573f
 void net_end(NET *net);
7a5573f
   void net_clear(NET *net, my_bool clear_buffer);
7a5573f
-my_bool net_realloc(NET *net, size_t length);
7a5573f
+my_bool mysql_net_realloc(NET *net, size_t length);
7a5573f
 my_bool net_flush(NET *net);
7a5573f
 my_bool my_net_write(NET *net,const unsigned char *packet, size_t len);
7a5573f
 my_bool net_write_command(NET *net,unsigned char command,
7a5573f
@@ -128,13 +128,11 @@ void randominit(struct rand_struct *, un
7a5573f
 double my_rnd(struct rand_struct *);
7a5573f
 void create_random_string(char *to, unsigned int length, struct rand_struct *rand_st);
7a5573f
 void hash_password(unsigned long *to, const char *password, unsigned int password_len);
7a5573f
-void make_scrambled_password_323(char *to, const char *password);
7a5573f
 void scramble_323(char *to, const char *message, const char *password);
7a5573f
 my_bool check_scramble_323(const unsigned char *reply, const char *message,
7a5573f
                            unsigned long *salt);
7a5573f
 void get_salt_from_password_323(unsigned long *res, const char *password);
7a5573f
 void make_password_from_salt_323(char *to, const unsigned long *salt);
7a5573f
-void make_scrambled_password(char *to, const char *password);
7a5573f
 void scramble(char *to, const char *message, const char *password);
7a5573f
 my_bool check_scramble(const unsigned char *reply, const char *message,
7a5573f
                        const unsigned char *hash_stage2);
7a5573f
diff -up mysql-5.5.28/include/my_sys.h.p8 mysql-5.5.28/include/my_sys.h
7a5573f
--- mysql-5.5.28/include/my_sys.h.p8	2012-12-06 14:09:15.218170154 +0100
7a5573f
+++ mysql-5.5.28/include/my_sys.h	2012-12-06 14:16:14.598520859 +0100
7a5573f
@@ -218,6 +218,7 @@ extern uint    my_large_page_size;
7a5573f
 
7a5573f
 /* charsets */
7a5573f
 #define MY_ALL_CHARSETS_SIZE 2048
7a5573f
+#define default_charset_info mysql_default_charset_info	/* namespace sanity */
7a5573f
 extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *default_charset_info;
7a5573f
 extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *all_charsets[MY_ALL_CHARSETS_SIZE];
7a5573f
 extern CHARSET_INFO compiled_charsets[];
7a5573f
@@ -895,6 +896,9 @@ extern uint get_charset_number(const cha
7a5573f
 extern uint get_collation_number(const char *name);
7a5573f
 extern const char *get_charset_name(uint cs_number);
7a5573f
 
7a5573f
+#define get_charset mysql_get_charset		/* namespace sanity */
7a5573f
+#define get_charset_by_csname mysql_get_charset_by_csname
7a5573f
+
7a5573f
 extern CHARSET_INFO *get_charset(uint cs_number, myf flags);
7a5573f
 extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags);
7a5573f
 extern CHARSET_INFO *get_charset_by_csname(const char *cs_name,
7a5573f
diff -up mysql-5.5.28/sql/password.c.p8 mysql-5.5.28/sql/password.c
7a5573f
--- mysql-5.5.28/sql/password.c.p8	2012-08-29 10:50:46.000000000 +0200
7a5573f
+++ mysql-5.5.28/sql/password.c	2012-12-06 14:16:14.599520860 +0100
7a5573f
@@ -155,23 +155,6 @@ void my_make_scrambled_password_323(char
7a5573f
 
7a5573f
 
7a5573f
 /*
7a5573f
-  Wrapper around my_make_scrambled_password_323() to maintain client lib ABI
7a5573f
-  compatibility.
7a5573f
-  In server code usage of my_make_scrambled_password_323() is preferred to
7a5573f
-  avoid strlen().
7a5573f
-  SYNOPSIS
7a5573f
-    make_scrambled_password_323()
7a5573f
-    to        OUT store scrambled password here
7a5573f
-    password  IN  NULL-terminated string with user-supplied password
7a5573f
-*/
7a5573f
-
7a5573f
-void make_scrambled_password_323(char *to, const char *password)
7a5573f
-{
7a5573f
-  my_make_scrambled_password_323(to, password, strlen(password));
7a5573f
-}
7a5573f
-
7a5573f
-
7a5573f
-/*
7a5573f
     Scramble string with password.
7a5573f
     Used in pre 4.1 authentication phase.
7a5573f
   SYNOPSIS
7a5573f
@@ -434,23 +417,6 @@ void my_make_scrambled_password(char *to
7a5573f
   
7a5573f
 
7a5573f
 /*
7a5573f
-  Wrapper around my_make_scrambled_password() to maintain client lib ABI
7a5573f
-  compatibility.
7a5573f
-  In server code usage of my_make_scrambled_password() is preferred to
7a5573f
-  avoid strlen().
7a5573f
-  SYNOPSIS
7a5573f
-    make_scrambled_password()
7a5573f
-    buf       OUT buffer of size 2*SHA1_HASH_SIZE + 2 to store hex string
7a5573f
-    password  IN  NULL-terminated password string
7a5573f
-*/
7a5573f
-
7a5573f
-void make_scrambled_password(char *to, const char *password)
7a5573f
-{
7a5573f
-  my_make_scrambled_password(to, password, strlen(password));
7a5573f
-}
7a5573f
-
7a5573f
-
7a5573f
-/*
7a5573f
     Produce an obscure octet sequence from password and random
7a5573f
     string, recieved from the server. This sequence corresponds to the
7a5573f
     password, but password can not be easily restored from it. The sequence