views:

100

answers:

3

Hello,

I have been utilizing two third party components for PDF document generation (in .NET, but i think this is a platform independent topic). I will leave the company's names out of it for now, but I will say, they are not extremely well known vendors.

I have found that both products make undocumented use of the filesystem (i.e. putting temp files on disk). This has created a problem for me in my ASP.NET web application as I now have to identify the file locations and set permissions on them as appropriate. Since my web application is setup for impersonation using Windows authentication, this essentially means I have to assign write permissions to a few file locations on my web server.

Not that big a deal, once I figured out why the components were failing, but...I see this as a maintenance issue. What happens when we upgrade our servers to some OS that changes one of the temporary file locations? What happens if the vendor decides to change the temporary file location? Our application will "break" without changing a line of our code. Related, but if we have to stand this application up in a "fresh" machine (regardless of environment), we have to know about this issue and set permissions appropriately.

Unfortunately, the components do not provide a way to make this temporary file path "configurable", which would certainly at least make it more explicit about what is going on under the covers.

This isn't really a question that I need answered, but more of a kick off for conversation about whether what these component vendors are doing is appropriate, how this should be documented/communicated to users, etc.

Thoughts? Opinions? Comments?

+2  A: 

First, I'd ask whether these PDF generation tools are designed to be run within ASP.NET apps. Do they make claims that this is something they support? If so, then they should provide documentation on how they use the file system and what permissions they need.

If not, then you're probably using an inappropriate tool set. I've been here and done that. I worked on a project where a "well known address lookup tool" was used, but the version we used was designed for desktop apps. As such, it wasn't written to cope with 100's of requests - many simultaneous - and it caused all sorts of hard to repro errors.

Martin Peck
Your response was exactly my initial response. I then verified that both apps were advertised to work in both a web and client-based environment. I essentially came to the same conclusion. This should be documented and made very clear.
Brian
Agreed - unless a component works "out of the box" or comes with clear configuration/documentation then it's not fit for purpose. Raise a support call/bug them.
Martin Peck
Perhaps, with the names of the products in you're using, someone will be able to tell you the special config sauce you need.
Martin Peck
I've gotten the response from one of the vendors and made appropriate security/permissions adjustments. For the other vendor, I still have no clear response on what the temporary files are doing, where/when they are being written, and what perms are needed.
Brian
+1  A: 

Commonplace? yes. Appropriate? usually not.

Temp Files are one of the appropriate uses IMHO, as long as they use the proper %TEMP% folder or even better, use the integrated Path.GetTempPath/Path.GetTempFileName Functions.

In an ideal world, each Third Party component comes with a Code Access Security description, listing in detail what is needed (and for what purpose), but CAS is possibly one of the most-ignored features of .net...

Michael Stum
I have reached out to the vendors for support and have gotten some decent responses from one, but very little from the other. The one product is utilizing Path.GetTempPath(). Although it's using a standard temporary file path, it's very likely in a web scenario that the web server is locked down and not allowing write permissions to this location (which was my case).Agreed on the CAS comment.
Brian
I just checked and saw that Medium Trust (which is the default on many hosters) indeed does not allow writing outside of the Application's hierarchy. Not sure how many vendors test this, because Medium Trust looks like a common issue. I see many projects being released first and THEN made compatible with Medium Trust when customers complain. Painful, because there is usually not much reason to run Full Trust in an ASP.net Application.
Michael Stum
Slightly Unrelated but interesting for vendors and users: http://stackoverflow.com/questions/275444/
Michael Stum
A: 

Writing temporary files would not be considered outside the normal functioning of any piece of software. Unless it is writing temp files to a really bizarre place, this seems more likely something they never thought to document rather than went out of their way to cause you trouble. I would simply contact the vendor explain what your are doing and ask if they can provide documentation.

Also Martin makes a good point about whether it is a app that should run with Asp.net or a desktop app.

Toby Allen
Would the application root/bin directory be considered "bizarre"? In a web app, I think so.I don't think the vendors did this on purpose, BUT I do think they do need to do a better job of documenting this.
Brian