Code Access Security and UAC
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
Nice,
This answer is helpful for me.
0
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
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