views:

86

answers:

1

I'm am developing a Firefox extension which interfaces with an underlying Windows service (which I have already made).

During the development so far I encountered one bug in the installer program (which installs the FF extension AND the service). This was due to the security model on Vista requiring elevated privileges to be able to install and start the service. I adjusted the installer and now it installs fine (just with additional Vista'esque warning dialogs being displayed to end-users - which I can live with !)

I am now in the process of developing an XPCOM component that will install along with the XUL stuff I have already made. There will be a XUL javascript interface to the XPCOM which will try to do things like stop and start the service (e.g when user-configuration data is changed).

My question: Since FF will normally be run under a user account, will I run into any difficulties on Vista or other Windows flavors trying to start or stop my own service via XPCOM?

(When users run the installer I don't mind security dialogs popping up in Vista. But I certainly don't want this to happen whenever they try to change their info in the XUL interface.)

What is the correct way to go about this?

+2  A: 

Yes, if your service is running as an Administrator then the Firefox process, running as a normal user will not be able to start or stop it. However, it appears that you can use the "sc" command to set access controls on your service from your installer, which means you can allow non-admin users to start and stop your service.

You'll need to use "sc sdset", which is documented (lightly) here: http://technet.microsoft.com/en-us/library/cc742037%28WS.10%29.aspx

However, to use that, you'll need to read up on the "Security Descriptor Definition Language", which looks kind of complicated: http://msdn.microsoft.com/en-us/library/aa379567%28VS.85%29.aspx

This blog entry appears to have some human-readable information on it: http://blogs.dirteam.com/blogs/jorge/archive/2008/03/26/parsing-sddl-strings.aspx

Ted Mielczarek