Ask a Question related to ASP.NET Security, Design and Development.
-
Shel Blauman [MSFT] #1
Re: feature or bug?
Forwarding to Aspnet and Aspnet.Security. They may have run across this
question before.
Shel
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
[url]http://www.microsoft.com/info/cpyright.htm[/url]
"Ademar Gonzalez" <ademar@isqsolutions.com> wrote in message
news:%23z3jikDYDHA.2572@TK2MSFTNGP09.phx.gbl...FileIOPermission(FileIOPermissionAccess.Read> Thanks Shel for your promt answer ...... but it doesn't work for me.
>
> I'm talking about NTFS permissions not Access Code Permissions.
> Let me set the scenario.
>
> The described issue happens when you try to execute the code from ASP.NET.
> ASP.NET is configured to impersonate the IUSR_WHATEVER user (throug the
> machine.config).
> This IUSR_WHATEVER user have NTFS write permission on the folder
> D:\Websites\WHATEVER_WEBSITE
> but non on D:\.
>
> Directory.Create fails with : System.IO.DirectoryNotFoundException: Could
> not find a part of the path "D:\"
> Note that it is not an access denied error!
>
> The funny thing is that File.Create works! in this same enviroment.
>
> Now, if i add ListFolder permission for the IUSR_WHATEVER user to all the
> parent folders including D: ,
> then Directory.Create works.
>
> D: is a local drive NOT network mapped.
>
> Any ideas, workarounds ?
>
>
> Thanks .. and regards!
>
> Ademar Gonzalez
>
>
>
>
> "Shel Blauman [MSFT]" <sheldonb@online.microsoft.com> wrote in message
> news:umSYDtCYDHA.2352@TK2MSFTNGP12.phx.gbl...> > I believe you only need read/write permission for the folder you are
> > creating the directory in. The following code works for me:
> >
> > FileIOPermission fIPerm = newhave> |> rights.> >
> > FileIOPermissionAccess.Write, "C:\\temp");
> >
> > fIPerm.PermitOnly();
> >
> > DirectoryInfo di = Directory.CreateDirectory("C:\\temp\\newDirectory" );
> >
> >
> >
> > Shel
> >
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no> > Use of included script samples are subject to the terms specified at
> > [url]http://www.microsoft.com/info/cpyright.htm[/url]
> >
> >
> > "Ademar Gonzalez" <ademar@isqsolutions.com> wrote in message
> > news:%236PyHWqXDHA.2572@TK2MSFTNGP09.phx.gbl...> > > Hi there.
> > >
> > > Why does "Directory.CreateDirectory" needs the impersonated user to> don't> > > access (at least ListFolder permission)
> > > to all the parent folders in the path structure. ?
> > >
> > > Why doesn't "File.Create" need it ?
> > >
> > > It doesn't make sense. Can somebody explain this behaviour.
> > > Is there any workaround for the Directory.CreateDirectory issue ?. I>> >> > > want users to have access to the root of the drive.
> > >
> > > Regards
> > >
> > > Ademar Gonzalez
> > > Programmer
> > >
> > >
> > >
> >
>
Shel Blauman [MSFT] Guest
-
Bug or feature ?
Within a website I'm working on I include price tables through a php include() statement. Each of these tables itself is derived from a template.... -
Feature or Bug
I have noticed while reading these newsgroups for information that when I click on a supplied link in a post, that IE 7 will open but the web page... -
Log-in feature
Okay, I have run into a little problem in creating an asp site. Many thanks to anyone who has any ideas. This is a rather complicated site--let me... -
the 3d feature
other than not having to launch classic and use another app (dimensions) whats the point of the 3d feature in cs? the 3d feature is slo and maybe... -
Bug or feature in SQL SP
Hi all. In db2diag.log I found next record 2003-07-03-13.21.46.812000 Instance:DB2 Node:000 PID:2096(db2dari.exe) TID:3144 Appid:... -
Shel Blauman [MSFT] #2
Re: feature or bug?
Forwarding to Aspnet and Aspnet.Security. They may have run across this
question before.
Shel
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
[url]http://www.microsoft.com/info/cpyright.htm[/url]
"Ademar Gonzalez" <ademar@isqsolutions.com> wrote in message
news:%23z3jikDYDHA.2572@TK2MSFTNGP09.phx.gbl...FileIOPermission(FileIOPermissionAccess.Read> Thanks Shel for your promt answer ...... but it doesn't work for me.
>
> I'm talking about NTFS permissions not Access Code Permissions.
> Let me set the scenario.
>
> The described issue happens when you try to execute the code from ASP.NET.
> ASP.NET is configured to impersonate the IUSR_WHATEVER user (throug the
> machine.config).
> This IUSR_WHATEVER user have NTFS write permission on the folder
> D:\Websites\WHATEVER_WEBSITE
> but non on D:\.
>
> Directory.Create fails with : System.IO.DirectoryNotFoundException: Could
> not find a part of the path "D:\"
> Note that it is not an access denied error!
>
> The funny thing is that File.Create works! in this same enviroment.
>
> Now, if i add ListFolder permission for the IUSR_WHATEVER user to all the
> parent folders including D: ,
> then Directory.Create works.
>
> D: is a local drive NOT network mapped.
>
> Any ideas, workarounds ?
>
>
> Thanks .. and regards!
>
> Ademar Gonzalez
>
>
>
>
> "Shel Blauman [MSFT]" <sheldonb@online.microsoft.com> wrote in message
> news:umSYDtCYDHA.2352@TK2MSFTNGP12.phx.gbl...> > I believe you only need read/write permission for the folder you are
> > creating the directory in. The following code works for me:
> >
> > FileIOPermission fIPerm = newhave> |> rights.> >
> > FileIOPermissionAccess.Write, "C:\\temp");
> >
> > fIPerm.PermitOnly();
> >
> > DirectoryInfo di = Directory.CreateDirectory("C:\\temp\\newDirectory" );
> >
> >
> >
> > Shel
> >
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no> > Use of included script samples are subject to the terms specified at
> > [url]http://www.microsoft.com/info/cpyright.htm[/url]
> >
> >
> > "Ademar Gonzalez" <ademar@isqsolutions.com> wrote in message
> > news:%236PyHWqXDHA.2572@TK2MSFTNGP09.phx.gbl...> > > Hi there.
> > >
> > > Why does "Directory.CreateDirectory" needs the impersonated user to> don't> > > access (at least ListFolder permission)
> > > to all the parent folders in the path structure. ?
> > >
> > > Why doesn't "File.Create" need it ?
> > >
> > > It doesn't make sense. Can somebody explain this behaviour.
> > > Is there any workaround for the Directory.CreateDirectory issue ?. I>> >> > > want users to have access to the root of the drive.
> > >
> > > Regards
> > >
> > > Ademar Gonzalez
> > > Programmer
> > >
> > >
> > >
> >
>
Shel Blauman [MSFT] Guest



Reply With Quote

