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 | e206bcf0670031d1ea028d561eca0fcc214313fb (patch) | |
tree | f4b60e9394c6d88f0bd04731d87ae6203e987e3b /sql/sql_db.cc | |
parent | bfb441a5bfe17222e09c05e94c24a11da57e53e7 (diff) | |
download | mariadb-git-e206bcf0670031d1ea028d561eca0fcc214313fb.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/sql_db.cc')
-rw-r--r-- | sql/sql_db.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 2b42c2c9a5b..113ff20ac08 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -592,6 +592,7 @@ bool mysql_change_db(THD *thd, const char *name) DBUG_RETURN(1); } DBUG_PRINT("info",("Use database: %s", dbname)); +#ifndef NO_EMBEDDED_ACCESS_CHECKS if (test_all_bits(thd->master_access,DB_ACLS)) db_access=DB_ACLS; else @@ -611,7 +612,7 @@ bool mysql_change_db(THD *thd, const char *name) my_free(dbname,MYF(0)); DBUG_RETURN(1); } - +#endif (void) sprintf(path,"%s/%s",mysql_data_home,dbname); length=unpack_dirname(path,path); // Convert if not unix if (length && path[length-1] == FN_LIBCHAR) @@ -626,8 +627,9 @@ bool mysql_change_db(THD *thd, const char *name) x_free(thd->db); thd->db=dbname; // THD::~THD will free this thd->db_length=db_length; +#ifndef NO_EMBEDDED_ACCESS_CHECKS thd->db_access=db_access; - +#endif strmov(path+unpack_dirname(path,path), MY_DB_OPT_FILE); load_db_opt(thd, path, &create); thd->db_charset= create.table_charset ? @@ -656,6 +658,7 @@ int mysqld_show_create_db(THD *thd, char *dbname, DBUG_RETURN(1); } +#ifndef NO_EMBEDDED_ACCESS_CHECKS if (test_all_bits(thd->master_access,DB_ACLS)) db_access=DB_ACLS; else @@ -674,6 +677,7 @@ int mysqld_show_create_db(THD *thd, char *dbname, dbname); DBUG_RETURN(1); } +#endif (void) sprintf(path,"%s/%s",mysql_data_home, dbname); length=unpack_dirname(path,path); // Convert if not unix |