HighTechTalks DotNet Forums  

Query permissions for System.Net

Dotnet Framework (CLR) microsoft.public.dotnet.framework.clr


Discuss Query permissions for System.Net in the Dotnet Framework (CLR) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Gene Chang
 
Posts: n/a

Default Query permissions for System.Net - 11-15-2007 , 07:52 AM






I am writing an application where I obtain the IP address of the local
adapter. When the user is logged in as Guest, this call fails with an
exception: Access to the path 'Global\.net clr networking' is denied

I think this is because the guest user is not allowed to access
System.Net.

How do I query if the current user is allowed ot use certain
assemblies or modules? For example, my networking functionality.

Thanks.

Gene Chang

Reply With Quote
  #2  
Old   
Peter Ritchie [C# MVP]
 
Posts: n/a

Default RE: Query permissions for System.Net - 11-17-2007 , 12:23 PM






That looks more like a perf counter or a named mutex.

Without knowing what method you've called it's hard to answer this question
exactly.

If it's a perf counter, the user must have the required access (which we
don't know). If it's a named mutex, whatever is creating the mutex must give
access to the current user. Again, since we don't know what you're calling
we can't tell how to discern if the current user has the required access to
do what you want.

Most method list the security requirements need in order to call them. You
can either add a try/catch(SecurityException) block around the code that may
not have access, or if you know the specific security permission that is
required you can create an instance of that type and call its Demand method
with a try/catch(SecurityException)--which would ensure things don't get into
an unknown state.

--
Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote.
http://www.peterRitchie.com/blog/
Microsoft MVP, Visual Developer - Visual C#


"Gene Chang" wrote:

Quote:
I am writing an application where I obtain the IP address of the local
adapter. When the user is logged in as Guest, this call fails with an
exception: Access to the path 'Global\.net clr networking' is denied

I think this is because the guest user is not allowed to access
System.Net.

How do I query if the current user is allowed ot use certain
assemblies or modules? For example, my networking functionality.

Thanks.

Gene Chang


Reply With Quote
  #3  
Old   
Günter Prossliner
 
Posts: n/a

Default Re: Query permissions for System.Net - 11-19-2007 , 02:06 AM



Hallo!

Quote:
That looks more like a perf counter or a named mutex.
It is a Performance-Counter
(HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servi ces\.NET CLR Networking).

The error-message ("Acces to path ... denied") sounds like the caller
doesn't hold the nessersary "unmanaged Permission" (ACLs).



GP




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.