Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-23875

select into outfile not respect UMASK and UMASK_DIR

    XMLWordPrintable

    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

            Activity

              People

              Assignee:
              rucha174 Rucha Deodhar
              Reporter:
              Richard Richard Stracke
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration