Re: Howto Apache2::AuthCookieDBI and followup question

2016-09-30 Thread Vincent Veyron
On Sat, 1 Oct 2016 00:16:59 +0200
Tosh Cooey  wrote:

> 
> Now the followup. I personally need extra dynamism, specifically I need 
> DBDParams and SessionCookieName to be dynamic for each request. Intense 
> googling has lead me to believe I can do so within a  block, 
> something like:
> 
> When the user requests www.site.com/client_identifier/*anything* then 
> the  block needs to get $client_identifier from the URI and then 
> get $host, $database, $username, $password via:
> 
> select host, database, username, password from clients where client = 
> $client_identifier
> 
> But I'm kind of at a bit of a loss how to accomplish this. Anyone here 
> have any hints?
> 

I don't know about the  block, but I would use the HeaderParser phase for 
this :

PerlModule your::module 



  PerlHeaderParserHandler your::module



and have your::module do the select host, etc... and set the cookie


-- 
Bien à vous, Vincent Veyron 

https://compta.libremen.com
Logiciel libre de comptabilité générale


Howto Apache2::AuthCookieDBI and followup question

2016-09-30 Thread Tosh Cooey
Ok, so it seems with Apache > 2.4 the functionality of 
Apache2::AuthCookieDBI can be duplicated using modules, specifically:


mod_auth_form AND mod_authn_dbd

This article gives a good writeup about it:

https://kodingnotes.wordpress.com/2013/02/26/authentication-in-apache2-4-part-1-installation/

In the config file you just need:

DBDriver mysql
DBDParams "dbname=myDB,user=root,pass=XXX"

  AuthFormProvider dbd
  AuthType form
  AuthName private

  Session On
  SessionCookieName session path=/
  SessionCryptoPassphrase secret
  ErrorDocument 401 /login.html

  # mod_authz_core configuration
  Require valid-user

  # mod_authn_dbd SQL query to authenticate a user
  AuthDBDUserPWQuery "SELECT password FROM apache_user WHERE username = %s"



Now the followup. I personally need extra dynamism, specifically I need 
DBDParams and SessionCookieName to be dynamic for each request. Intense 
googling has lead me to believe I can do so within a  block, 
something like:


When the user requests www.site.com/client_identifier/*anything* then 
the  block needs to get $client_identifier from the URI and then 
get $host, $database, $username, $password via:


select host, database, username, password from clients where client = 
$client_identifier


But I'm kind of at a bit of a loss how to accomplish this. Anyone here 
have any hints?


Thanks, and I hope this helps rescue people from Apache2::AuthCookieDBI

Tosh

--
McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/


Re: [RELEASE CANDIDATE] mod_perl-2.0.10 RC1

2016-09-30 Thread Michael Schout
On 9/30/16 8:53 AM, Michael Schout wrote:
> On 9/30/16 8:13 AM, Steve Hay wrote:
>> Please download, test, and report back on this mod_perl 2.0.10 release
>> candidate.
> 
> There is some kind of linker failure happening on OSX/Darwin.  I'm on El
> Capitan (10.11) using perl 5.20 and get all kinds of duplicate symbol
> errors.  I'll see if I can figure out where this broke.

Ok this seems to be caused by putting MP_vtbl_env and MP_vtbl_envelem in
the modperl_env.h header and removal of "static" qualifier for these
structs.  Presumably this was done to be threaded perl friendly?
Anyway, I made the compiler happy by adding "extern" in the header:

--- mod_perl-2.0.10-rc1/src/modules/perl/modperl_env.h  2016-09-30
07:45:25.0 -0500
+++ mod_perl-2.0.10-rc1.osx/src/modules/perl/modperl_env.h  2016-09-30
11:39:05.0 -0500
@@ -62,8 +62,8 @@

 void modperl_env_unload(pTHX);

-MGVTBL MP_vtbl_env;
-MGVTBL MP_vtbl_envelem;
+extern MGVTBL MP_vtbl_env;
+extern MGVTBL MP_vtbl_envelem;

 #endif /* MODPERL_ENV_H */


I also need the "no APR_INLINE" patch on OS X, to get it to compile but
that's nothing new:

--- mod_perl-2.0.4.orig/src/modules/perl/modperl_common_util.h
2007-12-31 01:23:36.0 -0600
+++ mod_perl-2.0.4/src/modules/perl/modperl_common_util.h   2012-09-11
21:56:40.0 -0500
@@ -22,7 +22,7 @@
 #ifdef MP_DEBUG
 #define MP_INLINE
 #else
-#define MP_INLINE APR_INLINE
+#define MP_INLINE
 #endif

 #ifdef CYGWIN

I *do* get test failures on OS X, but to be fair 2.0.9 produces even
MORE failures so 2.0.10 is actually an improvement in that regard :).

Regards,
Michael Schout


Re: [RELEASE CANDIDATE] mod_perl-2.0.10 RC1

2016-09-30 Thread Adam Prime

+1 on solaris 10 w/ apache 2.2.31 prefork and perl 5.24.0

all tests pass


Re: [RELEASE CANDIDATE] mod_perl-2.0.10 RC1

2016-09-30 Thread Adam Prime

+1 on ubuntu w/ apache 2.2.31 prefork & perl 5.24.0






Re: [RELEASE CANDIDATE] mod_perl-2.0.10 RC1

2016-09-30 Thread Michael Schout
On 9/30/16 8:13 AM, Steve Hay wrote:
> Please download, test, and report back on this mod_perl 2.0.10 release
> candidate.

There is some kind of linker failure happening on OSX/Darwin.  I'm on El
Capitan (10.11) using perl 5.20 and get all kinds of duplicate symbol
errors.  I'll see if I can figure out where this broke.

duplicate symbol _MP_vtbl_env in:
mod_perl.lo
modperl_interp.lo
duplicate symbol _MP_vtbl_envelem in:
mod_perl.lo
modperl_interp.lo
duplicate symbol _MP_vtbl_env in:
mod_perl.lo
modperl_tipool.lo
duplicate symbol _MP_vtbl_envelem in:
mod_perl.lo
modperl_tipool.lo
duplicate symbol _MP_vtbl_env in:
mod_perl.lo
modperl_config.lo
duplicate symbol _MP_vtbl_envelem in:
mod_perl.lo
modperl_config.lo


Regards,
Michael Schout


Re: [RELEASE CANDIDATE] mod_perl-2.0.10 RC1

2016-09-30 Thread Steve Hay
On 30 September 2016 at 14:13, Steve Hay  wrote:
> Please download, test, and report back on this mod_perl 2.0.10 release
> candidate.
>
> https://dist.apache.org/repos/dist/dev/perl/mod_perl-2.0.10-rc1.tar.gz
>

+1 (modulo the expected failures noted in the RC announcement) on
Windows 8.1 / VC++ 2010 with all eight combinations of:

Perl 5.20.3, 5.22.3-RC2, 5.24.1-RC2, 5.25.3
Apache httpd 2.2.31, 2.4.23

except that t/filter/in_bbs_inject_header.t is also failing tests 22,
26 and 30 with httpd 2.4, although I don't think that's new from
looking through the archives, e.g. see:

https://marc.info/?l=apache-modperl&m=143696414409949&w=2 (2015-07-15)
https://marc.info/?l=apache-modperl-dev&m=146450325022969&w=2 (2016-05-29)
https://marc.info/?l=apache-modperl&m=146922430215771&w=2 (2016-07-22)


[RELEASE CANDIDATE] mod_perl-2.0.10 RC1

2016-09-30 Thread Steve Hay
Please download, test, and report back on this mod_perl 2.0.10 release
candidate.

https://dist.apache.org/repos/dist/dev/perl/mod_perl-2.0.10-rc1.tar.gz

MD5  = f29feb099e0cff545da347b1bcead671
SHA1 = 07c8c656eecbc436ba285aa5a9a3c69947613a16

NOTE: Unfortunately, there is a new test failure on Windows when using
Perls built
with the PERL_IMPLICIT_SYS build option enabled (which it is by
default). This is in addition to the existing four known test failures
on Windows (t/protocol/echo_block.t, t/protocol/echo_nonblock.t,
t/protocol/echo_timeout.t and t/protocol/pseudo_http.t) which were
present in the previous release (2.0.9).

Major changes in this release are as follows:

Automatically select the appropriate c89 option when modperl is being
built with either gcc 5 or clang. [Klaus S. Madsen ]

Fix non-threaded Perl 5.22.x build and tests. [Klaus S. Madsen
]

Add support for Perl 5.22.x. [Niko Tyni , Steve Hay]