Areas of Interest, as counted by my cat

Month: March 2005

ASP.NET and impersonation trouble

So I have this Asp.NET application that needs to run on the WEBSERVER but see files in a directory on FILESERVER out on the net. (The files are, inevitably, Foxpro tables being accessed through OleDb.)

First cut, the OleDbConnection fails to open the data (\\FILESERVER\Sharename\datafolder) with an “invalid path or file name” error. That’s because the ASP.NET application is running under the WEBSERVER/aspnet user context which does not have permission to see the network share.

“No problem,” we say. “Let’s just use the web.config file to tell Asp.NET to run under a context that does have permission to see the share:

<system.web>
    :
    <identity impersonate="true"
              userName="NETDOMAIN\net_user"
              password="secret"/>
    :
</system.web>

This works – except that every time we uploaded a new version of the .aspx files to the webserver, it threw an exception: “Cannot execute a program. The command being executed was [..]\v1.1.4322\csc.exe /noconfig …”. Basically it didn’t appear to have rights to run the compiler to do that special ASP.NET on-the-fly compilation of the classes.

Investigation seemed to indicate that it should have the appropriate access rights, but all the same, we couldn’t make it work without commenting out the <identity> specification; re-starting the IIS process; then putting it back after the successful compilation so that the network share was visible.

Second cut was to omit the <identity> override, but to bracket the OleDb call with special in-line user impersonation code using Win32 LogonUser() calls. Well that didn’t work (and when I find out why, perhaps I’ll post about it).

I found a solution to the problem on a web thread posted by shamrox (http://forums.rainbowportal.net/ShowPost.aspx?PostID=5503) which I reproduce here:

Is this error happening when you try to run your project? I guess what I am asking is that it compiles fine but when it goes to the first screen you get this error. IE would never open if it didn’t compile.

If it is what I think it has to do with the aspnet_wp. It does some weird stuff. You don’t have to restart www to fix it, all you need to do is go to task manager and [terminate the aspnet_wp.exe process]. Don’t worry it restarts automatically. That will fix the problem for now. It comes up from time to time so if there is a better way I would like to know too.

Thanks shamrox – this works! Now we can leave the <identity> switch in place in the web.config in order for my web site to “see” the network resources, and when I upload a new version of the aspxs to my web site – it will stick with the exception on the recompile but a restart of the aspnet_wp.exe process will bring it back, no worries.

I still think ASP.NET is the bomb.

Google; IntelliTxt; and the nature of Evil

I know very few people actually read this, but I am compelled to write anyway. There is currently some controversy erupting among web content authors about a feature in Google’s upcoming toolbar AutoLink offering. Apparently the toolbar has a button on it that, if the user chooses to click on, will parse the current browser content and add additional hyperlinks to the page, things such as map references or ISBN lookups, etc.

This seems to have selected eminent bloggers up in arms on either side of the argument.

Dave Winer writes, negatively: 

The AutoLink feature is the first step down a treacherous slope, that could spell the end of the Web as a publishing environment with integrity, and an environment where commerce can take place.

Cory Doctorow writes, positively: 

I think I should be able to use a proxy that reformats my browsing sessions for viewing on a mobile phone; I think I should be able to use a proxy that finds every ISBN and links it to a comparison-shopping-engine’s best price for that book across ten vendors. I think I should be able to use a proxy that auto-links every proper noun to the corresponding Wikipedia entry.

And so on — it’s my screen, and I should be able to control it; companies like Google and individuals should be able to provide tools and services to let me control it.

Tim Bray writes a pretty good summary of the situation, concluding:  

There just isn’t that much fodder out there for AutoLink to get its teeth into. I haven’t had much time to think about it, but maybe it’s because most people who publish an address or ISBN or whatever that they actually care about take the time to link it to something useful. So, it’s not a game-changer. But it’s still evil.

I have been saving web pages to my local hard disk, editing them, and re-viewing them for some time. Sometimes I even add my own hyperlinks. The content writers can’t stop me from doing this, if I choose to do it. The Google Toolbar AutoLink feature is essentially doing the same thing – remember, I – the user – have to decide to install the toolbar, then browse around the web, and then when I’ve found a page that looks interesting, I have to consciously decide to push the “AutoLink” button to add the additional hyperlinks. I could do this myself if I had infinite time and patience, so what’s the big deal? It’s not like Google is republishing the altered content without the consent of either the author or the viewer. Calling it evil is a bit much.

Whether or not this is a good trend for the web as a whole, I don’t know.

Let me contrast this with something else.

You may have noticed some web sites seem to have weird links in them, that have a double-underline instead of the normal single underline. When you hover your mouse over them, you get an obnoxious popup tool tip with “Sponsored Link” and a bunch of other words. You probably need Javascript to be enabled as well, I don’t really know, I haven’t looked that closely.

This technology is called IntelliTxt by the company that is pushing it. (I won’t link to them – not even with rel=no_link or whatever that Google-juice suppressant thing is – but they call themselves Vibrant Media, a pioneer in contextual keyword advertising.) I’m sure the web site content owner has invited them to insert their links into the page in return for a share in the advertising revenue. For all I know, someone gets a kickback every time I hover my mouse over the link. 

Now, in my opinion, Vibrant/IntelliTxt aren’t evil either, but they are giving me, the end user, a negative browsing experience.

But that’s ok. I use the FireFox browser with the AdBlock plug-in, and I’ve told it to ignore anything that matches the filter “*.intellitxt.com/*” and since then I haven’t seen the pesky links. The web site owner probably isn’t getting any revenue from Vibrant due to my choice to render their links invisible, but that’s a risk they have to take. They don’t own my eyeballs.

You see, we don’t get to have it only one way. If we get to keep our AdBlock plug ins to suppress crap like IntelliTxt, then Google gets to offer their toolbar AutoLink feature. Either way, the web gets richer and more interesting, in my opinion.

Update: I see now that Yoz Grahame made the same point last week.

© 2024 More Than Four

Theme by Anders NorenUp ↑