Skip to content

Commit

Permalink
csd: Export some useful environment variables
Browse files Browse the repository at this point in the history
CSD_HOSTNAME is a known-valid hostname on which (hopefully) our script
won't have to perform too much input validation to know it's safe.

CSD_TOKEN is passed in as the "sdesktop" cookie from host scan.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
  • Loading branch information
cernekee committed Oct 28, 2012
1 parent f919a6b commit 5d87d8d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions http.c
Expand Up @@ -603,6 +603,11 @@ static int run_csd_script(struct openconnect_info *vpninfo, char *buf, int bufle
csd_argv[i++]= (char *)"-langselen";
csd_argv[i++] = NULL;

if (setenv("CSD_TOKEN", vpninfo->csd_token, 1))
goto out;
if (setenv("CSD_HOSTNAME", vpninfo->hostname, 1))
goto out;

execv(csd_argv[0], csd_argv);

out:
Expand Down

0 comments on commit 5d87d8d

Please sign in to comment.