Subject: | Apache2::Const::OK appearing under mod_perl 1.3 |
Hello,
I still use Apache/mod_perl 1.3 and I just upgraded
Apache::AuthDBI to (1.03, Auth_DBI_encryption_method++)
and got the following error in the logs:
[Tue Oct 17 15:26:22 2006] [error] Undefined subroutine
&Apache2::Const::OK called at /[...]/lib/Apache/AuthDBI.pm line 909.\n
Looking at that code it seems like the low precedence of
?: is causing the problem. Attached is a patch for the
example that I trip plus a few others (AuthDBI.pm.diff)
parens.diff is the difference between the
perl -MO=Deparse,-p lib/Apache/AuthDBI.pm output since I
wasn't sure if the I got all the bits required.
Maybe someone could add a test like:
perl -MO=Deparse,-p lib/Apache/AuthDBI.pm | grep Apache2::Const
Thanks,
Brad
Subject: | AuthDBI.pm.diff |
--- /home/bsb/lib/Apache/AuthDBI.pm.orig 2006-10-17 15:12:49.081154612 +1000
+++ /home/bsb/lib/Apache/AuthDBI.pm.new 2006-10-17 15:24:36.938718957 +1000
@@ -671,8 +671,8 @@
unless ($ary_ref) {
if ($Attr->{authoritative} eq 'on') {
$r->log_reason("user $user_sent denied, no access rules specified (DBI-Authoritative)", $r->uri);
- if ($authz_denied == MP2 ? Apache2::Const::AUTH_REQUIRED() :
- Apache::Constants::AUTH_REQUIRED()) {
+ if ($authz_denied == (MP2 ? Apache2::Const::AUTH_REQUIRED() :
+ Apache::Constants::AUTH_REQUIRED())) {
$r->note_basic_auth_failure;
}
return $authz_denied;
@@ -913,17 +913,17 @@
Apache::Constants::OK())
)
&& (
- $group_result != MP2 ? Apache2::Const::OK() :
- Apache::Constants::OK()
+ $group_result != (MP2 ? Apache2::Const::OK() :
+ Apache::Constants::OK())
)
) {
my $reason;
- if ($user_result == MP2 ? Apache2::Const::AUTH_REQUIRED() :
- Apache::Constants::AUTH_REQUIRED()) {
+ if ($user_result == (MP2 ? Apache2::Const::AUTH_REQUIRED() :
+ Apache::Constants::AUTH_REQUIRED())) {
$reason .= " USER";
}
- if ($group_result == MP2 ? Apache2::Const::AUTH_REQUIRED() :
- Apache::Constants::AUTH_REQUIRED()) {
+ if ($group_result == (MP2 ? Apache2::Const::AUTH_REQUIRED() :
+ Apache::Constants::AUTH_REQUIRED())) {
$reason .= " GROUP";
}
$r->log_reason(
@@ -931,8 +931,8 @@
$r->uri
);
- if ($authz_denied == MP2 ? Apache2::Const::AUTH_REQUIRED() :
- Apache::Constants::AUTH_REQUIRED()) {
+ if ($authz_denied == (MP2 ? Apache2::Const::AUTH_REQUIRED() :
+ Apache::Constants::AUTH_REQUIRED())) {
$r->note_basic_auth_failure;
}
Subject: | parens.diff |
--- a 2006-10-17 15:02:17.509102764 +1000
+++ b 2006-10-17 15:19:35.041493146 +1000
@@ -336,7 +336,7 @@
unless ($ary_ref) {
if (($$Attr{'authoritative'} eq 'on')) {
$r->log_reason("user $user_sent denied, no access rules specified (DBI-Authoritative)", $r->uri);
- if ((($authz_denied == 0) ? Apache2::Const::AUTH_REQUIRED() : Apache::Constants::AUTH_REQUIRED())) {
+ if (($authz_denied == Apache::Constants::AUTH_REQUIRED())) {
$r->note_basic_auth_failure;
}
return($authz_denied);
@@ -473,16 +473,16 @@
}
}
}
- if (((($$Attr{'authoritative'} eq 'on') and ($user_result != Apache::Constants::OK())) and (($group_result != 0) ? Apache2::Const::OK() : Apache::Constants::OK()))) {
+ if (((($$Attr{'authoritative'} eq 'on') and ($user_result != Apache::Constants::OK())) and ($group_result != Apache::Constants::OK()))) {
my($reason);
- if ((($user_result == 0) ? Apache2::Const::AUTH_REQUIRED() : Apache::Constants::AUTH_REQUIRED())) {
+ if (($user_result == Apache::Constants::AUTH_REQUIRED())) {
($reason .= ' USER');
}
- if ((($group_result == 0) ? Apache2::Const::AUTH_REQUIRED() : Apache::Constants::AUTH_REQUIRED())) {
+ if (($group_result == Apache::Constants::AUTH_REQUIRED())) {
($reason .= ' GROUP');
}
$r->log_reason("DBI-Authoritative: Access denied on $reason rule(s)", $r->uri);
- if ((($authz_denied == 0) ? Apache2::Const::AUTH_REQUIRED() : Apache::Constants::AUTH_REQUIRED())) {
+ if (($authz_denied == Apache::Constants::AUTH_REQUIRED())) {
$r->note_basic_auth_failure;
}
return($authz_denied);