apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: finfo->protection on Win32
Date Tue, 30 May 2006 09:02:46 GMT
It's related to the permissions we open the file with (in one case we
open for reading the security signature and in the other case we failed
to do so.)  Needs to be fixed before the next release.

You only missed it because the change was in apr_file_open :(

Bill

Randy Kobes wrote:
> In working on the perl glue to apr, I've come across
> a difference in finfo->protection on Win32 between
> different versions of apr that I'm wondering if
> someone can explain. I have this program:
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> #ifdef __cplusplus
> extern "C" {
> #endif
> #include <apr.h>
> #include <apr_version.h>
> #include <apr_portable.h>
> #ifdef __cplusplus
> }
> #endif
> 
> int main(int argc, char **argv) {
>   apr_status_t rc;
>   apr_pool_t *p;
>   apr_finfo_t *finfo;
>   apr_int32_t wanted = APR_FINFO_NORM;
>   apr_fileperms_t protection;
>   const char fname[] = "C:/Apache2/include/apr_file_info.h";
> 
>   rc = apr_app_initialize(&argc, &argv, NULL);
>   rc = apr_pool_create(&p, NULL);
>   finfo = (apr_finfo_t *) apr_pcalloc(p, sizeof(apr_finfo_t));
>   rc = apr_stat(finfo, fname, wanted, p);
>   protection = finfo->protection;
>   printf("protection: %d\n", protection);
>   printf("WREAD: %d\n", protection & APR_WREAD);
>   printf("WWRITE: %d\n", protection & APR_WWRITE);
>   return 0;
> }
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> 
> With version 0.9.7 of apr (Apache/2.0.55), I get:
> 
> protection: 1911
> WREAD: 4
> WWRITE: 2
> 
> while with version 1.2.7 of apr (Apache/2.2.2), I get:
> 
> protection: 1904
> WREAD: 0
> WWRITE: 0
> 
> I couldn't see what changed in apr/file_io/win32/filestat.c
> to cause this difference - is this an intentional change?
> Thanks.
> 


Mime
View raw message