<div dir="ltr">Between dropbear-047 and dropbear-051 changes were made that accounted for the fact that uClinux<br>needs to use vfork instead of fork.&nbsp; However, fork was not replaced with vfork in all places.&nbsp; I moved the<br>
conditional preproccessor check for uClinux into the includes.h file, so that fork is always replaced with vfork in <br>all of the dropbear code when compiling for uClinux.&nbsp; A side effect is that the code is cleaner since you just call fork<br>
without wrapping it every time with a conditional preprocessor check.<br><br>Common subdirectories: ../../dropbear-vanilla/dropbear-0.51/debian and ../../dropbear-vfork/dropbear-0.51/debian<br>diff -up ../../dropbear-vanilla/dropbear-0.51/includes.h ../../dropbear-vfork/dropbear-0.51/includes.h<br>
--- ../../dropbear-vanilla/dropbear-0.51/includes.h&nbsp;&nbsp; &nbsp;2008-03-27 09:17:14.000000000 -0400<br>+++ ../../dropbear-vfork/dropbear-0.51/includes.h&nbsp;&nbsp; &nbsp;2008-09-19 10:50:10.000000000 -0400<br>@@ -120,6 +120,11 @@<br>&nbsp;#include &lt;libgen.h&gt;<br>
&nbsp;#endif<br>&nbsp;<br>+/* uClinux uses vfork */ <br>+#ifdef __uClinux__<br>+#define fork vfork<br>+#endif<br>+<br>&nbsp;#include &quot;libtomcrypt/src/headers/tomcrypt.h&quot;<br>&nbsp;#include &quot;libtommath/tommath.h&quot;<br>&nbsp;<br>Common subdirectories: ../../dropbear-vanilla/dropbear-0.51/libtomcrypt and ../../dropbear-vfork/dropbear-0.51/libtomcrypt<br>
Common subdirectories: ../../dropbear-vanilla/dropbear-0.51/libtommath and ../../dropbear-vfork/dropbear-0.51/libtommath<br>Common subdirectories: ../../dropbear-vanilla/dropbear-0.51/_MTN and ../../dropbear-vfork/dropbear-0.51/_MTN<br>
Only in ../../dropbear-vfork/dropbear-0.51: patch051.vfork<br>diff -up ../../dropbear-vanilla/dropbear-0.51/scp.c ../../dropbear-vfork/dropbear-0.51/scp.c<br>--- ../../dropbear-vanilla/dropbear-0.51/scp.c&nbsp;&nbsp; &nbsp;2008-03-27 09:17:15.000000000 -0400<br>
+++ ../../dropbear-vfork/dropbear-0.51/scp.c&nbsp;&nbsp; &nbsp;2008-09-19 10:43:08.000000000 -0400<br>@@ -200,11 +200,7 @@ do_cmd(char *host, char *remuser, char *<br>&nbsp;#endif /* __uClinux__ */<br>&nbsp;<br>&nbsp;&nbsp;&nbsp; &nbsp;/* Fork a child to execute the command on the remote host using ssh. */<br>
-#ifdef __uClinux__<br>-&nbsp;&nbsp; &nbsp;do_cmd_pid = vfork();<br>-#else<br>&nbsp;&nbsp;&nbsp; &nbsp;do_cmd_pid = fork();<br>-#endif /* __uClinux__ */<br>&nbsp;<br>&nbsp;&nbsp;&nbsp; &nbsp;if (do_cmd_pid == 0) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;/* Child. */<br>diff -up ../../dropbear-vanilla/dropbear-0.51/svr-chansession.c ../../dropbear-vfork/dropbear-0.51/svr-chansession.c<br>
--- ../../dropbear-vanilla/dropbear-0.51/svr-chansession.c&nbsp;&nbsp; &nbsp;2008-03-27 09:17:16.000000000 -0400<br>+++ ../../dropbear-vfork/dropbear-0.51/svr-chansession.c&nbsp;&nbsp; &nbsp;2008-09-19 10:41:42.000000000 -0400<br>@@ -650,11 +650,7 @@ static int noptycommand(struct Channel *<br>
&nbsp;&nbsp;&nbsp; &nbsp;if (pipe(errfds) != 0)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return DROPBEAR_FAILURE;<br>&nbsp;<br>-#ifdef __uClinux__<br>-&nbsp;&nbsp; &nbsp;pid = vfork();<br>-#else<br>&nbsp;&nbsp;&nbsp; &nbsp;pid = fork();<br>-#endif<br>&nbsp;<br>&nbsp;&nbsp;&nbsp; &nbsp;if (pid &lt; 0)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return DROPBEAR_FAILURE;<br>
@@ -754,11 +750,8 @@ static int ptycommand(struct Channel *ch<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return DROPBEAR_FAILURE;<br>&nbsp;&nbsp;&nbsp; &nbsp;}<br>&nbsp;&nbsp;&nbsp; &nbsp;<br>-#ifdef __uClinux__<br>-&nbsp;&nbsp; &nbsp;pid = vfork();<br>-#else<br>&nbsp;&nbsp;&nbsp; &nbsp;pid = fork();<br>-#endif<br>+<br>&nbsp;&nbsp;&nbsp; &nbsp;if (pid &lt; 0)<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return DROPBEAR_FAILURE; &nbsp; <br></div>