diff svr-runopts.c @ 258:306499676384

* add -g (dbclient) and -a (dropbear) options for allowing non-local hosts to connect to forwarded ports. Rearranged various some of the tcp listening code. * changed to /* */ style brackets in svr-authpam.c
author Matt Johnston <matt@ucc.asn.au>
date Sun, 04 Dec 2005 16:13:11 +0000
parents 0cfba3034be5
children be18c7dd486e 740e782679be
line wrap: on
line diff
--- a/svr-runopts.c	Wed Nov 30 10:11:24 2005 +0000
+++ b/svr-runopts.c	Sun Dec 04 16:13:11 2005 +0000
@@ -63,13 +63,14 @@
 					"-s		Disable password logins\n"
 					"-g		Disable password logins for root\n"
 #endif
-#ifndef DISABLE_LOCALTCPFWD
+#ifdef ENABLE_SVR_LOCALTCPFWD
 					"-j		Disable local port forwarding\n"
 #endif
-#ifndef DISABLE_REMOTETCPFWD
+#ifdef ENABLE_SVR_REMOTETCPFWD
 					"-k		Disable remote port forwarding\n"
+					"-a		Allow connections to forwarded ports from any host\n"
 #endif
-					"-p port	Listen on specified tcp port, up to %d can be specified\n"
+					"-p port		Listen on specified tcp port, up to %d can be specified\n"
 					"		(default %s if none specified)\n"
 #ifdef INETD_MODE
 					"-i		Start for inetd\n"
@@ -104,8 +105,8 @@
 	svr_opts.inetdmode = 0;
 	svr_opts.portcount = 0;
 	svr_opts.hostkey = NULL;
-	opts.nolocaltcp = 0;
-	opts.noremotetcp = 0;
+	svr_opts.nolocaltcp = 0;
+	svr_opts.noremotetcp = 0;
 	/* not yet
 	opts.ipv4 = 1;
 	opts.ipv6 = 1;
@@ -116,6 +117,9 @@
 #ifndef DISABLE_SYSLOG
 	svr_opts.usingsyslog = 1;
 #endif
+#ifdef ENABLE_SVR_REMOTETCPFWD
+	opts.listen_fwd_all = 0;
+#endif
 
 	for (i = 1; i < (unsigned int)argc; i++) {
 		if (next) {
@@ -152,12 +156,15 @@
 #endif
 #ifndef DISABLE_LOCALTCPFWD
 				case 'j':
-					opts.nolocaltcp = 1;
+					svr_opts.nolocaltcp = 1;
 					break;
 #endif
 #ifndef DISABLE_REMOTETCPFWD
 				case 'k':
-					opts.noremotetcp = 1;
+					svr_opts.noremotetcp = 1;
+					break;
+				case 'a':
+					opts.listen_fwd_all = 1;
 					break;
 #endif
 #ifdef INETD_MODE