Skip to content

Commit fe1b205

Browse files
committed
merge from 5.5.16
2 parents 0f35957 + d10bddf commit fe1b205

74 files changed

Lines changed: 715 additions & 373 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bzr-mysql/default.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[MYSQL]
2-
post_commit_to = "[email protected].com"
3-
post_push_to = "[email protected].com"
4-
tree_name = "mysql-5.5"
2+
post_commit_to = "dbg_mysql_security@sun.com"
3+
post_push_to = "dbg_mysql_security@sun.com"
4+
tree_name = "mysql-5.5-security"

client/mysql_plugin.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -846,12 +846,19 @@ static int process_options(int argc, char *argv[], char *operation)
846846
{
847847
i= (int)strlength(opt_basedir);
848848
if (opt_basedir[i-1] != FN_LIBCHAR || opt_basedir[i-1] != FN_LIBCHAR2)
849+
{
850+
char buff[FN_REFLEN];
851+
852+
strncpy(buff, opt_basedir, sizeof(buff) - 1);
849853
#ifdef __WIN__
850-
if (opt_basedir[i-1] != '/')
851-
strcat(opt_basedir, "//");
854+
strncat(buff, "/", sizeof(buff) - strlen(buff) - 1);
852855
#else
853-
strcat(opt_basedir, FN_DIRSEP);
856+
strncat(buff, FN_DIRSEP, sizeof(buff) - strlen(buff) - 1);
854857
#endif
858+
buff[sizeof(buff) - 1]= 0;
859+
my_delete(opt_basedir, MYF(0));
860+
opt_basedir= my_strdup(buff, MYF(MY_FAE));
861+
}
855862
}
856863

857864
/*
@@ -1157,10 +1164,13 @@ static int bootstrap_server(char *server_path, char *bootstrap_file)
11571164

11581165
#ifdef __WIN__
11591166
char *format_str= 0;
1160-
char *verbose_str= "";
1167+
const char *verbose_str= NULL;
1168+
11611169

11621170
if (opt_verbose)
1163-
strcat(verbose_str, "--console");
1171+
verbose_str= "--console";
1172+
else
1173+
verbose_str= "";
11641174
if (has_spaces(opt_datadir) || has_spaces(opt_basedir) ||
11651175
has_spaces(bootstrap_file))
11661176
format_str= "\"%s %s --bootstrap --datadir=%s --basedir=%s < %s\"";

cmake/plugin.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ MACRO(MYSQL_ADD_PLUGIN)
196196
# Install dynamic library
197197
MYSQL_INSTALL_TARGETS(${target} DESTINATION ${INSTALL_PLUGINDIR} COMPONENT Server)
198198
INSTALL_DEBUG_TARGET(${target} DESTINATION ${INSTALL_PLUGINDIR}/debug)
199+
# Add installed files to list for RPMs
200+
FILE(APPEND ${CMAKE_BINARY_DIR}/support-files/plugins.files
201+
"%attr(755, root, root) %{_prefix}/${INSTALL_PLUGINDIR}/${ARG_MODULE_OUTPUT_NAME}.so\n"
202+
"%attr(755, root, root) %{_prefix}/${INSTALL_PLUGINDIR}/debug/${ARG_MODULE_OUTPUT_NAME}.so\n")
199203
# For internal testing in PB2, append collections files
200204
IF(DEFINED ENV{PB2WORKDIR})
201205
PLUGIN_APPEND_COLLECTIONS(${plugin})

include/mysql/plugin.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ typedef struct st_mysql_xid MYSQL_XID;
7171
Plugin API. Common for all plugin types.
7272
*/
7373

74-
#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0102
74+
#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0103
7575

7676
/*
7777
The allowable types of plugins
@@ -120,7 +120,7 @@ __MYSQL_DECLARE_PLUGIN(NAME, \
120120
builtin_ ## NAME ## _sizeof_struct_st_plugin, \
121121
builtin_ ## NAME ## _plugin)
122122

123-
#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0}}
123+
#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0,0}}
124124

125125
/*
126126
declarations for SHOW STATUS support in plugins
@@ -143,6 +143,14 @@ struct st_mysql_show_var {
143143
typedef int (*mysql_show_var_func)(MYSQL_THD, struct st_mysql_show_var*, char *);
144144

145145

146+
/*
147+
Constants for plugin flags.
148+
*/
149+
150+
#define PLUGIN_OPT_NO_INSTALL 1UL /* Not dynamically loadable */
151+
#define PLUGIN_OPT_NO_UNINSTALL 2UL /* Not dynamically unloadable */
152+
153+
146154
/*
147155
declarations for server variables and command line options
148156
*/
@@ -415,6 +423,7 @@ struct st_mysql_plugin
415423
struct st_mysql_show_var *status_vars;
416424
struct st_mysql_sys_var **system_vars;
417425
void * __reserved1; /* reserved for dependency checking */
426+
unsigned long flags; /* flags for plugin */
418427
};
419428

420429
/*************************************************************************

include/mysql/plugin_audit.h.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
struct st_mysql_show_var *status_vars;
102102
struct st_mysql_sys_var **system_vars;
103103
void * __reserved1;
104+
unsigned long flags;
104105
};
105106
#include "plugin_ftparser.h"
106107
#include "plugin.h"

include/mysql/plugin_auth.h.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
struct st_mysql_show_var *status_vars;
102102
struct st_mysql_sys_var **system_vars;
103103
void * __reserved1;
104+
unsigned long flags;
104105
};
105106
#include "plugin_ftparser.h"
106107
#include "plugin.h"

include/mysql/plugin_ftparser.h.pp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
THD_WAIT_BINLOG= 8,
4444
THD_WAIT_GROUP_COMMIT= 9,
4545
THD_WAIT_SYNC= 10,
46-
THD_WAIT_LAST= 11
46+
THD_WAIT_LAST= 11
4747
} thd_wait_type;
4848
extern struct thd_wait_service_st {
4949
void (*thd_wait_begin_func)(void*, int);
@@ -101,6 +101,7 @@
101101
struct st_mysql_show_var *status_vars;
102102
struct st_mysql_sys_var **system_vars;
103103
void * __reserved1;
104+
unsigned long flags;
104105
};
105106
#include "plugin_ftparser.h"
106107
struct st_mysql_daemon

libmysql/authentication_win/common.cc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,24 @@ template <> void error_log_print<error_log_level::INFO>(const char *fmt, ...);
2222
template <> void error_log_print<error_log_level::WARNING>(const char *fmt, ...);
2323
template <> void error_log_print<error_log_level::ERROR>(const char *fmt, ...);
2424

25+
/**
26+
Option indicating desired level of logging. Values:
27+
28+
0 - no logging
29+
1 - log only error messages
30+
2 - additionally log warnings
31+
3 - additionally log info notes
32+
4 - also log debug messages
33+
34+
Value of this option should be taken into account in the
35+
implementation of error_log_vprint() function (see
36+
log_client.cc).
37+
38+
Note: No error or debug messages are logged in production code
39+
(see logging macros in common.h).
40+
*/
41+
int opt_auth_win_log_level= 2;
42+
2543

2644
/** Connection class **************************************************/
2745

libmysql/authentication_win/common.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@ struct error_log_level
4141
typedef enum {INFO, WARNING, ERROR} type;
4242
};
4343

44+
extern "C" int opt_auth_win_log_level;
45+
unsigned int get_log_level(void);
46+
void set_log_level(unsigned int);
47+
4448

4549
/*
4650
If DEBUG_ERROR_LOG is defined then error logging happens only
4751
in debug-copiled code. Otherwise ERROR_LOG() expands to
48-
error_log_print() even in production code. Note that in client
49-
plugin, error_log_print() will print nothing if opt_auth_win_clinet_log
50-
is 0.
52+
error_log_print() even in production code.
5153
5254
Note: Macro ERROR_LOG() can use printf-like format string like this:
5355
@@ -57,8 +59,6 @@ struct error_log_level
5759
to fprintf() (see error_log_vprint() function).
5860
*/
5961

60-
extern "C" int opt_auth_win_client_log;
61-
6262
#if defined(DEBUG_ERROR_LOG) && defined(DBUG_OFF)
6363
#define ERROR_LOG(Level, Msg) do {} while (0)
6464
#else
@@ -67,7 +67,7 @@ extern "C" int opt_auth_win_client_log;
6767

6868

6969
void error_log_vprint(error_log_level::type level,
70-
const char *fmt, va_list args);
70+
const char *fmt, va_list args);
7171

7272
template <error_log_level::type Level>
7373
void error_log_print(const char *fmt, ...)
@@ -96,7 +96,7 @@ const char* get_last_error_message(Error_message_buf);
9696

9797
#define DBUG_PRINT_DO(Keyword, Msg) \
9898
do { \
99-
if (2 > opt_auth_win_client_log) break; \
99+
if (4 > get_log_level()) break; \
100100
fprintf(stderr, "winauth: %s: ", Keyword); \
101101
debug_msg Msg; \
102102
} while (0)

libmysql/authentication_win/handshake_client.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -323,13 +323,13 @@ int win_auth_handshake_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
323323
int opt_val= opt ? atoi(opt) : 0;
324324
if (opt && !opt_val)
325325
{
326-
if (!strncasecmp("on", opt, 2)) opt_val= 1;
327-
if (!strncasecmp("yes", opt, 3)) opt_val= 1;
328-
if (!strncasecmp("true", opt, 4)) opt_val= 1;
329-
if (!strncasecmp("debug", opt, 5)) opt_val= 2;
330-
if (!strncasecmp("dbug", opt, 4)) opt_val= 2;
326+
if (!strncasecmp("on", opt, 2)) opt_val= 2;
327+
if (!strncasecmp("yes", opt, 3)) opt_val= 2;
328+
if (!strncasecmp("true", opt, 4)) opt_val= 2;
329+
if (!strncasecmp("debug", opt, 5)) opt_val= 4;
330+
if (!strncasecmp("dbug", opt, 4)) opt_val= 4;
331331
}
332-
opt_auth_win_client_log= opt_val;
332+
set_log_level(opt_val);
333333
}
334334

335335
ERROR_LOG(INFO, ("Authentication handshake for account %s", mysql->user));

0 commit comments

Comments
 (0)