comparison svr-main.c @ 476:df7f7da7f6e4 pubkey-options

- Rework pubkey options to be more careful about buffer lengths. Needs review.
author Matt Johnston <matt@ucc.asn.au>
date Fri, 12 Sep 2008 17:23:56 +0000
parents 7e43f5e473b9
children 07a58e4da1ac
comparison
equal deleted inserted replaced
475:52a644e7b8e1 476:df7f7da7f6e4
264 if (pipe(childpipe) < 0) { 264 if (pipe(childpipe) < 0) {
265 TRACE(("error creating child pipe")) 265 TRACE(("error creating child pipe"))
266 goto out; 266 goto out;
267 } 267 }
268 268
269 #ifdef DEBUG_NOFORK
270 fork_ret = 0;
271 #else
269 fork_ret = fork(); 272 fork_ret = fork();
273 #endif
270 if (fork_ret < 0) { 274 if (fork_ret < 0) {
271 dropbear_log(LOG_WARNING, "error forking: %s", strerror(errno)); 275 dropbear_log(LOG_WARNING, "error forking: %s", strerror(errno));
272 goto out; 276 goto out;
273 277
274 } else if (fork_ret > 0) { 278 } else if (fork_ret > 0) {
290 294
291 m_free(remote_addr_str); 295 m_free(remote_addr_str);
292 addrstring = getaddrstring(&remoteaddr, 1); 296 addrstring = getaddrstring(&remoteaddr, 1);
293 dropbear_log(LOG_INFO, "Child connection from %s", addrstring); 297 dropbear_log(LOG_INFO, "Child connection from %s", addrstring);
294 298
299 #ifndef DEBUG_NOFORK
295 if (setsid() < 0) { 300 if (setsid() < 0) {
296 dropbear_exit("setsid: %s", strerror(errno)); 301 dropbear_exit("setsid: %s", strerror(errno));
297 } 302 }
303 #endif
298 304
299 /* make sure we close sockets */ 305 /* make sure we close sockets */
300 for (i = 0; i < listensockcount; i++) { 306 for (i = 0; i < listensockcount; i++) {
301 m_close(listensocks[i]); 307 m_close(listensocks[i]);
302 } 308 }