Bug 182449 - databases/pecl-memcached: Memcached::setSaslAuthData unavailable, by lack of SASL authentication option,
Summary: databases/pecl-memcached: Memcached::setSaslAuthData unavailable, by lack of ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Sunpoet Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-28 01:00 UTC by dereckson
Modified: 2015-03-21 20:52 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dereckson 2013-09-28 01:00:01 UTC
PECL extension by default doesn't include SASL authentication, it should be explicitly asked at configure time.

Excerpt from http://www.php.net/manual/en/memcached.installation.php:
SASL authentication support is disabled by default. To enable it, use --enable-memcached-sasl switch. This requires that libsasl2 has been installed and that libmemcached has been built with SASL support enabled.

Excerpt from http://www.php.net/manual/en/memcached.setsaslauthdata.php:
This method is only available when the memcached extension is build with SASL support. Please refer to Memcached setup for how to do this.

Fix: 

Add a SASL option:
- adding --enable-memcached-sasl to ./configure
- adding security/cyrus-sasl2 as dependency (should have been done by libmemcached)

If you wish to do it without the option:
- Argument pro: databases/libmemcached now always add SASL support
- Argument against: databases/memcached still provides the option (but we're in the client side, not the server side, so shouldn't we be coherent with libmemcached choice?)
How-To-Repeat: <?php
    $memcached = new Memcached();
    $memcached->addServer('localhost', 11211);
    $memcached->setSaslAuthData('username', 'password');
    //Fails, as setSaslAuthData doesn't exist
Comment 1 Edwin Groothuis freebsd_committer 2013-09-28 01:00:10 UTC
Responsible Changed
From-To: freebsd-ports-bugs->miwi

miwi@ wants this port PRs (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer 2013-09-28 01:00:11 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 Edwin Groothuis freebsd_committer 2013-09-28 01:00:11 UTC
Maintainer of databases/pecl-memcached,

Please note that PR ports/182449 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/182449

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 4 gslin 2013-10-22 10:48:24 UTC
Thanks, would you like to offer a patch to include these features ?

On Sat, Sep 28, 2013 at 12:00:11AM +0000, Edwin Groothuis wrote:
> Maintainer of databases/pecl-memcached,
> 
> Please note that PR ports/182449 has just been submitted.
> 
> If it contains a patch for an upgrade, an enhancement or a bug fix
> you agree on, reply to this email stating that you approve the patch
> and a committer will take care of it.
> 
> The full text of the PR can be found at:
>     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/182449
> 
> -- 
> Edwin Groothuis via the GNATS Auto Assign Tool
> edwin@FreeBSD.org

-- 
* Gea-Suan Lin  (public key: Using https://keyserver.pgp.com/ to search)
* If you cannot convince them, confuse them.           -- Harry S Truman
Comment 5 Martin Wilke freebsd_committer 2014-01-07 04:18:29 UTC
Responsible Changed
From-To: miwi->freebsd-port-bugs

back to pool.
Comment 6 Mark Linimon freebsd_committer freebsd_triage 2014-03-23 19:56:12 UTC
Responsible Changed
From-To: freebsd-port-bugs->freebsd-ports-bugs

Canonicalize assignment.
Comment 7 niels.poppe 2014-04-28 03:24:53 UTC
Someone somewhere found this problem and the solution, but somehow =
nobody followed up the friendly request to do the work:

> From:	Gea-Suan Lin <gslin@gslin.org>
> To:	bug-followup@FreeBSD.org
> Date:	Tue, 22 Oct 2013 17:48:24 +0800
>=20
> Thanks, would you like to offer a patch to include these features ?
>=20
> On Sat, Sep 28, 2013 at 12:00:11AM +0000, Edwin Groothuis wrote:
> > Maintainer of databases/pecl-memcached,
> >=20
> > Please note that PR ports/182449 has just been submitted.
> >=20

This little patch does provide the needed option (I did not look any =
deeper than that).

Index: databases/pecl-memcached/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- databases/pecl-memcached/Makefile	(revision 352016)
+++ databases/pecl-memcached/Makefile	(working copy)
@@ -25,8 +25,9 @@
 USE_PHP_BUILD=3D	yes
 CONFIGURE_ARGS+=3D--with-libmemcached-dir=3D${LOCALBASE}
=20
-OPTIONS_DEFINE=3D	IGBINARY
+OPTIONS_DEFINE=3D	IGBINARY SASL
 IGBINARY_DESC=3D	Binary serializer support
+SASL_DESC=3D	Cyrus SASL support
=20
 .include <bsd.port.options.mk>
=20
@@ -36,4 +37,9 @@
 RUN_DEPENDS+=3D	=
${LOCALBASE}/lib/php/${PHP_EXT_DIR}/igbinary.so:${PORTSDIR}/converters/igb=
inary
 .endif
=20
+.if ${PORT_OPTIONS:MSASL}
+CONFIGURE_ARGS+=3D--enable-memcached-sasl
+LIB_DEPENDS+=3D sasl2:${PORTSDIR}/security/cyrus-sasl2
+.endif
+
 .include <bsd.port.mk>
Comment 8 John Marino freebsd_committer 2014-07-26 10:24:08 UTC
niels, 
Can you resubmit this corrupt patch as an attachment?

assigning to maintainer in the meantime...
Comment 9 niels.poppe 2014-08-05 14:19:41 UTC
(In reply to John Marino from comment #8)
> niels, 
> Can you resubmit this corrupt patch as an attachment?

Hi John

I am sorry, my ports tree with that patch got lost while updating, and as I am not currently using nor building any of the pecl packages, someone who actually uses this stuff should make sure this is the correct way to go.

Yet, in order to build and link databases/pecl-memcached with SASL support, Makefile should be changed to:

- have the word 'SASL' added to OPTIONS_DEFINE
- have a SASL_DESC variable with some value like "Cyrus SASL support"
- have an .if ${PORT_OPTIONS:MSASL} clause, containing:

+CONFIGURE_ARGS+= --enable-memcached-sasl
+LIB_DEPENDS+= sasl2:${PORTSDIR}/security/cyrus-sasl2

That's all there is to it. Except someone should then build, install and test :-)
Comment 10 Sunpoet Po-Chuan Hsieh freebsd_committer 2015-03-20 13:43:15 UTC
delphij@ passes this port to me.
Comment 11 commit-hook freebsd_committer 2015-03-21 20:51:03 UTC
A commit references this bug:

Author: sunpoet
Date: Sat Mar 21 20:51:00 UTC 2015
New revision: 381867
URL: https://svnweb.freebsd.org/changeset/ports/381867

Log:
  - Add SASL option

  PR:		182449
  Submitted by:	<dereckson@gmail.com>, <niels.poppe@gmail.com>

Changes:
  head/databases/pecl-memcached/Makefile
Comment 12 Sunpoet Po-Chuan Hsieh freebsd_committer 2015-03-21 20:52:06 UTC
Committed. Thanks!