summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <tsmith@siva.hindu.god>2007-01-09 19:22:01 -0700
committerunknown <tsmith@siva.hindu.god>2007-01-09 19:22:01 -0700
commitc2e9a4af2dcebee419398a17530ef5c28d7962a9 (patch)
tree66654967ac4cd7bca3c3211426681a8f9ce3879d /sql
parenta1ecbab689ed475ce61c05c7b02609b1efe5e660 (diff)
downloadmariadb-git-c2e9a4af2dcebee419398a17530ef5c28d7962a9.tar.gz
WL #3670: Compile-time option to remove GRANT-related startup options
- configure --disable-grant-options defines DISABLE_GRANT_OPTIONS - configure.js/cmake also updated - if DISABLE_GRANT_OPTIONS is defined, mysqld no longer recognizes: --bootstrap --init-file --skip-grant-tables Scripts which rely on those three options are modified to check the environment for MYSQLD_BOOTSTRAP; it should be set to the full path of a mysqld which does handle those options. For example: $ export MYSQLD_BOOTSTRAP $ MYSQLD_BOOTSTRAP=/path/to/full/MySQL/bin/mysqld $ mysql_install_db $ make test configure.in: WL#3670 Add --disable-grant-options mysql-test/install_test_db.sh: Add MYSQLD_BOOTSTRAP env variable, to enable test suite to work even if mysqld does not accept --bootstrap or --skip-grant-tables. mysql-test/mysql-test-run.pl: Add MYSQLD_BOOTSTRAP env variable, to enable test suite to work even if mysqld does not accept --bootstrap or --skip-grant-tables. mysql-test/mysql_test_run_new.c: Mention need for MYSQLD_BOOTSTRAP in a comment, in case this needs to be used with a mysqld which does not accept the --bootstrap option. scripts/mysql_install_db.sh: Add MYSQLD_BOOTSTRAP env variable, to enable mysqld_install_db to work even if mysqld does not accept --bootstrap or --skip-grant-tables. sql/CMakeLists.txt: Add DISABLE_GRANT_OPTIONS define sql/mysqld.cc: Add DISABLE_GRANT_OPTIONS define, which removes the --bootstrap, --init-file, and --skip-grant-tables options win/README: Document the DISABLE_GRANT_OPTIONS define win/configure.js: Handle DISABLE_GRANT_OPTIONS
Diffstat (limited to 'sql')
-rwxr-xr-xsql/CMakeLists.txt4
-rw-r--r--sql/mysqld.cc6
2 files changed, 10 insertions, 0 deletions
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 9b2fae847d6..e77ac3d3a93 100755
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -25,6 +25,10 @@ SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/message.rc
ADD_DEFINITIONS(-DHAVE_INNOBASE -DMYSQL_SERVER
-D_CONSOLE -DHAVE_DLOPEN)
+
+IF(DISABLE_GRANT_OPTIONS)
+ ADD_DEFINITIONS(-DDISABLE_GRANT_OPTIONS)
+ENDIF(DISABLE_GRANT_OPTIONS)
ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc
discover.cc ../libmysql/errmsg.c field.cc field_conv.cc
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 5890a2af21d..687e59204fa 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -4775,8 +4775,10 @@ Disable with --skip-bdb (will save memory).",
{"binlog-ignore-db", OPT_BINLOG_IGNORE_DB,
"Tells the master that updates to the given database should not be logged tothe binary log.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+#ifndef DISABLE_GRANT_OPTIONS
{"bootstrap", OPT_BOOTSTRAP, "Used by mysql installation scripts.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+#endif
{"character-set-client-handshake", OPT_CHARACTER_SET_CLIENT_HANDSHAKE,
"Don't ignore client side character set value sent during handshake.",
(gptr*) &opt_character_set_client_handshake,
@@ -4892,9 +4894,11 @@ Disable with --skip-large-pages.",
{"init-connect", OPT_INIT_CONNECT, "Command(s) that are executed for each new connection",
(gptr*) &opt_init_connect, (gptr*) &opt_init_connect, 0, GET_STR_ALLOC,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+#ifndef DISABLE_GRANT_OPTIONS
{"init-file", OPT_INIT_FILE, "Read SQL commands from this file at startup.",
(gptr*) &opt_init_file, (gptr*) &opt_init_file, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
+#endif
{"init-rpl-role", OPT_INIT_RPL_ROLE, "Set the replication role.", 0, 0, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"init-slave", OPT_INIT_SLAVE, "Command(s) that are executed when a slave connects to this master",
@@ -5349,10 +5353,12 @@ Can't be set to 1 if --log-slave-updates is used.",
"Show user and password in SHOW SLAVE HOSTS on this master",
(gptr*) &opt_show_slave_auth_info, (gptr*) &opt_show_slave_auth_info, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+#ifndef DISABLE_GRANT_OPTIONS
{"skip-grant-tables", OPT_SKIP_GRANT,
"Start without grant tables. This gives all users FULL ACCESS to all tables!",
(gptr*) &opt_noacl, (gptr*) &opt_noacl, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0},
+#endif
{"skip-host-cache", OPT_SKIP_HOST_CACHE, "Don't cache host names.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"skip-locking", OPT_SKIP_LOCK,