views:

143

answers:

3

I'm having a problem that doesn't make a lot of sense to me. I have an ASP.NET application that runs perfectly in Debug mode, but throws Access Denied errors when running normally. I've given the ASPNET account and the account the application impersonates Full Control rights on the files the webapp is calling (using the Process object).

I determined that the files throwing the error are in a zip file and that the process I'm running will not look for them anywhere but the zip file. But it seems that until I unzip the zip file, I can't set permissions on its contents. Does this make sense to anyone else? And does anyone know of a solution?

+1  A: 

Set the permissions for CREATOR_OWNER on the folder it decompresses to.

Joshua
Not sure I'm following you.. If I decompress the zip, the process continues to call the compressed version. If I delete the zip and leave only the decompressed files, the code doesn't run.
garann
The reason it can't read its own files are the permissions are being set incorrectly for newly created files. When new files are created, they are given the CREATOR_OWNER ACL as the ACL.
Joshua
Ok, I tried giving CREATOR_OWNER Full Control on the unzipped files, and then set the account I'm using to access them as the Owner. It's still not finding the decompressed files. Did I understand you correctly?
garann
You understood all right. I must have given a wrong answer.
Joshua
A: 

What library do you use to access the zip file? Maybe you cannot open a single zip archive twice when to different threads try to extract a file from the archive at the same time?

0xA3
I'm not using a library to access the zip directly - it's accessed by an exe I'm calling using the Process object in .NET. It doesn't seem to have any problems with conflicting threads when running in Debug, however, which is why I think it's a permissions issue.
garann
A: 

Oh shoot, "Access Denied", not "Permission Denied". This one always catches me.

"Access Denied" is when you cannot open the file even though you have permissions, usually because somebody else already has it open.

Joshua
It seems odd that the issue would be with another process using the file. I'm able to delete and move it with no problems, and wouldn't the same issue occur in debug mode if that were the case?
garann
Sorry, but I'm now stumped too.
Joshua
Ok, I appreciate you taking a shot!
garann