X-Git-Url: https://git.distorted.org.uk/~mdw/with-authinfo-kludge/blobdiff_plain/68464b27da62c94b61822c1bd57aef4f6b9e3821..c8e6d566efc13deefae2c292112d13c3fc44dc49:/with-authinfo-kludge diff --git a/with-authinfo-kludge b/with-authinfo-kludge index d1bb048..3e3f95a 100755 --- a/with-authinfo-kludge +++ b/with-authinfo-kludge @@ -21,7 +21,7 @@ ### along with this program; if not, write to the Free Software Foundation, ### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -my $VERSION = "0.1.1"; +my $VERSION = "0.1.2"; use strict; @@ -831,13 +831,19 @@ sub run_client (@) { my (@args) = @_; inform "starting client"; + pipe my $r, my $w or sysfail "failed to create pipe: $!"; defined (my $kid = myfork) or sysfail "failed to fork: $!"; if (!$kid) { hack_noip_env \%CLIENT_NOIP, "$SESSDIR/noip-client"; setpgid $$, $$ or sysfail "failed to set kid process group: $!"; + close $w; close $r; my $prog = $args[0]; exec @args or sysfail "failed to exec `$prog': $!"; } + close $w; + defined sysread $r, my $buf, 1 + or sysfail "failed to read pipe: $!"; + close $r; $CLIENTKID = $kid; write_to_file "$SESSDIR/client.pid", "$kid\n"; maybe_foreground_client;