Bug #58139 default-auth option not recognized in MySQL standard command line clients
Submitted: 11 Nov 2010 15:34 Modified: 28 Jan 2011 15:51
Reporter: Giuseppe Maxia Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S1 (Critical)
Version:5.5.7 OS:Any (Linux, Mac OSX)
Assigned to: Nirbhay Choubey CPU Architecture:Any
Tags: authentication, client, plugin
Triage: Triaged: D2 (Serious)

[11 Nov 2010 15:34] Giuseppe Maxia
Description:
in MySQL 5.5.7, the 'mysql' client can connect to the server using the --default-auth option introduced by the authentication plugin.

However, other command line clients like mysqldump and mysqladmin fail to recognize the same option.

$HOME/opt/mysql/5.5.7/bin/mysql -h 127.0.0.1 -P 5570 \
  --default-auth=auth_test_plugin \
  --plugin-dir=$HOME/opt/mysql/5.5.7/lib/plugin/ \
   -u msandbox -pmsandbox -e 'select "IT WORKS" as auth'
+----------+
| auth     |
+----------+
| IT WORKS |
+----------+

$HOME/opt/mysql/5.5.7/bin/mysqladmin -h 127.0.0.1 -P 5570 \
  --default-auth=auth_test_plugin \
  --plugin-dir=$HOME/opt/mysql/5.5.7/lib/plugin/ \
  -u msandbox -pmsandbox shutdown
mysqladmin: unknown variable 'default-auth=auth_test_plugin'

$HOME/opt/mysql/5.5.7/bin/mysqldump -h 127.0.0.1 -P 5570 \
  --default-auth=auth_test_plugin \
  --plugin-dir=$HOME/opt/mysql/5.5.7/lib/plugin/ \
  -u msandbox -pmsandbox test
mysqldump: unknown variable 'default-auth=auth_test_plugin'

The same must be said for the --plugin-dir option. It is only recognized by 'mysql'

How to repeat:
see above
[18 Nov 2010 19:31] Sveta Smirnova
Thank you for the report.

Verified as described.
[6 Dec 2010 10:27] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/126114

3167 Nirbhay Choubey	2010-12-06
      Bug#58139 : default-auth option not recognized in MySQL standard
                  command line clients.
      
      Command line tools like mysqladmin and mysqldump did not recognize
      default-auth and plugin-dir options.
      
      Support for these options was found missing in these command line
      tools.
      
      Fixed by adding support for the same.
     @ client/mysqladmin.cc
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients.
        
        Introduced two new variables to hold values from default-auth and
        plugin-dir options and further pushed them to client's st_mysql
        instance.
     @ client/mysqldump.c
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients.
        
        Introduced two new variables to hold values from default-auth and
        plugin-dir options and further pushed them to client's st_mysql
        instance.
     @ mysql-test/r/plugin_auth.result
        Added test case for Bug#58139.
     @ mysql-test/t/plugin_auth.test
        Added test case for Bug#58139.
[7 Dec 2010 12:07] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/126198

3170 Nirbhay Choubey	2010-12-07
      Bug#58139 : default-auth option not recognized in MySQL standard
                  command line clients.
      
      Command line tools like mysqladmin and mysqldump did not recognize
      default-auth and plugin-dir options.
      
      Support for these options was found missing in these command line
      tools.
      
      Fixed by adding support for the same.
     @ client/mysqladmin.cc
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients.
        
        Introduced two new variables to hold values from default-auth and
        plugin-dir options and further pushed them to client's st_mysql
        instance.
     @ client/mysqldump.c
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients.
        
        Introduced two new variables to hold values from default-auth and
        plugin-dir options and further pushed them to client's st_mysql
        instance.
     @ mysql-test/r/plugin_auth.result
        Added test case for Bug#58139.
     @ mysql-test/t/plugin_auth.test
        Added test case for Bug#58139.
[7 Dec 2010 15:44] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/126227

3174 Nirbhay Choubey	2010-12-07
      Additional fix in the test for Bug#58139.
     @ mysql-test/t/plugin_auth.test
        Additional fix in the test for Bug#58139.
[17 Dec 2010 12:50] Bugs System
Pushed into mysql-5.5 5.5.9 (revid:georgi.kodinov@oracle.com-20101217124733-p1ivu6higouawv8l) (version source revid:guilhem@mysql.com-20101207161852-aos0579rlr3ro0ch) (merge vers: 5.5.8) (pib:24)
[17 Dec 2010 12:54] Bugs System
Pushed into mysql-trunk 5.6.1 (revid:georgi.kodinov@oracle.com-20101217125013-y8pb3az32rtbplc9) (version source revid:anitha.gopi@sun.com-20101210041312-50t9adyhwwybsm6x) (merge vers: 5.6.1) (pib:24)
[22 Dec 2010 7:43] Giuseppe Maxia
It looks like this patch is going to be applied to mysqldump and mysqladmin only.

If users switch from default authentication to plugin authentication, it is reasonable to think that they would use the new authentication system for everything. 

From my personal experience, if this patch is applied to mysqladmin, mysqldump, and mysqlbinlog, I should be OK. But others may have broader needs.

If there is a practical reason for some tools to be excluded from pluggable authentication, the documentation should state it explicitly.
[22 Dec 2010 18:28] Paul Dubois
Noted in 5.5.9 changelog.

The mysqladmin and mysqldump clients now have --default-auth and
--plugin-dir options for specifying which authentication plugin and
plugin directory to use.

Setting report to NDI awaiting decision whether this change will be made to other clients as well.
[22 Dec 2010 18:35] Paul Dubois
Noted in 5.5.9 changelog.

The mysqladmin and mysqldump clients now have --default-auth and
--plugin-dir options for specifying which authentication plugin and
plugin directory to use.

Setting report to NDI awaiting decision whether this change will be made to other clients as well.
[13 Jan 2011 9:13] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/128607

3219 Nirbhay Choubey	2011-01-13
      Bug#58139 : default-auth option not recognized in MySQL standard
                  command line clients.
      
      Postfix covering other mysql standard clients like mysql_upgrade,
      mysqlbinlog, mysqlcheck, mysqlimport, mysqlshow and mysqlslap.
     @ client/client_priv.h
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients
        
        Added an entry for 'default-auth' option.
     @ client/mysql.cc
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients
        
        Updated the id entry for default_auth option.
     @ client/mysql_upgrade.c
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients.
        
        Introduced two new variables to hold values from default-auth and
        plugin-dir options and further pushed them to client's st_mysql
        instance.
     @ client/mysqladmin.cc
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients
        
        Updated the id entry for default_auth option.
     @ client/mysqlbinlog.cc
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients.
        
        Introduced two new variables to hold values from default-auth and
        plugin-dir options and further pushed them to client's st_mysql
        instance.
     @ client/mysqlcheck.c
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients.
        
        Introduced two new variables to hold values from default-auth and
        plugin-dir options and further pushed them to client's st_mysql
        instance.
     @ client/mysqldump.c
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients
        
        Updated the id entry for default_auth option.
     @ client/mysqlimport.c
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients.
        
        Introduced two new variables to hold values from default-auth and
        plugin-dir options and further pushed them to client's st_mysql
        instance.
     @ client/mysqlshow.c
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients.
        
        Introduced two new variables to hold values from default-auth and
        plugin-dir options and further pushed them to client's st_mysql
        instance.
     @ client/mysqlslap.c
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients.
        
        Introduced two new variables to hold values from default-auth and
        plugin-dir options and further pushed them to client's st_mysql
        instance.
     @ mysql-test/r/plugin_auth.result
        Added test case for Bug#58139 for mysql_upgrade.
     @ mysql-test/t/plugin_auth.test
        Added test case for Bug#58139 for mysql_upgrade.
[16 Jan 2011 3:59] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/128865

3254 Nirbhay Choubey	2011-01-16
      Bug#58139 : default-auth option not recognized in MySQL standard
                  command line clients.
      
      Postfix covering other mysql standard clients like mysql_upgrade,
      mysqlbinlog, mysqlcheck, mysqlimport, mysqlshow and mysqlslap.
     @ client/client_priv.h
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients
        
        Added an entry for 'default-auth' option.
     @ client/mysql.cc
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients
        
        Updated the id entry for default_auth option.
     @ client/mysql_upgrade.c
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients.
        
        Introduced two new variables to hold values from default-auth and
        plugin-dir options and further pushed them to client's st_mysql
        instance.
     @ client/mysqladmin.cc
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients
        
        Updated the id entry for default_auth option.
     @ client/mysqlbinlog.cc
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients.
        
        Introduced two new variables to hold values from default-auth and
        plugin-dir options and further pushed them to client's st_mysql
        instance.
     @ client/mysqlcheck.c
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients.
        
        Introduced two new variables to hold values from default-auth and
        plugin-dir options and further pushed them to client's st_mysql
        instance.
     @ client/mysqldump.c
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients
        
        Updated the id entry for default_auth option.
     @ client/mysqlimport.c
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients.
        
        Introduced two new variables to hold values from default-auth and
        plugin-dir options and further pushed them to client's st_mysql
        instance.
     @ client/mysqlshow.c
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients.
        
        Introduced two new variables to hold values from default-auth and
        plugin-dir options and further pushed them to client's st_mysql
        instance.
     @ client/mysqlslap.c
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients.
        
        Introduced two new variables to hold values from default-auth and
        plugin-dir options and further pushed them to client's st_mysql
        instance.
     @ mysql-test/r/plugin_auth.result
        Added test case for Bug#58139 for mysql_upgrade.
     @ mysql-test/t/plugin_auth.test
        Added test case for Bug#58139 for mysql_upgrade.
[16 Jan 2011 4:03] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/128866

3516 Nirbhay Choubey	2011-01-16 [merge]
      Merge of fix for bug#58139 from mysql-5.5 -> mysql-trunk.
[16 Jan 2011 4:06] Bugs System
Pushed into mysql-5.5 5.5.10 (revid:nirbhay.choubey@sun.com-20110116035905-40dl65gk9h7gjn20) (version source revid:nirbhay.choubey@sun.com-20110116035905-40dl65gk9h7gjn20) (merge vers: 5.5.10) (pib:24)
[16 Jan 2011 4:07] Bugs System
Pushed into mysql-trunk 5.6.2 (revid:nirbhay.choubey@sun.com-20110116040229-246c5ia8cos0iwii) (version source revid:nirbhay.choubey@sun.com-20110116040229-246c5ia8cos0iwii) (merge vers: 5.6.2) (pib:24)
[16 Jan 2011 4:16] Nirbhay Choubey
Hi Paul,

These options should now be supported by all
mysql standard clients. For details, please
take a look at the latest change set pushed.
[19 Jan 2011 0:46] Paul Dubois
Noted in 5.5.10, 5.6.2 changelogs.

The mysql_upgrade, mysqlbinlog, mysqlcheck, mysqlimport, mysqlshow,
and mysqlslap clients now have --default-auth and --plugin-dir
options for specifying which authentication plugin and plugin
directory to use.