Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / November 2007

Tip: Looking for answers? Try searching our database.

Query permissions for System.Net

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gene Chang - 15 Nov 2007 13:52 GMT
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
Peter Ritchie [C# MVP] - 17 Nov 2007 18:23 GMT
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.

Signature

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

> 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
[quoted text clipped - 9 lines]
>
> Gene Chang
Günter Prossliner - 19 Nov 2007 08:06 GMT
Hallo!

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

It is a Performance-Counter
(HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\.NET CLR Networking).

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

GP

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.