Randy Kobes wrote: >On Thu, 5 May 2005, Markus Wichitill wrote: > > > >>Steve Hay wrote: >> >> >>>>how can we test if the filehandle is valid then? may be we should skip >>>>that bit altogether? Steve, does it work if you comment out the whole >>>> >>>> if (!size) { ... } >>>> >>>>block? >>>> >>>> >>>No, it doesn't :( >>> >>> >>I've removed the size code, too, and the problem is that after the exception >>is thrown, neither of the tests in RegistryCooker::read_script apply: >> >> if (ref $@ eq 'APR::Error') { >> return Apache2::Const::FORBIDDEN if $@ == APR::Const::EACCES; >> return Apache2::Const::NOT_FOUND if $@ == APR::Const::ENOENT; >> # oops >> } >> >>The actual error code returned by apr_file_open is 720002. >> >> >> > >Does the following fix this? > > No. I was just in the process of trying the same thing myself, but it doesn't fix it for me :(
>=================================================================== >Index: xs/APR/Status/APR__Status.h >=================================================================== >--- xs/APR/Status/APR__Status.h (revision 168337) >+++ xs/APR/Status/APR__Status.h (working copy) >@@ -16,3 +16,5 @@ > #include "apr_errno.h" > > #define mpxs_APR__Status_is_EAGAIN APR_STATUS_IS_EAGAIN >+#define mpxs_APR__Status_is_EACCES APR_STATUS_IS_EACCES >+#define mpxs_APR__Status_is_ENOENT APR_STATUS_IS_ENOENT >Index: xs/maps/apr_functions.map >=================================================================== >--- xs/maps/apr_functions.map (revision 168337) >+++ xs/maps/apr_functions.map (working copy) >@@ -649,3 +649,5 @@ > > MODULE=APR::Status PREFIX=mpxs_APR__STATUS_ > int:DEFINE_is_EAGAIN | | apr_status_t:rc >+ int:DEFINE_is_EACCES | | apr_status_t:rc >+ int:DEFINE_is_ENOENT | | apr_status_t:rc >Index: ModPerl-Registry/lib/ModPerl/RegistryCooker.pm >=================================================================== >--- ModPerl-Registry/lib/ModPerl/RegistryCooker.pm (revision 168337) >+++ ModPerl-Registry/lib/ModPerl/RegistryCooker.pm (working copy) >@@ -34,6 +34,7 @@ > use Apache2::Access (); > > use APR::Table (); >+use APR::Status (); > > use ModPerl::Util (); > use ModPerl::Global (); >@@ -41,7 +42,6 @@ > use File::Spec::Functions (); > use File::Basename; > >-use APR::Const -compile => qw(EACCES ENOENT); > use Apache2::Const -compile => qw(:common &OPT_EXECCGI); > use ModPerl::Const -compile => 'EXIT'; > >@@ -542,8 +542,8 @@ > $self->log_error("$@"); > > if (ref $@ eq 'APR::Error') { >- return Apache2::Const::FORBIDDEN if $@ == APR::Const::EACCES; >- return Apache2::Const::NOT_FOUND if $@ == APR::Const::ENOENT; >+ return Apache2::Const::FORBIDDEN if APR::Status::is_EACCES($@); >+ return Apache2::Const::NOT_FOUND if APR::Status::is_ENOENT($@); > } > else { > return Apache2::Const::SERVER_ERROR; > >======================================================================== > > > ------------------------------------------------ Radan Computational Ltd. The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email.