~ubuntu-branches/ubuntu/lucid/mysql-dfsg-5.1/lucid-security

« back to all changes in this revision

Viewing changes to extra/comp_err.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 22:33:55 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20120222223355-or06x1euyk8n0ldi
Tags: 5.1.61-0ubuntu0.10.04.1
* SECURITY UPDATE: Update to 5.1.61 to fix multiple security issues
  (LP: #937869)
  - http://www.oracle.com/technetwork/topics/security/cpujan2012-366304.html
  - CVE-2011-2262
  - CVE-2012-0075
  - CVE-2012-0112
  - CVE-2012-0113
  - CVE-2012-0114
  - CVE-2012-0115
  - CVE-2012-0116
  - CVE-2012-0117
  - CVE-2012-0118
  - CVE-2012-0119
  - CVE-2012-0120
  - CVE-2012-0484
  - CVE-2012-0485
  - CVE-2012-0486
  - CVE-2012-0487
  - CVE-2012-0488
  - CVE-2012-0489
  - CVE-2012-0490
  - CVE-2012-0491
  - CVE-2012-0492
  - CVE-2012-0493
  - CVE-2012-0494
  - CVE-2012-0495
  - CVE-2012-0496
* Dropped patches unnecessary with 5.1.61:
  - debian/patches/90_mysql_safer_strmov.dpatch
  - debian/patches/51_ssl_test_certs.dpatch
  - debian/patches/52_CVE-2009-4030.dpatch
  - debian/patches/53_CVE-2009-4484.dpatch
  - debian/patches/54_CVE-2008-7247.dpatch
  - debian/patches/55_CVE-2010-1621.dpatch
  - debian/patches/56_CVE-2010-1850.dpatch
  - debian/patches/57_CVE-2010-1849.dpatch
  - debian/patches/58_CVE-2010-1848.dpatch
  - debian/patches/59_CVE-2010-1626.dpatch
  - debian/patches/60_CVE-2010-2008.dpatch
  - debian/patches/60_CVE-2010-3677.dpatch
  - debian/patches/60_CVE-2010-3678.dpatch
  - debian/patches/60_CVE-2010-3679.dpatch
  - debian/patches/60_CVE-2010-3680.dpatch
  - debian/patches/60_CVE-2010-3681.dpatch
  - debian/patches/60_CVE-2010-3682.dpatch
  - debian/patches/60_CVE-2010-3683.dpatch
  - debian/patches/60_CVE-2010-3833.dpatch
  - debian/patches/60_CVE-2010-3834.dpatch
  - debian/patches/60_CVE-2010-3835.dpatch
  - debian/patches/60_CVE-2010-3836.dpatch
  - debian/patches/60_CVE-2010-3837.dpatch
  - debian/patches/60_CVE-2010-3838.dpatch
  - debian/patches/60_CVE-2010-3839.dpatch
  - debian/patches/60_CVE-2010-3840.dpatch
  - debian/patches/61_disable_longfilename_test.dpatch
  - debian/patches/62_alter_table_fix.dpatch
  - debian/patches/63_cherrypick-upstream-49479.dpatch
  - debian/patches/10_readline_build_fix.dpatch
* debian/mysql-client-5.1.docs: removed EXCEPTIONS-CLIENT file
* debian/mysql-server-5.1.docs,debian/libmysqlclient16.docs,
  debian/libmysqlclient-dev.docs: removed, no longer necessary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2004 MySQL AB
 
1
/*
 
2
   Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
2
3
 
3
4
   This program is free software; you can redistribute it and/or modify
4
5
   it under the terms of the GNU General Public License as published by
11
12
 
12
13
   You should have received a copy of the GNU General Public License
13
14
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
 
16
*/
15
17
 
16
18
/*
17
19
  Written by Anjuta Widenius
99
101
  {"debug", '#', "This is a non-debug version. Catch this and exit",
100
102
   0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
101
103
#else
102
 
  {"debug", '#', "Output debug log", (uchar**) & default_dbug_option,
103
 
   (uchar**) & default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
 
104
  {"debug", '#', "Output debug log", &default_dbug_option,
 
105
   &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
104
106
#endif
105
 
  {"debug-info", 'T', "Print some debug info at exit.", (uchar**) & info_flag,
106
 
   (uchar**) & info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
 
107
  {"debug-info", 'T', "Print some debug info at exit.", &info_flag,
 
108
   &info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
107
109
  {"help", '?', "Displays this help and exits.", 0, 0, 0, GET_NO_ARG,
108
110
   NO_ARG, 0, 0, 0, 0, 0, 0},
109
111
  {"version", 'V', "Prints version", 0, 0, 0, GET_NO_ARG,
110
112
   NO_ARG, 0, 0, 0, 0, 0, 0},
111
 
  {"charset", 'C', "Charset dir", (uchar**) & charsets_dir,
112
 
   (uchar**) & charsets_dir,
113
 
   0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
114
 
  {"in_file", 'F', "Input file", (uchar**) & TXTFILE, (uchar**) & TXTFILE,
115
 
   0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
116
 
  {"out_dir", 'D', "Output base directory", (uchar**) & DATADIRECTORY,
117
 
   (uchar**) & DATADIRECTORY,
118
 
   0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
119
 
  {"out_file", 'O', "Output filename (errmsg.sys)", (uchar**) & OUTFILE,
120
 
   (uchar**) & OUTFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
121
 
  {"header_file", 'H', "mysqld_error.h file ", (uchar**) & HEADERFILE,
122
 
   (uchar**) & HEADERFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
123
 
  {"name_file", 'N', "mysqld_ername.h file ", (uchar**) & NAMEFILE,
124
 
   (uchar**) & NAMEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
125
 
  {"state_file", 'S', "sql_state.h file", (uchar**) & STATEFILE,
126
 
   (uchar**) & STATEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 
113
  {"charset", 'C', "Charset dir", &charsets_dir, &charsets_dir,
 
114
   0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 
115
  {"in_file", 'F', "Input file", &TXTFILE, &TXTFILE,
 
116
   0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 
117
  {"out_dir", 'D', "Output base directory", &DATADIRECTORY, &DATADIRECTORY,
 
118
   0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 
119
  {"out_file", 'O', "Output filename (errmsg.sys)", &OUTFILE,
 
120
   &OUTFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 
121
  {"header_file", 'H', "mysqld_error.h file ", &HEADERFILE,
 
122
   &HEADERFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 
123
  {"name_file", 'N', "mysqld_ername.h file ", &NAMEFILE,
 
124
   &NAMEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 
125
  {"state_file", 'S', "sql_state.h file", &STATEFILE,
 
126
   &STATEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
127
127
  {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
128
128
};
129
129
 
641
641
static ha_checksum checksum_format_specifier(const char* msg)
642
642
{
643
643
  ha_checksum chksum= 0;
644
 
  const char* p= msg;
645
 
  const char* start= 0;
646
 
  int num_format_specifiers= 0;
 
644
  const uchar* p= (const uchar*) msg;
 
645
  const uchar* start= NULL;
 
646
  uint32 num_format_specifiers= 0;
647
647
  while (*p)
648
648
  {
649
649
 
660
660
      case 'u':
661
661
      case 'x':
662
662
      case 's':
663
 
        chksum= my_checksum(chksum, start, (uint) (p - start));
 
663
        chksum= my_checksum(chksum, start, (uint) (p + 1 - start));
664
664
        start= 0; /* Not in format specifier anymore */
665
665
        break;
666
666
 
833
833
static struct errors *parse_error_string(char *str, int er_count)
834
834
{
835
835
  struct errors *new_error;
836
 
  char *start;
837
836
  DBUG_ENTER("parse_error_string");
838
837
  DBUG_PRINT("enter", ("str: %s", str));
839
838
 
844
843
    DBUG_RETURN(0);                             /* OOM: Fatal error */
845
844
 
846
845
  /* getting the error name */
847
 
  start= str;
848
846
  str= skip_delimiters(str);
849
847
 
850
848
  if (!(new_error->er_name= get_word(&str)))
1030
1028
{
1031
1029
  int i, nr;
1032
1030
  char *row= pos;
 
1031
  size_t len;
1033
1032
  DBUG_ENTER("parse_text_line");
1034
1033
 
 
1034
  len= strlen (pos);
1035
1035
  while (*pos)
1036
1036
  {
1037
1037
    if (*pos == '\\')
1039
1039
      switch (*++pos) {
1040
1040
      case '\\':
1041
1041
      case '"':
1042
 
        VOID(strmov(pos - 1, pos));
 
1042
        VOID(memmove (pos - 1, pos, len - (row - pos)));
1043
1043
        break;
1044
1044
      case 'n':
1045
1045
        pos[-1]= '\n';
1046
 
        VOID(strmov(pos, pos + 1));
 
1046
        VOID(memmove (pos, pos + 1, len - (row - pos)));
1047
1047
        break;
1048
1048
      default:
1049
1049
        if (*pos >= '0' && *pos < '8')
1053
1053
            nr= nr * 8 + (*(pos++) - '0');
1054
1054
          pos -= i;
1055
1055
          pos[-1]= nr;
1056
 
          VOID(strmov(pos, pos + i));
 
1056
          VOID(memmove (pos, pos + i, len - (row - pos)));
1057
1057
        }
1058
1058
        else if (*pos)
1059
 
          VOID(strmov(pos - 1, pos));           /* Remove '\' */
 
1059
          VOID(memmove (pos - 1, pos, len - (row - pos)));              /* Remove '\' */
1060
1060
      }
1061
1061
    }
1062
1062
    else