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

restorecon call in RPM POSTIN script has hardcoded datadir path

    XMLWordPrintable

Details

    Description

      Most of the POSTIN script uses the datadir setting from the MariaDB configuration files, so this can be set to a different path before installing the MariaDB-server RPM.

      At the end of the POSTIN script we have the /var/lib/mysql data directory path hardcoded though:

      if [ -x /sbin/restorecon ] ; then
        /sbin/restorecon -R /var/lib/mysql
      fi
      

      so with a changed datadir setting these log messages are issued:

      /sbin/restorecon: lstat(/var/lib/mysql) failed: No such file or directory
      warning: %post(MariaDB-server-10.6.18-1.el8.x86_64) scriptlet failed, exit status 255
       
      Error in POSTIN scriptlet in rpm package MariaDB-server
      

      Not critical as the MariaDB-server package gets fully installed nonetheless, but it raises questions.

      No harm done by not actually running restorecon on the non-standard datadir either, as our SElinux policies would only have context for the default datadir anyway.

      Maybe we should just add a simple

      if test -d /var/lib/mysql
      

      condition to that last code block

      Attachments

        Activity

          People

            serg Sergei Golubchik
            hholzgra Hartmut Holzgraefe
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.