Posts

Showing posts with the label SECURITY

IE 8.0 Supports Cross-Domain Requests

Zen Master: Want  hotdog with everything. HotDog Stand Owner: OK Buddy, here ya go. That'll be $20.00. Zen Master: Here twenty dollar bill. HotDog Stand Owner: That'll do it, pal. Have a great day! Zen Master: What about change? HotDog Stand Owner: Ah, change... must come from within!   This is an area where I (and many others) have been quite vocal in complaining. If you can point the src property of a <script... tag at another domain, and said script can basically do anything it wants, then why can't you make an XmlHttpRequest to another domain (other than the one from which the page emanated)? It's certainly an inconsistent application of the notion of security, at a minimum. So in Internet Explorer 8.0 you have the new IHTMLXDomainRequest Interface. Here's how it works, in a nutshell: Cross-domain requests ("XDR", for short) require mutual consent between the webpage and the server. You can initiate a cross-domain request in your webpage by...

Making your assembly run "as Administrator" in Vista

This came from one of my favorites in the C# newsgroup, Willy DeNoyette. I'll simply post the questions and answers directly, since there is no need to modify it except for some formatting and cleanup: Q) I need to restart the "Windows Audio Service" (audiosrv) via C#. I'm using the ServiceController Class to do this. It is no problem under XP and no problem under vista if UAC is disabled. But with enabled UAC i'm getting a "access refused" exception. I also tried to do it via console with "net start ..." but the same error appears. Three questions: 1. Is it possible to restart the "windows audio service" if UAC is enabled ? A) Yes when running as full "Administrator". That is start the console (cmd interpreter) by right clicking "Run as Administrator". 2. Why does the exception occur? If I do some other stuff, e.g. starting regedit via Process.Start() the user gets asked if he really wants that. I would expect the...