3
Answers

Code Access Security and UAC

Peter

Peter

15y
5k
1
I create a console application (app.exe), with one line:

StreamWriter writer = File.CreateText(@"c:\file.txt");

Then, using caspol, I create a permissionset that states that the members of the permissionset cannot write to the c:\file.txt file, and apply it to a code group. This codegroup is then applied to the console application I just created.

Using mscorcfg.msc to evaluate the assembly, I made sure that app.exe is only affected by this new codegroup - and it is.

If I run this in Win7, with UAC at default - the app crashes, stating that the app didn't have the security permission to write to the file, which is what is to be expected.

However, if I run the app with UAC turned off - the app writes perfectly to the file. No crash, no warning, no nothing.

It's as if turning UAC off completes disables CAS. That can't possibly be right in any way, shape or form
Answers (3)
0
Rajeswari nathan
NA 274 20k 15y

Nice,
This answer is helpful for me.
0
Purushottam Rathore
20 8.9k 6.6m 15y
Thanks for reply. My question is how to find stored procedure which are related to particular table. Well, i have found the solution. SELECT DISTINCT sp.name as StoredProcedureName FROM syscomments scomment INNER JOIN sysobjects sp ON scomment.id=sp.id WHERE scomment.TEXT LIKE '%BannerStatistics%'
0
Roei Bar
NA 7.8k 0 15y
if you are looking for all sp used in specific DB you can use

select * from sys.objects where type='p'

or i am missing something