<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. However, fork was not replaced with vfork in all places. 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. 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 2008-03-27 09:17:14.000000000 -0400<br>+++ ../../dropbear-vfork/dropbear-0.51/includes.h 2008-09-19 10:50:10.000000000 -0400<br>@@ -120,6 +120,11 @@<br> #include <libgen.h><br>
#endif<br> <br>+/* uClinux uses vfork */ <br>+#ifdef __uClinux__<br>+#define fork vfork<br>+#endif<br>+<br> #include "libtomcrypt/src/headers/tomcrypt.h"<br> #include "libtommath/tommath.h"<br> <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 2008-03-27 09:17:15.000000000 -0400<br>
+++ ../../dropbear-vfork/dropbear-0.51/scp.c 2008-09-19 10:43:08.000000000 -0400<br>@@ -200,11 +200,7 @@ do_cmd(char *host, char *remuser, char *<br> #endif /* __uClinux__ */<br> <br> /* Fork a child to execute the command on the remote host using ssh. */<br>
-#ifdef __uClinux__<br>- do_cmd_pid = vfork();<br>-#else<br> do_cmd_pid = fork();<br>-#endif /* __uClinux__ */<br> <br> if (do_cmd_pid == 0) {<br> /* 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 2008-03-27 09:17:16.000000000 -0400<br>+++ ../../dropbear-vfork/dropbear-0.51/svr-chansession.c 2008-09-19 10:41:42.000000000 -0400<br>@@ -650,11 +650,7 @@ static int noptycommand(struct Channel *<br>
if (pipe(errfds) != 0)<br> return DROPBEAR_FAILURE;<br> <br>-#ifdef __uClinux__<br>- pid = vfork();<br>-#else<br> pid = fork();<br>-#endif<br> <br> if (pid < 0)<br> return DROPBEAR_FAILURE;<br>
@@ -754,11 +750,8 @@ static int ptycommand(struct Channel *ch<br> return DROPBEAR_FAILURE;<br> }<br> <br>-#ifdef __uClinux__<br>- pid = vfork();<br>-#else<br> pid = fork();<br>-#endif<br>+<br> if (pid < 0)<br>
return DROPBEAR_FAILURE; <br></div>