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

Password exprire interval is calculated from '1970-01-01 00:00:00' if there is no password_last_changed field

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4, 10.5, 10.6, 10.11, 11.0, 11.1, 11.2, 11.3, 11.4
    • 10.4, 10.5, 10.6, 10.11, 11.0, 11.1, 11.2, 11.3, 11.4
    • None
    • None

    Description

      When there is no password_last_changed field for the user in mysql.global_priv, then it is assumed to be '1970-01-01 00:00:00'
      Then if we set default_password_lifetime, it is calculated from that date:

      set global default_password_lifetime= 2;
      connect(con1, localhost, root);
       
      #error 1820: You must SET PASSWORD before executing this statement
      select * from mysql.global_priv where user='root';
      

      11.5

      MariaDB [information_schema]> select * from users where user like '%root%';
      +--------------------+-----------------+--------------------------+
      | USER               | PASSWORD_ERRORS | PASSWORD_EXPIRATION_TIME |
      +--------------------+-----------------+--------------------------+
      | 'root'@'localhost' |            NULL | NULL                     |
      +--------------------+-----------------+--------------------------+
      1 row in set (0,002 sec)
       
      MariaDB [information_schema]> set global default_password_lifetime= 2;
      Query OK, 0 rows affected (0,001 sec)
       
      MariaDB [information_schema]> select * from users where user like '%root%';
      +--------------------+-----------------+--------------------------+
      | USER               | PASSWORD_ERRORS | PASSWORD_EXPIRATION_TIME |
      +--------------------+-----------------+--------------------------+
      | 'root'@'localhost' |            NULL | 1970-01-03 01:00:00      |
      +--------------------+-----------------+--------------------------+
      1 row in set (0,002 sec)
      MariaDB [information_schema]> alter user 'root'@'localhost' password expire interval 5 DAY;
      Query OK, 0 rows affected (0,016 sec)
       
      MariaDB [information_schema]> select * from users where user like '%root%';
      +--------------------+-----------------+--------------------------+
      | USER               | PASSWORD_ERRORS | PASSWORD_EXPIRATION_TIME |
      +--------------------+-----------------+--------------------------+
      | 'root'@'localhost' |            NULL | 1970-01-06 01:00:00      |
      +--------------------+-----------------+--------------------------+
      1 row in set (0,003 sec)
      
      

      Attachments

        Activity

          People

            serg Sergei Golubchik
            alice Alice Sherepa
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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