ASP.NET application cannot access network drive

  • Thread starter Thread starter James N
  • Start date Start date
J

James N

My ASP.NET application needs read/write permissions for drive "Z:",
which is mapped to my Linksys Gigadrive (Network Attached Storage...if
anyone is familiar with that).

If I configure the Gigadrive with "Guest" access rights, then everything
works fine, BUT this leaves the drive vulnerable to everyone/everything
including network viruses. Lately, my drive has had several attacks by
the Lovegate virus.

Eliminating such attacks requires making my drive private, meaning I
must remove "Guest" access rights and only allow logged-in users to
access the drive through the ASP.NET applicaiton.

The problem is that without "guest" access rights, the ASP.NET
application itself cannot access the drive!

Is my ASP.NET application a "user" that I must add to the list of
priviledged users on the Gigadrive? Well, I tried adding users "ASPNET"
and "IUSR_MyComputer" to the Gigadrive, but it didnt seem to work.

Again, if I allow the "Everyone" group (which includes the user "Guest")
to have persmission to the drive, then everything works.

Can someone please help me?
 
I believe that giving permissions to ASPNET (assuming you're using the
default settings) is who needs the permissions. Drive mappings are user
specific so not only do you need to have Z mapped to the share, but the
ASPNET user has to have it mapped as well. I don't know if this is your
problem but this has bitten me in the past.

Also, you could try using a UNC path to access the drive which wouldn't
require a drive mapping.

Hope this helps.

Jeff Trotman
Westglenn Software
 
Jeff,

Im not sure what you mean when you said "the ASPNET user has to have it
mapped as well". Do you mean this:

Under "my computer" right-click the mapped drive and select
"properties". On the security tab, add "ASPNET" to the list of users?

Well, I tried doing that but it does not allow me to modify the list.
Currently, I have 3 users/roles: administrator(NASDRIVE\administrator),
Everyone, everyone(NASDRIVE\everyone). I checked the "full control"
option for all of them. However, when I click "apply", all the
checkboxes become unchecked again. Only the administrator still has
full control ( as how it was initially ).
 
I was playing around with the NAS a little more and I notice that
whenever I create a new user with the name "aspnet", I receive the same
error: "Could not find a part of the path 'z:\'". The odd thing is even
though "aspnet" is a member of the "everyone" group in NAS, and that the
"everyone" group does have R/W access to the share folder, the
application is still not able to write to the folder. Now if I delete
the "aspnet" user altogether, everything works like normal (where
"everyone" has access).

By the way, for your info (but im sure everyone here probably knows this
already) "ASPNET" is actually the user account that the asp.net worker
process (aspnet_wp.exe) is configured to runs as in IIS/windows. There
seems to be some correlation, but I just dont know exactly what. If
this info has shedded some light on this problem, please let me know.
THanks.
 
Back
Top