- Fix client input validation vulnerability

- Fix my.cnf search path
This commit is contained in:
Alex Dupre 2008-10-10 18:35:13 +00:00
parent a0bc190df2
commit c7d5687bb9
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=221400
15 changed files with 145 additions and 10 deletions

View File

@ -7,7 +7,7 @@
PORTNAME?= mysql
PORTVERSION= 5.0.67
PORTREVISION?= 0
PORTREVISION?= 1
CATEGORIES= databases
MASTER_SITES= ${MASTER_SITE_MYSQL}
MASTER_SITE_SUBDIR= MySQL-5.0

View File

@ -0,0 +1,27 @@
--- client/mysql.cc.orig 2007-11-13 13:29:42 +0000
+++ client/mysql.cc 2008-05-01 19:16:09 +0000
@@ -2636,9 +2636,12 @@
{
while((field = mysql_fetch_field(result)))
{
- tee_fprintf(PAGER, "<TH>%s</TH>", (field->name ?
- (field->name[0] ? field->name :
- " &nbsp; ") : "NULL"));
+ tee_fputs("<TH>", PAGER);
+ if (field->name && field->name[0])
+ xmlencode_print(field->name, field->name_length);
+ else
+ tee_fputs(field->name ? " &nbsp; " : "NULL", PAGER);
+ tee_fputs("</TH>", PAGER);
}
(void) tee_fputs("</TR>", PAGER);
}
@@ -2651,7 +2654,7 @@
for (uint i=0; i < mysql_num_fields(result); i++)
{
(void) tee_fputs("<TD>", PAGER);
- safe_put_field(cur[i],lengths[i]);
+ xmlencode_print(cur[i], lengths[i]);
(void) tee_fputs("</TD>", PAGER);
}
(void) tee_fputs("</TR>", PAGER);

View File

@ -15,7 +15,7 @@
if (DEFAULT_SYSCONFDIR != "")
+ {
errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
+ errors += add_directory(alloc, DEFAULT_SYSCONFDIR "mysql", dirs);
+ errors += add_directory(alloc, DEFAULT_SYSCONFDIR "/mysql", dirs);
+ }
#endif /* __EMX__ || __OS2__ */

View File

@ -7,7 +7,7 @@
PORTNAME?= mysql
PORTVERSION= 5.1.28
PORTREVISION?= 0
PORTREVISION?= 1
CATEGORIES= databases
MASTER_SITES= ${MASTER_SITE_MYSQL}
MASTER_SITE_SUBDIR= MySQL-5.1

View File

@ -0,0 +1,27 @@
--- client/mysql.cc.orig 2007-11-13 13:29:42 +0000
+++ client/mysql.cc 2008-05-01 19:16:09 +0000
@@ -2636,9 +2636,12 @@
{
while((field = mysql_fetch_field(result)))
{
- tee_fprintf(PAGER, "<TH>%s</TH>", (field->name ?
- (field->name[0] ? field->name :
- " &nbsp; ") : "NULL"));
+ tee_fputs("<TH>", PAGER);
+ if (field->name && field->name[0])
+ xmlencode_print(field->name, field->name_length);
+ else
+ tee_fputs(field->name ? " &nbsp; " : "NULL", PAGER);
+ tee_fputs("</TH>", PAGER);
}
(void) tee_fputs("</TR>", PAGER);
}
@@ -2651,7 +2654,7 @@
for (uint i=0; i < mysql_num_fields(result); i++)
{
(void) tee_fputs("<TD>", PAGER);
- safe_put_field(cur[i],lengths[i]);
+ xmlencode_print(cur[i], lengths[i]);
(void) tee_fputs("</TD>", PAGER);
}
(void) tee_fputs("</TR>", PAGER);

View File

@ -15,7 +15,7 @@
if (DEFAULT_SYSCONFDIR != "")
+ {
errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
+ errors += add_directory(alloc, DEFAULT_SYSCONFDIR "mysql", dirs);
+ errors += add_directory(alloc, DEFAULT_SYSCONFDIR "/mysql", dirs);
+ }
#endif /* DEFAULT_SYSCONFDIR */

View File

@ -7,7 +7,7 @@
PORTNAME?= mysql
PORTVERSION= 5.1.28
PORTREVISION?= 0
PORTREVISION?= 1
CATEGORIES= databases
MASTER_SITES= ${MASTER_SITE_MYSQL}
MASTER_SITE_SUBDIR= MySQL-5.1

View File

@ -0,0 +1,27 @@
--- client/mysql.cc.orig 2007-11-13 13:29:42 +0000
+++ client/mysql.cc 2008-05-01 19:16:09 +0000
@@ -2636,9 +2636,12 @@
{
while((field = mysql_fetch_field(result)))
{
- tee_fprintf(PAGER, "<TH>%s</TH>", (field->name ?
- (field->name[0] ? field->name :
- " &nbsp; ") : "NULL"));
+ tee_fputs("<TH>", PAGER);
+ if (field->name && field->name[0])
+ xmlencode_print(field->name, field->name_length);
+ else
+ tee_fputs(field->name ? " &nbsp; " : "NULL", PAGER);
+ tee_fputs("</TH>", PAGER);
}
(void) tee_fputs("</TR>", PAGER);
}
@@ -2651,7 +2654,7 @@
for (uint i=0; i < mysql_num_fields(result); i++)
{
(void) tee_fputs("<TD>", PAGER);
- safe_put_field(cur[i],lengths[i]);
+ xmlencode_print(cur[i], lengths[i]);
(void) tee_fputs("</TD>", PAGER);
}
(void) tee_fputs("</TR>", PAGER);

View File

@ -15,7 +15,7 @@
if (DEFAULT_SYSCONFDIR != "")
+ {
errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
+ errors += add_directory(alloc, DEFAULT_SYSCONFDIR "mysql", dirs);
+ errors += add_directory(alloc, DEFAULT_SYSCONFDIR "/mysql", dirs);
+ }
#endif /* DEFAULT_SYSCONFDIR */

View File

@ -7,7 +7,7 @@
PORTNAME?= mysql
PORTVERSION= 5.1.28
PORTREVISION?= 0
PORTREVISION?= 1
CATEGORIES= databases
MASTER_SITES= ${MASTER_SITE_MYSQL}
MASTER_SITE_SUBDIR= MySQL-5.1

View File

@ -0,0 +1,27 @@
--- client/mysql.cc.orig 2007-11-13 13:29:42 +0000
+++ client/mysql.cc 2008-05-01 19:16:09 +0000
@@ -2636,9 +2636,12 @@
{
while((field = mysql_fetch_field(result)))
{
- tee_fprintf(PAGER, "<TH>%s</TH>", (field->name ?
- (field->name[0] ? field->name :
- " &nbsp; ") : "NULL"));
+ tee_fputs("<TH>", PAGER);
+ if (field->name && field->name[0])
+ xmlencode_print(field->name, field->name_length);
+ else
+ tee_fputs(field->name ? " &nbsp; " : "NULL", PAGER);
+ tee_fputs("</TH>", PAGER);
}
(void) tee_fputs("</TR>", PAGER);
}
@@ -2651,7 +2654,7 @@
for (uint i=0; i < mysql_num_fields(result); i++)
{
(void) tee_fputs("<TD>", PAGER);
- safe_put_field(cur[i],lengths[i]);
+ xmlencode_print(cur[i], lengths[i]);
(void) tee_fputs("</TD>", PAGER);
}
(void) tee_fputs("</TR>", PAGER);

View File

@ -15,7 +15,7 @@
if (DEFAULT_SYSCONFDIR != "")
+ {
errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
+ errors += add_directory(alloc, DEFAULT_SYSCONFDIR "mysql", dirs);
+ errors += add_directory(alloc, DEFAULT_SYSCONFDIR "/mysql", dirs);
+ }
#endif /* DEFAULT_SYSCONFDIR */

View File

@ -7,7 +7,7 @@
PORTNAME?= mysql
PORTVERSION= 5.1.28
PORTREVISION?= 0
PORTREVISION?= 1
CATEGORIES= databases
MASTER_SITES= ${MASTER_SITE_MYSQL}
MASTER_SITE_SUBDIR= MySQL-5.1

View File

@ -0,0 +1,27 @@
--- client/mysql.cc.orig 2007-11-13 13:29:42 +0000
+++ client/mysql.cc 2008-05-01 19:16:09 +0000
@@ -2636,9 +2636,12 @@
{
while((field = mysql_fetch_field(result)))
{
- tee_fprintf(PAGER, "<TH>%s</TH>", (field->name ?
- (field->name[0] ? field->name :
- " &nbsp; ") : "NULL"));
+ tee_fputs("<TH>", PAGER);
+ if (field->name && field->name[0])
+ xmlencode_print(field->name, field->name_length);
+ else
+ tee_fputs(field->name ? " &nbsp; " : "NULL", PAGER);
+ tee_fputs("</TH>", PAGER);
}
(void) tee_fputs("</TR>", PAGER);
}
@@ -2651,7 +2654,7 @@
for (uint i=0; i < mysql_num_fields(result); i++)
{
(void) tee_fputs("<TD>", PAGER);
- safe_put_field(cur[i],lengths[i]);
+ xmlencode_print(cur[i], lengths[i]);
(void) tee_fputs("</TD>", PAGER);
}
(void) tee_fputs("</TR>", PAGER);

View File

@ -15,7 +15,7 @@
if (DEFAULT_SYSCONFDIR != "")
+ {
errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
+ errors += add_directory(alloc, DEFAULT_SYSCONFDIR "mysql", dirs);
+ errors += add_directory(alloc, DEFAULT_SYSCONFDIR "/mysql", dirs);
+ }
#endif /* DEFAULT_SYSCONFDIR */