diff options
author | unknown <hf@deer.(none)> | 2003-09-26 15:33:13 +0500 |
---|---|---|
committer | unknown <hf@deer.(none)> | 2003-09-26 15:33:13 +0500 |
commit | 1705369809aaa17407ce0bd25fdd15607cdf32b0 (patch) | |
tree | f4b60e9394c6d88f0bd04731d87ae6203e987e3b /sql-common | |
parent | 4535f6897f5ee132d086e0bd98bbc3a1fdaea54a (diff) | |
download | mariadb-git-1705369809aaa17407ce0bd25fdd15607cdf32b0.tar.gz |
SCRUM:
WL#604 Privileges in embedded library
code added to check privileges in embedded library
NO_EMBEDDED_ACCESS_CHECKS macros inserted in code so we can exclude
access-checking parts. Actually we now can exclude these parts from
standalone server as well. Do we need it?
Access checks are disabled in embedded server by default. One should
edit libmysqld/Makefile manually to get this working.
We definitely need the separate configure for embedded server
include/mysql.h:
options added so user of embedded library can set the client host
it will work as if the usual client connects from this host
libmysqld/Makefile.am:
Usually one doesn't need access checking in embedded library
we definitely should separate configure for embedded server
libmysqld/lib_sql.cc:
necessary code for getting passwords and access checks added
libmysqld/libmysqld.c:
code #ifdef-ed - we use this only when we check permissions
sql-common/client.c:
one mysql_close left now
sql/item_strfunc.cc:
#ifndef-s added
sql/log.cc:
#ifndef-s added
sql/mysql_priv.h:
#ifndef-s added
also i removed default parameters from check_access and check_table_access
definitions to set definitions working
sql/mysqld.cc:
#ifndef-s added
localhost renamed to my_localhost
sql/repl_failsafe.cc:
parameters added
sql/set_var.cc:
#ifndef-s added
sql/sql_acl.cc:
#ifndef-s added
sql/sql_acl.h:
#ifndef-s added
sql/sql_base.cc:
#ifndef-s added
sql/sql_cache.cc:
#ifndef-s added
sql/sql_class.cc:
#ifndef-s added
sql/sql_db.cc:
#ifndef-s added
sql/sql_derived.cc:
#ifndef-s added
sql/sql_insert.cc:
#ifndef-s added
sql/sql_parse.cc:
a horde of #ifndef-s added
sql/sql_prepare.cc:
#ifndef-s added
sql/sql_repl.cc:
parameters added
sql/sql_show.cc:
#ifndef-s added
sql/sql_update.cc:
#ifndef-s added
Diffstat (limited to 'sql-common')
-rw-r--r-- | sql-common/client.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sql-common/client.c b/sql-common/client.c index 508ebef2e1e..62524bc78bf 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -48,14 +48,12 @@ #endif #define CLI_MYSQL_REAL_CONNECT cli_mysql_real_connect -#define CLI_MYSQL_CLOSE cli_mysql_close #undef net_flush my_bool net_flush(NET *net); #else /*EMBEDDED_LIBRARY*/ #define CLI_MYSQL_REAL_CONNECT mysql_real_connect -#define CLI_MYSQL_CLOSE mysql_close #endif /*EMBEDDED_LIBRARY*/ #if !defined(MYSQL_SERVER) && (defined(__WIN__) || defined(_WIN32) || defined(_WIN64)) @@ -2127,6 +2125,7 @@ static void mysql_close_free_options(MYSQL *mysql) my_free(mysql->options.my_cnf_group,MYF(MY_ALLOW_ZERO_PTR)); my_free(mysql->options.charset_dir,MYF(MY_ALLOW_ZERO_PTR)); my_free(mysql->options.charset_name,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->options.client_ip,MYF(MY_ALLOW_ZERO_PTR)); if (mysql->options.init_commands) { DYNAMIC_ARRAY *init_commands= mysql->options.init_commands; @@ -2159,7 +2158,7 @@ static void mysql_close_free(MYSQL *mysql) } -void STDCALL CLI_MYSQL_CLOSE(MYSQL *mysql) +void STDCALL mysql_close(MYSQL *mysql) { DBUG_ENTER("mysql_close"); if (mysql) /* Some simple safety */ @@ -2529,6 +2528,8 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const char *arg) case MYSQL_OPT_GUESS_CONNECTION: mysql->options.methods_to_use= option; break; + case MYSQL_SET_CLIENT_IP: + mysql->options.client_ip= my_strdup(arg, MYF(MY_WME)); default: DBUG_RETURN(1); } |