Re: Why is this method requesting these permissions?



Hi,

the .config files defines all permissions granted to the appdomain running your assemblies. The CLR loader can refuse to load the assembly if you have RequestMinimum and Optional attributes in your assembly that do not match the policy. That's i think the policy exception you are seeing....

IMHO - permcalc is not really useful as it shows a lot of permissions that are not really needed. Run permcalc on a empty WinForms app - you will see stuff like UnmanagedCode etc - which is just not true...

dominick

Ok, I'm really not understanding something here. permcalc operates on
the dll file so asp.net is not involved - correct? And my initial
question was the permission required for Object.ToString.

If it's the permissions in web_medium.config then any DLL by
definition would load in an ASP.NET app. It might not run if certain
methods are called, but it would load wouldn't it if that were the
case?

Cubicle Wars - http://www.windwardreports.com/film.htm

"Dominick Baier" wrote:

i think you got this wrong...

the granted permissions are determined by a policy file found in the
framework config directory - e.g. medium trust maps to
web_medium.config. This file (or a copy of it) needs to get modified
if the app needs more permissions - e.g. the SocketPermission is not
granted by default.

if you want to modify the behavior of your component depending on
granted permissions you can do a Demand() for the permission and see
if an exception gets thrown...

dominick

Hi;

My understanding is if I do Required then anything I don't list is
not granted - so I then have to also do Optional for anything that
is optional - correct? My worry there is that I will then miss an
optional that is needed only in rare cases.

Or am I not understanding this correctly?

Cubicle Wars - http://www.windwardreports.com/film.htm

"Dominick Baier" wrote:

well - i am not sarcastic...

so why don't you grant the specific permissions until it works? I
think i made a comment on another post saying that SocketPermission
is not included in e.g. medium trust - DNS IIRC is included.

I personally wouldn't fiddle around with RequestMinumum or Optional
- just document which permissions are needed - which you can figure
out by trial and error (at least thats how I usually approach that
problem).

In my book I have a separate chapter on partial trust - maybe thats
helpful for you.

http://www.microsoft.com/mspress/books/9989.asp

dominick

Are you being sarcastic or serious about permcalc????

The problem we face is that we have a potential customer who needs
to use our library in a partially trusted environment. AFAIK our
code does not need to touch anything outside it's own code except
for the DNS and UDP capability and we are reducing that to what we
truly need.

But our code can, depending on how it is called, need to access
lots of things from the file system to the registry to ...

So I'm trying to figure out what we need to do so this guy can use
our library.

Cubicle Wars - http://www.windwardreports.com/film.htm

"Dominick Baier" wrote:

now you know how good permcalc really works....

by reading all your posts recently on CAS - i wonder what you are
really trying to do...

dominick



.



Relevant Pages

  • Re: Why is this method requesting these permissions?
    ... I think i made a comment on another post saying that SocketPermission is not included in e.g. medium trust - DNS IIRC is included. ... I personally wouldn't fiddle around with RequestMinumum or Optional - just document which permissions are needed - which you can figure out by trial and error. ... use our library in a partially trusted environment. ... "Dominick Baier" wrote: ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Why is this method requesting these permissions?
    ... the granted permissions are determined by a policy file found in the framework config directory - e.g. medium trust maps to web_medium.config. ... This file needs to get modified if the app needs more permissions - e.g. the SocketPermission is not granted by default. ... if you want to modify the behavior of your component depending on granted permissions you can do a Demandfor the permission and see if an exception gets thrown... ... "Dominick Baier" wrote: ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Access denied when using active directory groups and windows authentication
    ... I was a little hasty in saying that the problem was fixed. ... As Dominick ... Granting these permissions on the AD groups did nothing. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Reason behind implicit FullTrust LinkDemand?
    ... The removal of permissions from the Internet Zone or the ... time to protect the System* assemblies from this attack. ... the security holes are patched. ... The knew the LinkDemand would be a fix. ...
    (microsoft.public.dotnet.security)
  • Reason behind implicit FullTrust LinkDemand?
    ... The .NET Framework assemblies ... One may counter argue that the implicit FullTrust ... LinkDemand just forces users to grant full trust to code that doesn't really ... permissions describing custom actions allowed or not in the system. ...
    (microsoft.public.dotnet.security)