Bug 234817 - databases/pgpool-II-40: Broken PAM option?
Summary: databases/pgpool-II-40: Broken PAM option?
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Tobias Kortkamp
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2019-01-10 11:22 UTC by Tobias Kortkamp
Modified: 2019-01-16 12:07 UTC (History)
1 user (show)

See Also:
tz: maintainer-feedback+


Attachments
pgpool-II-40.diff (1.01 KB, patch)
2019-01-10 11:22 UTC, Tobias Kortkamp
tz: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Kortkamp freebsd_committer freebsd_triage 2019-01-10 11:22:03 UTC
Created attachment 200981 [details]
pgpool-II-40.diff

This has been raised on ports-committers before for ports r485048,
but was ignored so far.  I am filing this bug so that this is not
lost.  Since I have cleaned up some ports where variables are set
twice, introducing all sort of problems, over the last couple of days,
this has come up again.

pgpool-II-40 does the following with the PAM and SSL options:

SSL_CONFIGURE_WITH=     openssl                                                 
SSL_USES=               ssl                                                     
                                                                                
.include <bsd.port.options.mk>  

.if ${PORT_OPTIONS:MPAM}                                                        
#CONFIGURE_ARGS+=       --with-pam                                              
SSL_CONFIGURE_WITH=     pam                                                     
.endif     

Here SSL_CONFIGURE_WITH is set twice and seems to be tangled up
with the PAM option in a way that does not make much immediate
sense.

For starters, it does not make sense to set an options helper after
including bsd.port.options.mk.  It is an artifact of how make(1)
process variables, and how SSL_CONFIGURE_WITH was defined before
including bsd.port.options.mk as well, that this actually does
something here, i.e. add --with-pam to CONFIGURE_ARGS.

The PAM option currently does nothing without the SSL option turned
on.  If this entanglement is correct (I do not think it is) then at
the very least a PAM_IMPLIES=SSL is missing.

I'm attaching a patch that hopefully cleans this up.
Comment 1 Torsten Zuehlsdorff freebsd_committer freebsd_triage 2019-01-16 08:41:11 UTC
Hello Tobias,

thanks for taking care of this issue. I must admit, that i have no test-case for PƁM and i am not sure, that i understand this fully. Your explanation and your patch seems fine to me. Therefore i approve the patch.

Greetings,
Torsten
Comment 2 commit-hook freebsd_committer freebsd_triage 2019-01-16 12:03:50 UTC
A commit references this bug:

Author: tobik
Date: Wed Jan 16 12:03:14 UTC 2019
New revision: 490475
URL: https://svnweb.freebsd.org/changeset/ports/490475

Log:
  databases/pgpool-II-40: Unbreak PAM option

  The PAM option is tangled up with the SSL option in a weird way.
  SSL_CONFIGURE_WITH is set once before bsd.port.options.mk for
  enabling SSL support and overwritten again after including
  bsd.port.options.mk but only when PAM=on.

  Setting options helper after this point is not really supported,
  but --with-pam actually makes it to CONFIGURE_ARGS.  When options
  helpers are processed the results are only realized later by make(1).
  SSL_CONFIGURE_WITH has been defined before including bsd.port.options.mk,
  so this sort of "works".

  This, however, is presumably an implementation detail and enabling
  the PAM option breaks SSL support since SSL_CONFIGURE_WITH is
  overwritten with a new value: CONFIGURE_ARGS only has --with-pam
  left and is missing --with-openssl.

  PAM support does not depend on SSL support.  Just switch everything
  to options helpers to fix this.

  PR:		234817
  Submitted by:	tobik
  Approved by:	tz (maintainer)

Changes:
  head/databases/pgpool-II-40/Makefile
Comment 3 commit-hook freebsd_committer freebsd_triage 2019-01-16 12:06:54 UTC
A commit references this bug:

Author: tobik
Date: Wed Jan 16 12:06:25 UTC 2019
New revision: 490476
URL: https://svnweb.freebsd.org/changeset/ports/490476

Log:
  MFH: r490475

  databases/pgpool-II-40: Unbreak PAM option

  The PAM option is tangled up with the SSL option in a weird way.
  SSL_CONFIGURE_WITH is set once before bsd.port.options.mk for
  enabling SSL support and overwritten again after including
  bsd.port.options.mk but only when PAM=on.

  Setting options helper after this point is not really supported,
  but --with-pam actually makes it to CONFIGURE_ARGS.  When options
  helpers are processed the results are only realized later by make(1).
  SSL_CONFIGURE_WITH has been defined before including bsd.port.options.mk,
  so this sort of "works".

  This, however, is presumably an implementation detail and enabling
  the PAM option breaks SSL support since SSL_CONFIGURE_WITH is
  overwritten with a new value: CONFIGURE_ARGS only has --with-pam
  left and is missing --with-openssl.

  PAM support does not depend on SSL support.  Just switch everything
  to options helpers to fix this.

  PR:		234817
  Submitted by:	tobik
  Approved by:	tz (maintainer)

  Approved by:	ports-secteam build fix blanket

Changes:
_U  branches/2019Q1/
  branches/2019Q1/databases/pgpool-II-40/Makefile
Comment 4 Tobias Kortkamp freebsd_committer freebsd_triage 2019-01-16 12:07:42 UTC
(In reply to Torsten Zuehlsdorff from comment #1)

Thank you, Torsten.