Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-8386

puppetlabs-mysql : username length restriction checks aren't correct for MariaDB

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: mysql
    • Labels:
    • Environment:

      puppetserver 5.3.6 on RHEL 7.x

      puppet-agent 5.5.8 on RHEL 6.x and RHEL 7.x

      puppetlabs-mysql 5.3.1 OR puppetlabs-mysql 7.0.0

    • Template:
      MODULES Bug Template
    • Epic Link:
    • Team:
      Modules
    • Method Found:
      Needs Assessment
    • QA Risk Assessment:
      Needs Assessment

      Description

      puppetlabs-mysql/lib/puppet/type/mysql_user.rb has the following code for username length restrictions:

       

      unless mysql_version.nil?
       raise(ArgumentError, _('MySQL usernames are limited to a maximum of 16 characters.')) if Puppet::Util::Package.versioncmp(mysql_version, '5.7.8') < 0 && user_part.size > 16
       raise(ArgumentError, _('MySQL usernames are limited to a maximum of 32 characters.')) if Puppet::Util::Package.versioncmp(mysql_version, '10.0.0') < 0 && user_part.size > 32
       raise(ArgumentError, _('MySQL usernames are limited to a maximum of 80 characters.')) if Puppet::Util::Package.versioncmp(mysql_version, '10.0.0') > 0 && user_part.size > 80
       end 

      The problem is that these restrictions might not be correct for MariaDB.  The ability to support longer usernames was added at MariaDB 5.5.31.  Although the software supports it, the system schema is not updated by default to allow the longer username.  However, it's possible that the system administrator or DBA has applied the MariaDB schema changes to make 5.5.31+ compatible with MariaDB 10.x.**

      See: MariaDB KB on user-names

       It's possible to query the server and get the size of the User column using something like

      MariaDB [mysql]> select column_type from information_schema.columns where table_schema='mysql' and table_name='user' column_name='user';
      +-------------+
      | column_type |
      +-------------+
      | char(80)    |
      +-------------+
      1 row in set (0.00 sec)
      

      However I don't know how far back that's supported, and whether it would be supported for all versions of MySQL/Percona/MariaDB that puppetlabs-mysql currently supports.

      As it stands right now, puppetlabs-mysql is restricting username length to something less than what MariaDB 5.5.31+ can support.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            solstice Tim Mooney
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Zendesk Support