Bug 254731

Summary: [PATCH] security/pam_mysql: Add workaround for newer mysql version
Product: Ports & Packages Reporter: klaus
Component: Individual Port(s)Assignee: Jesper Schmitz Mouridsen <jsm>
Status: Closed FIXED    
Severity: Affects Some People CC: jsm
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
extra patch for pam_mysql.c
none
Makefile patch add option for extra patch
none
Updates to 0.8.2 instead
none
Updates to 0.8.2 instead none

Description klaus 2021-04-02 22:16:13 UTC
Created attachment 223777 [details]
extra patch for pam_mysql.c

I maintain a few customer systems with cyrus-sasl-saslauthd / pam_mysql on mysql 5.6.

After upgrading to mysql80-server, pam_mysql throws an error stating that make_scrambled_password() as undefined symbol so testsaslauthd failes authentication.

This patch is only a workaround to make pam_mysql work again till another sql solution is implemented for sasl authentication in postfix.
Comment 1 klaus 2021-04-02 22:17:20 UTC
Created attachment 223778 [details]
Makefile patch add option for extra patch
Comment 2 Jesper Schmitz Mouridsen freebsd_committer freebsd_triage 2021-06-03 17:51:45 UTC
Created attachment 225532 [details]
Updates to 0.8.2 instead

Hi

I tested an update to 0.8.2 instead. It also fixes the 
make_scrambled_password() as undefined symbol problem.
(It is fixed "upstream") Upstream changed.. since 0.7.x

Do you want to / have the opportunity to be the maintainer?

Can you perform some testing, in my tests it worked.

Note that I do not think that all info in pkg-message is correct.
I did not seem to need a symlink in /usr/lib
Comment 3 Jesper Schmitz Mouridsen freebsd_committer freebsd_triage 2021-06-04 18:09:10 UTC
Created attachment 225550 [details]
Updates to 0.8.2 instead
Comment 4 klaus 2021-06-05 16:13:18 UTC
Hi,

i tested version 0.8.2, but authentication (testsaslauthd) failed.

My installations work with the non crypt()ish MD5 hash in openssl which 
is not built in by default of pam_mysqls Makefile.

I tried to add --with-openssl in the Makefile, but openssl (from base)
is not found by the configure script.

I reverted back to my old "quick & dirty" version.
testsaslauthd is now working again.
Comment 5 Jesper Schmitz Mouridsen freebsd_committer freebsd_triage 2021-06-05 16:40:05 UTC
(In reply to klaus from comment #4)
Thanks for testing!

Do mind testing the diff from https://reviews.freebsd.org/D30646

https://reviews.freebsd.org/file/data/gdthqlo7tslktxoucc6y/PHID-FILE-c6eg7wyisfxmvrgmrm3r/D30646.diff

It finds openssl in base.

Thanks 

Jesper
Comment 6 Jesper Schmitz Mouridsen freebsd_committer freebsd_triage 2021-06-05 16:40:54 UTC
Comment on attachment 225550 [details]
Updates to 0.8.2 instead

see https://reviews.freebsd.org/D30646
Comment 7 klaus 2021-06-06 08:10:41 UTC
Hi,

i upgraded my private mail server yesterday and added the new diff.
testsaslauthd returns "Success". :-)

I do some mail tests in the next days and as sonn as this diff is committed i will 
upgrade the dbmail server in the company where i work ... :-)
Comment 8 commit-hook freebsd_committer freebsd_triage 2021-06-07 13:27:43 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e5e4475fb7f0d2692f668c23014e4aedcd7acff2

commit e5e4475fb7f0d2692f668c23014e4aedcd7acff2
Author:     Jesper Schmitz Mouridsen <jsm@FreeBSD.org>
AuthorDate: 2021-06-07 13:22:19 +0000
Commit:     Jesper Schmitz Mouridsen <jsm@FreeBSD.org>
CommitDate: 2021-06-07 13:27:24 +0000

    security/pam-mysql: Update to 0.8.2

    Old upstream is unmaintained and taken over by github.com/NigelCunningham/pam-MySQL

    This version supports newer versions of MySQL and MariaDB, that do not define
    make_scrambled_password().

    Since pam now looks in LOCALBASE for modules change pkg-message accordingly

    PR: 254731
    Reviewed_by: koobs (ports)
    Differential_Revision: 30646

 security/pam-mysql/Makefile                        | 31 +++++++++++++---------
 security/pam-mysql/distinfo                        |  5 ++--
 security/pam-mysql/files/patch-acinclude.m4 (gone) | 10 -------
 security/pam-mysql/files/pkg-message.in            |  8 ------
 security/pam-mysql/pkg-descr                       |  2 +-
 5 files changed, 22 insertions(+), 34 deletions(-)
Comment 9 Jesper Schmitz Mouridsen freebsd_committer freebsd_triage 2021-06-07 14:27:43 UTC
Thanks for testing, and reviewing.