[MDEV-23058] UMASK and UMASK_DIR are modes, not umasks Created: 2020-06-30  Updated: 2020-10-02  Resolved: 2020-07-02

Status: Closed
Project: MariaDB Server
Component/s: Configuration
Affects Version/s: 10.1.45, 10.2.32, 10.3.23, 10.4.13, 10.5.4
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Geoff Montee (Inactive) Assignee: Sergei Golubchik
Resolution: Won't Fix Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-23875 select into outfile not respect UMASK... Closed

 Description   

MariaDB reads the UMASK and UMASK_DIR environment variables to determine what permissions to use when creating new files.

However, these environment variables are not actually used as umasks. They are just used as regular file system permission modes.

You can see the environment variables are read here:

https://github.com/MariaDB/server/blob/mariadb-10.5.4/mysys/my_init.c#L83

And then they are used as the mode argument when creating new files with open() here:

https://github.com/MariaDB/server/blob/mariadb-10.5.4/mysys/my_open.c#L55

This is pretty confusing behavior. If the environment variables have UMASK in the name, then shouldn't they be used as umasks? And if the environment variables are used as file system permission modes, then shouldn't the names reflect that?



 Comments   
Comment by Sergei Golubchik [ 2020-07-02 ]

Right, but what can we do about it? It was like this forever, for 20 years at least, and users rely on this behavior.

Generated at Thu Feb 08 09:19:31 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.