summaryrefslogtreecommitdiff
path: root/sql/mysqld.cc
diff options
context:
space:
mode:
authorNisha Gopalakrishnan <nisha.gopalakrishnan@oracle.com>2014-01-08 10:04:05 +0530
committerNisha Gopalakrishnan <nisha.gopalakrishnan@oracle.com>2014-01-08 10:04:05 +0530
commit1ef8ed17f1b8547eed41f94edc73ca9b9c9dd2ea (patch)
tree78f4a2a89f3a6c63db103a1485259677ed05775d /sql/mysqld.cc
parentc052bec059997b50e2d2916bb6cecc03201cdbb8 (diff)
downloadmariadb-git-1ef8ed17f1b8547eed41f94edc73ca9b9c9dd2ea.tar.gz
BUG#17324415:GETTING MYSQLD --HELP AS ROOT EXITS WITH 1
Analysis -------- Running 'MYSQLD --help --verbose' as ROOT user without using '--user' option displays the help contents but aborts at the end with an exit code '1'. While starting the server, a validation is performed to ensure when the server is started as root user, it should be done using '--user' option. Else we abort. In case of help, we dump the help contents and abort. Fix: --- During the validation, we skip aborting the server incase we are using the help option under the condition mentioned above. NOTE: Test case has not been added since it requires using 'root' user.
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r--sql/mysqld.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index b4b5a69640a..b61e64e627b 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights
+ reserved.
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
@@ -1681,7 +1682,7 @@ static struct passwd *check_user(const char *user)
}
if (!user)
{
- if (!opt_bootstrap)
+ if (!opt_bootstrap && !opt_help)
{
sql_print_error("Fatal error: Please read \"Security\" section of the manual to find out how to run mysqld as root!\n");
unireg_abort(1);