Quantcast
Channel: VMware Communities : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 176483

Access issue in Service.java (Win32)

$
0
0

Hi,

 

When trying to view the status of Services in Windows, there's an issue with access management in the following code:

 

https://github.com/hyperic/sigar/blob/master/bindings/java/src/org/hyperic/sigar/win32/Service.java

 

It tries to gain access to services with full access codes, and Windows prevents this from happening for certain system services (such as MSDTC, which is very vital to monitor for SQL Server). The problems are in:

 

public Service(String serviceName) throws Win32Exception, which tries: this.service = OpenService(this.manager, serviceName, SERVICE_ALL_ACCESS);

 

And in the private Service()

 

private Service() throws Win32Exception { this.manager = OpenSCManager("", SC_MANAGER_ALL_ACCESS); }

 

Also, all the access modifiers are private static final int, so they can't be seen by other programs. My proposal would be to add new methods which would allow entering the access levels in the initializer, such as public Service(String serviceName, int access).


Viewing all articles
Browse latest Browse all 176483

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>