Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default 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...
    > 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 = new
    FileIOPermission(FileIOPermissionAccess.Read
    > |
    > >
    > > 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
    > 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:%236PyHWqXDHA.2572@TK2MSFTNGP09.phx.gbl...
    > > > Hi there.
    > > >
    > > > Why does "Directory.CreateDirectory" needs the impersonated user to
    have
    > > > 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
    > don't
    > > > want users to have access to the root of the drive.
    > > >
    > > > Regards
    > > >
    > > > Ademar Gonzalez
    > > > Programmer
    > > >
    > > >
    > > >
    > >
    > >
    >
    >

    Shel Blauman [MSFT] Guest

  2. Similar Questions and Discussions

    1. 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....
    2. 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...
    3. 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...
    4. 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...
    5. 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:...
  3. #2

    Default 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...
    > 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 = new
    FileIOPermission(FileIOPermissionAccess.Read
    > |
    > >
    > > 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
    > 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:%236PyHWqXDHA.2572@TK2MSFTNGP09.phx.gbl...
    > > > Hi there.
    > > >
    > > > Why does "Directory.CreateDirectory" needs the impersonated user to
    have
    > > > 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
    > don't
    > > > want users to have access to the root of the drive.
    > > >
    > > > Regards
    > > >
    > > > Ademar Gonzalez
    > > > Programmer
    > > >
    > > >
    > > >
    > >
    > >
    >
    >

    Shel Blauman [MSFT] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139