List:Packagers« Previous MessageNext Message »
From:Dmitry V. Levin Date:March 13 2003 11:48am
Subject:Re: [packagers] Re: MySQL user can be changed to root (fwd)
View as plain text  
On Thu, Mar 13, 2003 at 12:01:24PM +0100, Lenz Grimmer wrote:
> Dmitry, I did not forget your patch request - sorry for not getting back
> to you about this yet. The individual patches required to fix the first
> problem reported on bugtraq (creating my.cnf with additional --user
> parameters) can be obtained from here (they are in multiple BK
> Changesets):

Too late, I've already made the patch myself.

Btw, your patch introduces TOCTOU race condition:

> @@ -241,6 +242,16 @@
>    {
>      strmov(name,config_file);
>    }
> +  fn_format(name,name,"","",4);
> +#if !defined(__WIN__) && !defined(OS2)
> +  {
> +    MY_STAT stat_info;
> +    if (!my_stat(name,&stat_info,MYF(MY_WME)))
> +      return 0;
> +    if (stat_info.st_mode & S_IWOTH) /* ignore world-writeable files */
> +      return 0;
> +  }
> +#endif
>    if (!(fp = my_fopen(fn_format(name,name,"","",4),O_RDONLY,MYF(0))))
>      return 0;					/* Ignore wrong files */
>  

I'd recommend to replace this construction with my_fopen/my_fstat if at all possible.


--
ldv

Attachment: [application/pgp-signature]
Thread
Re: MySQL user can be changed to root (fwd)Lenz Grimmer10 Mar
  • mysql_install_db patch to support both mysqld-max and mysqldWarly12 Mar
    • Re: mysql_install_db patch to support both mysqld-max and mysqldLenz Grimmer13 Mar
      • Re: mysql_install_db patch to support both mysqld-max and mysqldWarly13 Mar
  • Re: [packagers] Re: MySQL user can be changed to root (fwd)Lenz Grimmer13 Mar
    • Re: [packagers] Re: MySQL user can be changed to root (fwd)Dmitry V. Levin13 Mar
      • Re: [packagers] Re: MySQL user can be changed to root (fwd)Lenz Grimmer13 Mar
        • Re: [packagers] Re: MySQL user can be changed to root (fwd)Dmitry V. Levin13 Mar
          • Re: [packagers] Re: MySQL user can be changed to root (fwd)Sergei Golubchik13 Mar
            • Re: [packagers] Re: MySQL user can be changed to root (fwd)Dmitry V. Levin13 Mar
              • Re: [packagers] Re: MySQL user can be changed to root (fwd)Sergei Golubchik13 Mar
                • Re: [packagers] Re: MySQL user can be changed to root (fwd)Dmitry V. Levin13 Mar
                  • Re: [packagers] Re: MySQL user can be changed to root (fwd)Sergei Golubchik13 Mar
                    • Re: [packagers] Re: MySQL user can be changed to root (fwd)Dmitry V. Levin13 Mar