← Back to team overview

maria-discuss team mailing list archive

Re: mysql_install_db as user

 

Ahh. Ok, so something wrong with how we upgraded to 10.1, then .. thanks!

Sent from my android device.

-----Original Message-----
From: Sergei Golubchik <serg@xxxxxxxxxxx>
To: Felipe Gasper <felipe@xxxxxxxxxxxxxxxx>
Cc: MariaDB discuss <maria-discuss@xxxxxxxxxxxxxxxxxxx>
Sent: Fri, 13 Nov 2015 6:30
Subject: Re: [Maria-discuss] mysql_install_db as user

Hi, Felipe!

On Nov 13, Felipe Gasper wrote:
> >
> > There's no special logic around it in MySQL 5.6 and no changes in
> > MariaDB 10.1.
> >
> > chown is done if user=xxx is specified on the command line or in the
> > my.cnf file. And if chown fails, you'll see the error message and
> > mysql_install_db will abort. Both in MySQL and MariaDB.
> 
> Hi Sergei! Thanks for responding. :)
> 
> I wonder, are we looking at the same things?

Ah, right. We are not. I was comparing shell script to a shell script.
And perl script to a perl script. You've compared MySQL-5.6 perl script
to MariaDB 10.1 shell script :)

> The 5.6 box’s mysql_install_db has:
> -----------------
>    if ($opt_user and -w "/")
>    {
>      chown($pwnam[2], $pwnam[3], $dir)
>        or error($opt, "Could not chown directory $dir");
>    }
> -----------------

In MariaDB 10.1 mysql_install_db.pl has

-----------------
  chown($opt->{user}, $dir) if -w "/" and !$opt->{user};
-----------------

> … whereas the MariaDB box has:
> -----------------
>      chown $user "$dir"
>      if test $? -ne 0
>      then
>        echo "Cannot change ownership of the database directories to the '$user'"
>        echo "user.  Check that you have the necessary permissions and try again."
>        exit 1
>      fi
> ------------------

In MySQL 5.6 mysql_install_db.sh has

-----------------
    chown $user $dir
    if test $? -ne 0
    then
      echo "Cannot change ownership of the database directories to the '$user'"
      echo "user.  Check that you have the necessary permissions and try again."
      exit 1
    fi
-----------------

which is almost exactly the same (only differece - it'll fail if $dir
contains spaces)

Regards,
Sergei
Chief Architect MariaDB
and security@xxxxxxxxxxx


References