473,486 Members | 2,401 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

File Permissions and Impersonation

Hi,

We have a number of websites running on an IIS6 server all running under
their own seperate Anonymous Web account and ASP.Net is configured to
Impersonate this account for each site for file system security reasons. The
problem comes however when one client needs to write files to their folders
and we receive the following error:

Server Error in '/' Application.
--------------------------------------------------------------------------------

Could not find a part of the path "c:\".
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.IO.DirectoryNotFoundException: Could not find a
part of the path "c:\".

I can get around this error by adding read permissions for all folders from
the drive root to the website directory ie. c:\ and c:\websites and
c:\website1 but this means that the client is now able to read the complete
file structure to their website which and other sites! Does anyone know of a
way of resolving this security issue?

Thanks - Steven
Nov 19 '05 #1
3 1457
Hi!

I'm sure you have your reasons for impersonating some other anonymous user
than the default one...
Can you configure the page that has to read something from C: to run under
the privileges of a more privileged user?
Check out the information here about configuring single pages:
http://msdn.microsoft.com/library/en...asp?frame=true
Here for impersonation:
http://msdn.microsoft.com/library/en...asp?frame=true
And here on how to put the password in secure storage:
http://support.microsoft.com/default...b;en-us;329290

HTH,
Lars-Erik

"Steve Winter" <st************@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi,

We have a number of websites running on an IIS6 server all running under
their own seperate Anonymous Web account and ASP.Net is configured to
Impersonate this account for each site for file system security reasons.
The problem comes however when one client needs to write files to their
folders and we receive the following error:

Server Error in '/' Application.
--------------------------------------------------------------------------------

Could not find a part of the path "c:\".
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.IO.DirectoryNotFoundException: Could not find a
part of the path "c:\".

I can get around this error by adding read permissions for all folders
from the drive root to the website directory ie. c:\ and c:\websites and
c:\website1 but this means that the client is now able to read the
complete file structure to their website which and other sites! Does
anyone know of a way of resolving this security issue?

Thanks - Steven

Nov 19 '05 #2
Basically all I want to do is to make sure that the one website can write to
it's own folders but for some strange reason I'm getting ACCESS DENIED
errors (using FileMon to debug) for all directories from the drive root to
the website itself. I would have though that just providing Write access to
the relevant folder in the website should be enough without having to give
read access as well to all folders up from the website to the drive root ?!

"Lars-Erik Aabech" <la******@newsgroup.nospam> wrote in message
news:O2**************@TK2MSFTNGP10.phx.gbl...
Hi!

I'm sure you have your reasons for impersonating some other anonymous user
than the default one...
Can you configure the page that has to read something from C: to run under
the privileges of a more privileged user?
Check out the information here about configuring single pages:
http://msdn.microsoft.com/library/en...asp?frame=true
Here for impersonation:
http://msdn.microsoft.com/library/en...asp?frame=true
And here on how to put the password in secure storage:
http://support.microsoft.com/default...b;en-us;329290

HTH,
Lars-Erik

"Steve Winter" <st************@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi,

We have a number of websites running on an IIS6 server all running under
their own seperate Anonymous Web account and ASP.Net is configured to
Impersonate this account for each site for file system security reasons.
The problem comes however when one client needs to write files to their
folders and we receive the following error:

Server Error in '/' Application.
--------------------------------------------------------------------------------

Could not find a part of the path "c:\".
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.IO.DirectoryNotFoundException: Could not find a
part of the path "c:\".

I can get around this error by adding read permissions for all folders
from the drive root to the website directory ie. c:\ and c:\websites and
c:\website1 but this means that the client is now able to read the
complete file structure to their website which and other sites! Does
anyone know of a way of resolving this security issue?

Thanks - Steven


Nov 19 '05 #3
OK, I think you might get what you want if you remove all impersonation
(don't use <impersonate> in web.config) and then give the ASPNET user write
access on the folder in question.

Lars-Erik

"Steve Winter" <st************@hotmail.com> wrote in message
news:eg**************@TK2MSFTNGP15.phx.gbl...
Basically all I want to do is to make sure that the one website can write
to it's own folders but for some strange reason I'm getting ACCESS DENIED
errors (using FileMon to debug) for all directories from the drive root to
the website itself. I would have though that just providing Write access
to the relevant folder in the website should be enough without having to
give read access as well to all folders up from the website to the drive
root ?!

"Lars-Erik Aabech" <la******@newsgroup.nospam> wrote in message
news:O2**************@TK2MSFTNGP10.phx.gbl...
Hi!

I'm sure you have your reasons for impersonating some other anonymous
user than the default one...
Can you configure the page that has to read something from C: to run
under the privileges of a more privileged user?
Check out the information here about configuring single pages:
http://msdn.microsoft.com/library/en...asp?frame=true
Here for impersonation:
http://msdn.microsoft.com/library/en...asp?frame=true
And here on how to put the password in secure storage:
http://support.microsoft.com/default...b;en-us;329290

HTH,
Lars-Erik

"Steve Winter" <st************@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi,

We have a number of websites running on an IIS6 server all running under
their own seperate Anonymous Web account and ASP.Net is configured to
Impersonate this account for each site for file system security reasons.
The problem comes however when one client needs to write files to their
folders and we receive the following error:

Server Error in '/' Application.
--------------------------------------------------------------------------------

Could not find a part of the path "c:\".
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.IO.DirectoryNotFoundException: Could not find
a part of the path "c:\".

I can get around this error by adding read permissions for all folders
from the drive root to the website directory ie. c:\ and c:\websites and
c:\website1 but this means that the client is now able to read the
complete file structure to their website which and other sites! Does
anyone know of a way of resolving this security issue?

Thanks - Steven



Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2252
by: clintonG | last post by:
The application is a simple form of three textbox controls that results in writing an XML file to the file system of the application root when it runs on the local development machine. I've just...
9
10857
by: Ben Dewey | last post by:
Project: ---------------------------- I am creating a HTTPS File Transfer App using ASP.NET and C#. I am utilizing ActiveDirectory and windows security to manage the permissions. Why reinvent...
2
9652
by: mt | last post by:
Is there a way to upload a file to a different server other than the one hosting the web app? I've tried using the following syntax: Request.Files.SaveAs("\\\\servername\\sharename\\directory" +...
9
3001
by: Ivan Demkovitch | last post by:
Hi! I would like to know if I can save File on Server using server-side code? For example, I like to create thumbnail images and populate specific directory. Do I need specific permissions...
1
6084
by: Edward Yang | last post by:
I setup web.config with impersonation="true". On our local server the project works great. I did the same procedures on our staging server, but it failed with an impossible error: Server Error in...
7
13362
by: Mark | last post by:
Hello, I have researched and tried every thing I have found on the web, in groups and MS KB articles. Here is what I have. I have a Windows 2000 Domain Controller all service packs and...
7
5810
by: zxkuqyb | last post by:
I've written a simple ASP .NET web application that reads a text file and displays it in the web browser. Works fine when reading a local path; but fails with "can not find a part of the path", or...
5
3090
by: cwbp15 | last post by:
Using Visual Studio C# When I ran the following code: System.IO; private void Button1_Click(object sender, System.EventArgs e) { //FileStream fs = File.Create(Server.MapPath("test.txt"));...
10
4920
by: robwharram | last post by:
Hi, I'm quite frustrated in the fact that I can't even display a simple "Hello World" message on .Net. I've been through all of the groups and searched all over the place and haven't been able...
0
7105
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7132
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7180
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7341
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5439
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4870
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3076
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
600
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
266
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.