]>
Commit | Line | Data |
---|---|---|
85beda0e | 1 | From: kpettersson |
2 | Date: October 23 2007 4:07pm | |
3 | Subject: bk commit into 5.0 tree (thek:1.2537) BUG#16470 | |
4 | ||
5 | Below is the list of changes that have just been committed into a local | |
6 | 5.0 repository of thek. When thek does a push these changes will | |
7 | be propagated to the main repository and, within 24 hours after the | |
8 | push, to the public repository. | |
9 | For information on how to access the public repository | |
10 | see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html | |
11 | ||
12 | ChangeSet@stripped, 2007-10-23 16:07:32+02:00, thek@adventure.(none) +1 -0 | |
13 | Bug #16470 crash on grant if old grant tables | |
14 | ||
15 | If a user upgraded the server without running mysql_upgrade, and later tried | |
16 | to run a GRANT command on grant tables like tables_priv, the server would | |
17 | crash. | |
18 | ||
19 | This patch fixes this problem by checking if the grant tables were properly | |
20 | initialized before attempt to store any new grants. | |
21 | ||
22 | sql/sql_acl.cc@stripped, 2007-10-23 16:07:31+02:00, thek@adventure.(none) +9 -3 | |
23 | If grant_reload fails, don't try to store new GRANTs because the grant tables | |
24 | weren't properly initialized. | |
25 | ||
26 | diff -Nrup a/sql/sql_acl.cc b/sql/sql_acl.cc | |
27 | --- a/sql/sql_acl.cc 2007-06-20 14:24:27 +02:00 | |
28 | +++ b/sql/sql_acl.cc 2007-10-23 16:07:31 +02:00 | |
29 | @@ -2786,7 +2786,12 @@ bool mysql_table_grant(THD *thd, TABLE_L | |
30 | MYF(0)); | |
31 | DBUG_RETURN(TRUE); | |
32 | } | |
33 | - | |
34 | + if (!grant_option) | |
35 | + { | |
36 | + my_message(ER_TABLE_NEEDS_UPGRADE, ER(ER_ILLEGAL_GRANT_FOR_TABLE), | |
37 | + MYF(0)); | |
38 | + DBUG_RETURN(TRUE); | |
39 | + } | |
40 | if (!revoke_grant) | |
41 | { | |
42 | if (columns.elements) | |
43 | @@ -3335,13 +3340,14 @@ my_bool grant_init() | |
44 | DBUG_RETURN(1); /* purecov: deadcode */ | |
45 | thd->thread_stack= (char*) &thd; | |
46 | thd->store_globals(); | |
47 | - return_val= grant_reload(thd); | |
48 | + if (grant_reload(thd)) | |
49 | + return TRUE; | |
50 | delete thd; | |
51 | /* Remember that we don't have a THD */ | |
52 | my_pthread_setspecific_ptr(THR_THD, 0); | |
53 | /* Set the grant option flag so we will check grants */ | |
54 | grant_option= TRUE; | |
55 | - DBUG_RETURN(return_val); | |
56 | + DBUG_RETURN(FALSE); | |
57 | } | |
58 | ||
59 |