From 59a33015b461216c22fdf51585a53c9afecf9bfb Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 1 Jun 2006 12:34:44 +0300 Subject: [PATCH 1/4] Fixed Bug#19479:mysqldump creates invalid dump. Only check for FN_DEVCHAR in filenames if FN_DEVCHAR is defined. This allows to use table names with ":" on non windows platforms. On Windows platform get an error if you use table name that contains FN_DEVCHAR include/config-win.h: Moved FN_DEVCHAR to config-win.h include/my_global.h: Moved FN_DEVCHAR to config-win.h mysql-test/r/create.result: Added testcase for Bug#19479:mysqldump creates invalid dump BitKeeper/etc/ignore: Added sql/share/iso639-2.txt sql/share/fixerrmsg.pl to the ignore list mysql-test/t/create.test: Added testcase for Bug#19479:mysqldump creates invalid dump mysys/mf_fn_ext.c: Added checking of BASKSLASH_MBTAIL as dirname_part depends on it. Fixed cast and indentation. sql/table.cc: Only check for FN_DEVCHAR in filenames if FN_DEVCHAR is defined. This allows to use table names with ":" on non windows platforms. On Windows platform get an error if you use table name that contains FN_DEVCHAR --- .bzrignore | 2 ++ include/config-win.h | 1 + include/my_global.h | 1 - mysql-test/r/create.result | 14 ++++++++++++++ mysql-test/t/create.test | 15 +++++++++++++++ mysys/mf_fn_ext.c | 6 +++--- sql/table.cc | 8 ++++++++ 7 files changed, 43 insertions(+), 4 deletions(-) diff --git a/.bzrignore b/.bzrignore index 80ed7872005..5eb09b07063 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1282,3 +1282,5 @@ extra/yassl/taocrypt/benchmark/benchmark extra/yassl/taocrypt/test/test extra/yassl/testsuite/testsuite client/mysql_upgrade +sql/share/iso639-2.txt +sql/share/fixerrmsg.pl diff --git a/include/config-win.h b/include/config-win.h index 8d937ffed22..75133ddc837 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -384,6 +384,7 @@ inline double ulonglong2double(ulonglong value) #define FN_LIBCHAR '\\' #define FN_ROOTDIR "\\" +#define FN_DEVCHAR ':' #define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */ #define FN_NO_CASE_SENCE /* Files are not case-sensitive */ #define OS_FILE_LIMIT 2048 diff --git a/include/my_global.h b/include/my_global.h index 7adf4845984..e7205c94c18 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -599,7 +599,6 @@ typedef SOCKET_SIZE_TYPE size_socket; #define FN_HOMELIB '~' /* ~/ is used as abbrev for home dir */ #define FN_CURLIB '.' /* ./ is used as abbrev for current dir */ #define FN_PARENTDIR ".." /* Parent directory; Must be a string */ -#define FN_DEVCHAR ':' #ifndef FN_LIBCHAR #ifdef __EMX__ diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 27a6c8a9d03..57ec76a0b53 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -773,3 +773,17 @@ Warnings: Warning 1071 Specified key was too long; max key length is 765 bytes insert into t1 values('aaa'); drop table t1; +drop table if exists `about:text`; +create table `about:text` ( +_id int not null auto_increment, +`about:text` varchar(255) not null default '', +primary key (_id) +); +show create table `about:text`; +Table Create Table +about:text CREATE TABLE `about:text` ( + `_id` int(11) NOT NULL auto_increment, + `about:text` varchar(255) NOT NULL default '', + PRIMARY KEY (`_id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table `about:text`; diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index e22c2b5c426..d1e9818088d 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -674,4 +674,19 @@ create table t1(f1 varchar(800) binary not null, key(f1)) engine = innodb insert into t1 values('aaa'); drop table t1; +# +# Bug#19479:mysqldump creates invalid dump +# +--disable_warnings +drop table if exists `about:text`; +--enable_warnings +create table `about:text` ( +_id int not null auto_increment, +`about:text` varchar(255) not null default '', +primary key (_id) +); + +show create table `about:text`; +drop table `about:text`; + # End of 5.0 tests diff --git a/mysys/mf_fn_ext.c b/mysys/mf_fn_ext.c index 9c86a8072ef..d7b1f8c1d61 100644 --- a/mysys/mf_fn_ext.c +++ b/mysys/mf_fn_ext.c @@ -40,14 +40,14 @@ my_string fn_ext(const char *name) DBUG_ENTER("fn_ext"); DBUG_PRINT("mfunkt",("name: '%s'",name)); -#if defined(FN_DEVCHAR) || defined(FN_C_AFTER_DIR) +#if defined(FN_DEVCHAR) || defined(FN_C_AFTER_DIR) || defined(BASKSLASH_MBTAIL) { char buff[FN_REFLEN]; gpos=(my_string) name+dirname_part(buff,(char*) name); } #else - if (!(gpos=strrchr(name,FNLIBCHAR))) - gpos=name; + if (!(gpos= strrchr(name, FN_LIBCHAR))) + gpos= (my_string) name; #endif pos=strchr(gpos,FN_EXTCHAR); DBUG_RETURN (pos ? pos : strend(gpos)); diff --git a/sql/table.cc b/sql/table.cc index 8e23bea2540..a71435ac0db 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1614,6 +1614,10 @@ bool check_db_name(char *name) if (*name == '/' || *name == '\\' || *name == FN_LIBCHAR || *name == FN_EXTCHAR) return 1; +#ifdef FN_DEVCHAR + if (*name == FN_DEVCHAR) + return 1; +#endif name++; } return last_char_is_space || (uint) (name - start) > NAME_LEN; @@ -1656,6 +1660,10 @@ bool check_table_name(const char *name, uint length) #endif if (*name == '/' || *name == '\\' || *name == FN_EXTCHAR) return 1; +#ifdef FN_DEVCHAR + if (*name == FN_DEVCHAR) + return 1; +#endif name++; } #if defined(USE_MB) && defined(USE_MB_IDENT) From 88ed77f2b772063b50438c9ba388f95989e5c990 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 2 Jun 2006 22:03:39 +0300 Subject: [PATCH 2/4] BUG#19363: mysql --no_pager makes core dump. The problem was missing break; operator. BitKeeper/etc/ignore: Added client/#mysql.cc# to the ignore list client/mysql.cc: Fixed bug #19363: mysql --no_pager makes core dump. There was break; missing in the case statement. --- .bzrignore | 1 + client/mysql.cc | 1 + 2 files changed, 2 insertions(+) diff --git a/.bzrignore b/.bzrignore index 80ed7872005..2bd67528bdc 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1282,3 +1282,4 @@ extra/yassl/taocrypt/benchmark/benchmark extra/yassl/taocrypt/test/test extra/yassl/testsuite/testsuite client/mysql_upgrade +client/#mysql.cc# diff --git a/client/mysql.cc b/client/mysql.cc index 900df825b25..6fcda6d766f 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -823,6 +823,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case OPT_NOPAGER: printf("WARNING: option deprecated; use --disable-pager instead.\n"); opt_nopager= 1; + break; case OPT_MYSQL_PROTOCOL: { if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0) From 8b6806800ada3472ae678ead6d9d52e89bc7fa05 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 4 Jun 2006 21:27:41 +0300 Subject: [PATCH 3/4] BUG#19479: mysqldump creates invalid dump Moved the test case to separate non-windows specific file. mysql-test/r/create.result: Moved non-windows specific test case to create_not_windows.test. mysql-test/t/create.test: Moved non-windows specific test case to create_not_windows.test. mysql-test/r/create_not_windows.result: #19479: mysqldump creates invalid dump Moved the non-windows specific test case from create.test. mysql-test/t/create_not_windows.test: #19479: mysqldump creates invalid dump Moved the non-windows specific test case from create.test. --- mysql-test/r/create.result | 14 -------------- mysql-test/r/create_not_windows.result | 14 ++++++++++++++ mysql-test/t/create.test | 15 --------------- mysql-test/t/create_not_windows.test | 20 ++++++++++++++++++++ 4 files changed, 34 insertions(+), 29 deletions(-) create mode 100644 mysql-test/r/create_not_windows.result create mode 100644 mysql-test/t/create_not_windows.test diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 57ec76a0b53..27a6c8a9d03 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -773,17 +773,3 @@ Warnings: Warning 1071 Specified key was too long; max key length is 765 bytes insert into t1 values('aaa'); drop table t1; -drop table if exists `about:text`; -create table `about:text` ( -_id int not null auto_increment, -`about:text` varchar(255) not null default '', -primary key (_id) -); -show create table `about:text`; -Table Create Table -about:text CREATE TABLE `about:text` ( - `_id` int(11) NOT NULL auto_increment, - `about:text` varchar(255) NOT NULL default '', - PRIMARY KEY (`_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -drop table `about:text`; diff --git a/mysql-test/r/create_not_windows.result b/mysql-test/r/create_not_windows.result new file mode 100644 index 00000000000..b975c98c2b1 --- /dev/null +++ b/mysql-test/r/create_not_windows.result @@ -0,0 +1,14 @@ +drop table if exists `about:text`; +create table `about:text` ( +_id int not null auto_increment, +`about:text` varchar(255) not null default '', +primary key (_id) +); +show create table `about:text`; +Table Create Table +about:text CREATE TABLE `about:text` ( + `_id` int(11) NOT NULL auto_increment, + `about:text` varchar(255) NOT NULL default '', + PRIMARY KEY (`_id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table `about:text`; diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index d1e9818088d..e22c2b5c426 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -674,19 +674,4 @@ create table t1(f1 varchar(800) binary not null, key(f1)) engine = innodb insert into t1 values('aaa'); drop table t1; -# -# Bug#19479:mysqldump creates invalid dump -# ---disable_warnings -drop table if exists `about:text`; ---enable_warnings -create table `about:text` ( -_id int not null auto_increment, -`about:text` varchar(255) not null default '', -primary key (_id) -); - -show create table `about:text`; -drop table `about:text`; - # End of 5.0 tests diff --git a/mysql-test/t/create_not_windows.test b/mysql-test/t/create_not_windows.test new file mode 100644 index 00000000000..71ad9ccd7fe --- /dev/null +++ b/mysql-test/t/create_not_windows.test @@ -0,0 +1,20 @@ +# Non-windows specific create tests. + +--source include/not_windows.inc + +# +# Bug#19479:mysqldump creates invalid dump +# +--disable_warnings +drop table if exists `about:text`; +--enable_warnings +create table `about:text` ( +_id int not null auto_increment, +`about:text` varchar(255) not null default '', +primary key (_id) +); + +show create table `about:text`; +drop table `about:text`; + +# End of 5.0 tests From 28e05fc752748844f1b8154239c6480c8a36f709 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 5 Jun 2006 15:41:29 +0200 Subject: [PATCH 4/4] Import patch for yassl 1.35 - Better check of required buffer size when processing incoming record headers extra/yassl/README: Import patch yassl.diff extra/yassl/src/handshake.cpp: Import patch yassl.diff extra/yassl/include/openssl/engine.h: Import patch yassl.diff extra/yassl/include/openssl/pkcs12.h: Import patch yassl.diff --- extra/yassl/README | 16 ++++++++++++--- extra/yassl/include/openssl/engine.h | 5 +++++ extra/yassl/include/openssl/pkcs12.h | 5 +++++ extra/yassl/src/handshake.cpp | 30 ++++++++++++++++++++++------ 4 files changed, 47 insertions(+), 9 deletions(-) create mode 100644 extra/yassl/include/openssl/engine.h create mode 100644 extra/yassl/include/openssl/pkcs12.h diff --git a/extra/yassl/README b/extra/yassl/README index 62209723f66..a5ff70aa6f6 100644 --- a/extra/yassl/README +++ b/extra/yassl/README @@ -1,4 +1,14 @@ -yaSSL Release notes, version 1.3.0 (04/26/06) +yaSSL Release notes, version 1.3.5 (06/01/06) + + + This release of yaSSL contains bug fixes, portability enhancements, + better libcurl support, and improved non-blocking I/O. + +See normal build instructions below under 1.0.6. +See libcurl build instructions below under 1.3.0. + + +********************yaSSL Release notes, version 1.3.0 (04/26/06) This release of yaSSL contains minor bug fixes, portability enhancements, @@ -17,8 +27,8 @@ See normal build instructions below under 1.0.6. make make openssl-links - (then go to your libcurl home and tell libcurl about yaSSL) - ./configure --with-ssl=/yaSSL-HomeDir + (then go to your libcurl home and tell libcurl about yaSSL build dir) + ./configure --with-ssl=/yaSSL-BuildDir LDFLAGS=-lm make diff --git a/extra/yassl/include/openssl/engine.h b/extra/yassl/include/openssl/engine.h new file mode 100644 index 00000000000..39952fcae84 --- /dev/null +++ b/extra/yassl/include/openssl/engine.h @@ -0,0 +1,5 @@ +/* engine.h for libcurl */ + +#undef HAVE_OPENSSL_ENGINE_H + + diff --git a/extra/yassl/include/openssl/pkcs12.h b/extra/yassl/include/openssl/pkcs12.h new file mode 100644 index 00000000000..e452fc879c4 --- /dev/null +++ b/extra/yassl/include/openssl/pkcs12.h @@ -0,0 +1,5 @@ +/* pkcs12.h for libcurl */ + + +#undef HAVE_OPENSSL_PKCS12_H + diff --git a/extra/yassl/src/handshake.cpp b/extra/yassl/src/handshake.cpp index 2b099af930c..12b62f26e14 100644 --- a/extra/yassl/src/handshake.cpp +++ b/extra/yassl/src/handshake.cpp @@ -458,6 +458,11 @@ void ProcessOldClientHello(input_buffer& input, SSL& ssl) uint16 sz = ((b0 & 0x7f) << 8) | b1; + if (sz > input.get_remaining()) { + ssl.SetError(bad_input); + return; + } + // hashHandShake manually const opaque* buffer = input.get_buffer() + input.get_current(); ssl.useHashes().use_MD5().update(buffer, sz); @@ -681,25 +686,38 @@ DoProcessReply(SSL& ssl, mySTL::auto_ptr buffered) // old style sslv2 client hello? if (ssl.getSecurity().get_parms().entity_ == server_end && ssl.getStates().getServer() == clientNull) - if (buffer.peek() != handshake) + if (buffer.peek() != handshake) { ProcessOldClientHello(buffer, ssl); + if (ssl.GetError()) { + buffered.reset(0); + return buffered; + } + } while(!buffer.eof()) { // each record RecordLayerHeader hdr; + bool needHdr = false; + + if (static_cast(RECORD_HEADER) > buffer.get_remaining()) + needHdr = true; + else { buffer >> hdr; ssl.verifyState(hdr); + } // make sure we have enough input in buffer to process this record - if (hdr.length_ > buffer.get_remaining()) { - uint sz = buffer.get_remaining() + RECORD_HEADER; + if (needHdr || hdr.length_ > buffer.get_remaining()) { + // put header in front for next time processing + uint extra = needHdr ? 0 : RECORD_HEADER; + uint sz = buffer.get_remaining() + extra; buffered.reset(NEW_YS input_buffer(sz, buffer.get_buffer() + - buffer.get_current() - RECORD_HEADER, sz)); + buffer.get_current() - extra, sz)); break; } while (buffer.get_current() < hdr.length_ + RECORD_HEADER + offset) { - // each message in record + // each message in record, can be more than 1 if not encrypted if (ssl.getSecurity().get_parms().pending_ == false) // cipher on decrypt_message(ssl, buffer, hdr.length_); mySTL::auto_ptr msg(mf.CreateObject(hdr.type_), ysDelete); @@ -717,7 +735,7 @@ DoProcessReply(SSL& ssl, mySTL::auto_ptr buffered) } offset += hdr.length_ + RECORD_HEADER; } - return buffered; // done, don't call again + return buffered; }