OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Michael Schloh
  Root:   /v/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   15-Apr-2005 13:45:18
  Branch: OPENPKG_2_2_SOLID                Handle: 2005041512451800

  Modified files:           (Branch: OPENPKG_2_2_SOLID)
    openpkg-src/mysql       mysql.patch mysql.spec

  Log:
    OpenPKG-SA-2005.006-mysql for CAN-2005-0004, CAN-2005-0709, CAN-2005-0710,
    and CAN-2005-0711

  Summary:
    Revision    Changes     Path
    1.7.4.1     +474 -0     openpkg-src/mysql/mysql.patch
    1.100.2.3   +1  -1      openpkg-src/mysql/mysql.spec
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/mysql/mysql.patch
  ============================================================================
  $ cvs diff -u -r1.7 -r1.7.4.1 mysql.patch
  --- openpkg-src/mysql/mysql.patch     18 May 2004 07:21:08 -0000      1.7
  +++ openpkg-src/mysql/mysql.patch     15 Apr 2005 11:45:18 -0000      1.7.4.1
  @@ -63,3 +63,477 @@
    #endif
    #ifdef DATADIR
    DATADIR,
  +
  +OpenPKG-SA-2005.006-mysql CAN-2005-0004
  +Users may overwrite arbitrary files or read temporary files
  +via a symlink attack on insecurely created temporary files.
  +Patch code taken from http://lists.mysql.com/internals/20600
  +--- scripts/mysqlaccess.sh.orig      2004-09-07 00:29:37 +0200
  ++++ scripts/mysqlaccess.sh   2005-04-15 11:51:42 +0200
  +@@ -2,7 +2,7 @@
  + # ****************************
  + package MySQLaccess;
  + #use strict;
  +-use POSIX qw(tmpnam);
  ++use File::Temp qw(tempfile tmpnam);
  + use Fcntl;
  + 
  + BEGIN {
  +@@ -32,7 +32,6 @@
  +     $ACCESS_U_BCK = 'user_backup';   
  +     $ACCESS_D_BCK = 'db_backup';     
  +         $DIFF      = '/usr/bin/diff'; 
  +-        $TMP_PATH  = '/tmp';             #path to writable tmp-directory
  +         $MYSQLDUMP = '@bindir@/mysqldump';
  +                                          #path to mysqldump executable
  + 
  +@@ -432,7 +431,7 @@
  + # no caching on STDOUT
  +     $|=1;
  + 
  +-    $MYSQL_CNF = POSIX::tmpnam();
  ++    $MYSQL_CNF = tmpnam();
  +     %MYSQL_CNF = (client    => { },
  +                       mysql     => { },
  +                       mysqldump => { },
  +@@ -577,8 +576,6 @@
  + push(@MySQLaccess::Grant::Error,'not_found_mysql')     if !(-x $MYSQL);
  + push(@MySQLaccess::Grant::Error,'not_found_diff')      if !(-x $DIFF);
  + push(@MySQLaccess::Grant::Error,'not_found_mysqldump') if !(-x $MYSQLDUMP);
  +-push(@MySQLaccess::Grant::Error,'not_found_tmp')       if !(-d $TMP_PATH);
  +-push(@MySQLaccess::Grant::Error,'write_err_tmp')       if !(-w $TMP_PATH);
  + if (@MySQLaccess::Grant::Error) {
  +    MySQLaccess::Report::Print_Error_Messages() ;
  +    exit 0;
  +@@ -1777,17 +1774,15 @@
  +    @before = sort(@before);
  +    @after  = sort(@after);
  + 
  +-   $before = "$MySQLaccess::TMP_PATH/$MySQLaccess::script.before.$$";
  +-   $after  = "$MySQLaccess::TMP_PATH/$MySQLaccess::script.after.$$";
  +-   #$after = "/tmp/t0";
  +-   open(BEFORE,"> $before") ||
  +-    push(@MySQLaccess::Report::Errors,"Can't open temporary file $before 
for writing");
  +-   open(AFTER,"> $after") ||
  +-    push(@MySQLaccess::Report::Errors,"Can't open temporary file $after for 
writing");
  +-   print BEFORE join("\n",@before);
  +-   print AFTER  join("\n",@after);
  +-   close(BEFORE);
  +-   close(AFTER);
  ++   ($hb, $before) = tempfile("$MySQLaccess::script.XXXXXX") or
  ++    push(@MySQLaccess::Report::Errors,"Can't create temporary file: $!");
  ++   ($ha, $after)  = tempfile("$MySQLaccess::script.XXXXXX") or
  ++    push(@MySQLaccess::Report::Errors,"Can't create temporary file: $!");
  ++
  ++   print $hb join("\n",@before);
  ++   print $ha join("\n",@after);
  ++   close $hb;
  ++   close $ha;
  + 
  +    # ----------------------------------
  +    # compute difference
  +@@ -1800,8 +1795,8 @@
  + 
  +    # ----------------------------------
  +    # cleanup temp. files
  +-   unlink(BEFORE);
  +-   unlink(AFTER);
  ++   unlink($before);
  ++   unlink($after);
  + 
  +    return [EMAIL PROTECTED];
  + }
  +@@ -2316,14 +2311,6 @@
  +    => "The diff program <$MySQLaccess::DIFF> could not be found.\n"
  +      ."+ Check your path, or\n"
  +      ."+ edit the source of this script to point \$DIFF to the diff 
program.\n"
  +- ,'not_found_tmp'
  +-   => "The temporary directory <$MySQLaccess::TMP_PATH> could not be 
found.\n"
  +-     ."+ create this directory (writeable!), or\n"
  +-     ."+ edit the source of this script to point \$TMP_PATH to the right 
directory.\n"
  +- ,'write_err_tmp'
  +-   => "The temporary directory <$MySQLaccess::TMP_PATH> is not writable.\n"
  +-     ."+ make this directory writeable!, or\n"
  +-     ."+ edit the source of this script to point \$TMP_PATH to another 
directory.\n"
  +  ,'Unrecognized_option'
  +    => "Sorry,\n"
  +      ."You are using an old version of the mysql-program,\n"
  +
  +OpenPKG-SA-2005.006-mysql CAN-2005-0709
  +Arbitrary code execution using CREATE FUNCTION and user definable
  +functions (UDFs), loading dynamic library symbols with dlsym(3).
  +Patch code extracted from mysql-4.0.24/sql/sql_udf.cc,
  +mysql-4.0.24/sql/mysqld.cc, and mysql-4.0.24/sql/mysql_priv.h
  +--- sql/sql_udf.cc.orig      2004-09-07 00:29:38 +0200
  ++++ sql/sql_udf.cc   2005-04-15 12:07:38 +0200
  +@@ -79,23 +79,45 @@
  + static void *find_udf_dl(const char *dl);
  + 
  + 
  +-static void init_syms(udf_func *tmp)
  ++static char *init_syms(udf_func *tmp, char *nm)
  + {
  +-  char nm[MAX_FIELD_NAME+16],*end;
  ++  char *end;
  ++
  ++  /* short circuit immediately if dlsym(3) fails */
  ++  if (!((tmp->func=dlsym(tmp->dlhandle, tmp->name))))
  ++    return tmp->name;
  + 
  +-  tmp->func = dlsym(tmp->dlhandle, tmp->name);
  +   end=strmov(nm,tmp->name);
  +-  (void) strmov(end,"_init");
  +-  tmp->func_init = dlsym(tmp->dlhandle, nm);
  +-  (void) strmov(end,"_deinit");
  +-  tmp->func_deinit = dlsym(tmp->dlhandle, nm);
  ++
  +   if (tmp->type == UDFTYPE_AGGREGATE)
  +   {
  +     (void)strmov( end, "_reset" );
  +-    tmp->func_reset = dlsym( tmp->dlhandle, nm );
  ++    if (!((tmp->func_reset=dlsym(tmp->dlhandle, nm))))
  ++      return nm; /* failure, deny the udf load request */
  +     (void)strmov( end, "_add" );
  +-    tmp->func_add = dlsym( tmp->dlhandle, nm );
  ++    if (!((tmp->func_add=dlsym(tmp->dlhandle, nm))))
  ++      return nm; /* failure, deny the udf load request */
  ++  }
  ++
  ++  (void) strmov(end,"_deinit");
  ++  tmp->func_deinit=dlsym(tmp->dlhandle, nm);
  ++
  ++  (void) strmov(end,"_init");
  ++  tmp->func_init=dlsym(tmp->dlhandle, nm);
  ++
  ++  /*
  ++    prevent loading udf should no auxiliary symbols be defined,
  ++    for example to protect from calling functions in libc.so
  ++  */
  ++  if (!tmp->func_init && !tmp->func_deinit && tmp->type != 
UDFTYPE_AGGREGATE)
  ++  {
  ++    if (opt_allow_suspicious_udfs)
  ++      sql_print_error(ER(ER_CANT_FIND_DL_ENTRY), nm);
  ++    else
  ++      return nm; /* failure, deny the udf load request */
  +   }
  ++
  ++  return 0; /* success */
  + }
  + 
  + extern "C" byte* get_hash_key(const byte *buff,uint *length,
  +@@ -186,13 +208,14 @@
  +       new_dl=1;
  +     }
  +     tmp->dlhandle = dl;
  +-    init_syms(tmp);
  +-    if (!tmp->func)
  +-    {
  +-      sql_print_error(ER(ER_CANT_FIND_DL_ENTRY), name);
  +-      del_udf(tmp);
  +-      if (new_dl)
  +-    dlclose(dl);
  ++      char buf[MAX_FIELD_NAME+16], *missing;
  ++      if ((missing=init_syms(tmp, buf)))
  ++      {
  ++        sql_print_error(ER(ER_CANT_FIND_DL_ENTRY), missing);
  ++        del_udf(tmp);
  ++        if (new_dl)
  ++          dlclose(dl);
  ++      }
  +     }
  +   }
  +   if (error > 0)
  +@@ -398,12 +421,13 @@
  +     new_dl=1;
  +   }
  +   udf->dlhandle=dl;
  +-  init_syms(udf);
  +-
  +-  if (udf->func == NULL)
  +   {
  +-    net_printf(&thd->net, ER_CANT_FIND_DL_ENTRY, udf->name);
  +-    goto err;
  ++    char buf[MAX_FIELD_NAME+16], *missing;
  ++    if ((missing=init_syms(udf, buf)))
  ++    {
  ++      net_printf(&thd->net, ER_CANT_FIND_DL_ENTRY, missing);
  ++      goto err;
  ++    }
  +   }
  +   udf->name=strdup_root(&mem,udf->name);
  +   udf->dl=strdup_root(&mem,udf->dl);
  +--- sql/mysqld.cc.orig       2004-09-07 00:29:37 +0200
  ++++ sql/mysqld.cc    2005-04-15 12:07:38 +0200
  +@@ -311,7 +311,7 @@
  + static my_bool opt_noacl=0, opt_bootstrap=0, opt_myisam_log=0;
  + my_bool opt_safe_user_create = 0, opt_no_mix_types = 0;
  + my_bool opt_show_slave_auth_info, opt_sql_bin_update = 0;
  +-my_bool opt_log_slave_updates= 0, opt_console= 0;
  ++my_bool opt_log_slave_updates= 0, opt_console= 0, opt_allow_suspicious_udfs;
  + my_bool opt_readonly = 0, opt_sync_bdb_logs, opt_sync_frm;
  + 
  + volatile bool  mqh_used = 0;
  +@@ -3482,7 +3482,7 @@
  +   OPT_BDB_MAX_LOCK,
  +   OPT_ERROR_LOG_FILE,
  +   OPT_DEFAULT_WEEK_FORMAT,
  +-  OPT_RANGE_ALLOC_BLOCK_SIZE,
  ++  OPT_RANGE_ALLOC_BLOCK_SIZE, OPT_ALLOW_SUSPICIOUS_UDFS,
  +   OPT_QUERY_ALLOC_BLOCK_SIZE, OPT_QUERY_PREALLOC_SIZE,
  +   OPT_TRANS_ALLOC_BLOCK_SIZE, OPT_TRANS_PREALLOC_SIZE,
  +   OPT_SYNC_FRM, OPT_BDB_NOSYNC
  +@@ -3495,6 +3495,13 @@
  + {
  +   {"ansi", 'a', "Use ANSI SQL syntax instead of MySQL syntax", 0, 0, 0,
  +    GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
  ++  {"allow-suspicious-udfs", OPT_ALLOW_SUSPICIOUS_UDFS,
  ++   "Allows use of UDFs consisting of only one symbol xxx() "
  ++   "without corresponding xxx_init() or xxx_deinit(). That also means "
  ++   "that one can load any function from any library, for example exit() "
  ++   "from libc.so",
  ++   (gptr*) &opt_allow_suspicious_udfs, (gptr*) &opt_allow_suspicious_udfs,
  ++   0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
  +   {"basedir", 'b',
  +    "Path to installation directory. All paths are usually resolved relative 
to this.",
  +    (gptr*) &mysql_home_ptr, (gptr*) &mysql_home_ptr, 0, GET_STR, 
REQUIRED_ARG,
  +--- sql/mysql_priv.h.orig    2004-09-07 00:29:38 +0200
  ++++ sql/mysql_priv.h 2005-04-15 12:07:38 +0200
  +@@ -721,7 +721,7 @@
  + extern my_bool opt_safe_show_db, opt_local_infile;
  + extern my_bool opt_slave_compressed_protocol, use_temp_pool;
  + extern my_bool opt_readonly, lower_case_file_system;
  +-extern my_bool opt_enable_named_pipe, opt_sync_frm;
  ++extern my_bool opt_enable_named_pipe, opt_sync_frm, 
opt_allow_suspicious_udfs;
  + 
  + extern MYSQL_LOG mysql_log,mysql_update_log,mysql_slow_log,mysql_bin_log;
  + extern FILE *bootstrap_file;
  +
  +OpenPKG-SA-2005.006-mysql CAN-2005-0710
  +Incomplete testing of dynamic library pathnames, risking insecure
  +loading of UDFs from dynamic libraries in arbitrary locations.
  +Patch code extracted from mysql-4.0.24/sql/sql_udf.cc
  +--- sql/sql_udf.cc.orig      2004-09-07 00:29:38 +0200
  ++++ sql/sql_udf.cc   2005-04-15 12:13:15 +0200
  +@@ -165,6 +165,12 @@
  +     if (table->fields >= 4)                 // New func table
  +       udftype=(Item_udftype) table->field[3]->val_int();
  + 
  ++    if (strchr(dl_name, '/') || strlen(name) > NAME_LEN)
  ++    {
  ++      sql_print_error("Invalid row in mysql.func table for function 
'%.64s'", name);
  ++      continue;
  ++    }
  ++
  +     if (!(tmp = add_udf(name,(Item_result) table->field[1]->val_int(),
  +                     dl_name, udftype)))
  +     {
  +
  +OpenPKG-SA-2005.006-mysql CAN-2005-0711
  +Creation of temporary tables uses predictable file names, allowing
  +some users to overwrite arbitrary files via a symlink attack.
  +Patch code extracted from mysql-4.0.24/sql/table.cc,
  +mysql-4.0.24/sql/ha_myisam.cc, mysql-4.0.24/mysys/mf_tempfile.c,
  +mysql-4.0.24/myisammrg/myrg_create.c, mysql-4.0.24/myisam/mi_create.c,
  +mysql-4.0.24/merge/mrg_create.c, mysql-4.0.24/isam/create.c, and
  +mysql-4.0.24/include/my_global.h
  +--- sql/table.cc.orig        2005-04-15 12:20:10 +0200
  ++++ sql/table.cc     2005-04-15 12:21:01 +0200
  +@@ -1048,6 +1048,10 @@
  +   uint key_length;
  +   ulong length;
  +   char fill[IO_SIZE];
  ++  int create_flags=O_RDWR | O_TRUNC;
  ++
  ++  if (create_info->options & HA_LEX_CREATE_TMP_TABLE)
  ++    create_flags |= O_EXCL | O_NOFOLLOW;
  + 
  + #if SIZEOF_OFF_T > 4
  +   /* Fix this in MySQL 4.0;  The current limit is 4G rows (QQ) */
  +@@ -1062,7 +1066,7 @@
  +   */
  +   set_if_smaller(create_info->raid_chunks, 255);
  + 
  +-  if ((file=my_create(name,CREATE_MODE,O_RDWR | O_TRUNC,MYF(MY_WME))) >= 0)
  ++  if ((file=my_create(name,CREATE_MODE,create_flags,MYF(MY_WME))) >= 0)
  +   {
  +     bzero((char*) fileinfo,64);
  +     fileinfo[0]=(uchar) 254; fileinfo[1]= 1; fileinfo[2]= FRM_VER+1; // 
Header
  +--- sql/ha_myisam.cc.orig    2004-09-07 00:29:38 +0200
  ++++ sql/ha_myisam.cc 2005-04-15 12:21:01 +0200
  +@@ -1038,7 +1038,7 @@
  +                   HA_CREATE_INFO *info)
  + {
  +   int error;
  +-  uint i,j,recpos,minpos,fieldpos,temp_length,length;
  ++  uint i,j,recpos,minpos,fieldpos,temp_length,length,create_flags=0;
  +   bool found_real_auto_increment=0;
  +   enum ha_base_keytype type;
  +   char buff[FN_REFLEN];
  +@@ -1210,17 +1210,21 @@
  +   create_info.data_file_name= info->data_file_name;
  +   create_info.index_file_name=info->index_file_name;
  + 
  ++  if (info->options & HA_LEX_CREATE_TMP_TABLE)
  ++    create_flags |= HA_CREATE_TMP_TABLE;
  ++  if (options & HA_OPTION_PACK_RECORD)
  ++    create_flags |= HA_PACK_RECORD;
  ++  if (options & HA_OPTION_CHECKSUM)
  ++    create_flags |= HA_CREATE_CHECKSUM;
  ++  if (options & HA_OPTION_DELAY_KEY_WRITE)
  ++    create_flags |= HA_CREATE_DELAY_KEY_WRITE;
  ++
  +   /* TODO: Check that the following fn_format is really needed */
  +   error=mi_create(fn_format(buff,name,"","",2+4),
  +               table_arg->keys,keydef,
  +               (uint) (recinfo_pos-recinfo), recinfo,
  +               0, (MI_UNIQUEDEF*) 0,
  +-              &create_info,
  +-              (((options & HA_OPTION_PACK_RECORD) ? HA_PACK_RECORD : 0) |
  +-               ((options & HA_OPTION_CHECKSUM) ? HA_CREATE_CHECKSUM : 0) |
  +-               ((options & HA_OPTION_DELAY_KEY_WRITE) ?
  +-                HA_CREATE_DELAY_KEY_WRITE : 0)));
  +-
  ++              &create_info, create_flags);
  + 
  +   my_free((gptr) recinfo,MYF(0));
  +   DBUG_RETURN(error);
  +--- mysys/mf_tempfile.c.orig 2004-09-07 00:29:37 +0200
  ++++ mysys/mf_tempfile.c      2005-04-15 12:21:01 +0200
  +@@ -70,7 +70,7 @@
  +     {
  +       strmake(to,res,FN_REFLEN-1);
  +       (*free)(res);
  +-      file=my_create(to,0, mode, MyFlags);
  ++      file=my_create(to,0, mode | O_EXCL | O_NOFOLLOW, MyFlags);
  +     }
  +     environ=old_env;
  +   }
  +@@ -81,7 +81,7 @@
  +   {
  +     strmake(to,res,FN_REFLEN-1);
  +     (*free)(res);
  +-    file=my_create(to, 0, mode, MyFlags);
  ++    file=my_create(to, 0, mode | O_EXCL | O_NOFOLLOW, MyFlags);
  +   }
  + #elif defined(HAVE_MKSTEMP) && !defined(__NETWARE__)
  +   {
  +@@ -143,7 +143,7 @@
  +       strmake(to,res,FN_REFLEN-1);
  +       (*free)(res);
  +       file=my_create(to,0,
  +-                 (int) (O_RDWR | O_BINARY | O_TRUNC |
  ++                 (int) (O_RDWR | O_BINARY | O_TRUNC | O_EXCL | O_NOFOLLOW |
  +                         O_TEMPORARY | O_SHORT_LIVED),
  +                  MYF(MY_WME));
  + 
  +@@ -186,7 +186,7 @@
  +       }
  +       (void) strmov(end_pos,TMP_EXT);
  +       file=my_create(to,0,
  +-                 (int) (O_RDWR | O_BINARY | O_TRUNC |
  ++                 (int) (O_RDWR | O_BINARY | O_TRUNC | O_EXCL | O_NOFOLLOW |
  +                         O_TEMPORARY | O_SHORT_LIVED),
  +                  MYF(MY_WME));
  +     }
  +--- myisammrg/myrg_create.c.orig     2004-09-07 00:29:37 +0200
  ++++ myisammrg/myrg_create.c  2005-04-15 12:21:01 +0200
  +@@ -34,7 +34,7 @@
  + 
  +   errpos=0;
  +   if ((file = my_create(fn_format(buff,name,"",MYRG_NAME_EXT,4),0,
  +-       O_RDWR | O_TRUNC,MYF(MY_WME))) < 0)
  ++       O_RDWR | O_EXCL | O_NOFOLLOW,MYF(MY_WME))) < 0)
  +     goto err;
  +   errpos=1;
  +   if (table_names)
  +--- myisam/mi_create.c.orig  2004-09-07 00:29:37 +0200
  ++++ myisam/mi_create.c       2005-04-15 12:21:01 +0200
  +@@ -37,7 +37,7 @@
  + {
  +   register uint i,j;
  +   File dfile,file;
  +-  int errpos,save_errno;
  ++  int errpos,save_errno,create_mode=O_RDWR | O_TRUNC;
  +   myf create_flag;
  +   uint fields,length,max_key_length,packed,pointer,
  +        key_length,info_length,key_segs,options,min_key_length_skipp,
  +@@ -174,7 +174,10 @@
  +     min_pack_length+=varchar_length+2*varchar_count;
  +   }
  +   if (flags & HA_CREATE_TMP_TABLE)
  ++  {
  +     options|= HA_OPTION_TMP_TABLE;
  ++    create_mode|= O_EXCL | O_NOFOLLOW;
  ++  }
  +   if (flags & HA_CREATE_CHECKSUM || (options & HA_OPTION_CHECKSUM))
  +   {
  +     options|= HA_OPTION_CHECKSUM;
  +@@ -505,7 +508,7 @@
  + 
  +   if ((file= my_create_with_symlink(linkname_ptr,
  +                                 filename,
  +-                                0, O_RDWR | O_TRUNC,
  ++                                0, create_mode,
  +                                 MYF(MY_WME | create_flag))) < 0)
  +     goto err;
  +   errpos=1;
  +@@ -516,7 +519,7 @@
  +     if (share.base.raid_type)
  +     {
  +       (void) fn_format(filename,name,"",MI_NAME_DEXT,2+4);
  +-      if ((dfile=my_raid_create(filename,0,O_RDWR | O_TRUNC,
  ++      if ((dfile=my_raid_create(filename,0,create_mode,
  +                             share.base.raid_type,
  +                             share.base.raid_chunks,
  +                             share.base.raid_chunksize,
  +@@ -540,8 +543,7 @@
  +     create_flag=MY_DELETE_OLD;
  +       }
  +       if ((dfile= 
  +-       my_create_with_symlink(linkname_ptr, filename,
  +-                              0,O_RDWR | O_TRUNC,
  ++       my_create_with_symlink(linkname_ptr, filename, 0, create_mode,
  +                               MYF(MY_WME | create_flag))) < 0)
  +     goto err;
  +     }
  +--- merge/mrg_create.c.orig  2004-09-07 00:29:37 +0200
  ++++ merge/mrg_create.c       2005-04-15 12:21:01 +0200
  +@@ -33,7 +33,7 @@
  + 
  +   errpos=0;
  +   if ((file = my_create(fn_format(buff,name,"",MRG_NAME_EXT,4),0,
  +-       O_RDWR | O_TRUNC,MYF(MY_WME))) < 0)
  ++       O_RDWR | O_EXCL | O_NOFOLLOW,MYF(MY_WME))) < 0)
  +     goto err;
  +   errpos=1;
  +   if (table_names)
  +--- isam/create.c.orig       2004-09-07 00:29:37 +0200
  ++++ isam/create.c    2005-04-15 12:21:01 +0200
  +@@ -58,13 +58,13 @@
  +   base_pos=512;                                     /* Enough for 
N_STATE_INFO */
  +   bzero((byte*) &share,sizeof(share));
  +   if ((file = my_create(fn_format(buff,name,"",N_NAME_IEXT,4),0,
  +-       O_RDWR | O_TRUNC,MYF(MY_WME))) < 0)
  ++       O_RDWR | O_EXCL | O_NOFOLLOW,MYF(MY_WME))) < 0)
  +     goto err;
  +   errpos=1;
  +   VOID(fn_format(buff,name,"",N_NAME_DEXT,2+4));
  +   if (!(flags & HA_DONT_TOUCH_DATA))
  +   {
  +-    if ((dfile = my_create(buff,0,O_RDWR | O_TRUNC,MYF(MY_WME))) < 0)
  ++    if ((dfile = my_create(buff,0,O_RDWR | O_EXCL | O_NOFOLLOW, 
MYF(MY_WME))) < 0)
  +       goto err;
  +     errpos=2;
  +   }
  +--- include/my_global.h.orig 2004-09-07 00:29:36 +0200
  ++++ include/my_global.h      2005-04-15 12:21:01 +0200
  +@@ -500,6 +500,9 @@
  + #ifndef O_SHORT_LIVED
  + #define O_SHORT_LIVED       0
  + #endif
  ++#ifndef O_NOFOLLOW
  ++#define O_NOFOLLOW      0
  ++#endif
  + 
  + /* #define USE_RECORD_LOCK  */
  + 
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/mysql/mysql.spec
  ============================================================================
  $ cvs diff -u -r1.100.2.2 -r1.100.2.3 mysql.spec
  --- openpkg-src/mysql/mysql.spec      9 Nov 2004 08:53:55 -0000       
1.100.2.2
  +++ openpkg-src/mysql/mysql.spec      15 Apr 2005 11:45:18 -0000      
1.100.2.3
  @@ -40,7 +40,7 @@
   Group:        Database
   License:      GPL
   Version:      %{V_opkg}
  -Release:      2.2.1
  +Release:      2.2.2
   
   #   package options
   %option       with_server    yes
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [email protected]

Reply via email to