AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Maybe it's a security problem? File() can't see remote drive

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Security and Java
View previous topic :: View next topic  
Author Message
Chris
Guest





PostPosted: Mon Jan 10, 2005 6:42 pm    Post subject: Maybe it's a security problem? File() can't see remote drive Reply with quote



It seems that the java.io.File() class can't see files and directories on
other computers on a particular Windows network.

For example:

C: is a local drive
Z: is a mapped drive on another computer

(new File("C:\mydirmyfile.txt")).exists() == true;
(new File("Z:\mydirmyfile.txt")).exists() == false;

myfile *does* exist on the Z: drive. You can navigate to it using Windows
Explorer, click on it, and edit it. You can also cd to this drive at the
command prompt.

My best guess is that this is a security/authentication issue. The network
uses Active Directory to authenticate users and give them access to shared
drives. But once the user is authenticated by Windows, I can't see why
Windows would deny access to a drive to an application being run by the same
user.

Has anyone seen this problem before? Why would Windows Explorer be able to
see this file but not Java?



Back to top
Michele Ouellet
Guest





PostPosted: Tue Jan 11, 2005 11:36 am    Post subject: Re: Maybe it's a security problem? File() can't see remote d Reply with quote




Quote:
Has anyone seen this problem before? Why would Windows Explorer be able to
see this file but not Java?

I remember having this kind of problem before; it was not really
security-related. I don't know exactly why, but the drive mapping had to be
made available explicitly to the DOS box in which I ran the Java
application. This is done with the net use command, I seem to remember.

There might also be an elegant, programmatic way to do this inside your
program?

Good luck,

Michèle Ouellet.



Back to top
Andreas Jaeger
Guest





PostPosted: Tue Jan 11, 2005 1:10 pm    Post subject: Re: Maybe it's a security problem? File() can't see remote d Reply with quote



Chris wrote:

Quote:
It seems that the java.io.File() class can't see files and directories on
other computers on a particular Windows network.

For example:

C: is a local drive
Z: is a mapped drive on another computer

(new File("C:\mydirmyfile.txt")).exists() == true;
(new File("Z:\mydirmyfile.txt")).exists() == false;

Has anyone seen this problem before? Why would Windows Explorer be able to
see this file but not Java?

This problem exists, e.g., with applications running as services
under LocalSystem account. For instance, all Tomcat webapps when
installed as service/LocalSystem. LocalSystem cannot see remote
drives (no matter whether mapped to a drive name or not, UNC paths
do not work either). Either change the logon account to somebody
entitled, or start a net use batch with a correct login.

Andreas

--
---------------------------------------------
Andreas Jaeger
http://afi.uni-muenster.de
afi - Institut für Agrar- und Forstinformatik
an der Universität Münster
---------------------------------------------


Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Security and Java All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.