Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Issue with TFTP to mapped drives

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have mapped G:\ to a directory on another PC in network, which has all permissions set for 'everyone'.
I have pointed the mapped drive to be tftpServer directory.
I am trying to upload a config file from my controller to this tftp server.

1. To check if the directory is a mapped directory, i am using: dir.getCanonicalFile().equals(dir).. this returns true for mapped drive.

This is the code to check for the write permissions:
// Check saveDirectory is writable,--
if (!dir.canWrite()) {
throw new IllegalArgumentException("Not writable: " + saveDirectory);
}

For the mapped directory 'canWrite' is returned false, even though the file permissions look ok. I can manually copy a file to the mapped drive,
modify the file on the mapped drive.

And checked on Google, could not find any way to check if canonical File is writable. How can I make sure the canonical file/dir is writable?

2. Removed the canWrite check, and looks like the tftpServer is unable to read from the mapped drive.
When I run CLI to upload the file, I see TFTP write requests in ethereal but no acknowledgement from tftp server.

I see this exception in the log:
java.io.FileNotFoundException: G:\one.txt (Access is denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
at com.globalros.tftp.FileSystem.getOutputStream(FileSystem.java:67)
at com.globalros.tftp.server.TFTPRequestHandler.run(TFTPRequestHandler.java:162)
at com.globalros.tftp.server.TFTPPool$TFTPRHThread.run(TFTPPool.java:278)

Also tried, creating a blank file with this name, and run the upload from CLI. I see same exception in the log.

We are using GlobalRos Tftp server. Is it that the Java GlobalRos tftp server has problems accessing the mapped Drive?

Could not find any info on its limitations on Google. Any suggestions?
 
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Veena Makal:
Hi,

I have mapped G:\ to a directory on another PC in network, which has all permissions set for 'everyone'.
I have pointed the mapped drive to be tftpServer directory.
I am trying to upload a config file from my controller to this tftp server.

1. To check if the directory is a mapped directory, i am using: dir.getCanonicalFile().equals(dir).. this returns true for mapped drive.

This is the code to check for the write permissions:


From From Juergen Haas at about.com: The Trivial File Transfer Protocol (TFTP) is normally used only for booting diskless workstations. The tftp-server package provides the server for TFTP, which allows users to transfer files to and from a remote machine. TFTP provides very little security, and should not be enabled unless it is expressly needed. The TFTP server is run from/etc/ xinetd.d/tftp, and is disabled by default on Red Hat Linuxsystems.

Therefore I suggest you look into tftp sources to determine if there is an authorization for read/write implemented.

For the mapped directory 'canWrite' is returned false, even though the file permissions look ok. I can manually copy a file to the mapped drive,
modify the file on the mapped drive.

And checked on Google, could not find any way to check if canonical File is writable. How can I make sure the canonical file/dir is writable?

2. Removed the canWrite check, and looks like the tftpServer is unable to read from the mapped drive.
When I run CLI to upload the file, I see TFTP write requests in ethereal but no acknowledgement from tftp server.

I see this exception in the log:
java.io.FileNotFoundException: G:\one.txt (Access is denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
at com.globalros.tftp.FileSystem.getOutputStream(FileSystem.java:67)
at com.globalros.tftp.server.TFTPRequestHandler.run(TFTPRequestHandler.java:162)
at com.globalros.tftp.server.TFTPPool$TFTPRHThread.run(TFTPPool.java:278)

Also tried, creating a blank file with this name, and run the upload from CLI. I see same exception in the log.

We are using GlobalRos Tftp server. Is it that the Java GlobalRos tftp server has problems accessing the mapped Drive?

Could not find any info on its limitations on Google. Any suggestions?



com.globalros.tftp.FileSystem does not have a canRead() canWrite() so it sounds to me like
  • ACK
  • DATA
  • ERROR
  • FRQ
  • OACK
  • RRQ
  • TFTPFile
  • TFTPOptions
  • TFTPPacket
  • VirtualFileImpl
  • WRQ
  • Exceptions


  • is all you have to work with.    

    It is not that the Java GlobalRos tftp server has problems accessing the mapped Drive, it that minimal basic permissions are not implemented in the protocol.
     
    reply
      Bookmark Topic Watch Topic
    • New Topic