On Tue, 16 Jul 2019 at 18:31, Steve Hay <steve.m....@googlemail.com> wrote:
>
> On Tue, 16 Jul 2019 at 14:53, William A Rowe Jr <wr...@rowe-clan.net> wrote:
> >
> > On Tue, Jul 16, 2019 at 8:10 AM Steve Hay <steve.m....@googlemail.com> 
> > wrote:
> >>
> >> I'm in the process of preparing a new mod_perl release and have run
> >> into a few test failures on Windows 10 which are caused by apr_stat()
> >> sometimes returning APR_INCOMPLETE (70008).
> >>
> >> I'm only getting this on Windows 10. If I run the same build of
> >> everything on Windows 7 then everything is fine. I've built everything
> >> from scratch with VS2019. I get the same behaviour with VS2015.
> >>
> >> I'm using apr-1.7.0 / apr-util-1.6.1. Is it worth trying the latest
> >> dev versions?
> >
> >
> > Would you retest with apr-1.6.5? Minor changes to the handling of symbolic
> > links (junction/reparse points) on Win32 in 1.7.0 may be to blame.
> >
> > (Yes, I understand that you are not looking at a symlink in this case.)
> >
> >
>
> I've built everything in a fresh directory tree in exactly the same
> way as before but using 1.6.5 instead of 1.7.0 and it behaves the
> same.

An update on this: The following program reproduces the problem for
me, using either branch of the if-block:

use strict;
use warnings FATAL => 'all';

use File::Temp qw(tempfile);

use APR::Finfo ();
use APR::Pool ();
use APR::Const -compile => qw(FINFO_NORM);

my($fh, $file);
if (0) {
  ($fh, $file) = tempfile(DIR => '.', UNLINK => 1);
  close $fh;
}
else {
  $file = 'test.txt';
  open $fh, '>', $file;
  close $fh;
}

print "Testing $file\n";

my $finfo = APR::Finfo::stat($file, APR::Const::FINFO_NORM, APR::Pool->new());

So it's nothing specific about the way httpd.conf is created.

But if I manually create a file in Windows Explorer and then point the
above program at that file then it works OK.

I think there is some weird permissions thing going on here. If I
double-click on the test.txt file produced by the program above then
it opens in Notepad. If I now try to Save that file then it fails,
saying 'You do not have permissions to open this file. See the owner
of the file or an administrator to obtain permission."

This makes no sense me because right-click > Properties > Security
shows that Administrators have Full control... and my (domain) user
account is in the (local) Administrators group that has Full control!

If I hit the Advanced button on the Properties dialog and go to the
Effective Access tab and select my user account then it confirms that
the Effective Access for my account really does include Full control.

Files that I make manually (right-click > New > Text Document in
Windows Explorer) have Owner set to my user account rather than
Administrators. And if I make a copy of the offending test.txt (or
httpd.conf) file then those copies are also owned by me.

So the problem is that apr_stat() fails on files that I don't own,
even when I have Full control over them. To be fair, Notepad also has
trouble with these files, which I don't understand.

Reply via email to