Skip Menu |
 

This queue is for tickets about the DBD-mysql CPAN distribution.

Report information
The Basics
Id: 92292
Status: resolved
Priority: 0/
Queue: DBD-mysql

People
Owner: Nobody in particular
Requestors: karlroyer [...] corp.cardboardfish.com
Cc: pali [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 4.026



Subject: Cannot use secure_auth=0 option for legacy DB connections
Date: Mon, 20 Jan 2014 12:16:07 +0000
To: bug-DBD-mysql [...] rt.cpan.org
From: Karl Royer <karlroyer [...] corp.cardboardfish.com>
Download (untitled) / with headers
text/plain 949b
The MYSQL_SECURE_AUTH option cannot be set to 0 using the DBD::mysql client, The following diff to dbdimp.c (DBD-mysql-4.025) permits the "mysql_insecure_auth=1" option to be permitted in the connection string which will set the MYSQL_SECURE_AUTH option to false. diff -r DBD-mysql-4.025/dbdimp.c DBD-mysql-4.025.modded/dbdimp.c 39a40,41 Show quoted text
> my_bool secure_auth = 0; >
1704a1707,1715 Show quoted text
> if ((svp = hv_fetch(hv, "mysql_insecure_auth", 19, FALSE)) > && *svp && SvTRUE(*svp)) > { > if (DBIc_TRACE_LEVEL(imp_xxh) >= 2) > PerlIO_printf(DBIc_LOGPIO(imp_xxh), > "imp_dbh->mysql_dr_connect: Setting" \ > " secure auth (0).\n"); > mysql_options(sock, MYSQL_SECURE_AUTH,&secure_auth); > }
This has been tested using the connection URI DBI->connect("DBI:mysql:host=$host;mysql_insecure_auth=1:database=$database'', $username, $password)
Download (untitled) / with headers
text/plain 1.1k
On Pon Jan 20 07:16:39 2014, karlroyer@corp.cardboardfish.com wrote: Show quoted text
> The MYSQL_SECURE_AUTH option cannot be set to 0 using the DBD::mysql > client, > > The following diff to dbdimp.c (DBD-mysql-4.025) permits the > "mysql_insecure_auth=1" option to be permitted in the connection > string > which will set the MYSQL_SECURE_AUTH option to false. > > diff -r DBD-mysql-4.025/dbdimp.c DBD-mysql-4.025.modded/dbdimp.c > 39a40,41
> > my_bool secure_auth = 0; > >
> 1704a1707,1715
> > if ((svp = hv_fetch(hv, "mysql_insecure_auth", 19, FALSE)) > > && *svp && SvTRUE(*svp)) > > { > > if (DBIc_TRACE_LEVEL(imp_xxh) >= 2) > > PerlIO_printf(DBIc_LOGPIO(imp_xxh), > > "imp_dbh->mysql_dr_connect: Setting" \ > > " secure auth (0).\n"); > > mysql_options(sock, MYSQL_SECURE_AUTH,&secure_auth); > > }
> > This has been tested using the connection URI > DBI-
> >connect("DBI:mysql:host=$host;mysql_insecure_auth=1:database=$database'',
> $username, $password)
New attribute mysql_skip_secure_auth was added in DBD::mysql 4.026 which allow to set MYSQL_SECURE_AUTH to 0: https://github.com/perl5-dbi/DBD-mysql/commit/8507172ecc057eb8b97d2f5873c37b17a04dae23


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.