https://bugs.winehq.org/show_bug.cgi?id=50412
Bug ID: 50412 Summary: Wrong check for needed access rights in QueryServiceConfig2 Product: Wine Version: 6.0-rc4 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: advapi32 Assignee: wine-bugs@winehq.org Reporter: dalai82@gmx.net Distribution: ---
Hi there.
While checking out Total Commander and one of my own TC plugins on Wine 4.0.2 on Debian 10.7 I saw that it failed to read the description of all services. After double-checking my code (and confirming its correctness) I saw Wine's output on the terminal:
006b:err:service:validate_context_handle Access denied - handle created with access 1, needed 4
Then I downloaded the source code of the current version dev version 6.0-rc4, searched all files (because I didn't know where to look) and found the culprit in programs/services/rpc.c, more precise in function svcctl_QueryServiceConfig2W where it makes the call to validate_service_handle() in line 984.
The bug and fix for it is simple: The needed access right must be SERVICE_QUERY_CONFIG instead of SERVICE_QUERY_STATUS, since it's the service config queried here, not its status.
Out of curiosity, I checked half a dozen older versions and found that this bug has been in the code since its implementation back in Wine 1.1.14. This more than a decade old wine didn't age well ;). But I guess this is a simple copy'n'paste error.
Maybe check for similar bugs/mistakes in the other functions when fixing this one.
Regards
https://bugs.winehq.org/show_bug.cgi?id=50412
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1
--- Comment #1 from Nikolay Sivov bunglehead@gmail.com --- Thanks, makes sense.
https://bugs.winehq.org/show_bug.cgi?id=50412
--- Comment #2 from Dalai dalai82@gmx.net --- It's been 8 months since my report and nothing has happened to the bug report itself, e.g. a confirmation, or the source code. The source code of the current stable and development versions (6.0.1 and 6.15 respectively) still contains the bug.
So, what's supposed to happen now?
Regards
https://bugs.winehq.org/show_bug.cgi?id=50412
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |z.figura12@gmail.com
--- Comment #3 from Zebediah Figura z.figura12@gmail.com --- The source code hasn't been changed because nobody has sent a patch, and no regular contributor has written a patch because they've been too busy with higher-priority bugs. But, as they say, patches welcome.
https://bugs.winehq.org/show_bug.cgi?id=50412
--- Comment #4 from Dalai dalai82@gmx.net --- Well, the information needed is right there in the original bug report including the file name, line number and what needs to be changed. But I'll attach a patch anyway and hope that it's not completely useless because I haven't created one so far.
Regards
https://bugs.winehq.org/show_bug.cgi?id=50412
--- Comment #5 from Dalai dalai82@gmx.net --- Created attachment 70549 --> https://bugs.winehq.org/attachment.cgi?id=70549 rpc.c, svcctl_QueryServiceConfig2W function - validate service handle correctly with SERVICE_QUERY_CONFIG
https://bugs.winehq.org/show_bug.cgi?id=50412
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |leslie_alistair@hotmail.com Resolution|--- |FIXED Fixed by SHA1| |4a18232e455d82c9334c71ebea8 | |33dfb5b50b19e Status|NEW |RESOLVED
--- Comment #6 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Fixed by https://source.winehq.org/git/wine.git/?a=commit;h=4a18232e455d82c9334c71ebe...
https://bugs.winehq.org/show_bug.cgi?id=50412
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #7 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 6.16.
https://bugs.winehq.org/show_bug.cgi?id=50412
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |6.0.x
https://bugs.winehq.org/show_bug.cgi?id=50412
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|6.0.x |---
--- Comment #8 from Michael Stefaniuc mstefani@winehq.org --- Removing the 6.0.x milestone from bug fixes included in 6.0.3.