Skip to content

Commit

Permalink
Do not call vpn_progress() after forking
Browse files Browse the repository at this point in the history
It's suboptimal that we only write to stderr, but calling the progress_fn
from a fork is going to cause all kinds of problems. Either we leave it
as it is or we come up with a saner way of passing the message back.

Perhaps a *new* 'child_write_progress' function which the caller can
provide, which does IPC or something. For now, stderr will suffice.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Oct 31, 2014
1 parent 4ba102a commit be40969
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tun.c
Expand Up @@ -472,12 +472,12 @@ int openconnect_setup_tun_script(struct openconnect_info *vpninfo,
return -EIO;
} else if (!child) {
if (setpgid(0, getpid()) < 0)
vpn_perror(vpninfo, _("setpgid"));
perror(_("setpgid"));
close(fds[0]);
script_setenv_int(vpninfo, "VPNFD", fds[1]);
apply_script_env(vpninfo->script_env);
execl("/bin/sh", "/bin/sh", "-c", vpninfo->vpnc_script, NULL);
vpn_perror(vpninfo, _("execl"));
perror(_("execl"));
exit(1);
}
close(fds[1]);
Expand Down

0 comments on commit be40969

Please sign in to comment.