From 1744d26c956736d2733d81f046bf41859b1504fb Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 23 Mar 2004 17:15:20 +0200 Subject: [PATCH 1/3] used right table for grants check (BUG#3270) mysql-test/t/alter_table.test: test for BUG#3270 added --- mysql-test/t/alter_table.test | 19 +++++++++++++++++++ sql/sql_parse.cc | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index cfb4f958372..ec057c156c8 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -3,6 +3,8 @@ # drop table if exists t1; +drop database if exists mysqltest; + create table t1 ( col1 int not null auto_increment primary key, col2 varchar(30) not null, @@ -99,3 +101,20 @@ select * from t1; select * from mysqltest.t1; drop table t1; drop database mysqltest; + +# +# Rights for renaming test (Bug #3270) +# +connect (root,localhost,root,,test,0,mysql-master.sock); +connection root; +--disable_warnings +create database mysqltest; +--enable_warnings +create table mysqltest.t1 (a int,b int,c int); +grant all on mysqltest.t1 to mysqltest_1@localhost; +connect (user1,localhost,mysqltest_1,,mysqltest,0,mysql-master.sock); +connection user1; +-- error 1142 +alter table t1 rename t2; +connection root; +drop database mysqltest; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 3f6fa8d24ad..e3d19de6374 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1446,7 +1446,7 @@ mysql_execute_command(void) tmp_table.real_name=lex->name; tmp_table.db=lex->db; tmp_table.grant.privilege=priv; - if (check_grant(thd,INSERT_ACL | CREATE_ACL,tables)) + if (check_grant(thd,INSERT_ACL | CREATE_ACL, &tmp_table)) goto error; } } From 7084ad6a73f4563b45a32af1a2874df32fca2540 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Mar 2004 20:27:07 +0100 Subject: [PATCH 2/3] protection against "ln -s /etc/passwd /tmp/failed-mysql-bugreport" --- scripts/mysqlbug.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mysqlbug.sh b/scripts/mysqlbug.sh index bd5cb497e59..3e0e2f9e8b8 100644 --- a/scripts/mysqlbug.sh +++ b/scripts/mysqlbug.sh @@ -252,9 +252,9 @@ eval $EDIT $TEMP if cmp -s $TEMP $TEMP.x then echo "File not changed, no bug report submitted." - cp $TEMP /tmp/failed-mysql-bugreport + mv -f $TEMP /tmp/failed-mysql-bugreport echo "The raw bug report exists in /tmp/failed-mysql-bugreport" - echo "If you use this remember that the first lines of the report now is a lie.." + echo "If you use this remember that the first lines of the report are now a lie.." exit 1 fi From 143e585a7f5deed19e618cfa7e2987d0949d7ad7 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 25 Mar 2004 21:52:25 +0200 Subject: [PATCH 3/3] Improved test case service backport from 4.0 mysql-test/t/alter_table.test: Improved test case sql/nt_servc.cc: service backport from 4.0 BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + mysql-test/t/alter_table.test | 2 ++ sql/nt_servc.cc | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 359cad878c2..e0a0f4304fb 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -25,6 +25,7 @@ monty@donna.mysql.fi monty@hundin.mysql.fi monty@mashka.mysql.fi monty@mishka.mysql.fi +monty@mysql.com monty@narttu. monty@narttu.mysql.fi monty@tik. diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index ec057c156c8..160495bcba6 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -117,4 +117,6 @@ connection user1; -- error 1142 alter table t1 rename t2; connection root; +revoke all privileges on mysqltest.t1 from mysqltest_1@localhost; +delete from mysql.user where user='mysqltest_1'; drop database mysqltest; diff --git a/sql/nt_servc.cc b/sql/nt_servc.cc index b18d3d00d88..320098cd8bc 100644 --- a/sql/nt_servc.cc +++ b/sql/nt_servc.cc @@ -498,7 +498,7 @@ BOOL NTService::IsService(LPCSTR ServiceName) if (scm = OpenSCManager(0, 0,SC_MANAGER_ENUMERATE_SERVICE)) { - if ((service = OpenService(scm,ServiceName, SERVICE_ALL_ACCESS ))) + if ((service = OpenService(scm,ServiceName, SERVICE_QUERY_STATUS))) { ret_value=TRUE; CloseServiceHandle(service);