Home All Groups Group Topic Archive Search About

Ping forbidden when SocketPermissionAttribute is Unrestricted

Author
18 May 2006 4:24 AM
Philip K
Using .NET Framework v1.1 on Win2000 and WinXP

Low Level Users get this error when code does a Ping:
System.Net.Sockets.SocketExecption: An attempt was made to access a socket
in a way forbidden by its access permissions.

Ping is using ICmp protocol via a Raw socket.
Code works fine for high level users.
TCP/IP sockets and remoting work fine for low level user only Ping fails.
Fails even when Firewall is Off.

AssemblyInfo.cs contains:
[assembly: PermissionSetAttribute(SecurityAction.RequestMinimum,
Name="LocalIntranet")]
[assembly: SocketPermissionAttribute(SecurityAction.RequestMinimum,
Unrestricted=true)]

Author
18 May 2006 6:56 AM
Philip K
An (far better) alternative to this would be an easy quick responsive way to
determine if a computer/device is on the LAN or not in the API, at a level
that would allow programs run by low level users to do these checks without
the very lengthy time outs that are incurred in other parts of the API.

Show quote
"Philip K" wrote:

> Using .NET Framework v1.1 on Win2000 and WinXP
>
> Low Level Users get this error when code does a Ping:
> System.Net.Sockets.SocketExecption: An attempt was made to access a socket
> in a way forbidden by its access permissions.
>
> Ping is using ICmp protocol via a Raw socket.
> Code works fine for high level users.
> TCP/IP sockets and remoting work fine for low level user only Ping fails.
> Fails even when Firewall is Off.
>
> AssemblyInfo.cs contains:
> [assembly: PermissionSetAttribute(SecurityAction.RequestMinimum,
> Name="LocalIntranet")]
> [assembly: SocketPermissionAttribute(SecurityAction.RequestMinimum,
> Unrestricted=true)]
>

AddThis Social Bookmark Button