Details
Description
select into outfile creates files everytime with 666 permission, regardsless if umask environment variables and umask settings on OS level.
It seems hardcoded.
/***************************************************************************
|
** Export of select to textfile
|
***************************************************************************/
|
[..]
|
static File create_file(THD *thd, char *path, sql_exchange *exchange, |
IO_CACHE *cache)
|
[...]
|
/* Create the file world readable */ |
if ((file= mysql_file_create(key_select_to_file, |
path, 0666, O_WRONLY|O_EXCL, MYF(MY_WME))) < 0) |
return file; |
#ifdef HAVE_FCHMOD
|
(void) fchmod(file, 0666); // Because of umask() |
#else |
(void) chmod(path, 0666); |
#endif
|
It should use my_umask instead to respect UMASK and UMASK_DIR environment variables.
Attachments
Issue Links
- relates to
-
MDEV-15844 Add umask and umask_dir as server variable
-
- Needs Feedback
-
-
MDEV-23058 UMASK and UMASK_DIR are modes, not umasks
-
- Closed
-
I disagree about UMASK and UMASK_DIR environment variables.
First, these are not masks, but file creation modes, which is quite confusing and bad.
https://jira.mariadb.org/browse/MDEV-23058?focusedCommentId=158790&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-158790
Second, using a MariaDB configuration variable will be much better, because: