O'Reilly logo

.NET Framework Security by Kevin T. Price, Rudi Martin, Matthew Lyons, Sebastian Lange, Brian A. LaMacchia

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Security Stack Walk

The type of stack walk that concerns us here is, of course, the security stack walk. Why would the security system need to walk the stack at all?

Let's take a simple example. Given the following code snippet from assembly MyDatabase,

public class MyDatabase
{
    public void BackupDatabase(String filename)
    {
        FileStream stream = new FileStream(filename, FileMode.Create);
        // Code to save database to newly created file...
    }
}

when the BackupDatabase method calls the constructor for FileStream, a security demand will be initiated to ensure that the caller has sufficient privilege to create the named file. Recall that the .NET Framework security system is primarily based on code access security. In other words, the security demand ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required