General information
Title:
System.Threading.Mutex vs CreateMutex
Does anyone have an inkling of how to go about setting security on a System.Threading.Mutex object? From the .NET Framework Developer’s Guide: "The Mutex class corresponds to a Win32 CreateMutex". The win32 call takes 3 parameters, one of which is a pointer to a security_attributes structure. If NULL is passed in, you get the system default security for the mutex.
Here's the scenario:
Say a global (named) mutex is created by a web service running under the auspices of IIS. Since IIS is a service, it excludes by default all but the local system for ALL_ACCESS security to the mutex. The doc also states that all calls to CreateMutex request MUTEX_ALL_ACCESS security to the object. Now I've got an application that tries to acquire the mutex by creating it. It fails with an "access denied" error. I'm assuming that the app does not have the same security permissions as a service.
Solution, use the win32 CreateMutex call within the service or set the appropriate security attributes on the .NET mutex object.
Any ideas?
- Paul Corriveau
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only