PATH: //usr/include/mysql/server/private
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📄 aligned.h
↓
X
📄 aria_backup.h
↓
X
📄 assume_aligned.h
↓
X
📁 atomic/
X
📄 authors.h
↓
X
📄 backup.h
↓
X
📄 bounded_queue.h
↓
X
📄 client_settings.h
↓
X
📄 compat56.h
↓
X
📄 config.h
↓
X
📄 contributors.h
↓
X
📄 create_options.h
↓
X
📄 create_tmp_table.h
↓
X
📄 cset_narrowing.h
↓
X
📄 custom_conf.h
↓
X
📄 datadict.h
↓
X
📄 ddl_log.h
↓
X
📄 debug.h
↓
X
📄 debug_sync.h
↓
X
📄 derived_handler.h
↓
X
📄 derror.h
↓
X
📄 des_key_file.h
↓
X
📄 discover.h
↓
X
📄 dur_prop.h
↓
X
📄 embedded_priv.h
↓
X
📄 event_data_objects.h
↓
X
📄 event_db_repository.h
↓
X
📄 event_parse_data.h
↓
X
📄 event_queue.h
↓
X
📄 event_scheduler.h
↓
X
📄 events.h
↓
X
📄 field.h
↓
X
📄 field_comp.h
↓
X
📄 filesort.h
↓
X
📄 filesort_utils.h
↓
X
📄 ft_global.h
↓
X
📄 gcalc_slicescan.h
↓
X
📄 gcalc_tools.h
↓
X
📄 grant.h
↓
X
📄 group_by_handler.h
↓
X
📄 gstream.h
↓
X
📄 ha_handler_stats.h
↓
X
📄 ha_partition.h
↓
X
📄 ha_sequence.h
↓
X
📄 handle_connections_win.h
↓
X
📄 handler.h
↓
X
📄 hash.h
↓
X
📄 hash_filo.h
↓
X
📄 heap.h
↓
X
📄 hostname.h
↓
X
📄 ilist.h
↓
X
📄 init.h
↓
X
📄 innodb_priv.h
↓
X
📄 item.h
↓
X
📄 item_cmpfunc.h
↓
X
📄 item_create.h
↓
X
📄 item_func.h
↓
X
📄 item_geofunc.h
↓
X
📄 item_jsonfunc.h
↓
X
📄 item_row.h
↓
X
📄 item_strfunc.h
↓
X
📄 item_subselect.h
↓
X
📄 item_sum.h
↓
X
📄 item_timefunc.h
↓
X
📄 item_vers.h
↓
X
📄 item_windowfunc.h
↓
X
📄 item_xmlfunc.h
↓
X
📄 json_table.h
↓
X
📄 key.h
↓
X
📄 keycaches.h
↓
X
📄 lex.h
↓
X
📄 lex_string.h
↓
X
📄 lex_symbol.h
↓
X
📄 lf.h
↓
X
📄 lock.h
↓
X
📄 log.h
↓
X
📄 log_event.h
↓
X
📄 log_event_data_type.h
↓
X
📄 log_event_old.h
↓
X
📄 log_slow.h
↓
X
📄 maria.h
↓
X
📄 mariadb.h
↓
X
📄 mdl.h
↓
X
📄 mem_root_array.h
↓
X
📄 message.h
↓
X
📄 multi_range_read.h
↓
X
📄 my_alarm.h
↓
X
📄 my_apc.h
↓
X
📄 my_atomic.h
↓
X
📄 my_atomic_wrapper.h
↓
X
📄 my_base.h
↓
X
📄 my_bit.h
↓
X
📄 my_bitmap.h
↓
X
📄 my_check_opt.h
↓
X
📄 my_compare.h
↓
X
📄 my_counter.h
↓
X
📄 my_cpu.h
↓
X
📄 my_crypt.h
↓
X
📄 my_decimal.h
↓
X
📄 my_default.h
↓
X
📄 my_handler_errors.h
↓
X
📄 my_json_writer.h
↓
X
📄 my_libwrap.h
↓
X
📄 my_md5.h
↓
X
📄 my_minidump.h
↓
X
📄 my_nosys.h
↓
X
📄 my_rdtsc.h
↓
X
📄 my_rnd.h
↓
X
📄 my_service_manager.h
↓
X
📄 my_stack_alloc.h
↓
X
📄 my_stacktrace.h
↓
X
📄 my_time.h
↓
X
📄 my_tree.h
↓
X
📄 my_uctype.h
↓
X
📄 my_user.h
↓
X
📄 myisam.h
↓
X
📄 myisamchk.h
↓
X
📄 myisammrg.h
↓
X
📄 myisampack.h
↓
X
📄 mysqld.h
↓
X
📄 mysqld_default_groups.h
↓
X
📄 mysqld_suffix.h
↓
X
📄 mysys_err.h
↓
X
📄 opt_range.h
↓
X
📄 opt_subselect.h
↓
X
📄 opt_trace.h
↓
X
📄 opt_trace_context.h
↓
X
📄 parse_file.h
↓
X
📄 partition_element.h
↓
X
📄 partition_info.h
↓
X
📄 password.h
↓
X
📄 pfs_file_provider.h
↓
X
📄 pfs_idle_provider.h
↓
X
📄 pfs_memory_provider.h
↓
X
📄 pfs_metadata_provider.h
↓
X
📄 pfs_socket_provider.h
↓
X
📄 pfs_stage_provider.h
↓
X
📄 pfs_statement_provider.h
↓
X
📄 pfs_table_provider.h
↓
X
📄 pfs_thread_provider.h
↓
X
📄 pfs_transaction_provider.h
↓
X
📄 privilege.h
↓
X
📄 probes_mysql.h
↓
X
📄 probes_mysql_dtrace.h
↓
X
📄 probes_mysql_nodtrace.h
↓
X
📄 procedure.h
↓
X
📄 protocol.h
↓
X
📄 proxy_protocol.h
↓
X
📄 queues.h
↓
X
📄 records.h
↓
X
📄 repl_failsafe.h
↓
X
📄 replication.h
↓
X
📄 rijndael.h
↓
X
📄 rowid_filter.h
↓
X
📄 rpl_constants.h
↓
X
📄 rpl_filter.h
↓
X
📄 rpl_gtid.h
↓
X
📄 rpl_injector.h
↓
X
📄 rpl_mi.h
↓
X
📄 rpl_parallel.h
↓
X
📄 rpl_record.h
↓
X
📄 rpl_record_old.h
↓
X
📄 rpl_reporting.h
↓
X
📄 rpl_rli.h
↓
X
📄 rpl_tblmap.h
↓
X
📄 rpl_utility.h
↓
X
📄 scheduler.h
↓
X
📄 scope.h
↓
X
📄 select_handler.h
↓
X
📄 semisync.h
↓
X
📄 semisync_master.h
↓
X
📄 semisync_master_ack_receiver.h
↓
X
📄 semisync_slave.h
↓
X
📄 service_versions.h
↓
X
📄 session_tracker.h
↓
X
📄 set_var.h
↓
X
📄 slave.h
↓
X
📄 socketpair.h
↓
X
📄 source_revision.h
↓
X
📄 sp.h
↓
X
📄 sp_cache.h
↓
X
📄 sp_head.h
↓
X
📄 sp_pcontext.h
↓
X
📄 sp_rcontext.h
↓
X
📄 span.h
↓
X
📄 spatial.h
↓
X
📄 sql_acl.h
↓
X
📄 sql_admin.h
↓
X
📄 sql_alloc.h
↓
X
📄 sql_alter.h
↓
X
📄 sql_analyse.h
↓
X
📄 sql_analyze_stmt.h
↓
X
📄 sql_array.h
↓
X
📄 sql_audit.h
↓
X
📄 sql_base.h
↓
X
📄 sql_basic_types.h
↓
X
📄 sql_binlog.h
↓
X
📄 sql_bitmap.h
↓
X
📄 sql_bootstrap.h
↓
X
📄 sql_cache.h
↓
X
📄 sql_callback.h
↓
X
📄 sql_class.h
↓
X
📄 sql_cmd.h
↓
X
📄 sql_connect.h
↓
X
📄 sql_const.h
↓
X
📄 sql_crypt.h
↓
X
📄 sql_cte.h
↓
X
📄 sql_cursor.h
↓
X
📄 sql_db.h
↓
X
📄 sql_debug.h
↓
X
📄 sql_delete.h
↓
X
📄 sql_derived.h
↓
X
📄 sql_digest.h
↓
X
📄 sql_digest_stream.h
↓
X
📄 sql_do.h
↓
X
📄 sql_error.h
↓
X
📄 sql_explain.h
↓
X
📄 sql_expression_cache.h
↓
X
📄 sql_get_diagnostics.h
↓
X
📄 sql_handler.h
↓
X
📄 sql_help.h
↓
X
📄 sql_hset.h
↓
X
📄 sql_i_s.h
↓
X
📄 sql_insert.h
↓
X
📄 sql_join_cache.h
↓
X
📄 sql_lex.h
↓
X
📄 sql_lifo_buffer.h
↓
X
📄 sql_limit.h
↓
X
📄 sql_list.h
↓
X
📄 sql_load.h
↓
X
📄 sql_locale.h
↓
X
📄 sql_manager.h
↓
X
📄 sql_mode.h
↓
X
📄 sql_parse.h
↓
X
📄 sql_partition.h
↓
X
📄 sql_partition_admin.h
↓
X
📄 sql_plist.h
↓
X
📄 sql_plugin.h
↓
X
📄 sql_plugin_compat.h
↓
X
📄 sql_prepare.h
↓
X
📄 sql_priv.h
↓
X
📄 sql_profile.h
↓
X
📄 sql_reload.h
↓
X
📄 sql_rename.h
↓
X
📄 sql_repl.h
↓
X
📄 sql_schema.h
↓
X
📄 sql_select.h
↓
X
📄 sql_sequence.h
↓
X
📄 sql_servers.h
↓
X
📄 sql_show.h
↓
X
📄 sql_signal.h
↓
X
📄 sql_sort.h
↓
X
📄 sql_statistics.h
↓
X
📄 sql_string.h
↓
X
📄 sql_table.h
↓
X
📄 sql_tablespace.h
↓
X
📄 sql_test.h
↓
X
📄 sql_time.h
↓
X
📄 sql_trigger.h
↓
X
📄 sql_truncate.h
↓
X
📄 sql_tvc.h
↓
X
📄 sql_type.h
↓
X
📄 sql_type_fixedbin.h
↓
X
📄 sql_type_fixedbin_storage.h
↓
X
📄 sql_type_geom.h
↓
X
📄 sql_type_int.h
↓
X
📄 sql_type_json.h
↓
X
📄 sql_type_real.h
↓
X
📄 sql_type_string.h
↓
X
📄 sql_udf.h
↓
X
📄 sql_union.h
↓
X
📄 sql_update.h
↓
X
📄 sql_view.h
↓
X
📄 sql_window.h
↓
X
📄 ssl_compat.h
↓
X
📄 strfunc.h
↓
X
📄 structs.h
↓
X
📄 sys_vars_shared.h
↓
X
📄 t_ctype.h
↓
X
📄 table.h
↓
X
📄 table_cache.h
↓
X
📄 thr_alarm.h
↓
X
📄 thr_lock.h
↓
X
📄 thr_malloc.h
↓
X
📄 thr_timer.h
↓
X
📄 thread_cache.h
↓
X
📄 threadpool.h
↓
X
📄 threadpool_generic.h
↓
X
📄 threadpool_winsockets.h
↓
X
📄 transaction.h
↓
X
📄 tzfile.h
↓
X
📄 tztime.h
↓
X
📄 uniques.h
↓
X
📄 unireg.h
↓
X
📄 vers_string.h
↓
X
📄 violite.h
↓
X
📄 waiting_threads.h
↓
X
📄 welcome_copyright_notice.h
↓
X
📄 win_tzname_data.h
↓
X
📄 winservice.h
↓
X
📄 wqueue.h
↓
X
📄 wsrep.h
↓
X
📄 wsrep_applier.h
↓
X
📄 wsrep_binlog.h
↓
X
📄 wsrep_client_service.h
↓
X
📄 wsrep_client_state.h
↓
X
📄 wsrep_condition_variable.h
↓
X
📄 wsrep_high_priority_service.h
↓
X
📄 wsrep_mutex.h
↓
X
📄 wsrep_mysqld.h
↓
X
📄 wsrep_mysqld_c.h
↓
X
📄 wsrep_on.h
↓
X
📄 wsrep_priv.h
↓
X
📄 wsrep_schema.h
↓
X
📄 wsrep_server_service.h
↓
X
📄 wsrep_server_state.h
↓
X
📄 wsrep_sst.h
↓
X
📄 wsrep_storage_service.h
↓
X
📄 wsrep_thd.h
↓
X
📄 wsrep_trans_observer.h
↓
X
📄 wsrep_types.h
↓
X
📄 wsrep_utils.h
↓
X
📄 wsrep_var.h
↓
X
📄 wsrep_xid.h
↓
X
📄 xa.h
↓
X
SAVING...
BERHASIL DIUBAH!
EDITING: sql_acl.h
#ifndef SQL_ACL_INCLUDED #define SQL_ACL_INCLUDED /* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2017, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */ #include "violite.h" /* SSL_type */ #include "sql_class.h" /* LEX_COLUMN */ #include "grant.h" #include "sql_cmd.h" /* Sql_cmd */ enum mysql_db_table_field { MYSQL_DB_FIELD_HOST = 0, MYSQL_DB_FIELD_DB, MYSQL_DB_FIELD_USER, MYSQL_DB_FIELD_SELECT_PRIV, MYSQL_DB_FIELD_INSERT_PRIV, MYSQL_DB_FIELD_UPDATE_PRIV, MYSQL_DB_FIELD_DELETE_PRIV, MYSQL_DB_FIELD_CREATE_PRIV, MYSQL_DB_FIELD_DROP_PRIV, MYSQL_DB_FIELD_GRANT_PRIV, MYSQL_DB_FIELD_REFERENCES_PRIV, MYSQL_DB_FIELD_INDEX_PRIV, MYSQL_DB_FIELD_ALTER_PRIV, MYSQL_DB_FIELD_CREATE_TMP_TABLE_PRIV, MYSQL_DB_FIELD_LOCK_TABLES_PRIV, MYSQL_DB_FIELD_CREATE_VIEW_PRIV, MYSQL_DB_FIELD_SHOW_VIEW_PRIV, MYSQL_DB_FIELD_CREATE_ROUTINE_PRIV, MYSQL_DB_FIELD_ALTER_ROUTINE_PRIV, MYSQL_DB_FIELD_EXECUTE_PRIV, MYSQL_DB_FIELD_EVENT_PRIV, MYSQL_DB_FIELD_TRIGGER_PRIV, MYSQL_DB_FIELD_DELETE_VERSIONING_ROWS_PRIV, MYSQL_DB_FIELD_COUNT }; extern const TABLE_FIELD_DEF mysql_db_table_def; extern bool mysql_user_table_is_in_short_password_format; extern LEX_CSTRING host_not_specified; extern LEX_CSTRING current_user; extern LEX_CSTRING current_role; extern LEX_CSTRING current_user_and_current_role; static inline int access_denied_error_code(int passwd_used) { #ifdef mysqld_error_find_printf_error_used return 0; #else return passwd_used == 2 ? ER_ACCESS_DENIED_NO_PASSWORD_ERROR : ER_ACCESS_DENIED_ERROR; #endif } /* prototypes */ bool hostname_requires_resolving(const char *hostname); bool acl_init(bool dont_read_acl_tables); bool acl_reload(THD *thd); void acl_free(bool end=0); privilege_t acl_get(const char *host, const char *ip, const char *user, const char *db, my_bool db_is_pattern); bool acl_authenticate(THD *thd, uint com_change_user_pkt_len); bool acl_getroot(Security_context *sctx, const char *user, const char *host, const char *ip, const char *db); bool acl_check_host(const char *host, const char *ip); bool check_change_password(THD *thd, LEX_USER *user); bool change_password(THD *thd, LEX_USER *user); bool mysql_grant_role(THD *thd, List<LEX_USER> &user_list, bool revoke); bool mysql_grant(THD *thd, const char *db, List <LEX_USER> &user_list, privilege_t rights, bool revoke, bool is_proxy); int mysql_table_grant(THD *thd, TABLE_LIST *table, List <LEX_USER> &user_list, List <LEX_COLUMN> &column_list, privilege_t rights, bool revoke); bool mysql_routine_grant(THD *thd, TABLE_LIST *table, const Sp_handler *sph, List <LEX_USER> &user_list, privilege_t rights, bool revoke, bool write_to_binlog); bool grant_init(); void grant_free(void); bool grant_reload(THD *thd); bool check_grant(THD *thd, privilege_t want_access, TABLE_LIST *tables, bool any_combination_will_do, uint number, bool no_errors); bool check_grant_column (THD *thd, GRANT_INFO *grant, const char *db_name, const char *table_name, const char *name, size_t length, Security_context *sctx); bool check_column_grant_in_table_ref(THD *thd, TABLE_LIST * table_ref, const char *name, size_t length, Field *fld); bool check_grant_all_columns(THD *thd, privilege_t want_access, Field_iterator_table_ref *fields); bool check_grant_routine(THD *thd, privilege_t want_access, TABLE_LIST *procs, const Sp_handler *sph, bool no_error); bool check_grant_db(THD *thd,const char *db); bool check_global_access(THD *thd, const privilege_t want_access, bool no_errors= false); bool check_access(THD *thd, privilege_t want_access, const char *db, privilege_t *save_priv, GRANT_INTERNAL_INFO *grant_internal_info, bool dont_check_global_grants, bool no_errors); privilege_t get_table_grant(THD *thd, TABLE_LIST *table); privilege_t get_column_grant(THD *thd, GRANT_INFO *grant, const char *db_name, const char *table_name, const char *field_name); bool get_show_user(THD *thd, LEX_USER *lex_user, const char **username, const char **hostname, const char **rolename); void mysql_show_grants_get_fields(THD *thd, List<Item> *fields, const char *name, size_t length); bool mysql_show_grants(THD *thd, LEX_USER *user); bool mysql_show_create_user(THD *thd, LEX_USER *user); int fill_schema_enabled_roles(THD *thd, TABLE_LIST *tables, COND *cond); int fill_schema_applicable_roles(THD *thd, TABLE_LIST *tables, COND *cond); void get_privilege_desc(char *to, uint max_length, privilege_t access); void get_mqh(const char *user, const char *host, USER_CONN *uc); bool mysql_create_user(THD *thd, List <LEX_USER> &list, bool handle_as_role); bool mysql_drop_user(THD *thd, List <LEX_USER> &list, bool handle_as_role); bool mysql_rename_user(THD *thd, List <LEX_USER> &list); int mysql_alter_user(THD *thd, List <LEX_USER> &list); bool mysql_revoke_all(THD *thd, List <LEX_USER> &list); void fill_effective_table_privileges(THD *thd, GRANT_INFO *grant, const char *db, const char *table); bool sp_revoke_privileges(THD *thd, const char *sp_db, const char *sp_name, const Sp_handler *sph); bool sp_grant_privileges(THD *thd, const char *sp_db, const char *sp_name, const Sp_handler *sph); bool check_routine_level_acl(THD *thd, const char *db, const char *name, const Sp_handler *sph); bool is_acl_user(const char *host, const char *user); int fill_schema_user_privileges(THD *thd, TABLE_LIST *tables, COND *cond); int fill_schema_schema_privileges(THD *thd, TABLE_LIST *tables, COND *cond); int fill_schema_table_privileges(THD *thd, TABLE_LIST *tables, COND *cond); int fill_schema_column_privileges(THD *thd, TABLE_LIST *tables, COND *cond); int wild_case_compare(CHARSET_INFO *cs, const char *str,const char *wildstr); /** Result of an access check for an internal schema or table. Internal ACL checks are always performed *before* using the grant tables. This mechanism enforces that the server implementation has full control on its internal tables. Depending on the internal check result, the server implementation can choose to: - always allow access, - always deny access, - delegate the decision to the database administrator, by using the grant tables. */ enum ACL_internal_access_result { /** Access granted for all the requested privileges, do not use the grant tables. */ ACL_INTERNAL_ACCESS_GRANTED, /** Access denied, do not use the grant tables. */ ACL_INTERNAL_ACCESS_DENIED, /** No decision yet, use the grant tables. */ ACL_INTERNAL_ACCESS_CHECK_GRANT }; /** Per internal table ACL access rules. This class is an interface. Per table(s) specific access rule should be implemented in a subclass. @sa ACL_internal_schema_access */ class ACL_internal_table_access { public: ACL_internal_table_access() = default; virtual ~ACL_internal_table_access() = default; /** Check access to an internal table. When a privilege is granted, this method add the requested privilege to save_priv. @param want_access the privileges requested @param [in, out] save_priv the privileges granted @return @retval ACL_INTERNAL_ACCESS_GRANTED All the requested privileges are granted, and saved in save_priv. @retval ACL_INTERNAL_ACCESS_DENIED At least one of the requested privileges was denied. @retval ACL_INTERNAL_ACCESS_CHECK_GRANT No requested privilege was denied, and grant should be checked for at least one privilege. Requested privileges that are granted, if any, are saved in save_priv. */ virtual ACL_internal_access_result check(privilege_t want_access, privilege_t *save_priv, bool any_combination_will_do) const= 0; }; /** Per internal schema ACL access rules. This class is an interface. Each per schema specific access rule should be implemented in a different subclass, and registered. Per schema access rules can control: - every schema privileges on schema.* - every table privileges on schema.table @sa ACL_internal_schema_registry */ class ACL_internal_schema_access { public: ACL_internal_schema_access() = default; virtual ~ACL_internal_schema_access() = default; /** Check access to an internal schema. @param want_access the privileges requested @param [in, out] save_priv the privileges granted @return @retval ACL_INTERNAL_ACCESS_GRANTED All the requested privileges are granted, and saved in save_priv. @retval ACL_INTERNAL_ACCESS_DENIED At least one of the requested privileges was denied. @retval ACL_INTERNAL_ACCESS_CHECK_GRANT No requested privilege was denied, and grant should be checked for at least one privilege. Requested privileges that are granted, if any, are saved in save_priv. */ virtual ACL_internal_access_result check(privilege_t want_access, privilege_t *save_priv) const= 0; /** Search for per table ACL access rules by table name. @param name the table name @return per table access rules, or NULL */ virtual const ACL_internal_table_access *lookup(const char *name) const= 0; }; /** A registry for per internal schema ACL. An 'internal schema' is a database schema maintained by the server implementation, such as 'performance_schema' and 'INFORMATION_SCHEMA'. */ class ACL_internal_schema_registry { public: static void register_schema(const LEX_CSTRING *name, const ACL_internal_schema_access *access); static const ACL_internal_schema_access *lookup(const char *name); }; const ACL_internal_schema_access * get_cached_schema_access(GRANT_INTERNAL_INFO *grant_internal_info, const char *schema_name); const ACL_internal_table_access * get_cached_table_access(GRANT_INTERNAL_INFO *grant_internal_info, const char *schema_name, const char *table_name); bool acl_check_proxy_grant_access (THD *thd, const char *host, const char *user, bool with_grant); int acl_setrole(THD *thd, const char *rolename, privilege_t access); int acl_check_setrole(THD *thd, const char *rolename, privilege_t *access); int acl_check_set_default_role(THD *thd, const char *host, const char *user, const char *role); int acl_set_default_role(THD *thd, const char *host, const char *user, const char *rolename); extern SHOW_VAR acl_statistics[]; /* Check if a role is granted to a user/role. If hostname == NULL, search for a role as the starting grantee. */ bool check_role_is_granted(const char *username, const char *hostname, const char *rolename); #ifndef DBUG_OFF extern ulong role_global_merges, role_db_merges, role_table_merges, role_column_merges, role_routine_merges; #endif class Sql_cmd_grant: public Sql_cmd { protected: enum_sql_command m_command; #ifndef NO_EMBEDDED_ACCESS_CHECKS void warn_hostname_requires_resolving(THD *thd, List<LEX_USER> &list); bool user_list_reset_mqh(THD *thd, List<LEX_USER> &list); void grant_stage0(THD *thd); #endif public: Sql_cmd_grant(enum_sql_command command) :m_command(command) { } bool is_revoke() const { return m_command == SQLCOM_REVOKE; } enum_sql_command sql_command_code() const override { return m_command; } }; class Sql_cmd_grant_proxy: public Sql_cmd_grant { privilege_t m_grant_option; #ifndef NO_EMBEDDED_ACCESS_CHECKS bool check_access_proxy(THD *thd, List<LEX_USER> &list); #endif public: Sql_cmd_grant_proxy(enum_sql_command command, privilege_t grant_option) :Sql_cmd_grant(command), m_grant_option(grant_option) { } bool execute(THD *thd) override; }; class Sql_cmd_grant_object: public Sql_cmd_grant, public Grant_privilege { protected: #ifndef NO_EMBEDDED_ACCESS_CHECKS bool grant_stage0_exact_object(THD *thd, TABLE_LIST *table); #endif public: Sql_cmd_grant_object(enum_sql_command command, const Grant_privilege &grant) :Sql_cmd_grant(command), Grant_privilege(grant) { } }; class Sql_cmd_grant_table: public Sql_cmd_grant_object { #ifndef NO_EMBEDDED_ACCESS_CHECKS bool execute_table_mask(THD *thd); bool execute_exact_table(THD *thd, TABLE_LIST *table); #endif public: Sql_cmd_grant_table(enum_sql_command command, const Grant_privilege &grant) :Sql_cmd_grant_object(command, grant) { } bool execute(THD *thd) override; }; class Sql_cmd_grant_sp: public Sql_cmd_grant_object { const Sp_handler &m_sph; public: Sql_cmd_grant_sp(enum_sql_command command, const Grant_privilege &grant, const Sp_handler &sph) :Sql_cmd_grant_object(command, grant), m_sph(sph) { } bool execute(THD *thd) override; }; #endif /* SQL_ACL_INCLUDED */
SIMPAN PERUBAHAN