cozsftp not liking the ls command

Discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
fulldraw68
Posts: 10
Joined: Mon Oct 19, 2015 5:29 pm

cozsftp not liking the ls command

Post by fulldraw68 »

I'm trying to execute the following code from our windows box..

ls /+mode=text,lrecl=80,recfm=fb
cd //MMITMMO.DBTEST.CNTL2
put C:\test\afile.txt //MMITMMO.DBTEST.CNTL2(FTPTST)

I have the trace in the sftp.log but I'm not sure the best way to get it to you guys as it would not all fit here.
Here is some of it.

Co:Z SFTP Server version: 2.4.5 (5.0p1) 2014-05-29
Copyright (C) Dovetailed Technologies, LLC. 2008-2013. All rights reserved.
ZosSettingsÝT¨: -> readConfiguration()
ZosSettingsÝT¨: -> processConfigurationFile(/etc/ssh/cozsftp_server_config)
ZosSettingsÝT¨: processConfigurationFile: Processing fixed: configuration file section
ZosSettingsÝT¨: processConfigurationFile: Processing default: configuration file section
ZosSettingsÝT¨: <- processConfigurationFile()
ZosSettingsÝT¨: -> processConfigurationFile(/u/V054305/.ssh/cozsftp_server_confiig)
ZosSettingsÝW¨: Fixed section found in user config file - ignoring
ZosSettingsÝT¨: processConfigurationFile: Processing default: configuration file section
ZosSettingsÝT¨: processConfigurationFile: Processing configuration file option: 'gdgnt'
ZosSettingsÝT¨: <- processConfigurationFile()
ZosSettingsÝT¨: <- readConfiguration()
ZosUtilÝT¨: -> zos_log_region_size()
ZosUtilÝD¨: region size requested = 55296K, Actual below/above limit = 9192K / 195608K
ZosUtilÝT¨: <- zos_log_region_size()
Ý14.229¨ session opened for local user V054305 from Ý172.16.0.25¨
ZosExitInterfaceÝT¨: -> checkIP()
ZosExitInterfaceÝT¨: checkIP: unable to load CZCHKIP - EDC5239S Fetched module not found. (errno2=0xC4070044)l
ZosExitInterfaceÝT¨: <- checkIP(true (module not found))
ZosExitInterfaceÝT¨: -> checkPwd()
ZosExitInterfaceÝT¨: checkPwd: unable to load CZCHKPWD - EDC5239S Fetched module not found. (errno2=0xC4070044)
ZosExitInterfaceÝT¨: <- checkPwd(true (module not found))
Connection established, local_addr=192.168.58.34 local_port=22 remote_addr=172.16.0.25 remote_port=54977
Ý14.268¨ debug3: Type: SSH2_FXP_INIT
Ý14.268¨ received client version 4
Ý14.302¨ debug3: Type: SSH2_FXP_REALPATH
Ý14.302¨ debug3: request 3294: realpath
Ý14.302¨ realpath "."
Ý14.302¨ debug3: initial zos directory requested: //
CatalogSearchÝD¨: filterKey="V054305"
CatalogSearchÝT¨: -> search()
CatalogSearchÝT¨: search: total_length=65536, min_required=0, used=64, num_fields_plus_one=6, resume=
CatalogSearchÝT¨: <- search()
ZosUtilÝT¨: Skipping getDatasetInfo for V054305, setting pPerm to S_IFDIR
Ý14.307¨ debug1: request 3294: sent names count 1
Ý14.341¨ debug3: Type: SSH2_FXP_OPEN
Ý14.341¨ debug3: request 1383: open flags 26
Ý14.341¨ open "/MMITMMO.DBTEST.CNTL2(FTPTST)" flags WRITE,CREATE,TRUNCATE mode 0666
ZosExitInterfaceÝT¨: -> checkCommandWithFileArg(STOR /MMITMMO.DBTEST.CNTL2(FTPTST))
ZosExitInterfaceÝT¨: <- checkCommandWithFileArg(true (module not available))
ZosSettingsÝD¨: Options in effect (no file pattern selected)
ZosSettingsÝD¨: .newoption=
ZosSettingsÝD¨: error.log
ZosSettingsÝD¨: gdgnt
ZosSettingsÝD¨: loglevel=T
ZosSettingsÝD¨: mode=binary
PosixFileÝT¨: -> open("/MMITMMO.DBTEST.CNTL2(FTPTST)", 0x0091, 0x01B6)
PosixFileÝE¨: open(/MMITMMO.DBTEST.CNTL2(FTPTST)) failed - EDC5141I Read-only file system. (errno2=0x05620060)
PosixFileÝT¨: open: realpath(/MMITMMO.DBTEST.CNTL2(FTPTST)) failed - EDC5129I No such file or directory. (errno2=0x115C006C)
PosixFileÝT¨: <- open(fd=-1, filename=/MMITMMO.DBTEST.CNTL2(FTPTST), mode=0, errno=129)
Ý14.341¨ debug3: request 1383: sent status 2
Ý14.341¨ sent status No such file
Ý14.375¨ debug1: read eof
Ý14.375¨ session closed for local user V054305 from Ý172.16.0.25¨
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: cozsftp not liking the ls command

Post by dovetail »

The trace does not show any evidence of the ls command being received.
(Note: ls commands result in "stat", "opendir", and "readdir" packets)

Also, the // prefix for the PDS name is being changed to a single slash by your Windows client software.

Some SFTP client programs don't seem to support "//". For these, you can use the alternate syntax:

cd /-/MMITMMO.DBTEST.CNTL2
put C:\test\afile.txt FTPTST <-- since you already did a "cd" do the PDS.
fulldraw68
Posts: 10
Joined: Mon Oct 19, 2015 5:29 pm

Re: cozsftp not liking the ls command

Post by fulldraw68 »

changed the prefix to /-/ and that worked. Still not able to pass props parms to COZ. Have tried ls /+ and dir /+.
We are using Ipswitch WS-FTP Professional 2007.1-2007.11.12 with the Ipswitch WS-FTP Scripting Utility 2007.1.

We issued the below commands..

dir /+mode=binary,lrecl=32704,recfm=vb
cd /-/MMITMMO.GAC.YYYYYYYY
put U:\FTPprocesses\CMS\CMSToMF\837XoverA-PROD\Data\837XoverAToMFTemp.txt (+1) 

File was sent to zos fine but has the following format and is unreadable..
Organization . . . : PS
Record format . . . : U
Record length . . . : 0
Block size . . . . : 6144

Here is part of trace log you might be interested in...
ZosUtilÝT¨: Skipping getDatasetInfo for V054305, setting pPerm to S_IFDIR
Ý37.352¨ debug1: request 3294: sent names count 1
Ý37.411¨ debug3: Type: SSH2_FXP_OPENDIR
Ý37.411¨ debug3: request 1110: opendir
Ý37.411¨ opendir "/-/MMITMMO.GAC.YYYYYYYY"
ZosExitInterfaceÝT¨: -> checkCommandWithFileArg(LIST /-/MMITMMO.GAC.YYYYYYYY)
ZosExitInterfaceÝT¨: <- checkCommandWithFileArg(true (module not available))
ZosDirÝT¨: -> open(MMITMMO.GAC.YYYYYYYY)
CatalogSearchÝD¨: filterKey="MMITMMO.GAC.YYYYYYYY"
CatalogSearchÝT¨: -> search()
CatalogSearchÝT¨: search: total_length=65536, min_required=0, used=185, num_fields_plus_one=6, resume=
CatalogSearchÝT¨: <- search()
CatalogSearchÝD¨: filterKey="MMITMMO.GAC.YYYYYYYY.**"
CatalogSearchÝT¨: -> search()
CatalogSearchÝT¨: search: total_length=65536, min_required=0, used=1440, num_fields_plus_one=6, resume=
CatalogSearchÝT¨: <- search()
ZosDirÝT¨: <- open(true)
Ý37.437¨ debug1: request 1110: sent handle handle 0
Ý37.507¨ debug3: Type: SSH2_FXP_CLOSE
Ý37.507¨ debug3: request 1929: close handle 0
Ý37.507¨ closedir "/-/MMITMMO.GAC.YYYYYYYY"
Ý37.507¨ debug3: request 1929: sent status 0
Ý37.507¨ sent status Success
Ý37.552¨ debug3: Type: SSH2_FXP_OPENDIR
Ý37.552¨ debug3: request 1110: opendir
Ý37.552¨ opendir "/-/MMITMMO.GAC.YYYYYYYY"
ZosExitInterfaceÝT¨: -> checkCommandWithFileArg(LIST /-/MMITMMO.GAC.YYYYYYYY)
ZosExitInterfaceÝT¨: <- checkCommandWithFileArg(true (module not available))
ZosDirÝT¨: -> open(MMITMMO.GAC.YYYYYYYY)
CatalogSearchÝD¨: filterKey="MMITMMO.GAC.YYYYYYYY"
CatalogSearchÝT¨: -> search()
CatalogSearchÝT¨: search: total_length=65536, min_required=0, used=185, num_fields_plus_one=6, resume=
CatalogSearchÝT¨: <- search()
CatalogSearchÝD¨: filterKey="MMITMMO.GAC.YYYYYYYY.**"
CatalogSearchÝT¨: -> search()
CatalogSearchÝT¨: search: total_length=65536, min_required=0, used=1440, num_fields_plus_one=6, resume=
CatalogSearchÝT¨: <- search()
ZosDirÝT¨: <- open(true)
Ý37.564¨ debug1: request 1110: sent handle handle 0
Ý37.598¨ debug3: Type: SSH2_FXP_READDIR
Ý37.598¨ debug1: request 3021: readdir "/-/MMITMMO.GAC.YYYYYYYY" (handle 0)
ZosDirÝT¨: -> readCatalogDir()
ZosDirÝT¨: <- readCatalogDir(0 '.zos_catalog')
Ý37.598¨ debug1: request 3021: count= 0 name= ".zos_catalog" long_name= "Volume Referred Ext Tracks Used Recfm Lrecl BlkSz Ds
ZosDirÝT¨: -> readCatalogDir()
ZosDirÝT¨: <- readCatalogDir(0 'G0001V00')
Ý37.608¨ debug1: request 3021: count= 1 name= "G0001V00" long_name= "NODRN9+ 2015/10/16 1 1 0 U 0 6144 PS
ZosDirÝT¨: -> readCatalogDir()
ZosDirÝT¨: <- readCatalogDir(0 'G0002V00')
Ý37.614¨ debug1: request 3021: count= 2 name= "G0002V00" long_name= "NODR87+ 2015/10/16 1 1 0 U 0 6144 PS
ZosDirÝT¨: -> readCatalogDir()
ZosDirÝT¨: <- readCatalogDir(0 'G0003V00')
Ý37.621¨ debug1: request 3021: count= 3 name= "G0003V00" long_name= "NODR20+ 2015/10/16 1 1 0 U 0 6144 PS
ZosDirÝT¨: -> readCatalogDir()
ZosDirÝT¨: <- readCatalogDir(0 'G0004V00')
Ý37.628¨ debug1: request 3021: count= 4 name= "G0004V00" long_name= "NODR8A+ 2015/10/20 1 9 9 U 0 6144 PS
ZosDirÝT¨: -> readCatalogDir()
ZosDirÝT¨: <- readCatalogDir(0 'G0005V00')
Ý37.635¨ debug1: request 3021: count= 5 name= "G0005V00" long_name= "NODR44+ 2015/10/20 1 176 176 U 0 6144 PS
ZosDirÝT¨: -> readCatalogDir()
ZosDirÝT¨: <- readCatalogDir(-1 '')
Ý37.635¨ debug1: request 3021: sent names count 6
Ý37.673¨ debug3: Type: SSH2_FXP_READDIR
Ý37.673¨ debug1: request 3021: readdir "/-/MMITMMO.GAC.YYYYYYYY" (handle 0)
Ý37.673¨ debug3: request 3021: sent status 1
Ý37.673¨ sent status End of file
Ý37.719¨ debug3: Type: SSH2_FXP_CLOSE
Ý37.719¨ debug3: request 1929: close handle 0
Ý37.719¨ closedir "/-/MMITMMO.GAC.YYYYYYYY"
Ý37.719¨ debug3: request 1929: sent status 0
Ý37.719¨ sent status Success
Ý37.752¨ debug3: Type: SSH2_FXP_OPENDIR
Ý37.752¨ debug3: request 1110: opendir
Ý37.752¨ opendir "/-/MMITMMO.GAC.YYYYYYYY"
ZosExitInterfaceÝT¨: -> checkCommandWithFileArg(LIST /-/MMITMMO.GAC.YYYYYYYY)
ZosExitInterfaceÝT¨: <- checkCommandWithFileArg(true (module not available))
ZosDirÝT¨: -> open(MMITMMO.GAC.YYYYYYYY)
CatalogSearchÝD¨: filterKey="MMITMMO.GAC.YYYYYYYY"
CatalogSearchÝT¨: -> search()
CatalogSearchÝT¨: search: total_length=65536, min_required=0, used=185, num_fields_plus_one=6, resume=
CatalogSearchÝT¨: <- search()
CatalogSearchÝD¨: filterKey="MMITMMO.GAC.YYYYYYYY.**"
CatalogSearchÝT¨: -> search()
CatalogSearchÝT¨: search: total_length=65536, min_required=0, used=1440, num_fields_plus_one=6, resume=
CatalogSearchÝT¨: <- search()
ZosDirÝT¨: <- open(true)
Ý37.766¨ debug1: request 1110: sent handle handle 0
Ý37.813¨ debug3: Type: SSH2_FXP_READDIR
Ý37.813¨ debug1: request 3021: readdir "/-/MMITMMO.GAC.YYYYYYYY" (handle 0)
ZosDirÝT¨: -> readCatalogDir()
ZosDirÝT¨: <- readCatalogDir(0 '.zos_catalog')
Ý37.813¨ debug1: request 3021: count= 0 name= ".zos_catalog" long_name= "Volume Referred Ext Tracks Used Recfm Lrecl BlkSz Ds
ZosDirÝT¨: -> readCatalogDir()
ZosDirÝT¨: <- readCatalogDir(0 'G0001V00')
Ý37.824¨ debug1: request 3021: count= 1 name= "G0001V00" long_name= "NODRN9+ 2015/10/16 1 1 0 U 0 6144 PS
ZosDirÝT¨: -> readCatalogDir()
ZosDirÝT¨: <- readCatalogDir(0 'G0002V00')
Ý37.835¨ debug1: request 3021: count= 2 name= "G0002V00" long_name= "NODR87+ 2015/10/16 1 1 0 U 0 6144 PS
ZosDirÝT¨: -> readCatalogDir()
ZosDirÝT¨: <- readCatalogDir(0 'G0003V00')
Ý37.845¨ debug1: request 3021: count= 3 name= "G0003V00" long_name= "NODR20+ 2015/10/16 1 1 0 U 0 6144 PS
ZosDirÝT¨: -> readCatalogDir()
ZosDirÝT¨: <- readCatalogDir(0 'G0004V00')
Ý37.852¨ debug1: request 3021: count= 4 name= "G0004V00" long_name= "NODR8A+ 2015/10/20 1 9 9 U 0 6144 PS
ZosDirÝT¨: -> readCatalogDir()
ZosDirÝT¨: <- readCatalogDir(0 'G0005V00')
Ý37.860¨ debug1: request 3021: count= 5 name= "G0005V00" long_name= "NODR44+ 2015/10/20 1 176 176 U 0 6144 PS
ZosDirÝT¨: -> readCatalogDir()
ZosDirÝT¨: <- readCatalogDir(-1 '')
Ý37.860¨ debug1: request 3021: sent names count 6
Ý37.897¨ debug3: Type: SSH2_FXP_READDIR
Ý37.897¨ debug1: request 3021: readdir "/-/MMITMMO.GAC.YYYYYYYY" (handle 0)
Ý37.897¨ debug3: request 3021: sent status 1
Ý37.897¨ sent status End of file
Ý37.932¨ debug3: Type: SSH2_FXP_CLOSE
Ý37.932¨ debug3: request 1929: close handle 0
Ý37.932¨ closedir "/-/MMITMMO.GAC.YYYYYYYY"
Ý37.933¨ debug3: request 1929: sent status 0
Ý37.933¨ sent status Success
Ý38.003¨ debug3: Type: SSH2_FXP_OPEN
Ý38.003¨ debug3: request 1383: open flags 26
Ý38.003¨ open "/-/MMITMMO.GAC.YYYYYYYY/(+1)" flags WRITE,CREATE,TRUNCATE mode 0666
ZosExitInterfaceÝT¨: -> checkCommandWithFileArg(STOR /-/MMITMMO.GAC.YYYYYYYY/(+1))
ZosExitInterfaceÝT¨: <- checkCommandWithFileArg(true (module not available))
ZosDatasetÝT¨: -> open("/-/MMITMMO.GAC.YYYYYYYY/(+1)", 0x0091, 0x01B6)
CatalogSearchÝD¨: filterKey="MMITMMO.GAC.YYYYYYYY"
CatalogSearchÝT¨: -> search()
CatalogSearchÝT¨: search: total_length=65536, min_required=0, used=185, num_fields_plus_one=6, resume=
CatalogSearchÝT¨: <- search()
ZosSettingsÝD¨: Options in effect (no file pattern selected)
ZosSettingsÝD¨: .newoption=
ZosSettingsÝD¨: error.log
ZosSettingsÝD¨: gdgnt
ZosSettingsÝD¨: loglevel=T
ZosSettingsÝD¨: mode=binary
DatasetHandlerÝT¨: -> setDSN(MMITMMO.GAC.YYYYYYYY(+1))
DatasetHandlerÝT¨: <- setDSN(effectiveDSN=MMITMMO.GAC.YYYYYYYY(+1))
ZosDatasetÝD¨: InputBuffer: size=131072, useRecv=1, recvFlags=0x0
ZosDatasetÝI¨: Opening dataset MMITMMO.GAC.YYYYYYYY(+1) for write with options: gdgnt new catalog
DatasetHandlerÝT¨: -> open()
DatasetHandlerÝT¨: <- open()
ZosDatasetÝT¨: <- open()
Ý38.124¨ debug1: request 1383: sent handle handle 0
Ý38.476¨ debug3: Type: SSH2_FXP_WRITE
Ý38.476¨ debug1: request 1234: write "/-/MMITMMO.GAC.YYYYYYYY/(+1)" (handle 0) off 0 len 32329
ZosDatasetÝT¨: -> write(off=0 len=32329)
ZosDatasetÝT¨: <- write(32329, recordCount=5, totalBytesWritten=32329)
Ý38.476¨ debug3: request 1234: sent status 0
Ý38.476¨ sent status Success
Ý38.653¨ debug3: Type: SSH2_FXP_WRITE
Ý38.653¨ debug1: request 1234: write "/-/MMITMMO.GAC.YYYYYYYY/(+1)" (handle 0) off 32329 len 32329
ZosDatasetÝT¨: -> write(off=32329 len=32329)
ZosDatasetÝT¨: <- write(32329, recordCount=10, totalBytesWritten=64658)
Ý38.653¨ debug3: request 1234: sent status 0
Ý38.653¨ sent status Success
......................................................................
Ý88.506¨ debug3: Type: SSH2_FXP_WRITE
Ý88.507¨ debug1: request 1234: write "/-/MMITMMO.GAC.YYYYYYYY/(+1)" (handle 0) off 8631811 len 19070
ZosDatasetÝT¨: -> write(off=8631811 len=19070)
ZosDatasetÝT¨: <- write(19070, recordCount=1408, totalBytesWritten=8650881)
Ý88.508¨ debug3: request 1234: sent status 0
Ý88.508¨ sent status Success
Ý88.540¨ debug3: Type: SSH2_FXP_CLOSE
Ý88.540¨ debug3: request 1929: close handle 0
Ý88.540¨ close "/-/MMITMMO.GAC.YYYYYYYY/(+1)" bytes read 0 written 8650881
ZosDatasetÝT¨: -> close(forced=0 writeError=0)
ZosDatasetÝT¨: -> write(off=8650881 len=0)
ZosDatasetÝT¨: <- write(0, recordCount=1409, totalBytesWritten=8650881)
ZosDatasetÝI¨: Closing dataset //MMITMMO.GAC.YYYYYYYY.G0006V00 - 8650881 bytes received, 1409 records written
DatasetHandlerÝT¨: -> close()
DatasetHandlerÝT¨: -> freeDD(SYS00004)
DatasetHandlerÝT¨: <- freeDD(rc=0)
DatasetHandlerÝT¨: <- close()
ZosDatasetÝT¨: <- close(rc=0)
DatasetHandlerÝT¨: -> close()
DatasetHandlerÝT¨: <- close()
ZosSmf119RecordÝD¨: Unable to send SMF 119 record to monitor socket "/var/log/cozsftp.smf.sock" - EDC5111I Permission denied. (errno
ZosSmf119RecordÝI¨: User not authorized to BPX.SMF class; SMF recording disabled
ZosExitInterfaceÝT¨: -> postProcessExit()
ZosExitInterfaceÝT¨: postProcessExit: unable to load CZPOSTPR - EDC5239S Fetched module not found. (errno2=0xC4070044)
ZosExitInterfaceÝT¨: <- postProcessExit(true (module not loaded))
Ý88.558¨ debug3: request 1929: sent status 0
Ý88.559¨ sent status Success
Ý88.700¨ debug1: read eof
Ý88.700¨ session closed for local user V054305 from Ý172.16.0.25¨
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: cozsftp not liking the ls command

Post by dovetail »

Suggest you contact your client SFTP software vendor for support on how to do a "ls" with /+ setting names.
The Co:Z SFTP server trace will show a "STAT" or "LSTAT" command packet with the path name if it is being sent.
fulldraw68
Posts: 10
Joined: Mon Oct 19, 2015 5:29 pm

Re: cozsftp not liking the ls command

Post by fulldraw68 »

It looks like the1nfamous had the same issue and question in September??
And it is the "ls" list file command that is supposed to be used to set the file attributes?? Is there another way?
the1nfamous
Posts: 9
Joined: Wed May 21, 2014 4:19 am

Re: cozsftp not liking the ls command

Post by the1nfamous »

~The client decided to change software their end - believe they went for WINSCP, which happily issued the ls command. Dovetail ADMIN advised to run a trace to see what was being received from IPSwitch, but never got the chance to try it as client had already changed software - so I'd suggest getting that trace going!
Post Reply