which is only thrown for one user.What should you do to stop the exception from being thrown?

You are working as an application developer at Domain.com. The Domain.com network consists of a single Active Directory domain named Domain.com. Domain.com uses Visual Studio 2005 as an application platform. Domain.com consists of a Development department. You as the developer of Domain.com use a client computer named Certkiller -WS023 as developing collateral. You are using the Semaphore class to synchronize access to a resource pool. During an inspection you find out that an exception of type UnauthorizedAccessException is thrown when you call the OpenExisting method of the Semaphore class, which is only thrown for one user.
What should you do to stop the exception from being thrown?

You are working as an application developer at Domain.com. The Domain.com network consists of a single Active Directory domain named Domain.com. Domain.com uses Visual Studio 2005 as an application platform. Domain.com consists of a Development department. You as the developer of Domain.com use a client computer named Certkiller -WS023 as developing collateral. You are using the Semaphore class to synchronize access to a resource pool. During an inspection you find out that an exception of type UnauthorizedAccessException is thrown when you call the OpenExisting method of the Semaphore class, which is only thrown for one user.
What should you do to stop the exception from being thrown?

A.
You should call the Demand method of an unrestricted SecurityPermission instance.

B.
You should grant the user permission to read the semaphore that protects the resource pool.

C.
You should grant the user permission to access the resource pool.

D.
You should call the Assert method of an unrestricted SecurityPermission instance.

Explanation:
The user’s permissions are granted to read the semaphore that protects the resource pool. An access control list is there to protect the Semaphores. The SetAccessControl method of the Semaphore class is there to grant the users permissions to read the semaphore.

Incorrect Answers:
A: The Demand method is not used for an unrestricted SecurityPermission instance.
C: The user permission is not use to access the resource to correct the problem.
D: The SecurityPermission prevents a code from performing a stack walk past the present stack.



Leave a Reply 0

Your email address will not be published. Required fields are marked *