commit - 1a869946e73a979f94ad32a359be1f462484f5e9
commit + 79313907d62183c09f6921bf623019912aacfa15
blob - a8b34106b844c70e975f9d72197bc876965435e8
blob + 7fd4e15052ba68d3bca88c3003411c9cfe8238e6
--- lstun.c
+++ lstun.c
int rport; /* ssh port */
const char *addr; /* our addr */
-const char *ssh_tunnel_flag;
+const char *ssh_tflag;
const char *ssh_dest;
char ssh_host[256];
case -1:
err(1, "fork");
case 0:
- execl(SSH_PATH, "ssh", "-L", ssh_tunnel_flag,
- "-NTq", ssh_dest, NULL);
+ execl(SSH_PATH, "ssh", "-L", ssh_tflag, "-NTq", ssh_dest,
+ NULL);
err(1, "exec");
default:
/* TODO: wait just a bit to let ssh to do its things */
{
const char *c;
- if (isdigit(*ssh_tunnel_flag)) {
+ if (isdigit(*ssh_tflag)) {
strlcpy(ssh_host, "localhost", sizeof(ssh_host));
- if (copysec(ssh_tunnel_flag, ssh_port, sizeof(ssh_port))
- == NULL)
+ if (copysec(ssh_tflag, ssh_port, sizeof(ssh_port)) == NULL)
goto err;
return;
}
- if ((c = copysec(ssh_tunnel_flag, ssh_host, sizeof(ssh_host)))
- == NULL)
+ if ((c = copysec(ssh_tflag, ssh_host, sizeof(ssh_host))) == NULL)
goto err;
if (copysec(c+1, ssh_port, sizeof(ssh_port)) == NULL)
goto err;
while ((ch = getopt(argc, argv, "B:b:t:")) != -1) {
switch (ch) {
case 'B':
- ssh_tunnel_flag = optarg;
+ ssh_tflag = optarg;
parse_tflag();
break;
case 'b':
argc -= optind;
argv += optind;
- if (argc != 1 || addr == NULL || ssh_tunnel_flag == NULL)
+ if (argc != 1 || addr == NULL || ssh_tflag == NULL)
usage();
if (tout == 0)