ftp check usage - Protocols

This is a discussion on ftp check usage - Protocols ; I have recently downloaded c-kermit 8.0.211 for solaris and am having a problem using the 'ftp check' command. I always receive a successful return status whether the file exists on the remote server or not. Any help would be greatly ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: ftp check usage

  1. ftp check usage

    I have recently downloaded c-kermit 8.0.211 for solaris and am having a
    problem using the 'ftp check' command. I always receive a successful
    return status whether the file exists on the remote server or not. Any
    help would be greatly appreciated. Thanks.


  2. Re: ftp check usage

    On 2006-12-22, robt wrote:
    : I have recently downloaded c-kermit 8.0.211 for solaris and am having a
    : problem using the 'ftp check' command. I always receive a successful
    : return status whether the file exists on the remote server or not. Any
    : help would be greatly appreciated. Thanks.
    :
    Use SET FTP DEBUG ON to see what's happening. Here's what happens when
    the connection and the FTP server are functioning properly. First we
    make the connection, CD, and enable debugging:

    C-Kermit>ftp open kermit.columbia.edu /anonymous
    Connected to kermit.columbia.edu.
    C-Kermit>cd kermit/a
    C-Kermit>set ftp debug on

    Now we try FTP CHECK for a file known to exist:

    C-Kermit>ftp check aavers.txt
    ---> TYPE A
    200 Type set to A.
    ---> PASV
    227 Entering Passive Mode (128,59,29,214,202,133)
    ---> NLST aavers.txt
    150 Opening ASCII mode data connection for file list.
    226 Transfer complete.
    LISTFILE: /tmp/ckOPaOze
    [aavers.txt]
    C-Kermit>status
    SUCCESS
    C-Kermit>

    And now for a file known not to exist:

    C-Kermit>ftp check lkjlkjlkj
    ---> TYPE A
    200 Type set to A.
    ---> PASV
    227 Entering Passive Mode (128,59,29,214,202,153)
    ---> NLST lkjlkjlkj
    550 lkjlkjlkj: No such file or directory.
    C-Kermit>status
    FAILURE
    C-Kermit>

    Works OK here!

    - Frank

  3. Re: ftp check usage

    This is what I receive on my system:
    (/usr2/prod/home/oracle/scripts/system/) C-Kermit>set ftp debug on
    (/usr2/prod/home/oracle/scripts/system/) C-Kermit>ftp open tartarus
    Connected to tartarus.
    220 tartarus FTP server (SunOS 5.8) ready.
    Name (tartarusracle): oracle
    ---> USER oracle
    331 Password required for oracle.
    Password:
    ---> PASS XXXX
    230 User oracle logged in.
    Switching LOCUS for file-management commands to REMOTE.
    ---> REST 0
    502 REST command not implemented.
    ---> SYST
    215 UNIX Type: L8 Version: SUNOS
    Remote system type is UNIX.
    ---> TYPE I
    200 Type set to I.
    Default transfer mode is BINARY
    ---> MODE S
    200 MODE S ok.
    ---> STRU F
    200 STRU F ok.
    ---> FEAT
    500 'FEAT': command not understood.
    (/usr2/prod/home/oracle/scripts/system/) C-Kermit>cd scripts
    ---> CWD scripts
    250 CWD command successful.
    (/usr2/prod/home/oracle/scripts/system/) C-Kermit>ftp check tst
    ---> TYPE A
    200 Type set to A.
    ---> PASV
    227 Entering Passive Mode (192,168,7,175,241,21)
    ---> NLST tst
    150 ASCII data connection for /bin/ls (192.168.7.99,38074) (0 bytes).
    226 ASCII Transfer complete.
    LISTFILE: /tmp/ckT9ayfB
    [/bin/ls: tst: No such file or directory]
    (/usr2/prod/home/oracle/scripts/system/) C-Kermit>status
    SUCCESS
    (/usr2/prod/home/oracle/scripts/system/) C-Kermit>

    You'll notice that even though the file 'tst' does not exist, I still
    am getting a 'SUCCESS' status.


  4. Re: ftp check usage

    robt wrote:

    > 227 Entering Passive Mode (192,168,7,175,241,21)
    > ---> NLST tst
    > 150 ASCII data connection for /bin/ls (192.168.7.99,38074) (0 bytes).
    > 226 ASCII Transfer complete.
    > LISTFILE: /tmp/ckT9ayfB
    > [/bin/ls: tst: No such file or directory]
    > (/usr2/prod/home/oracle/scripts/system/) C-Kermit>status
    > SUCCESS
    > (/usr2/prod/home/oracle/scripts/system/) C-Kermit>
    >
    > You'll notice that even though the file 'tst' does not exist, I still
    > am getting a 'SUCCESS' status.
    >


    What I believe is happening here is that the FTP server is returning

    [/bin/ls: tst: No such file or directory]

    as part of the LISTFILE output. If you examine the /tmp/ckT9ayfB
    file you should see it. If that is in fact the case, then when
    C-Kermit parses the LISTFILE searching for the specified pattern
    it does in fact find it.

    If I was debugging this problem I would request that you

    LOG DEBUG
    SET FTP DEBUG ON
    SET FTP VERBOSE ON

    repeat the test

    CLOSE DEBUG

    and then send the ftp debug output, the temporary LISTFILE, and
    the debug log output for analysis.




  5. Re: ftp check usage

    Here's the LISTFILE output:
    /bin/ls: tst: No such file or directory

    This is the ftp session:
    (/usr2/prod/home/oracle/scripts/system/) C-Kermit>log debug debug.out
    (/usr2/prod/home/oracle/scripts/system/) C-Kermit>set ftp debug on
    (/usr2/prod/home/oracle/scripts/system/) C-Kermit>set ftp verbose on
    (/usr2/prod/home/oracle/scripts/system/) C-Kermit>ftp open tartarus
    Connected to tartarus.
    220 tartarus FTP server (SunOS 5.8) ready.
    Name (tartarusracle): oracle
    ---> USER oracle
    331 Password required for oracle.
    Password:
    ---> PASS XXXX
    230 User oracle logged in.
    Switching LOCUS for file-management commands to REMOTE.
    ---> REST 0
    502 REST command not implemented.
    ---> SYST
    215 UNIX Type: L8 Version: SUNOS
    Remote system type is UNIX.
    ---> TYPE I
    200 Type set to I.
    Default transfer mode is BINARY
    ---> MODE S
    200 MODE S ok.
    ---> STRU F
    200 STRU F ok.
    ---> FEAT
    500 'FEAT': command not understood.
    (/usr2/prod/home/oracle/scripts/system/) C-Kermit>cd scripts
    ---> CWD scripts
    250 CWD command successful.
    (/usr2/prod/home/oracle/scripts/system/) C-Kermit>ftp check tst
    ---> TYPE A
    200 Type set to A.
    ---> PASV
    227 Entering Passive Mode (192,168,7,175,141,252)
    ---> NLST tst
    150 ASCII data connection for /bin/ls (192.168.7.99,40546) (0 bytes).
    226 ASCII Transfer complete.
    LISTFILE: /tmp/ck9naiav
    [/bin/ls: tst: No such file or directory]
    (/usr2/prod/home/oracle/scripts/system/) C-Kermit>status
    SUCCESS
    (/usr2/prod/home/oracle/scripts/system/) C-Kermit>close debug


    This is the logfile:
    Debug Log [C-Kermit 8.0.211, 10 Apr 2004]
    Solaris 9
    uname machine[sun4u]
    uname model [SUNW,Sun-Fire]
    uname sysname[SunOS]
    uname release[5.10]
    uname version[Generic_118833-03]
    build target[solaris9g]
    Wed Dec 27 10:47:38 2006

    byteorder=0
    Active connection: [none]
    docmd returns=1
    parser preparing to continue=-1
    parser success=1
    parser breaks out of while loop=-1
    parse top
    setint=3
    conint conistate=1
    conbgt process group test=0
    SVR4ORPOSIX jc test...
    sysconf(_SC_JOB_CONTROL)[jc]=1
    conbgt jc=1
    conbgt jcshell=1
    conbgt isatty test=1
    conbgt backgrd=0
    conint backgrd=0
    conint jc=1
    conint foreground catching signals, jc=1
    parser tlevel=-1
    parser cmd_rows=24
    parser wasclosed=0
    parser success=1
    parser nulcmd=0
    parser cmdlvl=0
    parser cmdsrc=0
    prompt sx=3220336
    prompt sy=3219296
    zzstring entry[(\v(dir)) C-Kermit>]
    zzstring entry[dir]
    zzstring while exit[dir]
    zzstring ok=1
    zzstring vname[dir]
    zzstring entry[dir]
    zzstring while exit[dir]
    zzstring ok=1
    nvlook y=3
    zgtdir SVORPOSIX CWDBL=1024
    zzstring while exit[(/usr2/prod/home/oracle/scripts/system/) C-Kermit>]
    zzstring ok=0
    cmini dpx=1
    parser top of while loop=0
    cmkey: pmsg=1
    cmkey: cmflgs=-5
    cmkey: cmswitch=0
    gtword c=115
    gtword c=101
    gtword c=116
    gtword c=32
    cmkey table length=321
    cmkey cmflgs=0
    cmkey cc=3
    cmkey gtword xc[set]=3
    cmkey gtword zz=0
    zzstring entry[set]
    zzstring while exit[set]
    zzstring ok=0
    cmkey atxbuf after *f[set]
    cmkey lookup[set]=30
    cmkey zz=0
    cmkey cmflgs=0
    cmkey crflag=0
    top-level cmkey2=30
    topcmd=30
    cmflgs=0
    cmdlvl=0
    ifcmd[cmdlvl]=0
    calling docmd()=30
    docmd entry, cx=30
    cmkey: pmsg=1
    cmkey: cmflgs=0
    cmkey: cmswitch=0
    gtword c=102
    gtword c=116
    gtword c=112
    gtword c=32
    cmkey table length=126
    cmkey cmflgs=0
    cmkey cc=3
    cmkey gtword xc[ftp]=3
    cmkey gtword zz=0
    zzstring entry[ftp]
    zzstring while exit[ftp]
    zzstring ok=0
    cmkey atxbuf after *f[ftp]
    cmkey lookup[ftp]=126
    cmkey zz=0
    cmkey cmflgs=0
    cmkey crflag=0
    cmkey: pmsg=1
    cmkey: cmflgs=0
    cmkey: cmswitch=0
    gtword c=100
    gtword c=101
    gtword c=98
    gtword c=117
    gtword c=103
    gtword c=32
    cmkey table length=22
    cmkey cmflgs=0
    cmkey cc=5
    cmkey gtword xc[debug]=5
    cmkey gtword zz=0
    zzstring entry[debug]
    zzstring while exit[debug]
    zzstring ok=0
    cmkey atxbuf after *f[debug]
    cmkey lookup[debug]=7
    cmkey zz=0
    cmkey cmflgs=0
    cmkey crflag=0
    cmkey: pmsg=1
    cmkey: cmflgs=0
    cmkey: cmswitch=0
    gtword c=111
    gtword c=110
    gtword c=8
    gtword c=110
    gtword c=10
    kstart[ch == LF]
    kstart[ch = CR]
    gtword iscontd=0
    CMD(P)[set ftp debug on]
    cmkey table length=2
    cmkey cmflgs=1
    cmkey cc=2
    cmkey gtword xc[on]=2
    cmkey gtword zz=1
    zzstring entry[on]
    zzstring while exit[on]
    zzstring ok=0
    cmkey atxbuf after *f[on]
    lookup[on]=2198344
    cmkey lookup[on]=1
    cmkey zz=1
    cmkey cmflgs=1
    cmkey crflag=1
    cmcfm: cmflgs=1
    cmcfm: atmbuf[on]
    docmd returns=1
    parser preparing to continue=-1
    parser success=1
    parser breaks out of while loop=-1
    parse top
    setint=3
    conint conistate=1
    conbgt process group test=0
    SVR4ORPOSIX jc test...
    sysconf(_SC_JOB_CONTROL)[jc]=1
    conbgt jc=1
    conbgt jcshell=1
    conbgt isatty test=1
    conbgt backgrd=0
    conint backgrd=0
    conint jc=1
    conint foreground catching signals, jc=1
    parser tlevel=-1
    parser cmd_rows=24
    parser wasclosed=0
    parser success=1
    parser nulcmd=0
    parser cmdlvl=0
    parser cmdsrc=0
    prompt sx=3220336
    prompt sy=3219296
    zzstring entry[(\v(dir)) C-Kermit>]
    zzstring entry[dir]
    zzstring while exit[dir]
    zzstring ok=1
    zzstring vname[dir]
    zzstring entry[dir]
    zzstring while exit[dir]
    zzstring ok=1
    nvlook y=3
    zgtdir SVORPOSIX CWDBL=1024
    zzstring while exit[(/usr2/prod/home/oracle/scripts/system/) C-Kermit>]
    zzstring ok=0
    cmini dpx=1
    parser top of while loop=0
    cmkey: pmsg=1
    cmkey: cmflgs=-5
    cmkey: cmswitch=0
    gtword c=115
    gtword c=101
    gtword c=116
    gtword c=32
    cmkey table length=321
    cmkey cmflgs=0
    cmkey cc=3
    cmkey gtword xc[set]=3
    cmkey gtword zz=0
    zzstring entry[set]
    zzstring while exit[set]
    zzstring ok=0
    cmkey atxbuf after *f[set]
    cmkey lookup[set]=30
    cmkey zz=0
    cmkey cmflgs=0
    cmkey crflag=0
    top-level cmkey2=30
    topcmd=30
    cmflgs=0
    cmdlvl=0
    ifcmd[cmdlvl]=0
    calling docmd()=30
    docmd entry, cx=30
    cmkey: pmsg=1
    cmkey: cmflgs=0
    cmkey: cmswitch=0
    gtword c=102
    gtword c=116
    gtword c=112
    gtword c=32
    cmkey table length=126
    cmkey cmflgs=0
    cmkey cc=3
    cmkey gtword xc[ftp]=3
    cmkey gtword zz=0
    zzstring entry[ftp]
    zzstring while exit[ftp]
    zzstring ok=0
    cmkey atxbuf after *f[ftp]
    cmkey lookup[ftp]=126
    cmkey zz=0
    cmkey cmflgs=0
    cmkey crflag=0
    cmkey: pmsg=1
    cmkey: cmflgs=0
    cmkey: cmswitch=0
    gtword c=118
    gtword c=101
    gtword c=114
    gtword c=98
    gtword c=111
    gtword c=115
    gtword c=101
    gtword c=32
    cmkey table length=22
    cmkey cmflgs=0
    cmkey cc=7
    cmkey gtword xc[verbose]=7
    cmkey gtword zz=0
    zzstring entry[verbose]
    zzstring while exit[verbose]
    zzstring ok=0
    cmkey atxbuf after *f[verbose]
    lookup[verbose-mode]=2408736
    cmkey lookup[verbose]=12
    cmkey zz=0
    cmkey cmflgs=0
    cmkey crflag=0
    cmkey: pmsg=1
    cmkey: cmflgs=0
    cmkey: cmswitch=0
    gtword c=111
    gtword c=110
    gtword c=10
    kstart[ch == LF]
    kstart[ch = CR]
    gtword iscontd=0
    CMD(P)[set ftp verbose on]
    cmkey table length=2
    cmkey cmflgs=1
    cmkey cc=2
    cmkey gtword xc[on]=2
    cmkey gtword zz=1
    zzstring entry[on]
    zzstring while exit[on]
    zzstring ok=0
    cmkey atxbuf after *f[on]
    lookup[on]=2198344
    cmkey lookup[on]=1
    cmkey zz=1
    cmkey cmflgs=1
    cmkey crflag=1
    cmcfm: cmflgs=1
    cmcfm: atmbuf[on]
    docmd returns=1
    parser preparing to continue=-1
    parser success=1
    parser breaks out of while loop=-1
    parse top
    setint=3
    conint conistate=1
    conbgt process group test=0
    SVR4ORPOSIX jc test...
    sysconf(_SC_JOB_CONTROL)[jc]=1
    conbgt jc=1
    conbgt jcshell=1
    conbgt isatty test=1
    conbgt backgrd=0
    conint backgrd=0
    conint jc=1
    conint foreground catching signals, jc=1
    parser tlevel=-1
    parser cmd_rows=24
    parser wasclosed=0
    parser success=1
    parser nulcmd=0
    parser cmdlvl=0
    parser cmdsrc=0
    prompt sx=3220336
    prompt sy=3219296
    zzstring entry[(\v(dir)) C-Kermit>]
    zzstring entry[dir]
    zzstring while exit[dir]
    zzstring ok=1
    zzstring vname[dir]
    zzstring entry[dir]
    zzstring while exit[dir]
    zzstring ok=1
    nvlook y=3
    zgtdir SVORPOSIX CWDBL=1024
    zzstring while exit[(/usr2/prod/home/oracle/scripts/system/) C-Kermit>]
    zzstring ok=0
    cmini dpx=1
    parser top of while loop=0
    cmkey: pmsg=1
    cmkey: cmflgs=-5
    cmkey: cmswitch=0
    gtword c=102
    gtword c=116
    gtword c=112
    gtword c=32
    cmkey table length=321
    cmkey cmflgs=0
    cmkey cc=3
    cmkey gtword xc[ftp]=3
    cmkey gtword zz=0
    zzstring entry[ftp]
    zzstring while exit[ftp]
    zzstring ok=0
    cmkey atxbuf after *f[ftp]
    cmkey lookup[ftp]=117
    cmkey zz=0
    cmkey cmflgs=0
    cmkey crflag=0
    top-level cmkey2=117
    topcmd=117
    cmflgs=0
    cmdlvl=0
    ifcmd[cmdlvl]=0
    calling docmd()=117
    docmd entry, cx=117
    cmfdb in->fcode=5
    cmkey: pmsg=0
    cmkey: cmflgs=0
    cmkey: cmswitch=0
    gtword c=111
    gtword c=112
    gtword c=101
    gtword c=110
    gtword c=32
    cmkey table length=45
    cmkey cmflgs=0
    cmkey cc=4
    cmkey gtword xc[open]=4
    cmkey gtword zz=0
    zzstring entry[open]
    zzstring while exit[open]
    zzstring ok=0
    cmkey atxbuf after *f[open]
    cmkey lookup[open]=16
    cmkey zz=0
    cmkey cmflgs=0
    cmkey crflag=0
    cmfdb cmkey=16
    cmfdb x=16
    cmfdb cmflgs=0
    cmfdb crflag=0
    cmfdb qmflag=0
    cmfdb esflag=0
    cmfdb out->nresult[(NULL)]=16
    cmfld xdef 1[]
    cmfld xdef 2[]=0
    cmfld atmbuf 1[open]=0
    gtword c=116
    gtword c=97
    gtword c=114
    gtword c=116
    gtword c=97
    gtword c=114
    gtword c=117
    gtword c=115
    gtword c=10
    kstart[ch == LF]
    kstart[ch = CR]
    gtword iscontd=0
    CMD(P)[ftp open tartarus]
    cmfld atmbuf 2[tartarus]=1
    cmfld gtword[tartarus]=8
    cmfld x=1
    cmfld 1[tartarus]=8
    cmfld 2[tartarus]=1
    zzstring entry[tartarus]
    zzstring while exit[tartarus]
    zzstring ok=0
    cmfld 3[tartarus]=8
    cmfld 4[tartarus]=8
    cmfld returns[tartarus]=1
    ftp open[tartarus]
    cmfdb in->fcode=5
    cmkey: pmsg=4
    cmkey: cmflgs=1
    cmkey: cmswitch=4
    cmkey table length=8
    cmkey cmflgs=1
    cmkey cc=0
    cmkey gtword xc[]=0
    cmkey gtword zz=1
    cmfdb cmkey=-3
    cmfdb x=-3
    cmfdb cmflgs=1
    cmfdb crflag=1
    cmfdb qmflag=0
    cmfdb esflag=0
    cmfdb in->fcode=3
    cmfld xdef 1[xYzBoo]
    cmfld xdef 2[xYzBoo]=-1
    cmfld atmbuf 1[]=0
    cmdgetc()[pushc]=10
    gtword c=10
    kstart[ch == LF]
    kstart[ch = CR]
    gtword iscontd=0
    cmfld atmbuf 2[]=1
    cmfld gtword[]=0
    cmfld x=1
    cmfld 1[]=0
    cmfld 2[xYzBoo]=1
    zzstring entry[xYzBoo]
    zzstring while exit[xYzBoo]
    zzstring ok=0
    cmfld 3[xYzBoo]=0
    cmfld 4[xYzBoo]=0
    cmfld returns[xYzBoo]=1
    cmfdb cmfld=1
    cmfdb x=1
    cmfdb cmflgs=1
    cmfdb crflag=1
    cmfdb qmflag=0
    cmfdb esflag=0
    cmfdb out->nresult[xYzBoo]=0
    cmfdb in->fcode=5
    cmkey: pmsg=4
    cmkey: cmflgs=1
    cmkey: cmswitch=4
    cmkey table length=8
    cmkey cmflgs=1
    cmkey cc=0
    cmkey gtword xc[]=0
    cmkey gtword zz=1
    cmfdb cmkey=-3
    cmfdb x=-3
    cmfdb cmflgs=1
    cmfdb crflag=1
    cmfdb qmflag=0
    cmfdb esflag=0
    cmfdb in->fcode=6
    cmcfm: cmflgs=-1
    cmcfm: atmbuf[]
    cmdgetc()[pushc]=10
    gtword c=10
    kstart[ch == LF]
    kstart[ch = CR]
    gtword iscontd=0
    cmfdb cmcfm=0
    cmfdb x=0
    cmfdb cmflgs=1
    cmfdb crflag=1
    cmfdb qmflag=0
    cmfdb esflag=0
    cmfdb out->nresult[(NULL)]=0
    10:48:00.043 ftp hookup B[tartarus]
    10:48:00.043 ftp hookup C[tartarus.publicans.com]
    10:48:00.043 ftp hookup socket=5
    10:48:00.043 ftp hookup HADDRLIST
    10:48:00.044 ftp hookup connect ok
    10:48:00.044 ftp hookup getsockname ok
    10:48:00.044 ftp getreply lcs=-1
    10:48:00.044 ftp getreply rcs=46
    10:48:00.044 ftp getreply fc=0
    10:48:00.055 FTP RCVD [220 tartarus FTP server (SunOS 5.8) ready.]
    10:48:00.055 ftp getreply[220 tartarus FTP server (SunOS 5.8) ready.]=2
    10:48:00.055 ftp hookup setsockopt ok
    ftp_login[(NULL)]=1
    concb constate=1
    concb cgmf=1
    concb backgrd=0
    cmini dpx=1
    prompt sx=3220336
    prompt sy=3219296
    zzstring entry[ Name (tartarusracle): ]
    zzstring while exit[ Name (tartarusracle): ]
    zzstring ok=0
    cmtxt cmflgs=-5
    gtword c=111
    gtword c=114
    gtword c=97
    gtword c=99
    gtword c=108
    gtword c=101
    gtword c=10
    kstart[ch == LF]
    kstart[ch = CR]
    gtword iscontd=0
    CMD(P)[oracle]
    ftpcmd cmd[USER]
    ftpcmd arg[oracle]
    ftpcmd lcs=-1
    ftpcmd rcs=-1
    FTP SENT [USER oracle]
    ftp getreply lcs=-1
    ftp getreply rcs=-1
    ftp getreply fc=0
    FTP RCVD [331 Password required for oracle.]
    ftp getreply[331 Password required for oracle.]=3
    setint=3
    conint conistate=1
    conbgt process group test=0
    SVR4ORPOSIX jc test...
    sysconf(_SC_JOB_CONTROL)[jc]=1
    conbgt jc=1
    conbgt jcshell=1
    conbgt isatty test=1
    conbgt backgrd=0
    conint backgrd=0
    conint jc=1
    conint foreground catching signals, jc=1
    ftpcmd cmd[PASS]
    ftpcmd arg[ch0colate]
    ftpcmd lcs=-1
    ftpcmd rcs=-1
    FTP SENT [PASS XXXX]
    ftp getreply lcs=-1
    ftp getreply rcs=-1
    ftp getreply fc=0
    FTP RCVD [230 User oracle logged in.]
    ftp getreply[230 User oracle logged in.]=2
    ftpcmd cmd[REST 0]
    ftpcmd arg[]
    ftpcmd lcs=0
    ftpcmd rcs=0
    FTP SENT [REST 0]
    ftp getreply lcs=0
    ftp getreply rcs=0
    ftp getreply fc=0
    FTP RCVD [502 REST command not implemented.]
    ftp getreply[502 REST command not implemented.]=5
    ftpcmd cmd[SYST]
    ftpcmd arg[]
    ftpcmd lcs=0
    ftpcmd rcs=0
    FTP SENT [SYST]
    ftp getreply lcs=0
    ftp getreply rcs=0
    ftp getreply fc=0
    FTP RCVD [215 UNIX Type: L8 Version: SUNOS]
    ftp getreply[215 UNIX Type: L8 Version: SUNOS]=2
    ftpcmd cmd[TYPE]
    ftpcmd arg[I]
    ftpcmd lcs=-1
    ftpcmd rcs=-1
    FTP SENT [TYPE I]
    ftp getreply lcs=-1
    ftp getreply rcs=-1
    ftp getreply fc=0
    FTP RCVD [200 Type set to I.]
    ftp getreply[200 Type set to I.]=2
    ftpcmd cmd[MODE S]
    ftpcmd arg[]
    ftpcmd lcs=0
    ftpcmd rcs=0
    FTP SENT [MODE S]
    ftp getreply lcs=0
    ftp getreply rcs=0
    ftp getreply fc=0
    FTP RCVD [200 MODE S ok.]
    ftp getreply[200 MODE S ok.]=2
    ftpcmd cmd[STRU F]
    ftpcmd arg[]
    ftpcmd lcs=0
    ftpcmd rcs=0
    FTP SENT [STRU F]
    ftp getreply lcs=0
    ftp getreply rcs=0
    ftp getreply fc=0
    FTP RCVD [200 STRU F ok.]
    ftp getreply[200 STRU F ok.]=2
    ftpcmd cmd[FEAT]
    ftpcmd arg[]
    ftpcmd lcs=0
    ftpcmd rcs=0
    FTP SENT [FEAT]
    ftp getreply lcs=0
    ftp getreply rcs=0
    ftp getreply fc=2
    FTP RCVD [500 'FEAT': command not understood.]
    ftp parsefeat[500 'FEAT': command not understood.]=-1
    ftp getreply[500 'FEAT': command not understood.]=5
    ftp cx log active[0]=0
    ftp cx log buf[]
    ztime GFTIMER gettimeofday[Wed Dec 27 10:48:03 2006
    ]=831331
    ckdate dbuf[Wed Dec 27 10:48:03 2006
    ]
    ckdate nowbuf[2006]
    ckdate nowbuf[20061227 ]
    ckdate nowbuf[20061227 10:48:03]
    ftp cx log begin[20061227 10:48:03 oracle 10753 T=FTP
    N=tartarus.publicans.com H=prometheus ]
    ftpopen ucbufsiz=8192
    ftp openftp D ftpopen success[tartarus]=1
    ftp openftp D ftpopen connected[tartarus]=1
    ftp openftp xopenftp rc=1
    docmd returns=1
    parser preparing to continue=-1
    parser success=1
    parser breaks out of while loop=-1
    parse top
    setint=3
    conint conistate=1
    conbgt process group test=0
    SVR4ORPOSIX jc test...
    sysconf(_SC_JOB_CONTROL)[jc]=1
    conbgt jc=1
    conbgt jcshell=1
    conbgt isatty test=1
    conbgt backgrd=0
    conint backgrd=0
    conint jc=1
    conint foreground catching signals, jc=1
    parser tlevel=-1
    parser cmd_rows=24
    parser wasclosed=0
    parser success=1
    parser nulcmd=0
    parser cmdlvl=0
    parser cmdsrc=0
    prompt sx=3220336
    prompt sy=3219296
    zzstring entry[(\v(dir)) C-Kermit>]
    zzstring entry[dir]
    zzstring while exit[dir]
    zzstring ok=1
    zzstring vname[dir]
    zzstring entry[dir]
    zzstring while exit[dir]
    zzstring ok=1
    nvlook y=3
    zgtdir SVORPOSIX CWDBL=1024
    zzstring while exit[(/usr2/prod/home/oracle/scripts/system/) C-Kermit>]
    zzstring ok=0
    cmini dpx=1
    parser top of while loop=0
    cmkey: pmsg=1
    cmkey: cmflgs=-5
    cmkey: cmswitch=0
    gtword c=99
    gtword c=100
    gtword c=32
    cmkey table length=321
    cmkey cmflgs=0
    cmkey cc=2
    cmkey gtword xc[cd]=2
    cmkey gtword zz=0
    zzstring entry[cd]
    zzstring while exit[cd]
    zzstring ok=0
    cmkey atxbuf after *f[cd]
    cmkey lookup[cd]=5
    cmkey zz=0
    cmkey cmflgs=0
    cmkey crflag=0
    top-level cmkey2=5
    topcmd=5
    cmflgs=0
    cmdlvl=0
    ifcmd[cmdlvl]=0
    calling docmd()=5
    docmd entry, cx=5
    cmtxt cmflgs=0
    gtword c=115
    gtword c=99
    gtword c=114
    gtword c=105
    gtword c=112
    gtword c=116
    gtword c=115
    gtword c=10
    kstart[ch == LF]
    kstart[ch = CR]
    gtword iscontd=0
    CMD(P)[cd scripts]
    cmtxt calling (*f)[scripts]=3166008
    zzstring entry[scripts]
    zzstring while exit[scripts]
    zzstring ok=0
    cmtxt (*f)[scripts]=7
    ftp doftpcwd[scripts]
    ftpcmd cmd[CWD]
    ftpcmd arg[scripts]
    ftpcmd lcs=-1
    ftpcmd rcs=-1
    FTP SENT [CWD scripts]
    ftp getreply lcs=-1
    ftp getreply rcs=-1
    ftp getreply fc=0
    FTP RCVD [250 CWD command successful.]
    ftp getreply[250 CWD command successful.]=2
    docmd returns=1
    parser preparing to continue=-1
    parser success=1
    parser breaks out of while loop=-1
    parse top
    setint=3
    conint conistate=1
    conbgt process group test=0
    SVR4ORPOSIX jc test...
    sysconf(_SC_JOB_CONTROL)[jc]=1
    conbgt jc=1
    conbgt jcshell=1
    conbgt isatty test=1
    conbgt backgrd=0
    conint backgrd=0
    conint jc=1
    conint foreground catching signals, jc=1
    parser tlevel=-1
    parser cmd_rows=24
    parser wasclosed=0
    parser success=1
    parser nulcmd=0
    parser cmdlvl=0
    parser cmdsrc=0
    prompt sx=3220336
    prompt sy=3219296
    zzstring entry[(\v(dir)) C-Kermit>]
    zzstring entry[dir]
    zzstring while exit[dir]
    zzstring ok=1
    zzstring vname[dir]
    zzstring entry[dir]
    zzstring while exit[dir]
    zzstring ok=1
    nvlook y=3
    zgtdir SVORPOSIX CWDBL=1024
    zzstring while exit[(/usr2/prod/home/oracle/scripts/system/) C-Kermit>]
    zzstring ok=0
    cmini dpx=1
    parser top of while loop=0
    cmkey: pmsg=1
    cmkey: cmflgs=-5
    cmkey: cmswitch=0
    gtword c=102
    gtword c=116
    gtword c=112
    gtword c=32
    cmkey table length=321
    cmkey cmflgs=0
    cmkey cc=3
    cmkey gtword xc[ftp]=3
    cmkey gtword zz=0
    zzstring entry[ftp]
    zzstring while exit[ftp]
    zzstring ok=0
    cmkey atxbuf after *f[ftp]
    cmkey lookup[ftp]=117
    cmkey zz=0
    cmkey cmflgs=0
    cmkey crflag=0
    top-level cmkey2=117
    topcmd=117
    cmflgs=0
    cmdlvl=0
    ifcmd[cmdlvl]=0
    calling docmd()=117
    docmd entry, cx=117
    cmfdb in->fcode=5
    cmkey: pmsg=0
    cmkey: cmflgs=0
    cmkey: cmswitch=0
    gtword c=99
    gtword c=104
    gtword c=101
    gtword c=99
    gtword c=107
    gtword c=32
    cmkey table length=45
    cmkey cmflgs=0
    cmkey cc=5
    cmkey gtword xc[check]=5
    cmkey gtword zz=0
    zzstring entry[check]
    zzstring while exit[check]
    zzstring ok=0
    cmkey atxbuf after *f[check]
    cmkey lookup[check]=35
    cmkey zz=0
    cmkey cmflgs=0
    cmkey crflag=0
    cmfdb cmkey=35
    cmfdb x=35
    cmfdb cmflgs=0
    cmfdb crflag=0
    cmfdb qmflag=0
    cmfdb esflag=0
    cmfdb out->nresult[(NULL)]=35
    cmtxt cmflgs=0
    gtword c=116
    gtword c=115
    gtword c=116
    gtword c=10
    kstart[ch == LF]
    kstart[ch = CR]
    gtword iscontd=0
    CMD(P)[ftp check tst]
    cmtxt calling (*f)[tst]=3166008
    zzstring entry[tst]
    zzstring while exit[tst]
    zzstring ok=0
    cmtxt (*f)[tst]=3
    ftp remote_files new_query=1
    ftp remote_files arg[tst]
    ftp remote_files pattern[(NULL)]
    ftp remote_files tempdir[(NULL)]
    ftp remote_files p[/tmp/]
    ftp remote_files tmpfilnam[mlsdepth][/tmp/ck9naiav]=0
    ftp remote_files ftp_xla=0
    ftp remote_files ftp_csl=-1
    ftp remote_files ftp_csr=46
    ftp remote_files mgetmethod[NLST]
    ftp remote_files whicharg[tst]
    ftp recvrequest cmd[NLST]=0
    ftp recvrequest local [/tmp/ck9naiav]
    ftp recvrequest remote[tst]=1
    ftp recvrequest pipename [(NULL)]
    ftp recvrequest xlate=0
    ftp recvrequest fcs=0
    ftp recvrequest rcs=0
    ftp recvrequest out2screen=0
    ftp recvrequest recover=0
    zchko entry[/tmp/ck9naiav]
    zchko setroot[]=0
    zchko len[/tmp/ck9naiav]=13
    zchko zchkod[/tmp/ck9naiav]=0
    isdir stat[/tmp/ck9naiav]=-1
    isdir errno=2
    zchko i=5
    zchko itsadir=1
    isdir stat[/tmp]=0
    isdir islink=0
    isdir statbuf.st_mode=17407
    zchko access ok:[/tmp]=0
    ftpcmd cmd[TYPE]
    ftpcmd arg[A]
    ftpcmd lcs=-1
    ftpcmd rcs=-1
    FTP SENT [TYPE A]
    ftp getreply lcs=-1
    ftp getreply rcs=-1
    ftp getreply fc=0
    FTP RCVD [200 Type set to A.]
    ftp getreply[200 Type set to A.]=2
    ftpcmd cmd[PASV]
    ftpcmd arg[]
    ftpcmd lcs=0
    ftpcmd rcs=0
    FTP SENT [PASV]
    ftp getreply lcs=0
    ftp getreply rcs=0
    ftp getreply fc=0
    FTP RCVD [227 Entering Passive Mode (192,168,7,175,141,252)]
    ftp getreply[227 Entering Passive Mode (192,168,7,175,141,252)]=2
    initconn connect ok
    ftp recvrequest recover E[tst]=0
    ftp recvrequest cmd[NLST]
    ftp recvrequest remote[tst]
    ftpcmd cmd[NLST]
    ftpcmd arg[tst]
    ftpcmd lcs=0
    ftpcmd rcs=0
    FTP SENT [NLST tst]
    ftp getreply lcs=0
    ftp getreply rcs=0
    ftp getreply fc=0
    FTP RCVD [150 ASCII data connection for /bin/ls (192.168.7.99,40546) (0
    bytes).]ftp getreply[150 ASCII data connection for /bin/ls
    (192.168.7.99,40546) (0 bytes).]=1
    zopeno[/tmp/ck9naiav]=3
    zopeno fcb disp=0
    zopeno fcb type=0
    zopeno fcb char=0
    zopeno setroot[]=0
    zopeno fopen arg[w]
    zopeno zobufsize=32768
    zopeno ok
    ftp recvrequest zopeno[/tmp/ck9naiav]=1
    ftp recvrequest blksize=10240
    ftp recvrequest rcvbufsiz=0
    ftp get rcvbuf malloc ok=10240
    ftp get rcvbufsiz[/tmp/ck9naiav]=10240
    ztime GFTIMER gettimeofday[Wed Dec 27 10:48:19 2006
    ]=842838
    ftp get type[/tmp/ck9naiav]=0
    ftp recvrequest ftp_dpl=1
    ftp recvrequest TYPE A xlate=0
    conchk contyp=1
    in_chk entry[0]=0
    in_chk ttyfd=-1
    in_chk ttpty=0
    in_chk ttpush=-1
    in_chk FIONREAD return code=0
    in_chk FIONREAD count=0
    in_chk FIONREAD errno=0
    ftp secure_getc recv=41
    HEXDUMP: ftp secure_getc recv (16 bytes)
    2f 62 69 6e 2f 6c 73 3a | 20 74 73 74 3a 20 4e 6f /bin/ls: tst: No
    conchk contyp=1
    in_chk entry[0]=0
    in_chk ttyfd=-1
    in_chk ttpty=0
    in_chk ttpush=-1
    in_chk FIONREAD return code=0
    in_chk FIONREAD count=0
    in_chk FIONREAD errno=0
    secure_getc recv errno[0]=0
    secure_getc returns EOF=-1
    zclose file number=3
    zoutdump zoutcnt=40
    zoutdump wrote=40
    zclose returns=1
    doftprecv2 zclose ftpcode[/tmp/ck9naiav]=150
    ztime GFTIMER gettimeofday[Wed Dec 27 10:48:19 2006
    ]=845683
    gftimer[0.005000]
    ftp getreply lcs=0
    ftp getreply rcs=0
    ftp getreply fc=0
    FTP RCVD [226 ASCII Transfer complete.]
    ftp getreply[226 ASCII Transfer complete.]=2
    ftp remote_files buf[/bin/ls: tst: No such file or directory]
    remote_files havesize=-1
    remote_files havetype=0
    remote_files havemdtm[(NULL)]
    remote_files name[/bin/ls: tst: No such file or directory]
    docmd returns=1
    parser preparing to continue=-1
    parser success=1
    parser breaks out of while loop=-1
    parse top
    setint=3
    conint conistate=1
    conbgt process group test=0
    SVR4ORPOSIX jc test...
    sysconf(_SC_JOB_CONTROL)[jc]=1
    conbgt jc=1
    conbgt jcshell=1
    conbgt isatty test=1
    conbgt backgrd=0
    conint backgrd=0
    conint jc=1
    conint foreground catching signals, jc=1
    parser tlevel=-1
    parser cmd_rows=24
    parser wasclosed=0
    parser success=1
    parser nulcmd=0
    parser cmdlvl=0
    parser cmdsrc=0
    prompt sx=3220336
    prompt sy=3219296
    zzstring entry[(\v(dir)) C-Kermit>]
    zzstring entry[dir]
    zzstring while exit[dir]
    zzstring ok=1
    zzstring vname[dir]
    zzstring entry[dir]
    zzstring while exit[dir]
    zzstring ok=1
    nvlook y=3
    zgtdir SVORPOSIX CWDBL=1024
    zzstring while exit[(/usr2/prod/home/oracle/scripts/system/) C-Kermit>]
    zzstring ok=0
    cmini dpx=1
    parser top of while loop=0
    cmkey: pmsg=1
    cmkey: cmflgs=-5
    cmkey: cmswitch=0
    gtword c=115
    gtword c=116
    gtword c=97
    gtword c=116
    gtword c=117
    gtword c=115
    gtword c=10
    kstart[ch == LF]
    kstart[ch = CR]
    gtword iscontd=0
    CMD(P)[status]
    cmkey table length=321
    cmkey cmflgs=1
    cmkey cc=6
    cmkey gtword xc[status]=6
    cmkey gtword zz=1
    zzstring entry[status]
    zzstring while exit[status]
    zzstring ok=0
    cmkey atxbuf after *f[status]
    cmkey lookup[status]=158
    cmkey zz=1
    cmkey cmflgs=1
    cmkey crflag=1
    top-level cmkey2=158
    topcmd=158
    cmflgs=1
    cmdlvl=0
    ifcmd[cmdlvl]=0
    calling docmd()=158
    docmd entry, cx=158
    cmcfm: cmflgs=1
    cmcfm: atmbuf[status]
    docmd returns=0
    parser preparing to continue=-1
    parser success=1
    parser breaks out of while loop=-1
    parse top
    setint=3
    conint conistate=1
    conbgt process group test=0
    SVR4ORPOSIX jc test...
    sysconf(_SC_JOB_CONTROL)[jc]=1
    conbgt jc=1
    conbgt jcshell=1
    conbgt isatty test=1
    conbgt backgrd=0
    conint backgrd=0
    conint jc=1
    conint foreground catching signals, jc=1
    parser tlevel=-1
    parser cmd_rows=24
    parser wasclosed=0
    parser success=1
    parser nulcmd=0
    parser cmdlvl=0
    parser cmdsrc=0
    prompt sx=3220336
    prompt sy=3219296
    zzstring entry[(\v(dir)) C-Kermit>]
    zzstring entry[dir]
    zzstring while exit[dir]
    zzstring ok=1
    zzstring vname[dir]
    zzstring entry[dir]
    zzstring while exit[dir]
    zzstring ok=1
    nvlook y=3
    zgtdir SVORPOSIX CWDBL=1024
    zzstring while exit[(/usr2/prod/home/oracle/scripts/system/) C-Kermit>]
    zzstring ok=0
    cmini dpx=1
    parser top of while loop=0
    cmkey: pmsg=1
    cmkey: cmflgs=-5
    cmkey: cmswitch=0
    gtword c=99
    gtword c=108
    gtword c=111
    gtword c=115
    gtword c=101
    gtword c=32
    cmkey table length=321
    cmkey cmflgs=0
    cmkey cc=5
    cmkey gtword xc[close]=5
    cmkey gtword zz=0
    zzstring entry[close]
    zzstring while exit[close]
    zzstring ok=0
    cmkey atxbuf after *f[close]
    cmkey lookup[close]=2
    cmkey zz=0
    cmkey cmflgs=0
    cmkey crflag=0
    top-level cmkey2=2
    topcmd=2
    cmflgs=0
    cmdlvl=0
    ifcmd[cmdlvl]=0
    calling docmd()=2
    docmd entry, cx=2
    cmkey: pmsg=1
    cmkey: cmflgs=0
    cmkey: cmswitch=0
    gtword c=100
    gtword c=101
    gtword c=98
    gtword c=117
    gtword c=103
    gtword c=10
    kstart[ch == LF]
    kstart[ch = CR]
    gtword iscontd=0
    CMD(P)[close debug]
    cmkey table length=27
    cmkey cmflgs=1
    cmkey cc=5
    cmkey gtword xc[debug]=5
    cmkey gtword zz=1
    zzstring entry[debug]
    zzstring while exit[debug]
    zzstring ok=0
    cmkey atxbuf after *f[debug]
    cmkey lookup[debug]=0
    cmkey zz=1
    cmkey cmflgs=1
    cmkey crflag=1
    cmcfm: cmflgs=1
    cmcfm: atmbuf[debug]
    Debug Log Closed
    prometheus{oracle}$


  6. Re: ftp check usage

    On 2006-12-27, robt wrote:
    : Here's the LISTFILE output:
    : /bin/ls: tst: No such file or directory
    :
    When Jeff suggested that you get a debug log, he didn't mean you should
    post it to the newsgroup. That's what kermit-support@columbia.edu is for.

    : This is the ftp session:
    : ...
    : (/usr2/prod/home/oracle/scripts/system/) C-Kermit>ftp check tst
    : ---> TYPE A
    : 200 Type set to A.
    : ---> PASV
    : 227 Entering Passive Mode (192,168,7,175,141,252)
    : ---> NLST tst
    : 150 ASCII data connection for /bin/ls (192.168.7.99,40546) (0 bytes).
    : 226 ASCII Transfer complete.
    : LISTFILE: /tmp/ck9naiav
    : [/bin/ls: tst: No such file or directory]
    : (/usr2/prod/home/oracle/scripts/system/) C-Kermit>status
    : SUCCESS
    :
    : This is the logfile:
    :
    It would have been more useful to enclose the listfile itself, which in
    this case was /tmp/ck9naiav.

    : CMD(P)[ftp check tst]
    : ftp remote_files mgetmethod[NLST]
    : ftp remote_files whicharg[tst]
    : ftp recvrequest cmd[NLST]=0
    : ftp recvrequest local [/tmp/ck9naiav]
    : zchko entry[/tmp/ck9naiav]
    : zchko len[/tmp/ck9naiav]=13
    : zchko zchkod[/tmp/ck9naiav]=0
    : ...
    : FTP SENT [NLST tst]
    : FTP RCVD [150 ASCII data connection for /bin/ls (192.168.7.99,40546) (0
    : bytes).]ftp getreply[150 ASCII data connection for /bin/ls
    : (192.168.7.99,40546) (0 bytes).]=1
    : HEXDUMP: ftp secure_getc recv (16 bytes)
    : 2f 62 69 6e 2f 6c 73 3a | 20 74 73 74 3a 20 4e 6f /bin/ls: tst: No...
    : FTP RCVD [226 ASCII Transfer complete.]
    : ftp getreply[226 ASCII Transfer complete.]=2
    : remote_files name[/bin/ls: tst: No such file or directory]
    :
    This shows that "NLST tst" resulted in the FTP sending back the following
    text on the data channel:

    /bin/ls: tst: No such file or directory

    Quoting from RFC959, the File Transfer Protocol (FTP) specification:

    NAME LIST (NLST)
    This command causes a directory listing to be sent from
    server to user site. The pathname should specify a
    directory or other system-specific file group descriptor; a
    null argument implies the current directory. The server
    will return a stream of names of files and no other
    information.

    The server is clearly in the wrong. If it followed the protocol, there
    would be no problem.

    However I can see that Kermit could defend itself better in this case.
    I'll add this to the list.

    - Frank

  7. Re: ftp check usage

    There definitely is a bug here. FTP CHECK is implemented as:

    case FTP_CHK: /* Check if remote file(s) exist(s) */
    if ((x = cmtxt("remote filename", "", &s, xxstring)) < 0)
    return(x);
    CHECKCONN();
    success = remote_files(1,(CHAR *)s,NULL,0) ? 1 : 0;
    return(success);

    The problem is that remote_files() returns a CHAR * not a success
    or failure value.

    In this case, because no pattern parameter is being specified,
    the return value is a pointer to the static buffer containing

    /bin/ls: tst: No such file or directory

    This is because in remote_files() the NLST case doesn't handle
    the situation where the server returns an error string instead
    of the file name.

    if (mgetmethod == SND_NLS) { /* NLST... */
    if (pattern) {
    if (!ckmatch((char *)pattern,p,(servertype == SYS_UNIX),1))
    goto again;
    }
    }

    The end result is that the non-NULL return is being treated as
    a success value.

    This could be fixed by treating by using the 'arg' as the 'pattern'
    in the NLST case if 'pattern' is not specified or by passing in
    'arg' as the 'pattern' into the remote_files() call in the FTP_CHK
    block.

    Jeffrey Altman
    Secure Endpoints Inc.


+ Reply to Thread