summaryrefslogtreecommitdiffhomepage
path: root/svr-chansession.c
diff options
context:
space:
mode:
Diffstat (limited to 'svr-chansession.c')
-rw-r--r--svr-chansession.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/svr-chansession.c b/svr-chansession.c
index 03ac40a..8ddbe40 100644
--- a/svr-chansession.c
+++ b/svr-chansession.c
@@ -623,7 +623,12 @@ static int noptycommand(struct Channel *channel, struct ChanSess *chansess) {
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 @@ static int ptycommand(struct Channel *channel, struct ChanSess *chansess) {
return DROPBEAR_FAILURE;
}
+#ifdef __uClinux__
+ pid = vfork();
+#else
pid = fork();
+#endif
if (pid < 0)
return DROPBEAR_FAILURE;
@@ -828,12 +837,16 @@ static void execchild(struct ChanSess *chansess) {
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();
+ reseedrandom();
+#endif
/* close file descriptors except stdin/stdout/stderr
* Need to be sure FDs are closed here to avoid reading files as root */