[PATCH 2/4] advapi32/tests: Simple tests of GetFileSecurity()/SetFileSecurity()

Paul Bryan Roberts pbronline-wine at yahoo.co.uk
Wed Nov 5 01:01:46 CST 2008


This is a resubmission

This patch has been reworked.
The changes in the Wine server is withdrawn.
Only a minimum of tests of GetFileSecurity() and SetFileSecuirty() for 
the 'file case' are provided.


Detailed description of original submission:

This patch is one a series intended to fix Bug 14434 (WordPerfect Office
2002:  Unable to Install).

The problem here is that the installer calls GetFileSecurity() on
directories, not files while the Wine server only has support for this
API call for files, not directories.

The solution seems simple - implement support for directories by cloning
the support for files.  Provided, of course, that this is backed up by
cloning the conformance tests.

The problem here is that cloning propagates maintenance headaches.  If
the support for GetFileSecurity() is cloned, then folks might reasonably
expect the support for SetFileSecurity() to be cloned too, bugs and all.

The bit I take issue with is not cloning the "FIXME: get Unix uid and
call fchown" in file_set_sd(), nor really the idea that this bit of code
does nothing, not even return an error to indicate it has not succeeded
but that it is always executed (as it were).

This is because, as the code stands, the object's sd is not current.
There should be a call to file_get_sd() to make it so, then
file_set_sd() will only (not) try to change the file's ownership only if
that is what the calling application wants.  By putting the call to
get_sd() in handle.c, the fix covers all implementations of
get_sd()/set_sd(), which may not be what is wanted.

To back this up, some more conformance tests have been added.  I don't
know that these are particularly representative but they do at least
show the problem described above and confirm its resolution.

Conformance tests checked again W2K and WXP, both administrator and user
accounts.




-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0002-advapi32-tests-Simple-tests-of.txt
Url: http://www.winehq.org/pipermail/wine-patches/attachments/20081105/fa70b57c/attachment.txt 


More information about the wine-patches mailing list