Again, it would be better to do something like the following in includes.h:<br>+#ifdef __uClinux__<br>+#define exit(x) _exit(x)<br>+#endif<br><br><div class="gmail_quote">On Tue, Oct 21, 2008 at 1:01 AM, Mike Frysinger <span dir="ltr">&lt;<a href="mailto:vapier@gentoo.org">vapier@gentoo.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c">On Saturday 20 September 2008, Jamie Lokier wrote:<br>
&gt; Farrell Aultman wrote:<br>
&gt; &gt; Between dropbear-047 and dropbear-051 changes were made that<br>
&gt; &gt; accounted for the fact that uClinux needs to use vfork instead of<br>
&gt; &gt; fork. &nbsp;However, fork was not replaced with vfork in all places. &nbsp;I<br>
&gt; &gt; moved the conditional preproccessor check for uClinux into the<br>
&gt; &gt; includes.h file, so that fork is always replaced with vfork in all<br>
&gt; &gt; of the dropbear code when compiling for uClinux. &nbsp;A side effect is<br>
&gt; &gt; that the code is cleaner since you just call fork without wrapping<br>
&gt; &gt; it every time with a conditional preprocessor check.<br>
&gt;<br>
&gt; Have you checked that it&#39;s safe to call vfork in all those places?<br>
&gt;<br>
&gt; vfork is not always a safe replacement for fork, even on uClinux where<br>
&gt; fork doesn&#39;t work.<br>
<br>
</div></div>it istn safe. &nbsp;the exit() calls need to be updated too. &nbsp;the patch i wrote is<br>
here (i could have sworn i posted it already):<br>
--- dropbear-0.51/scp.c<br>
+++ dropbear-0.51/scp.c<br>
@@ -130,13 +130,22 @@<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fprintf(stderr, &quot; %s&quot;, a-&gt;list[i]);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fprintf(stderr, &quot;\n&quot;);<br>
 &nbsp; &nbsp; &nbsp; &nbsp;}<br>
- &nbsp; &nbsp; &nbsp; if ((pid = fork()) == -1)<br>
<div class="Ih2E3d">+#ifdef __uClinux__<br>
+ &nbsp; &nbsp; &nbsp; pid = vfork();<br>
+#else<br>
+ &nbsp; &nbsp; &nbsp; pid = fork();<br>
</div>+#endif /* __uClinux__ */<br>
+ &nbsp; &nbsp; &nbsp; if (pid == -1)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fatal(&quot;do_local_cmd: fork: %s&quot;, strerror(errno));<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;if (pid == 0) {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;execvp(a-&gt;list[0], a-&gt;list);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;perror(a-&gt;list[0]);<br>
+#ifdef __uClinux__<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _exit(1);<br>
+#else<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit(1);<br>
+#endif /* __uClinux__ */<br>
 &nbsp; &nbsp; &nbsp; &nbsp;}<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;do_cmd_pid = pid;<br>
@@ -225,7 +234,11 @@<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;execvp(ssh_program, args.list);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;perror(ssh_program);<br>
+#ifndef __uClinux__<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit(1);<br>
+#else<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _exit(1);<br>
+#endif /* __uClinux__ */<br>
 &nbsp; &nbsp; &nbsp; &nbsp;} else if (do_cmd_pid == -1) {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fatal(&quot;fork: %s&quot;, strerror(errno));<br>
 &nbsp; &nbsp; &nbsp; &nbsp;}<br>
<font color="#888888">-mike<br>
</font></blockquote></div><br>