-static int
-viewer_open_tunnel_ssh (const char *sshhost, int sshport, const char *sshuser,
- int vncport)
-{
- const char *cmd[10];
- char portstr[50], portstr2[50];
- int n = 0;
-
- if (!sshport)
- sshport = 22;
-
- snprintf (portstr, sizeof portstr, "%d", sshport);
- snprintf (portstr2, sizeof portstr2, "%d", vncport);
-
- cmd[n++] = "ssh";
- cmd[n++] = "-p";
- cmd[n++] = portstr;
- if (sshuser) {
- cmd[n++] = "-l";
- cmd[n++] = sshuser;