Step 3. Test File IO with No Code Access Security Constraints


Step 3. Test File I/O with No Code Access Security Constraints

By default, Web applications and any assemblies they call on the local computer are granted full trust by code access security policy. The default <trust> configuration in Machine.config assigns the full trust level to all Web applications, as follows :

 <trust level="Full" originUrl="" /> 

With full trust, Web applications are not constrained in any way by code access security policy. The success or failure of resource access is determined purely by operating system security.

 Task   To test file I/O with no code access security constraints

  1. Use Notepad to create a text file called Somefile.txt that contains a simple text string, and then place the file in the C:\temp directory. Also place a copy in the root C:\ directory.

  2. Run the Web application and click Read File .

    The contents of the text file are displayed.

  3. Enter c:\somefile.txt in the text box and click Read File .

    The contents of the text file are displayed.




Improving Web Application Security. Threats and Countermeasures
Improving Web Application Security: Threats and Countermeasures
ISBN: 0735618429
EAN: 2147483647
Year: 2003
Pages: 613

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net