diff options
author | unknown <monty@donna.mysql.com> | 2001-01-14 12:25:30 +0200 |
---|---|---|
committer | unknown <monty@donna.mysql.com> | 2001-01-14 12:25:30 +0200 |
commit | 3d3d876cc18036f9a43c5eff26d3c3d0c5e46f0d (patch) | |
tree | 2246f6c5eb1aa8db6ceeda223a34ef345f2d163a /sql/sql_parse.cc | |
parent | 08637701b01f6463e89079546c0f8ff0c294c270 (diff) | |
download | mariadb-git-3d3d876cc18036f9a43c5eff26d3c3d0c5e46f0d.tar.gz |
Fixed that --open-files-limit works on Linux
Docs/manual.texi:
Update of security and replication sections
sql/ha_berkeley.cc:
More documentation
sql/sql_base.cc:
Fixed overflow bug
sql/sql_parse.cc:
Variable name change
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index c1c27ec3192..1d41ae6230a 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1784,8 +1784,8 @@ mysql_execute_command(void) break; case SQLCOM_SHOW_GRANTS: res=0; - if ((thd->user && !strcmp(thd->user,lex->grant_user->user.str)) || - !(check_access(thd, SELECT_ACL, "mysql"))) + if ((thd->priv_user && !strcmp(thd->priv_user,lex->grant_user->user.str)) || + !check_access(thd, SELECT_ACL, "mysql",0,1)) { res = mysql_show_grants(thd,lex->grant_user); } @@ -1854,7 +1854,7 @@ error: bool check_access(THD *thd,uint want_access,const char *db, uint *save_priv, - bool no_grant) + bool dont_check_global_grants) { uint db_access,dummy; if (save_priv) @@ -1862,7 +1862,7 @@ check_access(THD *thd,uint want_access,const char *db, uint *save_priv, else save_priv= &dummy; - if (!db && !thd->db && !no_grant) + if (!db && !thd->db && !dont_check_global_grants) { send_error(&thd->net,ER_NO_DB_ERROR); /* purecov: tested */ return TRUE; /* purecov: tested */ @@ -1874,7 +1874,7 @@ check_access(THD *thd,uint want_access,const char *db, uint *save_priv, return FALSE; } if ((want_access & ~thd->master_access) & ~(DB_ACLS | EXTRA_ACL) || - ! db && no_grant) + ! db && dont_check_global_grants) { // We can never grant this net_printf(&thd->net,ER_ACCESS_DENIED_ERROR, thd->priv_user, @@ -1892,8 +1892,11 @@ check_access(THD *thd,uint want_access,const char *db, uint *save_priv, db_access=thd->db_access; want_access &= ~EXTRA_ACL; // Remove SHOW attribute db_access= ((*save_priv=(db_access | thd->master_access)) & want_access); + + /* grant_option is set if there exists a single table or column grant */ if (db_access == want_access || - ((grant_option && !no_grant) && !(want_access & ~TABLE_ACLS))) + ((grant_option && !dont_check_global_grants) && + !(want_access & ~TABLE_ACLS))) return FALSE; /* Ok */ net_printf(&thd->net,ER_DBACCESS_DENIED_ERROR, thd->priv_user, |