Bug #6551 UMASK_DIR & UMASK not taken into account (mysqld.cc my_init.c inconsistency)
Submitted: 10 Nov 2004 14:16 Modified: 12 Nov 2004 9:08
Reporter: [ name withheld ] Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.1.x OS:Linux (Linux)
Assigned to: Ramil Kalimullin CPU Architecture:Any

[10 Nov 2004 14:16] [ name withheld ]
Description:
UMASK_DIR and UMASK variables are not taken into account!

They did in earlier versions.

How to repeat:
set UMASK_DIR & UMASK to 0777 and create a database (after having restarted mysqld)

the database directory has the 0700 privilege instead of 0777

Suggested fix:
when browsing mysql sources, I pointed out that :
in mysqld.cc in function init_common_variables definition(),

my_umask a my_umask_dir were initialized with default value, after the call to my_init() function that initialized correctly the my_umask & my_umask_dir variables.

I temporary corrected for my needs by :
a) commented the initialization in mysqld.cc (line 2308-2309)
//  my_umask=0660;		// Default umask for new files
//  my_umask_dir=0700;		// Default umask for new directories

b) inserted the two lines in function my_init() in my_init.c (at line 101-102)

      my_win_init();

  my_umask=0660;		// Default umask for new files
  my_umask_dir=0700;		// Default umask for new directories

     if ((home_dir=getenv("HOME")) != 0)
[12 Nov 2004 9:08] Ramil Kalimullin
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html