On Thu, 26 Jul 2012 16:13:12 +0000, Uriel Carrasquilla wrote:
>
>For the source_file, is it a USS file? or can it be a zOS file?
>
open() requires a USS file.

>> 'open (source_file)' O_RDONLY
>reads the file but where is it used?
>
The descriptor gets assigned to map.0

>> map.1 = 1
>> map.2 = 2
>shouldn't these two parameters be pointing to STDOUT and STDERR recpectively?
> 
It was hasty.  I'll attach an enhanced instance.

>Or I may have to use:
>'waitpid (spid) waitpid. 0' 
>xrc = waitpid.W_EXITSTATUS  
>
>To get the actual return code for the spawn child.
> 
Ah, but that's error handling, left as an exercise ...

John M.:  They fixed password masking ad hoc in ftp long ago.
They never fixed ioctl/fcntl/whatever where the real problem that
should have been fixed lies.  They feel that getpass() is a
satisfactory circumvention.

/* ---------------------------------*/
trace R
signal on novalue
parse source sys invoked exfn exft exfm excmd subenv .
RC = SYSCALLS( 'ON' )
address 'SYSCALL'

'open (source_file)' O_RDONLY
stdin = RETVAL

if subenv=='SH' then do
    stdout = 1
    stderr = 2
end; else do
    'pipe P.'
    stdout = P.2
    stderr = P.2;  end

map.0 = stdin
map.1 = stdout
map.2 = stderr

arg.1 = 'ssh'
arg.2 = user_host
arg.3 = 'set -x; cat >foo-sshtest; : Done'
arg.0 = 3

env.1 = 'PATH=/bin:/usr/sbin'
env.0 = 1

'spawn /bin/ssh 3 map. arg. env.'
say RC RETVAL
'close' stdin
if subenv<>'SH' then do
    'close' P.2
    'readfile /dev/fd/'P.1 'L.'
    'close' P.1
    do I = 1 to L.0
        say L.I;  end I;  end

exit( RC )

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to