Bug 199583 - [ftp] Support for FTP Only Connections to MVS running on z/os
Summary: [ftp] Support for FTP Only Connections to MVS running on z/os
Status: ASSIGNED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement with 4 votes (vote)
Target Milestone: ---   Edit
Assignee: dsdp.tm.rse-inbox CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: helpwanted
: 265291 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-08-10 10:45 EDT by Daniel Harp CLA
Modified: 2013-08-04 21:57 EDT (History)
5 users (show)

See Also:


Attachments
patch for partial mvs solution (4.77 KB, patch)
2011-05-31 10:41 EDT, Eric Spencer CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Harp CLA 2007-08-10 10:45:58 EDT
Current implementation is unable to correctly parse output from ftp connection to MVS on z/os.  

1)  It incorrectly identifies the initial working directory.
On my system, the initial PWD gives:
PWD
257 "'APL0A13.'" is working directory.

This creates the root node as 'APL0A13.' including the quotes, which should not be part of the name.

2) DIR list did not parse correctly.  This is easily overcomed with the ftpListingParsers extension point.

3)  Directory separators are periods, not slashes.  Where most systems would say "/APL0A13/BENCH", this system uses "APL0A13.BENCH".


I was able to parse the directory listings using the ftpListingParsers extension point, but the other two issues prevented this from really working.  The root node 'APL0A13.' was created with a child of BENCH, but expanding bench fails, because the single quotes were included and the path separator '/' was added.:
CWD 'APL0A13.'/BENCH
501 Mismatched quotes on directory name "'APL0A13.'/BENCH".
The command should have been CWD APL0A13.BENCH

Sample output from a manual connection follows below:

Connected to *********.
220-FTPD1 IBM FTP CS V1R7 at *************, 09:16:54 on 2007-08-10.
230 APL0A13 is logged on.  Working directory is "APL0A13.".
ftp> quote syst
215 MVS is the operating system of this server. FTP Server is running on z/OS.
ftp> pwd
257 "'APL0A13.'" is working directory.
ftp> dir
200 Port request OK.
125 List started OK
Volume Unit    Referred Ext Used Recfm Lrecl BlkSz Dsorg Dsname
TSD003 3390   2007/08/10  1  128  FB      80  3120  PO  BENCH.SRCE
ARCIVE Not Direct Access Device                         BENCH.SRCEJC
250 List completed successfully.
635 bytes received in 0.018 seconds (34.92 Kbytes/s)
ftp> cd BENCH
250 "APL0A13.BENCH." is the working directory name prefix.
ftp> dir
200 Port request OK.
125 List started OK
Volume Unit    Referred Ext Used Recfm Lrecl BlkSz Dsorg Dsname
TSD003 3390   2007/08/10  1  128  FB      80  3120  PO  SRCE
ARCIVE Not Direct Access Device                         SRCEJC
250 List completed successfully.
252 bytes received in 0.0096 seconds (25.72 Kbytes/s)
ftp> cd SRCE
250 The working directory "APL0A13.BENCH.SRCE" is a partitioned data set
ftp> dir
200 Port request OK.
125 List started OK
 Name     VV.MM   Created       Changed      Size  Init   Mod   Id
JS                                                                    
SQL       01.24 2005/11/28 2005/12/09 12:49    20     5     0 APL0A13 
250 List completed successfully.
1076 bytes received in 0.0087 seconds (120.56 Kbytes/s)
ftp> 


A few things to note:
1. Datasets listed with: ARCIVE Not Direct Access Device
  This are just archived.  Browsing into them will work, the system will just recall the archive from disk (which may take a few seconds longer).
2. dir behaves differently depending on whether it is listing volumes or files. (See the last listing for Files.)  Also note the JS file.  It is a different format, so all you get is the name, but it can be downloaded just like the SQL file.
3.  To CWD from the Root directory, single quotes are used:
CWD 'APL0A13.BENCH'
without the single quotes it is relative.
CWD BENCH
goes into a subfolder called BENCH from the current location.

Let me know how else I can help (or if this is the wrong place to post this).

Thanks!
Comment 1 Martin Oberhuber CLA 2007-08-10 11:06:32 EDT
Thanks a lot for the report, Daniel.

We'd love to support z/OS over FTP, but none of us committers has a system ready for testing. Therefore, we depend on your help if this should get fixed. Can you debug and fix this yourself, and provide patches?

As an alternative, can you run a dstore server on you z/OS MVS box? You'd get more features out of dstore, and I think it should be supported on z/OS.
Comment 2 Daniel Harp CLA 2007-08-10 13:40:06 EDT
(In reply to comment #1)
> Thanks a lot for the report, Daniel.
> We'd love to support z/OS over FTP, but none of us committers has a system
> ready for testing. Therefore, we depend on your help if this should get fixed.
> Can you debug and fix this yourself, and provide patches?
> As an alternative, can you run a dstore server on you z/OS MVS box? You'd get
> more features out of dstore, and I think it should be supported on z/OS.

Unfornately, I wont be able to run a dstore server, for policy reasons, not technical.  I'll continue to play around and see what I could contribute, but as this was the first extension point I'd even tried to write, I don't think I have any patches for you anytime soon.
Comment 3 Martin Oberhuber CLA 2007-08-14 10:01:23 EDT
(In reply to comment #2)
This would not be about contributing an extension point, but simply about bug-fixing the functionality that's already there. It's pretty clear where the functionality to be fixed resides, so if you know any Java that should not be too hard to do.

The steps to be done are mostly documented in the FAQ:
http://wiki.eclipse.org/index.php/TM_and_RSE_FAQ#How_do_I_build_RSE_from_CVS_if_I_want_a_more_recent_build_than_is_on_the_downloads_page.3F

In your case, it's as simple as this:
1.) Ensure you are running Eclipse SDK
2.) Follow instructions on 
    http://www.eclipse.org/dsdp/tm/development/cvs_setup.php
    to get the "rse-anonymous.psf" file, then File > Import > Team it
3.) Ctrl+Shift+T, "FTPService"
4.) Set a breakpoint at method internalFetch()
5.) Select org.eclipse.rse.services.files.ftp project, 
    Right-click > Debug As > Eclipse Application
6.) Connect to your server, will break at the breakpoint

Edit code as you want. When done,
7.) Select modified projects, then Team > Create Patch...
    and attach the patch to this bug.
Comment 4 Martin Oberhuber CLA 2007-08-14 10:08:08 EDT
The most important part seems to be working on the "." as path separator.
For a start, I suppose you'll need to change the
   getSeparator()
   getRoots()
Also, look at the connect() method, below the following comment:
   //For VMS, normalize the home location
It normalizes the VMS notion of directories.

probably you'll also need to modify
   FTPHostFile.getAbsolutePath()

In general, everything would be simpler if the server accepted commands like
   CHDIR "/path/to/x"
perhaps the FTP Server could be configured to run in kind of a UNIX compatibility mode?
Comment 5 Jens Neuschulz CLA 2010-08-16 15:57:03 EDT
Hi Martin, 

I would like to fix this problem. I have followed your instruction until

5.) Select org.eclipse.rse.services.files.ftp project, 
    Right-click > Debug As > Eclipse Application
6.) Connect to your server, will break at the breakpoint

But I can't open the RSE perspective in order to open the "new connection dialog"

Would you help me please. 

Many thanks Jens
Comment 6 Martin Oberhuber CLA 2010-08-17 03:26:36 EDT
Hi Jens, 

What versions of everything are you using? Has everything compiled properly or are there any error markers? Delete the breakpoints again, until you get the debuggee to run.

next question is whether all RSE plugins are "visible" in your debuggee. In the debugee, use Help > About > Installation Details : Plug-ins. Sort by plug-in ID and see whether the RSE plug-ins are there. Check the errorlog; in the About Dialog's Configuration Tab, use the "View Error Log" button. You can also copy & paste your configuration details and attach here on bugzilla to give more details.

It may help when you install RSE from the Helios repository into your host Eclipse and verify that it runs in the host. Then you can close all your other plug-in projects except the ones with ".ftp" in the name - should make it easier for the debuggee to come up.

Hope that helps!
Comment 7 Jens Neuschulz CLA 2010-08-17 09:38:49 EDT
Hi Martin,

many thanks for your detailed description. Now it works and I'm able to debug and to modify the sources. I will provide you a patch asap.

Ciao Jens
Comment 8 Eric Spencer CLA 2011-05-31 10:41:42 EDT
Created attachment 196986 [details]
patch for partial mvs solution

The zip contains 5 patch files for the various packages touched.
Comment 9 Eric Spencer CLA 2011-05-31 10:43:41 EDT
(In reply to comment #8)
> Created attachment 196986 [details]
> patch for partial mvs solution
> 
> The zip contains 5 patch files for the various packages touched.

I have done a little work to get this going. 
I can now get a list of files to display, can open "folders" and select files but there is still a problem downloading files - the framework always switches to Image mode. I am forcing ASCII mode at connect time but it gets switched regardless just before the download starts. The MVS FTP server will handle the EBCDIC to ASCII conversion if in ASCII mode. I have not had time to investigate why the framework always switches to Image mode.  

There are numerous places in the code where separator character / is assumed which is causing a lot of problems in getting this going, I have just been looking at the FTP only path. I would really like to use RSE in another project I am working on (because I had hoped it would same me the time of writing my own...) 

I have attached my patch files that built on the 3.2.2 source from Feb 13 2011.
Comment 10 Martin Oberhuber CLA 2013-05-15 16:31:18 EDT
*** Bug 265291 has been marked as a duplicate of this bug. ***
Comment 11 Martin Oberhuber CLA 2013-05-15 16:57:47 EDT
(In reply to comment #0)
Current status after updating to Commons Net 3.2 (as per bug 346892):

> 1)  It incorrectly identifies the initial working directory.
> On my system, the initial PWD gives:
> PWD
> 257 "'APL0A13.'" is working directory.
> 
> This creates the root node as 'APL0A13.' including the quotes, which should
> not be part of the name.

The response is incorrect as per RFC 959 -- Following the RFC, the single-quotes should be part of the name. I'm not sure where this MVS peculiarity would be handled best.

> 2) DIR list did not parse correctly.  This is easily overcomed with the
> ftpListingParsers extension point.

This should be improved with the new MVS listing parsers from Commons Net.

> 3)  Directory separators are periods, not slashes.  Where most systems would
> say "/APL0A13/BENCH", this system uses "APL0A13.BENCH".

This needs to be addressed all across RSE.

And, another remaining issue is the "dual mode" nature of z/OS which can print FTP output in HFS mode or MVS mode as per the current directory; bug 227410 deals with that.