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