diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-12-19 19:05:35 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-12-19 19:05:35 +0100 |
commit | cd15849bf2359dbd7868dcfd4f85c7da6d46f396 (patch) | |
tree | 9cb2a3143f6af7ef2a3a52786b9f0bbff11102a0 /rc/bin/rcpu | |
parent | 4f72cda4acaa92dfaddb29891d86efeea990e030 (diff) | |
download | plan9front-cd15849bf2359dbd7868dcfd4f85c7da6d46f396.tar.xz |
rcpu: avoid filedescriptor conflict with <{} (thanks mycroftiv)
the rcpu client dup's fd 0,1,2 to fd 10,11,12 which
can accidentally override the pipe file descriptor
allocated by the <{} operator. to avoid this problem,
we generate the remote script as an /env file in a
separate step now.
Diffstat (limited to 'rc/bin/rcpu')
-rwxr-xr-x | rc/bin/rcpu | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/rc/bin/rcpu b/rc/bin/rcpu index 3e9f17987..01e388ee6 100755 --- a/rc/bin/rcpu +++ b/rc/bin/rcpu @@ -80,4 +80,9 @@ fn pvar { } } -exec $connect $host <{dir=`{pwd} pvar dir cmd; builtin whatis server; echo server} client <[10=0] >[11=1] >[12=2] +>/env/rscript { + dir=`{pwd} pvar dir cmd + builtin whatis server + echo server +} +exec $connect $host /env/rscript client <[10=0] >[11=1] >[12=2] |