Commit fca6284c authored by unknown's avatar unknown

Bug#32078 - Excessive warnings: One can only use the --user switch

            if running as root

Every start of a server in the test suite raised that warning.

The cause was an unconditionla add of the --user option to the
server command line. Only the "root" user (effective user id == 0)
must use that option.

Added check for effective user id == 0 before adding --user.

Thanks to Magnus Svensson for the patch.


mysql-test/mysql-test-run.pl:
  Bug#32078 - Excessive warnings: One can only use the --user switch
              if running as root
  Added check for effective user id == 0 before adding --user
  in mysqld_arguments().
parent 71328b4f
......@@ -3754,7 +3754,9 @@ sub mysqld_arguments ($$$$) {
# When mysqld is run by a root user(euid is 0), it will fail
# to start unless we specify what user to run as. If not running
# as root it will be ignored, see BUG#30630
if (!(grep(/^--user/, @$extra_opt, @opt_extra_mysqld_opt))) {
my $euid= $>;
if (!$glob_win32 and $euid == 0 and
grep(/^--user/, @$extra_opt, @opt_extra_mysqld_opt) == 0) {
mtr_add_arg($args, "%s--user=root");
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment