summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2005-03-03 19:51:29 +0100
committerunknown <serg@serg.mylan>2005-03-03 19:51:29 +0100
commit8104faa08305df5cbc848fe593444d2716ba49eb (patch)
tree6a871c4d1335ae125f6cd13af89645ec25365e37 /sql/table.cc
parent026bb52678a2a8ca1cc2b242b5dfaa38c56261b9 (diff)
downloadmariadb-git-8104faa08305df5cbc848fe593444d2716ba49eb.tar.gz
Fixes for bugs reported by Stefano Di Paola (stefano.dipaola@wisec.it)
include/my_global.h: O_NOFOLLOW isam/create.c: create table files with O_EXCL|O_NOFOLLOW merge/mrg_create.c: create table files with O_EXCL|O_NOFOLLOW myisam/mi_create.c: create files of temporary tables with O_EXCL|O_NOFOLLOW myisammrg/myrg_create.c: create table files with O_EXCL|O_NOFOLLOW mysys/mf_tempfile.c: create temporary files with O_EXCL|O_NOFOLLOW sql/ha_myisam.cc: let mi_create know if the table is TEMPORARY sql/mysql_priv.h: --allow_suspicious_udfs sql/mysqld.cc: --allow_suspicious_udfs sql/share/english/errmsg.txt: typo sql/sql_udf.cc: --allow_suspicious_udfs don't allow xxx() udf without any of xxx_init/deinit/add/reset check paths when loading from mysql.func sql/table.cc: create frm of temporary table with O_EXCL|O_NOFOLLOW
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 43ac122c7f3..8ce6362e63c 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -1048,6 +1048,10 @@ File create_frm(register my_string name, uint reclength, uchar *fileinfo,
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 @@ File create_frm(register my_string name, uint reclength, uchar *fileinfo,
*/
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