------------------------------------------------------------ revno: 2750 committer: Sergei Golubchik branch nick: maria-5.2-pa timestamp: Tue 2010-03-02 21:32:24 +0100 message: fixes for embedded modified: .bzrignore libmysqld/lib_sql.cc mysql-test/r/change_user.result mysql-test/t/change_user.test sql-common/client.c sql/sql_acl.cc diff: === modified file '.bzrignore' --- .bzrignore 2010-02-19 08:18:09 +0000 +++ .bzrignore 2010-03-02 20:32:24 +0000 @@ -1933,3 +1933,4 @@ client/sql_list.h libmysqld/client_plugin.c sql/client_plugin.c +*.dgcov === modified file 'libmysqld/lib_sql.cc' --- libmysqld/lib_sql.cc 2010-02-19 08:18:09 +0000 +++ libmysqld/lib_sql.cc 2010-03-02 20:32:24 +0000 @@ -582,6 +582,7 @@ THD *thd = (THD *)mysql->thd; thd->mysql= mysql; mysql->server_version= server_version; + mysql->client_flag= client_flag; init_alloc_root(&mysql->field_alloc, 8192, 0); } === modified file 'mysql-test/r/change_user.result' --- mysql-test/r/change_user.result 2010-02-19 08:18:09 +0000 +++ mysql-test/r/change_user.result 2010-03-02 20:32:24 +0000 @@ -1,33 +1,33 @@ grant select on test.* to test_nopw; grant select on test.* to test_oldpw identified by password "09301740536db389"; grant select on test.* to test_newpw identified by "newpw"; -select user(), current_user(), database(); -user() current_user() database() -root@localhost root@localhost test -select user(), current_user(), database(); -user() current_user() database() -test_nopw@localhost test_nopw@% NULL -select user(), current_user(), database(); -user() current_user() database() -test_oldpw@localhost test_oldpw@% NULL -select user(), current_user(), database(); -user() current_user() database() -test_newpw@localhost test_newpw@% NULL -select user(), current_user(), database(); -user() current_user() database() -root@localhost root@localhost NULL -select user(), current_user(), database(); -user() current_user() database() -test_nopw@localhost test_nopw@% test -select user(), current_user(), database(); -user() current_user() database() -test_oldpw@localhost test_oldpw@% test -select user(), current_user(), database(); -user() current_user() database() -test_newpw@localhost test_newpw@% test -select user(), current_user(), database(); -user() current_user() database() -root@localhost root@localhost test +select concat('<', user(), '>'), concat('<', current_user(), '>'), database(); +concat('<', user(), '>') concat('<', current_user(), '>') database() + test +select concat('<', user(), '>'), concat('<', current_user(), '>'), database(); +concat('<', user(), '>') concat('<', current_user(), '>') database() + NULL +select concat('<', user(), '>'), concat('<', current_user(), '>'), database(); +concat('<', user(), '>') concat('<', current_user(), '>') database() + NULL +select concat('<', user(), '>'), concat('<', current_user(), '>'), database(); +concat('<', user(), '>') concat('<', current_user(), '>') database() + NULL +select concat('<', user(), '>'), concat('<', current_user(), '>'), database(); +concat('<', user(), '>') concat('<', current_user(), '>') database() + NULL +select concat('<', user(), '>'), concat('<', current_user(), '>'), database(); +concat('<', user(), '>') concat('<', current_user(), '>') database() + test +select concat('<', user(), '>'), concat('<', current_user(), '>'), database(); +concat('<', user(), '>') concat('<', current_user(), '>') database() + test +select concat('<', user(), '>'), concat('<', current_user(), '>'), database(); +concat('<', user(), '>') concat('<', current_user(), '>') database() + test +select concat('<', user(), '>'), concat('<', current_user(), '>'), database(); +concat('<', user(), '>') concat('<', current_user(), '>') database() + test drop user test_nopw; drop user test_oldpw; drop user test_newpw; === modified file 'mysql-test/t/change_user.test' --- mysql-test/t/change_user.test 2010-02-19 08:18:09 +0000 +++ mysql-test/t/change_user.test 2010-03-02 20:32:24 +0000 @@ -6,25 +6,39 @@ grant select on test.* to test_oldpw identified by password "09301740536db389"; grant select on test.* to test_newpw identified by "newpw"; -select user(), current_user(), database(); +# +# massaging the data for tests to pass in the embedded server, +# that has authentication completely disabled. +# + +--replace_result <@> @> @localhost> +select concat('<', user(), '>'), concat('<', current_user(), '>'), database(); change_user test_nopw; -select user(), current_user(), database(); +--replace_result <@> @> @localhost> +select concat('<', user(), '>'), concat('<', current_user(), '>'), database(); change_user test_oldpw, oldpw; -select user(), current_user(), database(); +--replace_result <@> @> @localhost> +select concat('<', user(), '>'), concat('<', current_user(), '>'), database(); change_user test_newpw, newpw; -select user(), current_user(), database(); +--replace_result <@> @> @localhost> +select concat('<', user(), '>'), concat('<', current_user(), '>'), database(); change_user root; -select user(), current_user(), database(); +--replace_result <@> @> @localhost> +select concat('<', user(), '>'), concat('<', current_user(), '>'), database(); change_user test_nopw,,test; -select user(), current_user(), database(); +--replace_result <@> @> @localhost> +select concat('<', user(), '>'), concat('<', current_user(), '>'), database(); change_user test_oldpw,oldpw,test; -select user(), current_user(), database(); +--replace_result <@> @> @localhost> +select concat('<', user(), '>'), concat('<', current_user(), '>'), database(); change_user test_newpw,newpw,test; -select user(), current_user(), database(); +--replace_result <@> @> @localhost> +select concat('<', user(), '>'), concat('<', current_user(), '>'), database(); change_user root,,test; -select user(), current_user(), database(); +--replace_result <@> @> @localhost> +select concat('<', user(), '>'), concat('<', current_user(), '>'), database(); drop user test_nopw; drop user test_oldpw; === modified file 'sql-common/client.c' --- sql-common/client.c 2010-02-23 18:49:25 +0000 +++ sql-common/client.c 2010-03-02 20:32:24 +0000 @@ -1961,7 +1961,7 @@ else { DBUG_ASSERT(data_len == SCRAMBLE_LENGTH_323 + 1); - DBUG_ASSERT(data[data_len] == 0); + DBUG_ASSERT(data[SCRAMBLE_LENGTH_323] == 0); } memcpy(end, data, data_len); end+= data_len; === modified file 'sql/sql_acl.cc' --- sql/sql_acl.cc 2010-02-23 18:49:25 +0000 +++ sql/sql_acl.cc 2010-03-02 20:32:24 +0000 @@ -7110,10 +7110,10 @@ the packet must contain at least the trailing '\0'. */ if (db >= end) - { - my_message(ER_UNKNOWN_COM_ERROR, ER(ER_UNKNOWN_COM_ERROR), MYF(0)); - return 1; - } + { + my_message(ER_UNKNOWN_COM_ERROR, ER(ER_UNKNOWN_COM_ERROR), MYF(0)); + return 1; + } uint db_len= strlen(db); @@ -7450,7 +7450,7 @@ { /* we cannot allow plugin data packet to start from 255 or 254 - - as the client will treat it as an error or "change plugi" packet. + as the client will treat it as an error or "change plugin" packet. We'll escape these bytes with \1. Consequently, we have to escape \1 byte too. */ @@ -7690,6 +7690,7 @@ */ int acl_authenticate(THD *thd, uint connect_errors, uint com_change_user_pkt_len) { + DBUG_ENTER("acl_authenticate"); int res, old_status; plugin_ref plugin; MPVIO_EXT mpvio; @@ -7717,7 +7718,7 @@ mpvio.packets_read++; // take COM_CHANGE_USER packet into account if (parse_com_change_user_packet(&mpvio, com_change_user_pkt_len)) - return 1; + DBUG_RETURN(1); DBUG_ASSERT(mpvio.status == MPVIO_EXT::RESTART || mpvio.status == MPVIO_EXT::SUCCESS); @@ -7748,7 +7749,7 @@ { /* Server cannot load required plugin. */ my_error(ER_PLUGIN_IS_NOT_LOADED, MYF(0), auth_plugin_name->str); - return 1; + DBUG_RETURN(1); } mpvio.plugin= plugin; @@ -7816,7 +7817,7 @@ if (!thd->is_error()) login_failed_error(thd, thd->password); - return 1; + DBUG_RETURN(1); } if (initialized) // if not --skip-grant-tables @@ -7836,7 +7837,7 @@ if (acl_check_ssl(thd, acl_user)) { login_failed_error(thd, thd->password); - return 1; + DBUG_RETURN(1); } /* Don't allow the user to connect if he has done too many queries */ @@ -7847,7 +7848,7 @@ (opt_old_style_user_limits ? sctx->user : sctx->priv_user), (opt_old_style_user_limits ? sctx->host_or_ip : sctx->priv_host), &acl_user->user_resource)) - return 1; // The error is set by get_or_create_user_conn() + DBUG_RETURN(1); // The error is set by get_or_create_user_conn() } else sctx->skip_grants(); @@ -7859,7 +7860,7 @@ check_for_max_user_connections(thd, thd->user_connect)) { status_var_increment(denied_connections); - return 1; // The error is set in check_for_max_user_connections() + DBUG_RETURN(1); // The error is set in check_for_max_user_connections() } DBUG_PRINT("info", @@ -7881,7 +7882,7 @@ if (!count_ok) { // too many connections my_error(ER_CON_COUNT_ERROR, MYF(0)); - return 1; + DBUG_RETURN(1); } } @@ -7904,7 +7905,7 @@ status_var_increment(thd->status_var.access_denied_errors); thd->user_connect= 0; } - return 1; + DBUG_RETURN(1); } } @@ -7914,7 +7915,7 @@ my_ok(thd); /* Ready to handle queries */ - return 0; + DBUG_RETURN(0); } /** ------------------------------------------------------------ revno: 2751 committer: Sergei Golubchik branch nick: maria-5.2-pa timestamp: Thu 2010-03-11 13:33:22 +0100 message: comments modified: client/mysql.cc plugin/auth/auth_socket.c plugin/auth/dialog.c sql-common/client.c sql-common/client_plugin.c sql/sql_acl.cc diff: === modified file 'client/mysql.cc' --- client/mysql.cc 2010-02-19 08:18:09 +0000 +++ client/mysql.cc 2010-03-11 12:33:22 +0000 @@ -4235,6 +4235,7 @@ return valid_arg ? start : NullS; } + /** An example of mysql_authentication_dialog_ask callback. @@ -4257,6 +4258,7 @@ In all other cases it is assumed to be an allocated string, and the "dialog" plugin will free() it. */ + extern "C" char *mysql_authentication_dialog_ask(MYSQL *mysql, int type, const char *prompt, char *buf, int buf_len) === modified file 'plugin/auth/auth_socket.c' --- plugin/auth/auth_socket.c 2010-02-19 08:18:09 +0000 +++ plugin/auth/auth_socket.c 2010-03-11 12:33:22 +0000 @@ -29,6 +29,15 @@ #include #include +/** + perform the unix socket based authentication + + This authentication callback performs a unix socket based authentication - + it gets the uid of the client process and considers the user authenticated + if it uses username of this uid. That is - if the user is already + authenticated to the OS (if she is logged in) - she can use MySQL as herself +*/ + static int socket_auth(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info) { unsigned char *pkt; === modified file 'plugin/auth/dialog.c' --- plugin/auth/dialog.c 2010-02-23 12:02:00 +0000 +++ plugin/auth/dialog.c 2010-03-11 12:33:22 +0000 @@ -54,8 +54,9 @@ /********************* SERVER SIDE ****************************************/ /** - dialog demo with two questions, one password and one, the last, ordinary. + dialog demo with two questions, one password and one ordinary. */ + static int two_questions(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info) { unsigned char *pkt; @@ -94,7 +95,11 @@ two_questions }; -/* dialog demo where the number of questions is not known in advance */ + +/** + dialog demo where the number of questions is not known in advance +*/ + static int three_attempts(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info) { unsigned char *pkt; @@ -191,6 +196,7 @@ return buf; } + /** The main function of the dialog plugin. @@ -207,6 +213,7 @@ and whether the input is a password (not echoed). 3. the prompt is expected to be sent zero-terminated */ + static int perform_dialog(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql) { unsigned char *pkt, cmd= 0; @@ -268,12 +275,14 @@ return CR_OK; } + /** initialization function of the dialog plugin Pick up the client's authentication_dialog_ask() function, if exists, or fall back to the default implementation. */ + static int init_dialog() { void *sym= dlsym(RTLD_DEFAULT, "mysql_authentication_dialog_ask"); === modified file 'sql-common/client.c' --- sql-common/client.c 2010-03-02 20:32:24 +0000 +++ sql-common/client.c 2010-03-11 12:33:22 +0000 @@ -1933,6 +1933,7 @@ @retval 0 ok @retval 1 error */ + static int send_change_user_packet(MCPVIO_EXT *mpvio, const uchar *data, int data_len) { @@ -1985,6 +1986,7 @@ return res; } + /** sends a client authentication packet (second packet in the 3-way handshake) @@ -2015,6 +2017,7 @@ @retval 0 ok @retval 1 error */ + static int send_client_reply_packet(MCPVIO_EXT *mpvio, const uchar *data, int data_len) { @@ -2183,13 +2186,16 @@ return 1; } + static int client_mpvio_write_packet(struct st_plugin_vio*, const uchar*, int); + /** vio->read_packet() callback method for client authentication plugins This function is called by a client authentication plugin, when it wants to read data from the server. */ + static int client_mpvio_read_packet(struct st_plugin_vio *mpv, uchar **buf) { MCPVIO_EXT *mpvio= (MCPVIO_EXT*)mpv; @@ -2240,6 +2246,7 @@ return pkt_len; } + /** vio->write_packet() callback method for client authentication plugins @@ -2249,6 +2256,7 @@ It transparently wraps the data into a change user or authentication handshake packet, if neccessary. */ + static int client_mpvio_write_packet(struct st_plugin_vio *mpv, const uchar *pkt, int pkt_len) { @@ -2279,10 +2287,12 @@ return res; } + /** fills MYSQL_PLUGIN_VIO_INFO structure with the information about the connection */ + void mpvio_info(Vio *vio, MYSQL_PLUGIN_VIO_INFO *info) { bzero(info, sizeof(*info)); @@ -2320,6 +2330,7 @@ } } + static void client_mpvio_info(MYSQL_PLUGIN_VIO *vio, MYSQL_PLUGIN_VIO_INFO *info) { @@ -2327,6 +2338,7 @@ mpvio_info(mpvio->mysql->net.vio, info); } + /** Client side of the plugin driver authentication. @@ -2343,6 +2355,7 @@ @retval 0 ok @retval 1 error */ + int run_plugin_auth(MYSQL *mysql, char *data, uint data_len, char *data_plugin, const char *db) { @@ -2475,6 +2488,7 @@ return mysql->net.read_pos[0] != 0; } + MYSQL * STDCALL CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, const char *passwd, const char *db, @@ -3765,10 +3779,12 @@ return mysql->net.last_errno; } + /** client authentication plugin that does native MySQL authentication using a 20-byte (4.1+) scramble */ + static int native_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql) { int pkt_len; @@ -3811,10 +3827,12 @@ return CR_OK; } + /** client authentication plugin that does old MySQL authentication using an 8-byte (4.0-) scramble */ + static int old_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql) { uchar *pkt; === modified file 'sql-common/client_plugin.c' --- sql-common/client_plugin.c 2010-02-19 08:18:09 +0000 +++ sql-common/client_plugin.c 2010-03-11 12:33:22 +0000 @@ -82,6 +82,7 @@ return 1; } + /** finds a plugin in the list @@ -92,8 +93,8 @@ @retval a pointer to a found plugin or 0 */ -static struct st_mysql_client_plugin * -find_plugin(const char *name, int type) + +static struct st_mysql_client_plugin *find_plugin(const char *name, int type) { struct st_client_plugin_int *p; @@ -110,6 +111,7 @@ return NULL; } + /** verifies the plugin and adds it to the list @@ -122,6 +124,7 @@ @retval a pointer to an installed plugin or 0 */ + static struct st_mysql_client_plugin * add_plugin(MYSQL *mysql, struct st_mysql_client_plugin *plugin, void *dlhandle, int argc, va_list args) @@ -184,6 +187,7 @@ return NULL; } + /** Loads plugins which are specified in the environment variable LIBMYSQL_PLUGINS. @@ -199,6 +203,7 @@ or LIBMYSQL_PLUGINS="plugin1=int:param1,str:param2;plugin2;..." */ + static void load_env_plugins(MYSQL *mysql) { char *plugs, *free_env, *s= getenv("LIBMYSQL_PLUGINS"); @@ -231,6 +236,7 @@ @retval 0 successful @retval != 0 error occured */ + int mysql_client_plugin_init() { MYSQL mysql; @@ -260,11 +266,13 @@ return 0; } + /** Deinitializes the client plugin layer. Unloades all client plugins and frees any associated resources. */ + void mysql_client_plugin_deinit() { int i; @@ -315,6 +323,7 @@ return plugin; } + /* see for a full description */ struct st_mysql_client_plugin * mysql_load_plugin_v(MYSQL *mysql, const char *name, int type, @@ -390,6 +399,7 @@ return NULL; } + /* see for a full description */ struct st_mysql_client_plugin * mysql_load_plugin(MYSQL *mysql, const char *name, int type, int argc, ...) @@ -402,6 +412,7 @@ return p; } + /* see for a full description */ struct st_mysql_client_plugin * mysql_client_find_plugin(MYSQL *mysql, const char *name, int type) === modified file 'sql/sql_acl.cc' --- sql/sql_acl.cc 2010-03-02 20:32:24 +0000 +++ sql/sql_acl.cc 2010-03-11 12:33:22 +0000 @@ -6793,9 +6793,11 @@ enum { SUCCESS, FAILURE, RESTART } status; }; + /** a helper function to report an access denied error in all the proper places */ + static void login_failed_error(THD *thd, bool passwd_used) { my_error(ER_ACCESS_DENIED_ERROR, MYF(0), @@ -6821,6 +6823,7 @@ } } + /** sends a server handshake initialization packet, the very first packet after the connection was established @@ -6846,6 +6849,7 @@ @retval 0 ok @retval 1 error */ + static bool send_server_handshake_packet(MPVIO_EXT *mpvio, const char *data, uint data_len) { @@ -6939,6 +6943,7 @@ return res; } + static uchar switch_plugin_request_buf[]= { 254 }; /** @@ -6962,6 +6967,7 @@ @retval 0 ok @retval 1 error */ + static bool send_plugin_request_packet(MPVIO_EXT *mpvio, const uchar *data, uint data_len) { @@ -7013,6 +7019,7 @@ (uchar*)data, data_len); } + #ifndef NO_EMBEDDED_ACCESS_CHECKS /** Finds acl entry in user database for authentication purposes. @@ -7026,6 +7033,7 @@ @retval 0 found @retval 1 not found */ + static bool find_mpvio_user(MPVIO_EXT *mpvio, Security_context *sctx) { pthread_mutex_lock(&acl_cache->lock); @@ -7068,6 +7076,7 @@ } #endif + /* the packet format is described in send_change_user_packet() */ static bool parse_com_change_user_packet(MPVIO_EXT *mpvio, uint packet_length) { @@ -7201,6 +7210,7 @@ return 0; } + /* the packet format is described in send_client_reply_packet() */ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio, uchar **buff, ulong pkt_len) @@ -7424,6 +7434,7 @@ #endif } + /** vio->write_packet() callback method for server authentication plugins @@ -7434,6 +7445,7 @@ and handles plugin negotiation with the client. If necessary, it escapes the plugin data, if it starts with a mysql protocol packet byte. */ + static int server_mpvio_write_packet(MYSQL_PLUGIN_VIO *param, const uchar *packet, int packet_len) { @@ -7466,6 +7478,7 @@ return res; } + /** vio->read_packet() callback method for server authentication plugins @@ -7476,6 +7489,7 @@ a client authentication handshake packet, and handles plugin negotiation with the client, if necessary. */ + static int server_mpvio_read_packet(MYSQL_PLUGIN_VIO *param, uchar **buf) { MPVIO_EXT *mpvio= (MPVIO_EXT*)param; @@ -7558,10 +7572,12 @@ return -1; } + /** fills MYSQL_PLUGIN_VIO_INFO structure with the information about the connection */ + static void server_mpvio_info(MYSQL_PLUGIN_VIO *vio, MYSQL_PLUGIN_VIO_INFO *info) { @@ -7569,6 +7585,7 @@ mpvio_info(mpvio->thd->net.vio, info); } + static int acl_check_ssl(THD *thd, ACL_USER *acl_user) { #if defined(HAVE_OPENSSL) @@ -7674,6 +7691,7 @@ return 1; } + /** Perform the handshake, authorize the client and update thd sctx variables. @@ -7688,6 +7706,7 @@ @retval 0 success, thd is updated. @retval 1 error */ + int acl_authenticate(THD *thd, uint connect_errors, uint com_change_user_pkt_len) { DBUG_ENTER("acl_authenticate"); @@ -7918,6 +7937,7 @@ DBUG_RETURN(0); } + /** MySQL Server Password Authentication Plugin @@ -7926,6 +7946,7 @@ 2. client sends the encrypted password back to the server 3. the server checks the password. */ + static int native_password_authenticate(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info) { @@ -8009,6 +8030,7 @@ return CR_ERROR; } + static int old_password_authenticate(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info) { ------------------------------------------------------------ revno: 2753 committer: Sergei Golubchik branch nick: maria-5.2-pa timestamp: Mon 2010-03-15 11:57:42 +0100 message: add new API files to the abi_check rule added: include/mysql/client_plugin.h.pp include/mysql/plugin_auth.h.pp modified: Makefile.am diff: === modified file 'Makefile.am' --- Makefile.am 2010-02-19 08:06:33 +0000 +++ Makefile.am 2010-03-15 10:57:42 +0000 @@ -272,11 +272,13 @@ # API_PREPROCESSOR_HEADER = $(top_srcdir)/include/mysql/plugin.h \ - $(top_srcdir)/include/mysql.h + $(top_srcdir)/include/mysql.h \ + $(top_srcdir)/include/mysql/client_plugin.h \ + $(top_srcdir)/include/mysql/plugin_auth.h -TEST_PREPROCESSOR_HEADER = $(top_srcdir)/include/mysql/plugin.h \ - $(top_srcdir)/sql/mysql_priv.h \ - $(top_srcdir)/include/mysql.h +TEST_PREPROCESSOR_HEADER = $(API_PREPROCESSOR_HEADER) \ + $(top_srcdir)/sql/mysql_priv.h + # # Rules for checking that the abi/api has not changed. === added file 'include/mysql/client_plugin.h.pp' --- include/mysql/client_plugin.h.pp 1970-01-01 00:00:00 +0000 +++ include/mysql/client_plugin.h.pp 2010-03-15 10:57:42 +0000 @@ -0,0 +1,41 @@ +#include +#include +struct st_mysql_client_plugin +{ + int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; int (*init)(char *, size_t, int, va_list); int (*deinit)(); +}; +struct st_mysql; +#include +typedef struct st_plugin_vio_info +{ + enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET, + MYSQL_VIO_PIPE, MYSQL_VIO_MEMORY } protocol; + int socket; +} MYSQL_PLUGIN_VIO_INFO; +typedef struct st_plugin_vio +{ + int (*read_packet)(struct st_plugin_vio *vio, + unsigned char **buf); + int (*write_packet)(struct st_plugin_vio *vio, + const unsigned char *packet, + int packet_len); + void (*info)(struct st_plugin_vio *vio, struct st_plugin_vio_info *info); +} MYSQL_PLUGIN_VIO; +struct st_mysql_client_plugin_AUTHENTICATION +{ + int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; int (*init)(char *, size_t, int, va_list); int (*deinit)(); + int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, struct st_mysql *mysql); +}; +typedef char *(*mysql_authentication_dialog_ask_t)(struct st_mysql *mysql, + int type, const char *prompt, char *buf, int buf_len); +struct st_mysql_client_plugin * +mysql_load_plugin(struct st_mysql *mysql, const char *name, int type, + int argc, ...); +struct st_mysql_client_plugin * +mysql_load_plugin_v(struct st_mysql *mysql, const char *name, int type, + int argc, va_list args); +struct st_mysql_client_plugin * +mysql_client_find_plugin(struct st_mysql *mysql, const char *name, int type); +struct st_mysql_client_plugin * +mysql_client_register_plugin(struct st_mysql *mysql, + struct st_mysql_client_plugin *plugin); === added file 'include/mysql/plugin_auth.h.pp' --- include/mysql/plugin_auth.h.pp 1970-01-01 00:00:00 +0000 +++ include/mysql/plugin_auth.h.pp 2010-03-15 10:57:42 +0000 @@ -0,0 +1,193 @@ +#include +#include +#include +#include +#include +extern struct my_snprintf_service_st { + size_t (*my_snprintf_type)(char*, size_t, const char*, ...); + size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list); +} *my_snprintf_service; +size_t my_snprintf(char* to, size_t n, const char* fmt, ...); +size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap); +#include +#include +struct st_mysql_lex_string +{ + char *str; + size_t length; +}; +typedef struct st_mysql_lex_string MYSQL_LEX_STRING; +extern struct thd_alloc_service_st { + void *(*thd_alloc_func)(void*, unsigned int); + void *(*thd_calloc_func)(void*, unsigned int); + char *(*thd_strdup_func)(void*, const char *); + char *(*thd_strmake_func)(void*, const char *, unsigned int); + void *(*thd_memdup_func)(void*, const void*, unsigned int); + MYSQL_LEX_STRING *(*thd_make_lex_string_func)(void*, MYSQL_LEX_STRING *, + const char *, unsigned int, int); +} *thd_alloc_service; +void *thd_alloc(void* thd, unsigned int size); +void *thd_calloc(void* thd, unsigned int size); +char *thd_strdup(void* thd, const char *str); +char *thd_strmake(void* thd, const char *str, unsigned int size); +void *thd_memdup(void* thd, const void* str, unsigned int size); +MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str, + const char *str, unsigned int size, + int allocate_lex_string); +struct st_mysql_xid { + long formatID; + long gtrid_length; + long bqual_length; + char data[128]; +}; +typedef struct st_mysql_xid MYSQL_XID; +enum enum_mysql_show_type +{ + SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG, + SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR, + SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE, + SHOW_always_last +}; +struct st_mysql_show_var { + const char *name; + char *value; + enum enum_mysql_show_type type; +}; +typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, char *); +struct st_mysql_sys_var; +struct st_mysql_value; +typedef int (*mysql_var_check_func)(void* thd, + struct st_mysql_sys_var *var, + void *save, struct st_mysql_value *value); +typedef void (*mysql_var_update_func)(void* thd, + struct st_mysql_sys_var *var, + void *var_ptr, const void *save); +struct st_mysql_plugin +{ + int type; + void *info; + const char *name; + const char *author; + const char *descr; + int license; + int (*init)(void *); + int (*deinit)(void *); + unsigned int version; + struct st_mysql_show_var *status_vars; + struct st_mysql_sys_var **system_vars; + void * __reserved1; +}; +enum enum_ftparser_mode +{ + MYSQL_FTPARSER_SIMPLE_MODE= 0, + MYSQL_FTPARSER_WITH_STOPWORDS= 1, + MYSQL_FTPARSER_FULL_BOOLEAN_INFO= 2 +}; +enum enum_ft_token_type +{ + FT_TOKEN_EOF= 0, + FT_TOKEN_WORD= 1, + FT_TOKEN_LEFT_PAREN= 2, + FT_TOKEN_RIGHT_PAREN= 3, + FT_TOKEN_STOPWORD= 4 +}; +typedef struct st_mysql_ftparser_boolean_info +{ + enum enum_ft_token_type type; + int yesno; + int weight_adjust; + char wasign; + char trunc; + char prev; + char *quot; +} MYSQL_FTPARSER_BOOLEAN_INFO; +typedef int mysql_ft_size_t; +typedef struct st_mysql_ftparser_param +{ + int (*mysql_parse)(struct st_mysql_ftparser_param *, + const unsigned char *doc, mysql_ft_size_t doc_len); + int (*mysql_add_word)(struct st_mysql_ftparser_param *, + const unsigned char *word, mysql_ft_size_t word_len, + MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info); + void *ftparser_state; + void *mysql_ftparam; + const struct charset_info_st *cs; + const unsigned char *doc; + mysql_ft_size_t length; + unsigned int flags; + enum enum_ftparser_mode mode; +} MYSQL_FTPARSER_PARAM; +struct st_mysql_ftparser +{ + int interface_version; + int (*parse)(MYSQL_FTPARSER_PARAM *param); + int (*init)(MYSQL_FTPARSER_PARAM *param); + int (*deinit)(MYSQL_FTPARSER_PARAM *param); +}; +struct st_mysql_storage_engine +{ + int interface_version; +}; +struct handlerton; +struct st_mysql_daemon +{ + int interface_version; +}; +struct st_mysql_information_schema +{ + int interface_version; +}; +struct st_mysql_value +{ + int (*value_type)(struct st_mysql_value *); + const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length); + int (*val_real)(struct st_mysql_value *, double *realbuf); + int (*val_int)(struct st_mysql_value *, long long *intbuf); +}; +int thd_in_lock_tables(const void* thd); +int thd_tablespace_op(const void* thd); +long long thd_test_options(const void* thd, long long test_options); +int thd_sql_command(const void* thd); +void **thd_ha_data(const void* thd, const struct handlerton *hton); +int thd_tx_isolation(const void* thd); +char *thd_security_context(void* thd, char *buffer, unsigned int length, + unsigned int max_query_len); +void thd_inc_row_count(void* thd); +const char *set_thd_proc_info(void*, const char * info, const char *func, + const char *file, const unsigned int line); +int mysql_tmpfile(const char *prefix); +int thd_killed(const void* thd); +unsigned long thd_get_thread_id(const void* thd); +void thd_get_xid(const void* thd, MYSQL_XID *xid); +void mysql_query_cache_invalidate4(void* thd, + const char *key, unsigned int key_length, + int using_trx); +#include +typedef struct st_plugin_vio_info +{ + enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET, + MYSQL_VIO_PIPE, MYSQL_VIO_MEMORY } protocol; + int socket; +} MYSQL_PLUGIN_VIO_INFO; +typedef struct st_plugin_vio +{ + int (*read_packet)(struct st_plugin_vio *vio, + unsigned char **buf); + int (*write_packet)(struct st_plugin_vio *vio, + const unsigned char *packet, + int packet_len); + void (*info)(struct st_plugin_vio *vio, struct st_plugin_vio_info *info); +} MYSQL_PLUGIN_VIO; +typedef struct st_mysql_server_auth_info +{ + const char *user_name; + const char *auth_string; + char authenticated_as[48 +1]; + int password_used; +} MYSQL_SERVER_AUTH_INFO; +struct st_mysql_auth +{ + int interface_version; + const char *client_auth_plugin; + int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info); +}; ------------------------------------------------------------ revno: 2755 committer: Sergei Golubchik branch nick: maria-5.2-pa timestamp: Mon 2010-03-15 19:16:54 +0100 message: indentation fixes modified: sql/sql_acl.cc diff: === modified file 'sql/sql_acl.cc' --- sql/sql_acl.cc 2010-03-15 17:35:32 +0000 +++ sql/sql_acl.cc 2010-03-15 18:16:54 +0000 @@ -7835,7 +7835,7 @@ plugin= old_password_plugin; else if ((plugin= my_plugin_lock_by_name(thd, auth_plugin_name, - MYSQL_AUTHENTICATION_PLUGIN))) + MYSQL_AUTHENTICATION_PLUGIN))) unlock_plugin= true; else #endif @@ -8028,7 +8028,7 @@ */ static int native_password_authenticate(MYSQL_PLUGIN_VIO *vio, - MYSQL_SERVER_AUTH_INFO *info) + MYSQL_SERVER_AUTH_INFO *info) { uchar *pkt; int pkt_len; @@ -8112,7 +8112,7 @@ static int old_password_authenticate(MYSQL_PLUGIN_VIO *vio, - MYSQL_SERVER_AUTH_INFO *info) + MYSQL_SERVER_AUTH_INFO *info) { uchar *pkt; int pkt_len; ------------------------------------------------------------ revno: 2757 committer: Sergei Golubchik branch nick: maria-5.2-pa timestamp: Mon 2010-03-15 21:35:53 +0100 message: fixes for make distcheck removed: include/mysql/plugin.h.pp modified: Makefile.am include/Makefile.am sql-common/Makefile.am sql/sql_acl.cc diff: === modified file 'Makefile.am' --- Makefile.am 2010-03-15 10:57:42 +0000 +++ Makefile.am 2010-03-15 20:35:53 +0000 @@ -271,8 +271,7 @@ # after which TEST_PREPROCESSOR_HEADER will be used. # -API_PREPROCESSOR_HEADER = $(top_srcdir)/include/mysql/plugin.h \ - $(top_srcdir)/include/mysql.h \ +API_PREPROCESSOR_HEADER = $(top_srcdir)/include/mysql.h \ $(top_srcdir)/include/mysql/client_plugin.h \ $(top_srcdir)/include/mysql/plugin_auth.h === modified file 'include/Makefile.am' --- include/Makefile.am 2010-02-19 08:18:09 +0000 +++ include/Makefile.am 2010-03-15 20:35:53 +0000 @@ -44,7 +44,7 @@ atomic/rwlock.h atomic/x86-gcc.h atomic/generic-msvc.h \ atomic/gcc_builtins.h my_libwrap.h my_stacktrace.h \ wqueue.h waiting_threads.h -EXTRA_DIST = mysql.h.pp mysql/plugin.h.pp +EXTRA_DIST = mysql.h.pp mysql/plugin_auth.h.pp mysql/client_plugin.h.pp # Remove built files and the symlinked directories CLEANFILES = $(BUILT_SOURCES) readline openssl === removed file 'include/mysql/plugin.h.pp' --- include/mysql/plugin.h.pp 2010-03-03 14:44:14 +0000 +++ include/mysql/plugin.h.pp 1970-01-01 00:00:00 +0000 @@ -1,163 +0,0 @@ -#include -#include -#include -#include -extern struct my_snprintf_service_st { - size_t (*my_snprintf_type)(char*, size_t, const char*, ...); - size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list); -} *my_snprintf_service; -size_t my_snprintf(char* to, size_t n, const char* fmt, ...); -size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap); -#include -#include -struct st_mysql_lex_string -{ - char *str; - size_t length; -}; -typedef struct st_mysql_lex_string MYSQL_LEX_STRING; -extern struct thd_alloc_service_st { - void *(*thd_alloc_func)(void*, unsigned int); - void *(*thd_calloc_func)(void*, unsigned int); - char *(*thd_strdup_func)(void*, const char *); - char *(*thd_strmake_func)(void*, const char *, unsigned int); - void *(*thd_memdup_func)(void*, const void*, unsigned int); - MYSQL_LEX_STRING *(*thd_make_lex_string_func)(void*, MYSQL_LEX_STRING *, - const char *, unsigned int, int); -} *thd_alloc_service; -void *thd_alloc(void* thd, unsigned int size); -void *thd_calloc(void* thd, unsigned int size); -char *thd_strdup(void* thd, const char *str); -char *thd_strmake(void* thd, const char *str, unsigned int size); -void *thd_memdup(void* thd, const void* str, unsigned int size); -MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str, - const char *str, unsigned int size, - int allocate_lex_string); -struct st_mysql_xid { - long formatID; - long gtrid_length; - long bqual_length; - char data[128]; -}; -typedef struct st_mysql_xid MYSQL_XID; -enum enum_mysql_show_type -{ - SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG, - SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR, - SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE, - SHOW_always_last -}; -struct st_mysql_show_var { - const char *name; - char *value; - enum enum_mysql_show_type type; -}; -typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, char *); -struct st_mysql_sys_var; -struct st_mysql_value; -typedef int (*mysql_var_check_func)(void* thd, - struct st_mysql_sys_var *var, - void *save, struct st_mysql_value *value); -typedef void (*mysql_var_update_func)(void* thd, - struct st_mysql_sys_var *var, - void *var_ptr, const void *save); -struct st_mysql_plugin -{ - int type; - void *info; - const char *name; - const char *author; - const char *descr; - int license; - int (*init)(void *); - int (*deinit)(void *); - unsigned int version; - struct st_mysql_show_var *status_vars; - struct st_mysql_sys_var **system_vars; - void * __reserved1; -}; -enum enum_ftparser_mode -{ - MYSQL_FTPARSER_SIMPLE_MODE= 0, - MYSQL_FTPARSER_WITH_STOPWORDS= 1, - MYSQL_FTPARSER_FULL_BOOLEAN_INFO= 2 -}; -enum enum_ft_token_type -{ - FT_TOKEN_EOF= 0, - FT_TOKEN_WORD= 1, - FT_TOKEN_LEFT_PAREN= 2, - FT_TOKEN_RIGHT_PAREN= 3, - FT_TOKEN_STOPWORD= 4 -}; -typedef struct st_mysql_ftparser_boolean_info -{ - enum enum_ft_token_type type; - int yesno; - int weight_adjust; - char wasign; - char trunc; - char prev; - char *quot; -} MYSQL_FTPARSER_BOOLEAN_INFO; -typedef int mysql_ft_size_t; -typedef struct st_mysql_ftparser_param -{ - int (*mysql_parse)(struct st_mysql_ftparser_param *, - const unsigned char *doc, mysql_ft_size_t doc_len); - int (*mysql_add_word)(struct st_mysql_ftparser_param *, - const unsigned char *word, mysql_ft_size_t word_len, - MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info); - void *ftparser_state; - void *mysql_ftparam; - const struct charset_info_st *cs; - const unsigned char *doc; - mysql_ft_size_t length; - unsigned int flags; - enum enum_ftparser_mode mode; -} MYSQL_FTPARSER_PARAM; -struct st_mysql_ftparser -{ - int interface_version; - int (*parse)(MYSQL_FTPARSER_PARAM *param); - int (*init)(MYSQL_FTPARSER_PARAM *param); - int (*deinit)(MYSQL_FTPARSER_PARAM *param); -}; -struct st_mysql_storage_engine -{ - int interface_version; -}; -struct handlerton; -struct st_mysql_daemon -{ - int interface_version; -}; -struct st_mysql_information_schema -{ - int interface_version; -}; -struct st_mysql_value -{ - int (*value_type)(struct st_mysql_value *); - const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length); - int (*val_real)(struct st_mysql_value *, double *realbuf); - int (*val_int)(struct st_mysql_value *, long long *intbuf); -}; -int thd_in_lock_tables(const void* thd); -int thd_tablespace_op(const void* thd); -long long thd_test_options(const void* thd, long long test_options); -int thd_sql_command(const void* thd); -void **thd_ha_data(const void* thd, const struct handlerton *hton); -int thd_tx_isolation(const void* thd); -char *thd_security_context(void* thd, char *buffer, unsigned int length, - unsigned int max_query_len); -void thd_inc_row_count(void* thd); -const char *set_thd_proc_info(void*, const char * info, const char *func, - const char *file, const unsigned int line); -int mysql_tmpfile(const char *prefix); -int thd_killed(const void* thd); -unsigned long thd_get_thread_id(const void* thd); -void thd_get_xid(const void* thd, MYSQL_XID *xid); -void mysql_query_cache_invalidate4(void* thd, - const char *key, unsigned int key_length, - int using_trx); === modified file 'sql-common/Makefile.am' --- sql-common/Makefile.am 2006-12-31 00:02:27 +0000 +++ sql-common/Makefile.am 2010-03-15 20:35:53 +0000 @@ -14,7 +14,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## Process this file with automake to create Makefile.in -EXTRA_DIST = client.c pack.c my_time.c my_user.c +EXTRA_DIST = client.c pack.c my_time.c my_user.c client_plugin.c # Don't update the files from bitkeeper %::SCCS/s.% === modified file 'sql/sql_acl.cc' --- sql/sql_acl.cc 2010-03-15 18:16:54 +0000 +++ sql/sql_acl.cc 2010-03-15 20:35:53 +0000 @@ -6838,6 +6838,7 @@ #ifndef HAVE_OPENSSL #define ssl_acceptor_fd 0 #define sslaccept(A,B,C,D) 1 +#define NORMAL_HANDSHAKE_SIZE 6 #endif /** ------------------------------------------------------------ revno: 2760 committer: Sergei Golubchik branch nick: maria-5.2-pa timestamp: Sat 2010-03-20 14:58:55 +0100 message: We cannot use AM_CONDITIONAL conditionally. For every conditional AM_CONDITIONAL should be invoked unconditionally at least once. Otherwise, under certain conditions configure will complain that conditional was never defined because the macro was only invoked conditionally. conditional, conditional, conditional. modified: plugin/auth/plug.in diff: === modified file 'plugin/auth/plug.in' --- plugin/auth/plug.in 2010-02-19 08:18:09 +0000 +++ plugin/auth/plug.in 2010-03-20 13:58:55 +0000 @@ -12,3 +12,4 @@ ]])],have_peercred=yes) AM_CONDITIONAL(HAVE_PEERCRED, test x$have_peercred = xyes) ]) +AM_CONDITIONAL(HAVE_PEERCRED, false) ------------------------------------------------------------ revno: 2762 committer: Sergei Golubchik branch nick: maria-5.2-pa timestamp: Mon 2010-03-22 19:09:47 +0100 message: fixes for: compilation failure in static builds. test failure in optimized builds modified: include/my_global.h mysql-test/t/mysql_delimiter_19799.sql* mysql-test/t/windows.test* sql/sql_acl.cc diff: === modified file 'include/my_global.h' --- include/my_global.h 2010-03-15 17:35:32 +0000 +++ include/my_global.h 2010-03-22 18:09:47 +0000 @@ -1530,10 +1530,12 @@ #endif #ifndef HAVE_DLERROR -#define dlerror() "" +#define dlerror() "No support for dynamic loading (static build?)" +#define dlopen(A,B) 0 +#define dlsym(A,B) 0 +#define dlclose(A) 0 #endif - #ifndef __NETWARE__ /* * Include standard definitions of operator new and delete. === modified file 'mysql-test/t/mysql_delimiter_19799.sql' (properties changed: +x to -x) === modified file 'mysql-test/t/windows.test' (properties changed: +x to -x) === modified file 'sql/sql_acl.cc' --- sql/sql_acl.cc 2010-03-15 20:35:53 +0000 +++ sql/sql_acl.cc 2010-03-22 18:09:47 +0000 @@ -7785,7 +7785,7 @@ int acl_authenticate(THD *thd, uint connect_errors, uint com_change_user_pkt_len) { DBUG_ENTER("acl_authenticate"); - int res, old_status; + int res= CR_OK, old_status= MPVIO_EXT::FAILURE; plugin_ref plugin; MPVIO_EXT mpvio; st_mysql_auth *auth; ------------------------------------------------------------ revno: 2763 committer: Sergei Golubchik branch nick: maria-5.2-pa timestamp: Mon 2010-03-22 23:14:48 +0100 message: fix for funcs_1 suite, fix for opensolaris gcc modified: mysql-test/suite/funcs_1/r/is_columns_mysql.result mysql-test/suite/funcs_1/r/is_user_privileges.result plugin/auth/Makefile.am diff: === modified file 'mysql-test/suite/funcs_1/r/is_columns_mysql.result' --- mysql-test/suite/funcs_1/r/is_columns_mysql.result 2009-10-28 09:23:02 +0000 +++ mysql-test/suite/funcs_1/r/is_columns_mysql.result 2010-03-22 22:14:48 +0000 @@ -178,6 +178,7 @@ NULL mysql time_zone_transition_type Transition_type_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references NULL mysql user Alter_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NULL mysql user Alter_routine_priv 28 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references +NULL mysql user auth_string 41 NULL NO text 65535 65535 NULL NULL utf8 utf8_bin text select,insert,update,references NULL mysql user Create_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NULL mysql user Create_routine_priv 27 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NULL mysql user Create_tmp_table_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references @@ -198,6 +199,7 @@ NULL mysql user max_updates 37 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references NULL mysql user max_user_connections 39 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references NULL mysql user Password 3 NO char 41 41 NULL NULL latin1 latin1_bin char(41) select,insert,update,references +NULL mysql user plugin 40 NO char 60 60 NULL NULL latin1 latin1_swedish_ci char(60) select,insert,update,references NULL mysql user Process_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NULL mysql user References_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NULL mysql user Reload_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references @@ -233,6 +235,7 @@ 1.0000 char latin1 latin1_bin 1.0000 char latin1 latin1_swedish_ci 1.0000 varchar latin1 latin1_swedish_ci +1.0000 text utf8 utf8_bin 1.0000 mediumtext utf8 utf8_general_ci 1.0000 text utf8 utf8_general_ci SELECT DISTINCT @@ -497,3 +500,5 @@ NULL mysql user max_updates int NULL NULL NULL NULL int(11) unsigned NULL mysql user max_connections int NULL NULL NULL NULL int(11) unsigned NULL mysql user max_user_connections int NULL NULL NULL NULL int(11) unsigned +1.0000 mysql user plugin char 60 60 latin1 latin1_swedish_ci char(60) +1.0000 mysql user auth_string text 65535 65535 utf8 utf8_bin text === modified file 'mysql-test/suite/funcs_1/r/is_user_privileges.result' --- mysql-test/suite/funcs_1/r/is_user_privileges.result 2008-03-07 19:18:14 +0000 +++ mysql-test/suite/funcs_1/r/is_user_privileges.result 2010-03-22 22:14:48 +0000 @@ -76,10 +76,10 @@ 'testuser3'@'localhost' NULL USAGE NO SELECT * FROM mysql.user WHERE user LIKE 'testuser%' ORDER BY host, user; -Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections -localhost testuser1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 -localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 -localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 +Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections plugin auth_string +localhost testuser1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 +localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 +localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 # # Add GRANT OPTION db_datadict.* to testuser1; GRANT UPDATE ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION; @@ -93,10 +93,10 @@ 'testuser3'@'localhost' NULL USAGE NO SELECT * FROM mysql.user WHERE user LIKE 'testuser%' ORDER BY host, user; -Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections -localhost testuser1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 -localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 -localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 +Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections plugin auth_string +localhost testuser1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 +localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 +localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 # Establish connection testuser1 (user=testuser1) SELECT * FROM information_schema.user_privileges WHERE grantee LIKE '''testuser%''' @@ -105,10 +105,10 @@ 'testuser1'@'localhost' NULL USAGE NO SELECT * FROM mysql.user WHERE user LIKE 'testuser%' ORDER BY host, user; -Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections -localhost testuser1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 -localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 -localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 +Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections plugin auth_string +localhost testuser1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 +localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 +localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 SHOW GRANTS; Grants for testuser1@localhost GRANT USAGE ON *.* TO 'testuser1'@'localhost' @@ -130,10 +130,10 @@ 'testuser3'@'localhost' NULL USAGE NO SELECT * FROM mysql.user WHERE user LIKE 'testuser%' ORDER BY host, user; -Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections -localhost testuser1 Y N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 -localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 -localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 +Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections plugin auth_string +localhost testuser1 Y N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 +localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 +localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 GRANT SELECT ON *.* TO 'testuser1'@'localhost' WITH GRANT OPTION; # # Here