RE: [PATCH] ApacheMonitor.c

2002-07-12 Thread Mladen Turk



> -Original Message-
> From: David Shane Holden [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, July 12, 2002 8:11 PM
> To: [EMAIL PROTECTED]
> Subject: [PATCH] ApacheMonitor.c
> 
> 
> This patch fixes AM where it throws an error window when 
> trying to control the service for lack of query status access.  
> 
> I don't want Mladen to feel like I'm stepping on his toes, 
Don't worry abot that :-)

> but I really 
> don't like
> using the generic access unless there's a good reason to.  So 
> I changed 
> all the
> service calls to use only the access rights that are needed.  
> Which IMO 
> is the
> more logical approach, but I might be wrong.

I don't see why is that such a problem. I think that if you fail to see
the service but still cannot start it, then what is the purpose of
displaying the AM for the particular user?. Think it's a admin tool, not
a Guest one, and why that user will have to know if some service is
running on that box or not?

MT.




[PATCH] ApacheMonitor.c

2002-07-12 Thread David Shane Holden

This patch fixes AM where it throws an error window when trying to control
the service for lack of query status access.  

I don't want Mladen to feel like I'm stepping on his toes, but I really 
don't like
using the generic access unless there's a good reason to.  So I changed 
all the
service calls to use only the access rights that are needed.  Which IMO 
is the
more logical approach, but I might be wrong.

Shane




Index: ApacheMonitor.c
===
RCS file: /home/cvspublic/httpd-2.0/support/win32/ApacheMonitor.c,v
retrieving revision 1.21
diff -u -3 -r1.21 ApacheMonitor.c
--- ApacheMonitor.c 9 Jul 2002 17:13:48 -   1.21
+++ ApacheMonitor.c 12 Jul 2002 17:32:26 -
@@ -780,13 +780,14 @@
 else
 {
 schSCManager = OpenSCManager(szComputerName, NULL,
- GENERIC_EXECUTE);
+ SC_MANAGER_CONNECT);
 if (!schSCManager) {
 return FALSE;
 }
 
 schService = OpenService(schSCManager, szServiceName, 
- GENERIC_EXECUTE);
+ SERVICE_QUERY_STATUS | SERVICE_START | 
+ SERVICE_STOP | SERVICE_USER_DEFINED_CONTROL);
 if (schService != NULL)
 {
 retValue = FALSE;
@@ -937,7 +938,7 @@
 {
 dwPid = 0;
 schSCManager = OpenSCManager(szComputerName, NULL,
- GENERIC_READ);
+ SC_MANAGER_CONNECT);
 if (!schSCManager) {
 return FALSE;
 }