Hello b2112!
> I'm using the uClinux 2.4 kernel with a Coldfire MC5275 and I'm trying
> to build in the sshd application and I'm getting a build failure. I
> used make menuconfig and selected sshd under the networking
> applications option.
>
> In the build process I'm getting the following error;
>
> Has anyone been successful in getting sshd to build? I'm wondering if
> I'm missing something or if there is a patch available.
>
> Any help is greatly appreciated.
You can look at my patches for uClinux-20090302 for openssl and ssh.
--
Igor Plyatov
diff --git a/lib/libssl/makefile b/lib/libssl/makefile
index b6039b1..68fa4a0 100644
--- a/lib/libssl/makefile
+++ b/lib/libssl/makefile
@@ -68,13 +68,13 @@ CONFIG_OPTS += no-err
# REVISIT: It would be better to have OPENSSL config options
# which turn on this support as needed
ifeq ($(CONFIG_USER_NESSUS_NASL)$(CONFIG_USER_SSH_SSH),)
-CONFIG_OPTS += no-ripemd
-CONFIG_OPTS += no-cast
-CONFIG_OPTS += no-rc4
+#CONFIG_OPTS += no-ripemd
+#CONFIG_OPTS += no-cast
+#CONFIG_OPTS += no-rc4
endif
ifeq ($(CONFIG_USER_NESSUS_NASL)$(CONFIG_USER_SSH_SSH)$(CONFIG_PROP_SSCEP_SSCEP),)
-CONFIG_OPTS += no-bf
+#CONFIG_OPTS += no-bf
endif
ifeq ($(CONFIG_USER_OPENVPN_OPENVPN)$(CONFIG_USER_WGET),)
@@ -140,6 +140,7 @@ $(SRC_DIR)/Configure $(SRC_DIR)/config: makefile $(SRC_DIR).tar.gz \
rm -rf $(SRC_DIR) build
gunzip < $(SRC_DIR).tar.gz | tar xf -
patch -p0 < patches/$(SRC_DIR).patch
+ patch -p0 < patches/speed.patch
touch $(SRC_DIR)/Configure $(SRC_DIR)/config
else
diff --git a/lib/libssl/patches/speed.patch b/lib/libssl/patches/speed.patch
new file mode 100644
index 0000000..a3f4c6c
--- /dev/null
+++ b/lib/libssl/patches/speed.patch
@@ -0,0 +1,11 @@
+--- openssl-0.9.8i/apps/speed.c 2009-05-05 16:31:08.000000000 +0400
++++ openssl-0.9.8i/apps/speed.c 2009-05-05 16:19:25.000000000 +0400
+@@ -254,7 +254,7 @@
+ # endif
+ #endif
+
+-#if !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && !defined(OPENSSL_SYS_OS2) && !defined(OPENSSL_SYS_NETWARE)
++#if !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && !defined(OPENSSL_SYS_OS2) && !defined(OPENSSL_SYS_NETWARE) && !defined(CONFIG_COLDFIRE)
+ # define HAVE_FORK 1
+ #endif
+
diff --git a/user/ssh/auth-pam.c b/user/ssh/auth-pam.c
index 1b39552..054aedf 100644
--- a/user/ssh/auth-pam.c
+++ b/user/ssh/auth-pam.c
@@ -187,7 +187,11 @@ pthread_create(sp_pthread_t *thread, const void *attr,
struct pam_ctxt *ctx = arg;
sshpam_thread_status = -1;
+#ifdef __uClinux__
+ switch ((pid = vfork())) {
+#else
switch ((pid = fork())) {
+#endif
case -1:
error("fork(): %s", strerror(errno));
return (-1);
diff --git a/user/ssh/entropy.c b/user/ssh/entropy.c
index 8b70539..fe471cf 100644
--- a/user/ssh/entropy.c
+++ b/user/ssh/entropy.c
@@ -91,8 +91,13 @@ seed_rng(void)
fatal("pipe: %s", strerror(errno));
old_sigchld = signal(SIGCHLD, SIG_DFL);
- if ((pid = fork()) == -1)
+#ifdef __uClinux__
+ if ((pid = vfork()) == -1) {
+#else
+ if ((pid = fork()) == -1) {
+#endif
fatal("Couldn't fork: %s", strerror(errno));
+ }
if (pid == 0) {
dup2(devnull, STDIN_FILENO);
dup2(p[1], STDOUT_FILENO);
diff --git a/user/ssh/openbsd-compat/daemon.c b/user/ssh/openbsd-compat/daemon.c
index e3a6886..5006dc3 100644
--- a/user/ssh/openbsd-compat/daemon.c
+++ b/user/ssh/openbsd-compat/daemon.c
@@ -53,7 +53,11 @@ daemon(int nochdir, int noclose)
{
int fd;
+#ifdef __uClinux__
+ switch (vfork()) {
+#else
switch (fork()) {
+#endif
case -1:
return (-1);
case 0:
diff --git a/user/ssh/scp.c b/user/ssh/scp.c
index a685c93..4e4dc52 100644
--- a/user/ssh/scp.c
+++ b/user/ssh/scp.c
@@ -172,13 +172,21 @@ do_local_cmd(arglist *a)
fprintf(stderr, " %s", a->list[i]);
fprintf(stderr, "\n");
}
- if ((pid = fork()) == -1)
+#ifdef __uClinux__
+ if ((pid = vfork()) == -1) {
+#else
+ if ((pid = fork()) == -1) {
+#endif
fatal("do_local_cmd: fork: %s", strerror(errno));
-
+}
if (pid == 0) {
execvp(a->list[0], a->list);
perror(a->list[0]);
+#ifdef __uClinux__
+ _exit(1);
+#else
exit(1);
+#endif
}
do_cmd_pid = pid;
diff --git a/user/ssh/sftp.c b/user/ssh/sftp.c
index 66bd111..3087e60 100644
--- a/user/ssh/sftp.c
+++ b/user/ssh/sftp.c
@@ -253,9 +253,13 @@ local_do_shell(const char *args)
if ((shell = getenv("SHELL")) == NULL)
shell = _PATH_BSHELL;
- if ((pid = fork()) == -1)
+#ifdef __uClinux__
+ if ((pid = vfork()) == -1) {
+#else
+ if ((pid = fork()) == -1) {
+#endif
fatal("Couldn't fork: %s", strerror(errno));
-
+ }
if (pid == 0) {
/* XXX: child has pipe fds to ssh subproc open - issue? */
if (args) {
@@ -1630,8 +1634,13 @@ connect_to_server(char *path, char **args, int *in, int *out)
c_in = c_out = inout[1];
#endif /* USE_PIPES */
- if ((sshpid = fork()) == -1)
+#ifdef __uClinux__
+ if ((sshpid = vfork()) == -1) {
+#else
+ if ((sshpid = fork()) == -1) {
+#endif
fatal("fork: %s", strerror(errno));
+ }
else if (sshpid == 0) {
if ((dup2(c_in, STDIN_FILENO) == -1) ||
(dup2(c_out, STDOUT_FILENO) == -1)) {
diff --git a/user/ssh/ssh-agent.c b/user/ssh/ssh-agent.c
index 9123cfe..a3d00ab 100644
--- a/user/ssh/ssh-agent.c
+++ b/user/ssh/ssh-agent.c
@@ -1206,7 +1206,11 @@ main(int ac, char **av)
printf("echo Agent pid %ld;\n", (long)parent_pid);
goto skip;
}
+#ifdef __uClinux__
+ pid = vfork();
+#else
pid = fork();
+#endif
if (pid == -1) {
perror("fork");
cleanup_exit(1);
diff --git a/user/ssh/ssh-rand-helper.c b/user/ssh/ssh-rand-helper.c
index 8b1c4b4..bcb6691 100644
--- a/user/ssh/ssh-rand-helper.c
+++ b/user/ssh/ssh-rand-helper.c
@@ -328,7 +328,11 @@ hash_command_output(entropy_cmd_t *src, unsigned char *hash)
(void)gettimeofday(&tv_start, NULL); /* record start time */
+#ifdef __uClinux__
+ switch (pid = vfork()) {
+#else
switch (pid = fork()) {
+#endif
case -1: /* Error */
close(p[0]);
close(p[1]);
diff --git a/user/ssh/sshconnect.c b/user/ssh/sshconnect.c
index a8a1a94..53fa98f 100644
--- a/user/ssh/sshconnect.c
+++ b/user/ssh/sshconnect.c
@@ -1170,7 +1170,11 @@ ssh_local_cmd(const char *args)
if ((shell = getenv("SHELL")) == NULL)
shell = _PATH_BSHELL;
+#ifdef __uClinux__
+ pid = vfork();
+#else
pid = fork();
+#endif
if (pid == 0) {
debug3("Executing %s -c \"%s\"", shell, args);
execl(shell, shell, "-c", args, (char *)NULL);
diff --git a/user/ssh/sshd.c b/user/ssh/sshd.c
index 068e5c2..38a3306 100644
--- a/user/ssh/sshd.c
+++ b/user/ssh/sshd.c
@@ -627,7 +627,11 @@ privsep_preauth(Authctxt *authctxt)
/* Store a pointer to the kex for later rekeying */
pmonitor->m_pkex = &xxx_kex;
+#ifdef __uClinux__
+ pid = vfork();
+#else
pid = fork();
+#endif
if (pid == -1) {
fatal("fork of unprivileged child failed");
} else if (pid != 0) {
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev