Re: trying to figure out code permissions
- From: Dominick Baier <dbaier@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 7 Apr 2007 11:24:21 +0000 (UTC)
RequestMinimum makes sure you have this permission. Not that all others are disabled.
Try RequestOptional instead.
-----
Dominick Baier (http://www.leastprivilege.com)
Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)
Hi;
I assumed the following code would not load. And if it loaded, would
throw an exception on the OpenText. However it runs fine.
AssemblyInfo.cs:
// only permission - set to cause all other to be disallowed
[assembly: RegistryPermission(SecurityAction.RequestMinimum)]
Program.cs:
class Program
{
static void Main(string[] args)
{
MyObj obj = new MyObj();
string str = obj.ToString();
File.OpenText(str);
}
}
class MyObj
{
public override string ToString()
{
return "dave.txt";
}
}
Why does this work?
Cubicle Wars - http://www.windwardreports.com/film.htm
.
- Follow-Ups:
- Re: trying to figure out code permissions
- From: David Thielen
- Re: trying to figure out code permissions
- Prev by Date: Re: Integrated Windows Authentication Timeout?
- Next by Date: Lost ability to use membership system
- Previous by thread: Dotnetnuke Password Encryption
- Next by thread: Re: trying to figure out code permissions
- Index(es):
Relevant Pages
|