diff svr-chansession.c @ 274:8438ff0cdb74

merge of 50848a51c2f9867bc10e81826190dbc326ea16b9 and 84e3597daa468534c4a34231ae8761f841a0f5ae
author Matt Johnston <matt@ucc.asn.au>
date Tue, 28 Feb 2006 04:04:27 +0000
parents 3be7ae2e8dfa 02a80ce2ead4
children 1f5ec029dfe8
line wrap: on
line diff
--- a/svr-chansession.c	Sat Feb 11 15:15:37 2006 +0000
+++ b/svr-chansession.c	Tue Feb 28 04:04:27 2006 +0000
@@ -623,7 +623,12 @@
 	if (pipe(errfds) != 0)
 		return DROPBEAR_FAILURE;
 
+#ifdef __uClinux__
+	pid = vfork();
+#else
 	pid = fork();
+#endif
+
 	if (pid < 0)
 		return DROPBEAR_FAILURE;
 
@@ -714,7 +719,11 @@
 		return DROPBEAR_FAILURE;
 	}
 	
+#ifdef __uClinux__
+	pid = vfork();
+#else
 	pid = fork();
+#endif
 	if (pid < 0)
 		return DROPBEAR_FAILURE;
 
@@ -828,12 +837,16 @@
 	char * baseshell = NULL;
 	unsigned int i;
 
+    /* with uClinux we'll have vfork()ed, so don't want to overwrite the
+     * hostkey. can't think of a workaround to clear it */
+#ifndef __uClinux__
 	/* wipe the hostkey */
 	sign_key_free(svr_opts.hostkey);
 	svr_opts.hostkey = NULL;
 
 	/* overwrite the prng state */
 	reseedrandom();
+#endif
 
 	/* close file descriptors except stdin/stdout/stderr
 	 * Need to be sure FDs are closed here to avoid reading files as root */