Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...SecurityException on Directory.Create()SecurityException on Directory.Create()
Previous
 
Next
New Post
1/18/2009 12:29 PM
 

Hi all,

In a plesk 8.6 environment (shared hosting), I'm constantly struggling with the creation of directories by dnn. I've managed to maintain my dnn installation in the root (httpdocs) for years up until now, upgrading to 5.0.0. Ok, I gave up my requirement for a nicer URL and moved the entire app to a virtual directory named 'portal'. This way I can set the permissions for IUSR_x and IWPD_x. The site runs on medium trust. I completely don't understand why it's not possible to set the permissions on the httpdocs directory, but that's another question...

But I still get in trouble when the site is creating directories. During installation a zip file is unpacked into Portals\_default\Temp and the directory name is random. So, I'm never able to 'help' the installation by creating directories myself.

Since the SecurityException for the FileIOPermission does not state the name of the directory (for security reasons I suppose) I created custom DotNetNuke.dll to be able to see the exact dircectory name. That's how I managed to find out the name: C:\inetpub\vhosts\domain.com\httpdocs\portal\Portals\_default\Temp\2fsjdhkb

Why do I get an FileIOPermission security exception when Plesk setttings are correct (checked and double checked)?
Does anyone know why the creation of directories fail? Or some hints maybe?

Best regards,
Geert Doornbos

 
New Post
1/18/2009 1:22 PM
 

you're missing a permission, you either need the aspnet user (xp), or "network service"  user (vista, win 2003, win 2008, windows 7) to have modify permissions.

Cathal


Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
1/18/2009 2:19 PM
 

Thank you for your response Cathal. I already came to the same conclusion. The question should be: why do I get a FileIOPermission security exception. In the Plesk environment I see for both users IUSR_ and IWPD_ on webdirectory as well as on folder permissions: 'Full Control'.

I don't have an 'impersionation' element in web.config, so the code in the app pool runs as user IWPD_x. I've checked this to be sure: System.Security.Principal.WindowsIdentity.GetCurrent().Name

So, basicly, why can't IWPD_x not create a directory?

 
New Post
1/18/2009 4:52 PM
 

Geert, when a folder is created via asp.net code , .net code access permissions "walk" along the folder path checking permissions i.e. if you are trying to create a folder called "newfolder" with a path like  d:\somefile\someuser\newfolder then asp.net will check that the user has at least read permissions at the drive root ("d:") otherwise folder creation will fail. Perhaps plesk is not correctly setting drive root permissions?

Heres a link to a user with a similar problem, and some code they checked with - http://www.justskins.com/forums/create-directory-65741.html

Cathal


Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
1/18/2009 5:40 PM
 

Thanks again Cathal. I've got a response from my hosting provider (prioserve.net), who suggested to add the impersonation element to the web.config:
<identity impersonate="true"/>  I should have tried that myself of cource :-)

So I did and now the code is executed as IUSR_x and it worked! Surprisingly, IUSR_ has permissions and IWPD_ has not.
(Can't find the differences anywhere...)

In the mean while, I also found: http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/107/postid/124684/scope/posts/Default.aspx

I hope not to run into other problems, now i'm impersonating...

Thanks

 
Previous
 
Next
HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...SecurityException on Directory.Create()SecurityException on Directory.Create()


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out