diff options
author | unknown <monty@mashka.mysql.fi> | 2003-04-28 10:32:56 +0300 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2003-04-28 10:32:56 +0300 |
commit | a34fc634658ce1b2ba63a45ee6bad4355a390439 (patch) | |
tree | 2420ece2919824dc5183a5aa772da0153ad2a123 /sql | |
parent | 31dc4b3c83917c48ee4882add75143a273a0c98b (diff) | |
download | mariadb-git-a34fc634658ce1b2ba63a45ee6bad4355a390439.tar.gz |
Fix for openssl on Solaris
Fix for grant bug with SELECT *
include/my_global.h:
Fix for openssl on Solaris
sql/item_strfunc.cc:
Fix for openssl on Solaris
sql/sql_acl.cc:
Indentation cleanup
sql/sql_base.cc:
Fix for grant bug with SELECT *
sql/sql_parse.cc:
Added comment
tests/grant.pl:
New grant test for SELECT *
tests/grant.res:
new grant results
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item_strfunc.cc | 3 | ||||
-rw-r--r-- | sql/sql_acl.cc | 17 | ||||
-rw-r--r-- | sql/sql_base.cc | 5 | ||||
-rw-r--r-- | sql/sql_parse.cc | 20 |
4 files changed, 26 insertions, 19 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index af4e2a01eae..29165d85451 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -27,9 +27,6 @@ #include "mysql_priv.h" #include "sql_acl.h" #include <m_ctype.h> -#ifdef HAVE_CRYPT_H -#include <crypt.h> -#endif #ifdef HAVE_OPENSSL #include <openssl/des.h> #endif /* HAVE_OPENSSL */ diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 8ee210f4e24..3f63344baba 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1997,10 +1997,10 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table, } -int mysql_table_grant (THD *thd, TABLE_LIST *table_list, - List <LEX_USER> &user_list, - List <LEX_COLUMN> &columns, ulong rights, - bool revoke_grant) +int mysql_table_grant(THD *thd, TABLE_LIST *table_list, + List <LEX_USER> &user_list, + List <LEX_COLUMN> &columns, ulong rights, + bool revoke_grant) { ulong column_priv = 0; List_iterator <LEX_USER> str_list (user_list); @@ -2374,7 +2374,7 @@ my_bool grant_init(THD *org_thd) mem_check->ok() && hash_insert(&hash_tables,(byte*) mem_check)) { /* This could only happen if we are out memory */ - grant_option = FALSE; /* purecov: deadcode */ + grant_option= FALSE; /* purecov: deadcode */ goto end_unlock; } } @@ -2404,7 +2404,8 @@ end: void grant_reload(THD *thd) { - HASH old_hash_tables;bool old_grant_option; + HASH old_hash_tables; + bool old_grant_option; MEM_ROOT old_mem; DBUG_ENTER("grant_reload"); @@ -2413,14 +2414,14 @@ void grant_reload(THD *thd) pthread_mutex_lock(&LOCK_grant); grant_version++; old_hash_tables=hash_tables; - old_grant_option = grant_option; + old_grant_option= grant_option; old_mem = memex; if (grant_init(thd)) { // Error. Revert to old hash grant_free(); /* purecov: deadcode */ hash_tables=old_hash_tables; /* purecov: deadcode */ - grant_option = old_grant_option; /* purecov: deadcode */ + grant_option= old_grant_option; /* purecov: deadcode */ memex = old_mem; /* purecov: deadcode */ } else diff --git a/sql/sql_base.cc b/sql/sql_base.cc index e27ccf55543..0f0c3c97ed2 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1984,8 +1984,9 @@ insert_fields(THD *thd,TABLE_LIST *tables, const char *db_name, (!db_name || !strcmp(tables->db,db_name)))) { /* Ensure that we have access right to all columns */ - if (grant_option && !thd->master_access && - check_grant_all_columns(thd,SELECT_ACL,table) ) + if (grant_option && !(table->grant.privilege & + table->grant.want_privilege) && + check_grant_all_columns(thd,SELECT_ACL,table)) DBUG_RETURN(-1); Field **ptr=table->field,*field; thd->used_tables|=table->map; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 1a8ea7da8f4..7479ef653a9 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2519,12 +2519,20 @@ error: /**************************************************************************** Get the user (global) and database privileges for all used tables - Returns true (error) if we can't get the privileges and we don't use - table/column grants. - The idea of EXTRA_ACL is that one will be granted access to the table if - one has the asked privilege on any column combination of the table; For - example to be able to check a table one needs to have SELECT privilege on - any column of the table. + + NOTES + The idea of EXTRA_ACL is that one will be granted access to the table if + one has the asked privilege on any column combination of the table; For + example to be able to check a table one needs to have SELECT privilege on + any column of the table. + + RETURN + 0 ok + 1 If we can't get the privileges and we don't use table/column grants. + + save_priv In this we store global and db level grants for the table + Note that we don't store db level grants if the global grants + is enough to satisfy the request. ****************************************************************************/ bool |