You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Andreas Magnusson <an...@home.se> on 2006/01/21 12:01:22 UTC

[PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

I recently had a discussion with Garrett Rooney and William A. Rowe Jr. 
   about a bug in apr_file_open (on Windows in APR 0.9.7) that when 
fixed created "problems" in apr_stat (for Subversion). Spurred by this 
discussion, I decided to look for the root cause of the problem.

And what I found was that apr_stat(&finfo, path, APR_FINFO_PROT, &pool) 
does indeed not behave (on Windows) as I imagine it would behave on 
Unix/Linux.
The difference is that unpatched, the result in finfo.protection is 
*only* the world rights (translated into the group "Everyone" on 
Windows), and no group or user rights.
With this patch, the finfo.protection includes the rights for the 
current user, and the rights for his/her primary group (plus of course 
world/Everyone). Which is much more like the way I believe it works on 
Unix/Linux.

In more detail, more_finfo() asks for user and group information based 
on "(wanted & (APR_FINFO_USER | APR_FINFO_UPROT))" and vice versa for 
groups. But when it calls GetSecurityInfo (and friends depending on 
input), it only supplies the user argument if "(wanted & APR_FINFO_USER)".
Which means that when the routine later checks if "user" is valid, it 
isn't, which means that when we in resolve_prot() check to see if we can 
use the user information, it fails. The interesting thing is that 
resolve_prot() seems to be written as if this scenario should work from 
the beginning.

Note that I am by no means fluent in Unix/Linux, so if I have 
misunderstood that part, please set me straight immediately.

Regards,
/Andreas

Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by "D.J. Heap" <dj...@gmail.com>.
On 2/10/06, Garrett Rooney <ro...@electricjellyfish.net> wrote:
[snip]
> Well, it depends.  'incomplete' means you have to look at the 'valid'
> member and see if the parts you care about are valid or not, IIRC.
> But yes, the reason this set of patches haven't been committed (in the
> case of this patch) and merged back to the older branches (in the case
> of the already committed rev in question) is that nobody has done the
> leg work on it.  If you're willing to do the work of confirming that
> the changes work correctly and makes sense (i.e. makes the code do
> roughly the same thing on windows as it does on Unix) I'd be happy to
> commit the changes.
>

Ok, this APR fix is quite straightforward and looks like an oversight
in the original code, really -- without it the function doesn't bother
to get the permissions (unless you also happen ask for the user/group
info) and so it will always return 'incomplete'.

Now, although this fixes these functions in APR on Windows, Subversion
seems to have a different problem when it comes to setting files
readonly or read-write.  It seems to be assuming that the file
attribute 'readonly' is the same as permissions.  On Windows NTFS
filesystems they are not the same (the readonly attribute is
independent of the real permissions), but they *are* the same on FAT
filesystems and Unix, I think, right?

So even though it appears that APR tries to maintain the distinction
with different functions for attributes, Subversion is not (or at
least not completely) following that distinction and so when it finds
that the permissions on source and dest files are the same in
svn_io_set_file_read_write_carefully, it returns early and doesn't
actually change the readonly attribute.  Which causes troubles with
svn:needs-lock, at least.

Does that sound correct?  File attributes and file permissions are
distinct on Windows NTFS, but not really on Unix?  And even though APR
has separate functions to read/manipulate each, Subversion is kind of
munging them together?

It used to sort of work in old APRs because the calls to get security
failed on Win32 (because the file wasn't opened with READ_CONTROL
access) and so it called guess_protection_bits which just looks at the
readonly file attribute and makes up some permissions based on that.

Okay, that is confusing even to me as the writer.  Sooo, here is what
I think happened:

  1. Old APR was never reading file permissions on Win32 -- it just
guessed based on the readonly file attribute.

  2. Subversion treats readonly-ness mostly based on permissions
(svn_io_set_file_read_write_carefully) but since APR is only looking
at the file attribute, Subversion is fooled into thinking it is
behaving correctly on Win32.

  3. New APR is semi-fixed to pass READ_CONTROL on open so that it can
query permissions, but it doesn't actually query the permissions
causing 'incomplete' return codes.

  4. With the patch for new APR, permissions are queryed and returned
successfully.

  5. Even with the patch for new APR, Subversion is still semi-broken
in regards to setting the readonly file attribute on Win32 because it
is looking at permissions -- and the user's permissions are the same,
even if the readonly file attribute is not, so it never changes the
readonly attribute.

  6. I guess Subversion needs to be fixed to look at/change the
readonly file attribute even if permissions are the same (in
svn_io_set_file_read_write_carefully)?

I hope that makes sense...

DJ

Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by "D.J. Heap" <dj...@gmail.com>.
On 2/10/06, Garrett Rooney <ro...@electricjellyfish.net> wrote:
[snip]
> Well, it depends.  'incomplete' means you have to look at the 'valid'
> member and see if the parts you care about are valid or not, IIRC.
> But yes, the reason this set of patches haven't been committed (in the
> case of this patch) and merged back to the older branches (in the case
> of the already committed rev in question) is that nobody has done the
> leg work on it.  If you're willing to do the work of confirming that
> the changes work correctly and makes sense (i.e. makes the code do
> roughly the same thing on windows as it does on Unix) I'd be happy to
> commit the changes.
>

Ok, this APR fix is quite straightforward and looks like an oversight
in the original code, really -- without it the function doesn't bother
to get the permissions (unless you also happen ask for the user/group
info) and so it will always return 'incomplete'.

Now, although this fixes these functions in APR on Windows, Subversion
seems to have a different problem when it comes to setting files
readonly or read-write.  It seems to be assuming that the file
attribute 'readonly' is the same as permissions.  On Windows NTFS
filesystems they are not the same (the readonly attribute is
independent of the real permissions), but they *are* the same on FAT
filesystems and Unix, I think, right?

So even though it appears that APR tries to maintain the distinction
with different functions for attributes, Subversion is not (or at
least not completely) following that distinction and so when it finds
that the permissions on source and dest files are the same in
svn_io_set_file_read_write_carefully, it returns early and doesn't
actually change the readonly attribute.  Which causes troubles with
svn:needs-lock, at least.

Does that sound correct?  File attributes and file permissions are
distinct on Windows NTFS, but not really on Unix?  And even though APR
has separate functions to read/manipulate each, Subversion is kind of
munging them together?

It used to sort of work in old APRs because the calls to get security
failed on Win32 (because the file wasn't opened with READ_CONTROL
access) and so it called guess_protection_bits which just looks at the
readonly file attribute and makes up some permissions based on that.

Okay, that is confusing even to me as the writer.  Sooo, here is what
I think happened:

  1. Old APR was never reading file permissions on Win32 -- it just
guessed based on the readonly file attribute.

  2. Subversion treats readonly-ness mostly based on permissions
(svn_io_set_file_read_write_carefully) but since APR is only looking
at the file attribute, Subversion is fooled into thinking it is
behaving correctly on Win32.

  3. New APR is semi-fixed to pass READ_CONTROL on open so that it can
query permissions, but it doesn't actually query the permissions
causing 'incomplete' return codes.

  4. With the patch for new APR, permissions are queryed and returned
successfully.

  5. Even with the patch for new APR, Subversion is still semi-broken
in regards to setting the readonly file attribute on Win32 because it
is looking at permissions -- and the user's permissions are the same,
even if the readonly file attribute is not, so it never changes the
readonly attribute.

  6. I guess Subversion needs to be fixed to look at/change the
readonly file attribute even if permissions are the same (in
svn_io_set_file_read_write_carefully)?

I hope that makes sense...

DJ

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by Andreas Magnusson <an...@home.se>.
D.J. Heap wrote:
> 
> And it's utterly wasted since setting permissions on Win32 isn't even
> implemented in APR (and I'm not sure you can reasonably implement
> setting ACL permissions from a limited u/g/w API like APR currently
> has).
> 
One clarification, the time spent is only getting the ACLs from the 
files, it never tries to set them.

> 
> Can you clean it up and submit a patch for discussion?  

Will do.

> Personally I
> think it is pointless to try to fiddle with permissions in an ACL
> system -- you almost always just want to inherit the container
> permissions.  And Subversion currently only fiddles with the readonly
> file attribute anyway.  But we'll have to see what the other devs
> think.
> 
> DJ

/Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by "D.J. Heap" <dj...@gmail.com>.
On 2/11/06, Andreas Magnusson <an...@home.se> wrote:
[snip]
> With a corrected APR and trunk, apr_stat took between 35% and 40% of the
> total time used, only when *setting* the readonly flag. How serious in
> the real world this is, I cannot say.


And it's utterly wasted since setting permissions on Win32 isn't even
implemented in APR (and I'm not sure you can reasonably implement
setting ACL permissions from a limited u/g/w API like APR currently
has).


>
> After I changed svn_io_set_file_read_write_carefully to be just
> set/clear the readonly flag on Windows, apr_stat disappeared from the
> "top" list (landing on 2% total time), being replaced by apr_file_rename
> and apr_file_open (which seems reasonable).


Can you clean it up and submit a patch for discussion?  Personally I
think it is pointless to try to fiddle with permissions in an ACL
system -- you almost always just want to inherit the container
permissions.  And Subversion currently only fiddles with the readonly
file attribute anyway.  But we'll have to see what the other devs
think.

DJ

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by "D.J. Heap" <dj...@gmail.com>.
On 2/20/06, Branko Čibej <br...@xbc.nu> wrote:
[snip]
> > Yes, just svn_io_set_readwrite_carefully.  If that is fixed, then we
> > won't be relying on APR's behavior with Win32 ACLs anymore anyway.
> > The patch will probably go through a few cycles to get the Unix
> > permissions dance right if APR doesn't quite do what is expected, but
> > the Unix folks will help, I'm sure.
> >
> I'm already working on this patch, but due to spotty 'net access lately
> (thanks, useless ISP!),. I haven't finished it yet.
>
> I'm also wondering if we should rely on umask or some other mechanism
> when setting the write (and execute!!!!) bits "carefully" (in APR, that is).
>
> -- Brane

Any progress on this patch?  Now that Apache 2.2.2 is released for
Win32 it'd be good to get Subversion on Win32 working with it before
we get more questions about it.  If you are too busy I can try to work
on it.

DJ

Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by Branko Čibej <br...@xbc.nu>.
D.J. Heap wrote:
> On 2/18/06, Andreas Magnusson <an...@home.se> wrote:
> [snip]
>   
>> Are we talking about one for svn_io_set_readwrite_carefully (if that is
>> the name)? I will give it my best, no problem. APR is (of course)
>> another bag since I'm not very good at the non-Win32 side.
>>
>>     
>
>
> Yes, just svn_io_set_readwrite_carefully.  If that is fixed, then we
> won't be relying on APR's behavior with Win32 ACLs anymore anyway. 
> The patch will probably go through a few cycles to get the Unix
> permissions dance right if APR doesn't quite do what is expected, but
> the Unix folks will help, I'm sure.
>   
I'm already working on this patch, but due to spotty 'net access lately 
(thanks, useless ISP!),. I haven't finished it yet.

I'm also wondering if we should rely on umask or some other mechanism 
when setting the write (and execute!!!!) bits "carefully" (in APR, that is).

-- Brane


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by "D.J. Heap" <dj...@gmail.com>.
On 2/18/06, Andreas Magnusson <an...@home.se> wrote:
[snip]
> Are we talking about one for svn_io_set_readwrite_carefully (if that is
> the name)? I will give it my best, no problem. APR is (of course)
> another bag since I'm not very good at the non-Win32 side.
>


Yes, just svn_io_set_readwrite_carefully.  If that is fixed, then we
won't be relying on APR's behavior with Win32 ACLs anymore anyway. 
The patch will probably go through a few cycles to get the Unix
permissions dance right if APR doesn't quite do what is expected, but
the Unix folks will help, I'm sure.

Thanks!

DJ

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by Andreas Magnusson <an...@home.se>.
D.J. Heap wrote:
> On 2/11/06, Andreas Magnusson <an...@home.se> wrote:
>> Branko Čibej wrote:
> [snip]
>>> I propose we deprecate this function immediately and change the
>>> implementation to just call svn_io_set_file_read_only or
>>> svn_io_set_file_read_write, then concentrate on getting the correct
>>> behaviour implemented in APR.
>>>
>>> -- Brane
>> Sounds wise. Know if there is any reason there isn't a apr_file_attrs_get()?
>>
>> Lastly, I found out that another "strange" usage of apr_stat (in
>> svn_io_file_rename) was removed in r17366 on trunk. So with that, all
>> the odd performance measures I saw in 1.30 is gone.
> 
> 
> Were you going to work on a patch for this, Andreas?   If not, no
> problem, I'll get to it eventually.  It'd be great if you could,
> though.
> 
> Thanks!
> 
> DJ

Are we talking about one for svn_io_set_readwrite_carefully (if that is 
the name)? I will give it my best, no problem. APR is (of course) 
another bag since I'm not very good at the non-Win32 side.

/Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by "D.J. Heap" <dj...@gmail.com>.
On 2/11/06, Andreas Magnusson <an...@home.se> wrote:
> Branko Čibej wrote:
[snip]
> > I propose we deprecate this function immediately and change the
> > implementation to just call svn_io_set_file_read_only or
> > svn_io_set_file_read_write, then concentrate on getting the correct
> > behaviour implemented in APR.
> >
> > -- Brane
>
> Sounds wise. Know if there is any reason there isn't a apr_file_attrs_get()?
>
> Lastly, I found out that another "strange" usage of apr_stat (in
> svn_io_file_rename) was removed in r17366 on trunk. So with that, all
> the odd performance measures I saw in 1.30 is gone.


Were you going to work on a patch for this, Andreas?   If not, no
problem, I'll get to it eventually.  It'd be great if you could,
though.

Thanks!

DJ

Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by Branko Čibej <br...@xbc.nu>.
Andreas Magnusson wrote:
> Know if there is any reason there isn't a apr_file_attrs_get()?
We didn't need it in Subversion, so I didn't write it. Not much of an 
excuse, I know ... :)

-- Brane


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by Andreas Magnusson <an...@home.se>.
Branko Čibej wrote:
> I'm looking at svn_io_set_file_read_write_carefully, and try as I might, 
> I can't imagine what this monstrosity is doing in our public API. We 
> must all have been smoking something really weird to allow it in in the 
> first place.
> 
> It is APR's job to do the right platform-specific thing. The semantics 
> that this function is trying to implement should have gone into APR's 
> Unix-specific implementation of apr_file_attrs_set.
> 
> I propose we deprecate this function immediately and change the 
> implementation to just call svn_io_set_file_read_only or 
> svn_io_set_file_read_write, then concentrate on getting the correct 
> behaviour implemented in APR.
> 
> -- Brane

Sounds wise. Know if there is any reason there isn't a apr_file_attrs_get()?

Lastly, I found out that another "strange" usage of apr_stat (in 
svn_io_file_rename) was removed in r17366 on trunk. So with that, all 
the odd performance measures I saw in 1.30 is gone.

/Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by Julian Foad <ju...@btopenworld.com>.
Branko Čibej wrote:
> I'm looking at svn_io_set_file_read_write_carefully, and try as I might, 
> I can't imagine what this monstrosity is doing in our public API. We 
> must all have been smoking something really weird to allow it in in the 
> first place.
> 
> It is APR's job to do the right platform-specific thing. The semantics 
> that this function is trying to implement should have gone into APR's 
> Unix-specific implementation of apr_file_attrs_set.
> 
> I propose we deprecate this function immediately and change the 
> implementation to just call svn_io_set_file_read_only or 
> svn_io_set_file_read_write, then concentrate on getting the correct 
> behaviour implemented in APR.

+1 on deprecating it.  It's name and doc string don't make a lot of sense.  It 
starts with "Minimally change ..." and then contradicts that with things like 
"as much as the OS allows".  And "If enable_write is false, make the file 
write-only."  Is that just a typo for "read-only"?

I don't think just calling one of the existing functions will do, but I'm sure 
we can come up with some better solution or at least a better name and doc-string.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by Branko Čibej <br...@xbc.nu>.
I'm looking at svn_io_set_file_read_write_carefully, and try as I might, 
I can't imagine what this monstrosity is doing in our public API. We 
must all have been smoking something really weird to allow it in in the 
first place.

It is APR's job to do the right platform-specific thing. The semantics 
that this function is trying to implement should have gone into APR's 
Unix-specific implementation of apr_file_attrs_set.

I propose we deprecate this function immediately and change the 
implementation to just call svn_io_set_file_read_only or 
svn_io_set_file_read_write, then concentrate on getting the correct 
behaviour implemented in APR.

-- Brane


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by Andreas Magnusson <an...@home.se>.
D.J. Heap wrote:
> Does that sound correct?  File attributes and file permissions are
> distinct on Windows NTFS, but not really on Unix?  And even though APR
> has separate functions to read/manipulate each, Subversion is kind of
> munging them together?
Yes, that is my impression as well. Also, note that if my two patches 
get committed to APR, the INCOMPLETE messages will go away.

> It used to sort of work in old APRs because the calls to get security
> failed on Win32 (because the file wasn't opened with READ_CONTROL
> access) and so it called guess_protection_bits which just looks at the
> readonly file attribute and makes up some permissions based on that.
Correct.

>   6. I guess Subversion needs to be fixed to look at/change the
> readonly file attribute even if permissions are the same (in
> svn_io_set_file_read_write_carefully)?
I've just made some profiling on trunk on Win32, and these are my findings:
I have a repository with 5 directories, 3 tiers deep and 5 files in each 
dir (created with stress.pl). In this I changed all the files to 
svn:needs-lock to force a change in readonlyness, and to be able to see 
how much the corrected APR inflicted upon Subversion.
(I previously made the same check on 1.30, but it seems that some of the 
places that took lots of time are gone, I'll do a blame and see where 
they went...)

So before the test I did up WC -r 1 to seed it with files without 
readonly flag, and then profiled the call 'svn up WC'.

With a corrected APR and trunk, apr_stat took between 35% and 40% of the 
total time used, only when *setting* the readonly flag. How serious in 
the real world this is, I cannot say.

After I changed svn_io_set_file_read_write_carefully to be just 
set/clear the readonly flag on Windows, apr_stat disappeared from the 
"top" list (landing on 2% total time), being replaced by apr_file_rename 
and apr_file_open (which seems reasonable).

> 
> I hope that makes sense...
> 
> DJ
I hope the above does too.

/Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 2/10/06, D.J. Heap <dj...@gmail.com> wrote:
> On 2/10/06, Garrett Rooney <ro...@electricjellyfish.net> wrote:
> [snip]
> > Unfortunately no, this (along with the proposed backport of that other
> > revision, IIRC) has not yet been committed.  I haven't had a chance to
> > dig into it, and nobody with any win32-fu has looked at this AFAIK.
> >
>
>
> So if I understand correctly, 'incomplete' is a fatal error and
> Subversion (for example) should not attempt to deal with it and
> continue.  And this set of patches fixes apr to do that on Win32, but
> hasn't been verified to look and work correctly yet?

Well, it depends.  'incomplete' means you have to look at the 'valid'
member and see if the parts you care about are valid or not, IIRC. 
But yes, the reason this set of patches haven't been committed (in the
case of this patch) and merged back to the older branches (in the case
of the already committed rev in question) is that nobody has done the
leg work on it.  If you're willing to do the work of confirming that
the changes work correctly and makes sense (i.e. makes the code do
roughly the same thing on windows as it does on Unix) I'd be happy to
commit the changes.

-garrett

Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by "D.J. Heap" <dj...@gmail.com>.
On 2/10/06, William A. Rowe, Jr. <wr...@rowe-clan.net> wrote:
> In case we are less than clear here,
>
> from apr's getfileinfo, stat, lstat and readdir API, the system is to return
> only those components listed in the 'wanted' argument and those that come
> FOR FREE.  If processing time would increase, to retrieve 'unwanted' info, then
> those will not be marked as not retrieved.


Ok, the issue was that permissions were asked for but never actually
queried causing the 'incomplete' returns.  Old APR failed even earlier
because it did not pass READ_CONTROL on open, but then it went on to
'guess' based on the readonly file attribute.


>
> ANY PLATFORM may refuse to provide information that it can't obtain.  Therefore
> APR_EINCOMPLETE will signal missing bits from the 'wanted' mask that aren't
> present in the ->valid results.


Ok.


>
> I need to review the proposed changes carefully, but be warned I will veto any
> change which 'makes up' answers that don't correspond to the true values of
> these fields.  APR isn't cygwin, no results are 'invented' here.  They all
> correspond to true data or they are not returned at all.


Sure...it looks like the ACL -> permission mapping is fairly close,
though.  To me, anyway.


>
> Sure, there's a source code tarball.  Feel free to build.
>
> Most users need to run Apache 2.2.0 + patches, and even on win32 apply
> additional build patches, so mirroring the 2.2.0 tarball with a broken
> binary wasn't high on my priority list.  Releasing the next apr, apr-util
> and httpd IS high on my priority list, which is why I'd spent so much time
> in the past two weeks on bugs.


Ah, good to know, thanks!


>
> Glad this one 'resurfaced' during my bugzilla review :)  I'll investigate.
>


Great, thanks!

DJ

Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by "D.J. Heap" <dj...@gmail.com>.
On 5/12/06, William A. Rowe, Jr. <wr...@rowe-clan.net> wrote:
[snip]
>
> There's nothing straighforward about win32 perms and emulating unix ;-)
>
> That said, YES I promise to get on this in the coming week for apr releases
> 0.9.13/1.2.8/1.3.0 - getting the x64 build issues and .manifest's from command
> line builds is the only higher priority.
>
> Thank you for the reminder - if I haven't touched this by Tuesday, holler again.
>


Sorry, trying not to be a pest about this, but any progress or is
there a hold-up of some sort?

Thanks!

DJ

Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by "D.J. Heap" <dj...@gmail.com>.
On 5/12/06, William A. Rowe, Jr. <wr...@rowe-clan.net> wrote:
[snip]
> There's nothing straighforward about win32 perms and emulating unix ;-)
>


Very true, heh.


> That said, YES I promise to get on this in the coming week for apr releases
> 0.9.13/1.2.8/1.3.0 - getting the x64 build issues and .manifest's from command
> line builds is the only higher priority.
>
> Thank you for the reminder - if I haven't touched this by Tuesday, holler again.
>
> Bill
>
>


Thank you!

DJ

Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by "D.J. Heap" <dj...@gmail.com>.
On 5/12/06, William A. Rowe, Jr. <wr...@rowe-clan.net> wrote:
>
> There's nothing straighforward about win32 perms and emulating unix ;-)
>
> That said, YES I promise to get on this in the coming week for apr releases
> 0.9.13/1.2.8/1.3.0 - getting the x64 build issues and .manifest's from command
> line builds is the only higher priority.
>
> Thank you for the reminder - if I haven't touched this by Tuesday, holler again.
>


Ping...

DJ

Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
D.J. Heap wrote:
> On 2/10/06, William A. Rowe, Jr. <wr...@rowe-clan.net> wrote:
>>
>> Glad this one 'resurfaced' during my bugzilla review :)  I'll 
>> investigate.
> 
> It doesn't appear that this patch made it into Apache 2.2.2 -- is
> there something wrong with it?  It's working for me and appears to be
> a straightforward fix to an oversight on Win32.

There's nothing straighforward about win32 perms and emulating unix ;-)

That said, YES I promise to get on this in the coming week for apr releases
0.9.13/1.2.8/1.3.0 - getting the x64 build issues and .manifest's from command
line builds is the only higher priority.

Thank you for the reminder - if I haven't touched this by Tuesday, holler again.

Bill


Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by "D.J. Heap" <dj...@gmail.com>.
On 2/10/06, William A. Rowe, Jr. <wr...@rowe-clan.net> wrote:
[snip]
>
> Glad this one 'resurfaced' during my bugzilla review :)  I'll investigate.
>
> Bill
>


It doesn't appear that this patch made it into Apache 2.2.2 -- is
there something wrong with it?  It's working for me and appears to be
a straightforward fix to an oversight on Win32.

DJ

Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
In case we are less than clear here,

from apr's getfileinfo, stat, lstat and readdir API, the system is to return
only those components listed in the 'wanted' argument and those that come
FOR FREE.  If processing time would increase, to retrieve 'unwanted' info, then
those will not be marked as not retrieved.

ANY PLATFORM may refuse to provide information that it can't obtain.  Therefore
APR_EINCOMPLETE will signal missing bits from the 'wanted' mask that aren't
present in the ->valid results.

I need to review the proposed changes carefully, but be warned I will veto any
change which 'makes up' answers that don't correspond to the true values of
these fields.  APR isn't cygwin, no results are 'invented' here.  They all
correspond to true data or they are not returned at all.

Bill


D.J. Heap wrote:
> On 2/10/06, Garrett Rooney <ro...@electricjellyfish.net> wrote:
> [snip]
> 
>>Unfortunately no, this (along with the proposed backport of that other
>>revision, IIRC) has not yet been committed.  I haven't had a chance to
>>dig into it, and nobody with any win32-fu has looked at this AFAIK.
> 
> So if I understand correctly, 'incomplete' is a fatal error and
> Subversion (for example) should not attempt to deal with it and
> continue.  And this set of patches fixes apr to do that on Win32, but
> hasn't been verified to look and work correctly yet?
> 
> I should have some time this weekend to help, but I'm a bit unclear on
> what the situation is if the above is not right.
> 
> BTW, I can't seem to find a 'real' release of Apache 2.2 for
> Windows...is there one out yet?

Sure, there's a source code tarball.  Feel free to build.

Most users need to run Apache 2.2.0 + patches, and even on win32 apply
additional build patches, so mirroring the 2.2.0 tarball with a broken
binary wasn't high on my priority list.  Releasing the next apr, apr-util
and httpd IS high on my priority list, which is why I'd spent so much time
in the past two weeks on bugs.

Glad this one 'resurfaced' during my bugzilla review :)  I'll investigate.

Bill

Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by "D.J. Heap" <dj...@gmail.com>.
On 2/10/06, Garrett Rooney <ro...@electricjellyfish.net> wrote:
[snip]
> Unfortunately no, this (along with the proposed backport of that other
> revision, IIRC) has not yet been committed.  I haven't had a chance to
> dig into it, and nobody with any win32-fu has looked at this AFAIK.
>


So if I understand correctly, 'incomplete' is a fatal error and
Subversion (for example) should not attempt to deal with it and
continue.  And this set of patches fixes apr to do that on Win32, but
hasn't been verified to look and work correctly yet?

I should have some time this weekend to help, but I'm a bit unclear on
what the situation is if the above is not right.

BTW, I can't seem to find a 'real' release of Apache 2.2 for
Windows...is there one out yet?

DJ

Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 2/10/06, D.J. Heap <dj...@gmail.com> wrote:
> On 1/23/06, Andreas Magnusson <an...@home.se> wrote:
> > Garrett Rooney wrote:
> > >
> > > I'm not positive, not being an especially fluent win32 developer, but
> > > I think this seems reasonable...  Would this patch be a replacement
> > > for the backport you previously identified as avoiding the problem, or
> > > is it in addition to it?
> > >
> > > -garrett
> > >
> >
> > Ah, no this patch is an addition to that backport, and I now realize
> > that this patch ought to be nominated for backport if the intended
> > behavior is to mimmick the *nix behavior of apr_stat(,,APR_FINFO_PROT,)
> >
> > /Andreas
> >
>
>
> I lost track of where this issue is at...have these fixes been applied
> so that on Win32 Subversion should work with the latest apr?

Unfortunately no, this (along with the proposed backport of that other
revision, IIRC) has not yet been committed.  I haven't had a chance to
dig into it, and nobody with any win32-fu has looked at this AFAIK.

-garrett

Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by "D.J. Heap" <dj...@gmail.com>.
On 1/23/06, Andreas Magnusson <an...@home.se> wrote:
> Garrett Rooney wrote:
> >
> > I'm not positive, not being an especially fluent win32 developer, but
> > I think this seems reasonable...  Would this patch be a replacement
> > for the backport you previously identified as avoiding the problem, or
> > is it in addition to it?
> >
> > -garrett
> >
>
> Ah, no this patch is an addition to that backport, and I now realize
> that this patch ought to be nominated for backport if the intended
> behavior is to mimmick the *nix behavior of apr_stat(,,APR_FINFO_PROT,)
>
> /Andreas
>


I lost track of where this issue is at...have these fixes been applied
so that on Win32 Subversion should work with the latest apr?

DJ

Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by Andreas Magnusson <an...@home.se>.
Garrett Rooney wrote:
> 
> I'm not positive, not being an especially fluent win32 developer, but
> I think this seems reasonable...  Would this patch be a replacement
> for the backport you previously identified as avoiding the problem, or
> is it in addition to it?
> 
> -garrett
> 

Ah, no this patch is an addition to that backport, and I now realize 
that this patch ought to be nominated for backport if the intended 
behavior is to mimmick the *nix behavior of apr_stat(,,APR_FINFO_PROT,)

/Andreas


Re: [PATCH] Adjust more_finfo() on Win32 to behave more like its Unix/Linux counterpart

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 1/21/06, Andreas Magnusson <an...@home.se> wrote:
> I recently had a discussion with Garrett Rooney and William A. Rowe Jr.
>    about a bug in apr_file_open (on Windows in APR 0.9.7) that when
> fixed created "problems" in apr_stat (for Subversion). Spurred by this
> discussion, I decided to look for the root cause of the problem.
>
> And what I found was that apr_stat(&finfo, path, APR_FINFO_PROT, &pool)
> does indeed not behave (on Windows) as I imagine it would behave on
> Unix/Linux.
> The difference is that unpatched, the result in finfo.protection is
> *only* the world rights (translated into the group "Everyone" on
> Windows), and no group or user rights.
> With this patch, the finfo.protection includes the rights for the
> current user, and the rights for his/her primary group (plus of course
> world/Everyone). Which is much more like the way I believe it works on
> Unix/Linux.
>
> In more detail, more_finfo() asks for user and group information based
> on "(wanted & (APR_FINFO_USER | APR_FINFO_UPROT))" and vice versa for
> groups. But when it calls GetSecurityInfo (and friends depending on
> input), it only supplies the user argument if "(wanted & APR_FINFO_USER)".
> Which means that when the routine later checks if "user" is valid, it
> isn't, which means that when we in resolve_prot() check to see if we can
> use the user information, it fails. The interesting thing is that
> resolve_prot() seems to be written as if this scenario should work from
> the beginning.
>
> Note that I am by no means fluent in Unix/Linux, so if I have
> misunderstood that part, please set me straight immediately.

I'm not positive, not being an especially fluent win32 developer, but
I think this seems reasonable...  Would this patch be a replacement
for the backport you previously identified as avoiding the problem, or
is it in addition to it?

-garrett