From fde5906b303f0374e460f324504790026b233b71 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 14 Feb 2016 05:18:33 +0100 Subject: adding experimental rcpu service this is a reimplementation of cpu and import utilities in rc using a tlsclient and tlssrv as the encryption and authentication layers. there is only one new service, which after authentication and encryption setup accepts an arbitrary rc script over the network and executes it with the standard filedescriptors redirected to the conversaion (this is *after* authentication and in the context of the authorized user). the new rcpu program has a few improvements over cpu(1): - doesnt mangle program arguments - the remote process will get the clients standard file descriptors, so error and output are separated and you can consume the clients input from the remote side :-) - forwards error status of remote process theres no backwards mode for rimport, but a new program called rexport for the same purpose. all these services use exportfs without the bolted on initial handshake, so the hope is to clean up exportfs in the future and remove all the ugly crap in there. --- rc/bin/service/tcp17019 | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 rc/bin/service/tcp17019 (limited to 'rc/bin/service') diff --git a/rc/bin/service/tcp17019 b/rc/bin/service/tcp17019 new file mode 100755 index 000000000..3b12d7ba5 --- /dev/null +++ b/rc/bin/service/tcp17019 @@ -0,0 +1,8 @@ +#!/bin/rc +netdir=$3 +remote=$2!`{cat $3/remote} +fn server { + echo -n $netdir $remote >/proc/$pid/args + . <{n=`{read} && ! ~ $#n 0 && read -c $n} >[2=1] +} +exec tlssrv -a /bin/rc -c server -- cgit v1.2.3