diff svr-chansession.c @ 299:740e782679be ucc-axis-hack

Various changes to compile+kind of run on UCC's axis board. Note that fprintf(stdin -> printf( accounts for many of the changes
author Matt Johnston <matt@ucc.asn.au>
date Sat, 25 Mar 2006 12:57:09 +0000
parents 541b14504870
children 8438ff0cdb74
line wrap: on
line diff
--- a/svr-chansession.c	Fri Dec 09 06:10:27 2005 +0000
+++ b/svr-chansession.c	Sat Mar 25 12:57:09 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 */
 	seedrandom();
+#endif
 
 	/* close file descriptors except stdin/stdout/stderr
 	 * Need to be sure FDs are closed here to avoid reading files as root */