comparison svr-runopts.c @ 323:3bfbe95f9a14

Add -P pidfile patch from Swen Schillig
author Matt Johnston <matt@ucc.asn.au>
date Wed, 07 Jun 2006 14:10:21 +0000
parents be18c7dd486e
children 337c45621e81
comparison
equal deleted inserted replaced
322:84aa4e60bd3c 323:3bfbe95f9a14
70 "-k Disable remote port forwarding\n" 70 "-k Disable remote port forwarding\n"
71 "-a Allow connections to forwarded ports from any host\n" 71 "-a Allow connections to forwarded ports from any host\n"
72 #endif 72 #endif
73 "-p port Listen on specified tcp port, up to %d can be specified\n" 73 "-p port Listen on specified tcp port, up to %d can be specified\n"
74 " (default %s if none specified)\n" 74 " (default %s if none specified)\n"
75 "-P PidFile Create pid file PidFile\n"
76 " (default %s)\n"
75 #ifdef INETD_MODE 77 #ifdef INETD_MODE
76 "-i Start for inetd\n" 78 "-i Start for inetd\n"
77 #endif 79 #endif
78 #ifdef DEBUG_TRACE 80 #ifdef DEBUG_TRACE
79 "-v verbose\n" 81 "-v verbose\n"
83 DSS_PRIV_FILENAME, 85 DSS_PRIV_FILENAME,
84 #endif 86 #endif
85 #ifdef DROPBEAR_RSA 87 #ifdef DROPBEAR_RSA
86 RSA_PRIV_FILENAME, 88 RSA_PRIV_FILENAME,
87 #endif 89 #endif
88 DROPBEAR_MAX_PORTS, DROPBEAR_DEFPORT); 90 DROPBEAR_MAX_PORTS, DROPBEAR_DEFPORT, DROPBEAR_PIDFILE);
89 } 91 }
90 92
91 void svr_getopts(int argc, char ** argv) { 93 void svr_getopts(int argc, char ** argv) {
92 94
93 unsigned int i; 95 unsigned int i;
103 svr_opts.noauthpass = 0; 105 svr_opts.noauthpass = 0;
104 svr_opts.norootpass = 0; 106 svr_opts.norootpass = 0;
105 svr_opts.inetdmode = 0; 107 svr_opts.inetdmode = 0;
106 svr_opts.portcount = 0; 108 svr_opts.portcount = 0;
107 svr_opts.hostkey = NULL; 109 svr_opts.hostkey = NULL;
110 svr_opts.pidfile = DROPBEAR_PIDFILE;
108 #ifdef ENABLE_SVR_LOCALTCPFWD 111 #ifdef ENABLE_SVR_LOCALTCPFWD
109 svr_opts.nolocaltcp = 0; 112 svr_opts.nolocaltcp = 0;
110 #endif 113 #endif
111 #ifdef ENABLE_SVR_REMOTETCPFWD 114 #ifdef ENABLE_SVR_REMOTETCPFWD
112 svr_opts.noremotetcp = 0; 115 svr_opts.noremotetcp = 0;
182 next = &svr_opts.ports[svr_opts.portcount]; 185 next = &svr_opts.ports[svr_opts.portcount];
183 /* Note: if it doesn't actually get set, we'll 186 /* Note: if it doesn't actually get set, we'll
184 * decrement it after the loop */ 187 * decrement it after the loop */
185 svr_opts.portcount++; 188 svr_opts.portcount++;
186 } 189 }
190 break;
191 case 'P':
192 next = &svr_opts.pidfile;
187 break; 193 break;
188 #ifdef DO_MOTD 194 #ifdef DO_MOTD
189 /* motd is displayed by default, -m turns it off */ 195 /* motd is displayed by default, -m turns it off */
190 case 'm': 196 case 'm':
191 svr_opts.domotd = 0; 197 svr_opts.domotd = 0;