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

Secure installation with normal user fails to accept empty root password

Details

    Description

      When installing MariaDB as a normal user, mysql_secure_installation fails when attempting to authenticate the root user (with an empty password).

      This can be worked around by updating the make_config function to avoid writing the user and password lines if the provided root password is empty, as in the following alternate implementation (first if-statement added):

      make_config() {
          echo "# mysql_secure_installation config file" >$config
          echo "[mysql]" >>$config
          if [ ! -z "$rootpass" ]; then
              echo "user=root" >>$config
              esc_pass=`basic_single_escape "$rootpass"`
              echo "password='$esc_pass'" >>$config
          fi
          #sed 's,^,> ,' < $config  # Debugging
       
          if test -n "$defaults_file"
          then
              dfile=`parse_arg "$defaults_file"`
              cat "$dfile" >>$config
          fi
      }
      

      I'm not sure if this is the proper fix, but hopefully it at least highlights where the conflict is happening.

      Attachments

        Issue Links

          Activity

            Yes, I believe your impression is exactly correct. And mysql_secure_installation could, indeed, be extended to recognize when it's run as $USER that owns all the data files and use that somehow.

            serg Sergei Golubchik added a comment - Yes, I believe your impression is exactly correct. And mysql_secure_installation could, indeed, be extended to recognize when it's run as $USER that owns all the data files and use that somehow.
            groot-verde Andrew Groot added a comment -

            In that case, what's the appropriate course of action from here? Should this issue be re-opened? Let me know if there's anything else I can I do to help this be addressed.

            groot-verde Andrew Groot added a comment - In that case, what's the appropriate course of action from here? Should this issue be re-opened? Let me know if there's anything else I can I do to help this be addressed.
            groot-verde Andrew Groot added a comment - - edited

            Sergei/Anel, can either of you provide some guidance on what the next steps are from here? Are you willing to re-open the issue in light of Sergei's last comment? If not, let me know what other next steps are most appropriate.

            groot-verde Andrew Groot added a comment - - edited Sergei/Anel, can either of you provide some guidance on what the next steps are from here? Are you willing to re-open the issue in light of Sergei's last comment? If not, let me know what other next steps are most appropriate.

            Hi groot-verde, I'm working on the patch for MDEV-22486 which will address also your concerns.
            It will need some time to communicate with my reviewers, have worked on some patch.
            Let's leave this closed and please follow MDEV-22486.

            anel Anel Husakovic added a comment - Hi groot-verde , I'm working on the patch for MDEV-22486 which will address also your concerns. It will need some time to communicate with my reviewers, have worked on some patch. Let's leave this closed and please follow MDEV-22486 .
            groot-verde Andrew Groot added a comment -

            Sounds good, thank you!

            groot-verde Andrew Groot added a comment - Sounds good, thank you!

            People

              anel Anel Husakovic
              groot-verde Andrew Groot
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.