summaryrefslogtreecommitdiffhomepage
path: root/svr-runopts.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2005-12-04 16:13:11 +0000
committerMatt Johnston <matt@ucc.asn.au>2005-12-04 16:13:11 +0000
commita673d609639b180eee3a4ba49d7f07d0239ea666 (patch)
treecc1c3b4f3d9d52b79861942a360bca266e98bdcb /svr-runopts.c
parent736f370dce614b717193f45d084e9e009de723ce (diff)
* 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 --HG-- extra : convert_revision : c1e04e648867db464fe9818c4910e4320cd50c32
Diffstat (limited to 'svr-runopts.c')
-rw-r--r--svr-runopts.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/svr-runopts.c b/svr-runopts.c
index 375797b..6c42fb4 100644
--- a/svr-runopts.c
+++ b/svr-runopts.c
@@ -63,13 +63,14 @@ static void printhelp(const char * progname) {
"-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 @@ void svr_getopts(int argc, char ** argv) {
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 @@ void svr_getopts(int argc, char ** argv) {
#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 @@ void svr_getopts(int argc, char ** argv) {
#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