Author: priyananth | Posted on: 11/21/2009 4:30:15 PM | Views : 263



I have a method called ExecCommand() which has the following code block.
ProcessStartInfo startInfo = new ProcessStartInfo("CMD.exe");
... and
Process cmdProcess = new Process(); ....


When I run code analysis, it gives the following error. Can anyone tell me how to incorporate the review.


Do not indirectly expose methods with link demands. Do not wrap a method protected by a LinkDemand with a method that does not perform a security check. A LinkDemand checks the permissions of the immediate caller rather than checking the permissions of all callers in the call stack. In this case, the permissions of the wrapper method will be checked. If the wrapper method does not, itself, check the permissions of callers higher in the call stack, malicious code might be able to execute the wrapped function even though it lacks permission to do so.
...

Go to the complete details ...