PC Review


Reply
Thread Tools Rate Thread

About Application Security(Code Access Security). It dosn't show correct output

 
 
Tony Johansson
Guest
Posts: n/a
 
      13th Apr 2010
Hi

I have the program below which is from Microsoft Press exam 70-536
When I run this program I get this output
C:\>listpermissions.exe
System.Security.Permissions.FileIOPermission: True
System.Security.Permissions.EnvironmentPermission: True
System.Security.Permissions.FileDialogPermission: True
System.Security.Permissions.IsolatedStorageFilePermission: True
System.Security.Permissions.ReflectionPermission: True
System.Security.Permissions.UIPermission: True
System.Drawing.Printing.PrintingPermission: True

If I run the program in this way I got the same output.
C:\>\\127.0.0.1\c$\listpermissions.exe
System.Security.Permissions.FileIOPermission: True
System.Security.Permissions.EnvironmentPermission: True
System.Security.Permissions.FileDialogPermission: True
System.Security.Permissions.IsolatedStorageFilePermission: True
System.Security.Permissions.ReflectionPermission: True
System.Security.Permissions.UIPermission: True
System.Drawing.Printing.PrintingPermission: True

According to the book I should get false for some of them because when I run
by using 127.0.0.1 it being run from a shared folder, so it is running from
Internet zone
but as you saw I get the same output whether I run it like this
C:\>listpermissions.exe or this C:\>\\127.0.0.1\c$\listpermissions.exe
The permission that the Internet_zone has is
File Dialog
Isolated Storage
Security
User Interface
Printing

class Program
{
static void Main(string[] args)
{
writePermissionState(new
FileIOPermission(PermissionState.Unrestricted));
writePermissionState(new
EnvironmentPermission(EnvironmentPermissionAccess.Read, "USERNAME"));
writePermissionState(new
FileDialogPermission(FileDialogPermissionAccess.Open));
writePermissionState(new
IsolatedStorageFilePermission(PermissionState.Unrestricted));
writePermissionState(new
ReflectionPermission(ReflectionPermissionFlag.MemberAccess));
writePermissionState(new
UIPermission(UIPermissionWindow.SafeTopLevelWindows));
writePermissionState(new
PrintingPermission(PrintingPermissionLevel.SafePrinting));
Console.WriteLine("\nPress Enter key to continue");
Console.Read();
}

static private void writePermissionState(CodeAccessPermission p)
{
// Write True or False depending on whether the user has the
permission
Console.WriteLine(p.GetType().ToString() + ": " +
SecurityManager.IsGranted(p));
}
}

Does anyone has some suggestion why the output is the same it shouldn't be ?

//Tony


 
Reply With Quote
 
 
 
 
GS
Guest
Posts: n/a
 
      14th Apr 2010
are you sure 127..0.0.1 is in the internet zone on your pc instead of local
intranet?


 
Reply With Quote
 
Tony Johansson
Guest
Posts: n/a
 
      14th Apr 2010
"GS" <(E-Mail Removed)> skrev i meddelandet
news:(E-Mail Removed)...
> are you sure 127..0.0.1 is in the internet zone on your pc instead of
> local
> intranet?
>


How do I check if it's in the Internet zone or the local internet ?
I mean to judge from the output it would be the local internet and not the
Internet zone.

So why do the book says that it would be the Internet zone ?
Is it possible to configure so 127.0.0.1 would be the Internet zone ?

//Tony


 
Reply With Quote
 
Karl Mitschke
Guest
Posts: n/a
 
      14th Apr 2010
Hello Tony,

> "GS" <(E-Mail Removed)> skrev i meddelandet
> news:(E-Mail Removed)...
>
>> are you sure 127..0.0.1 is in the internet zone on your pc instead of
>> local
>> intranet?

> How do I check if it's in the Internet zone or the local internet ?
> I mean to judge from the output it would be the local internet and not
> the
> Internet zone.
> So why do the book says that it would be the Internet zone ? Is it
> possible to configure so 127.0.0.1 would be the Internet zone ?
>
> //Tony
>


127.0.0.1 is localhost....

Karl
http://unlockpowershell.wordpress.com


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code Access Security(CAS) and Role Based Security(RBS) Tony Johansson Microsoft C# .NET 0 19th Apr 2010 11:19 AM
Application Security Code Access sequrity(CAS) Tony Johansson Microsoft C# .NET 3 14th Apr 2010 04:24 PM
Security Policy, Code Groups and Security Tools. Mark Broadbent Microsoft C# .NET 0 20th May 2004 06:45 PM
Security Policy, Code Groups and Security Tools. Mark Broadbent Microsoft Dot NET Framework 0 20th May 2004 06:45 PM
Code Access Security [Was .NET Framework Security Projects] Ben Microsoft Dot NET Framework 3 25th Nov 2003 12:09 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:10 PM.