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