--- user/dropbear/config.h.in_orig 2007-10-27 22:03:24.000000000 +0800 +++ user/dropbear/config.h.in 2007-10-27 22:04:00.000000000 +0800 @@ -22,7 +22,7 @@ #undef CONF_WTMP_FILE /* Disable use of lastlog() */ -#undef DISABLE_LASTLOG +#define DISABLE_LASTLOG=y /* Use PAM */ #undef DISABLE_PAM --- user/dropbear/Makefile.in_orig 2007-10-27 22:07:14.000000000 +0800 +++ user/dropbear/Makefile.in 2007-10-27 22:07:47.000000000 +0800 @@ -10,7 +10,7 @@ # Hopefully that seems intuitive. ifndef PROGRAMS - PROGRAMS=dropbear dbclient dropbearkey dropbearconvert + PROGRAMS=dropbear dbclient dropbearkey dropbearconvert ssh scp endif LTC=libtomcrypt/libtomcrypt.a --- user/dropbear/Makefile_orig 2007-10-27 22:05:30.000000000 +0800 +++ user/dropbear/Makefile 2007-10-27 22:10:53.000000000 +0800 @@ -1,5 +1,5 @@ all: build/Makefile - $(MAKE) -C build MULTI=1 + $(MAKE) -C build MULTI=1 SCPPROGRESS=1 PROGRAMS="dropbear dropbearkey dropbearconvert dbclient ssh scp" CFLAGS += -I$(ROOTDIR)/lib/zlib build/Makefile: @@ -29,6 +29,8 @@ $(ROMFSINST) -e CONFIG_USER_DROPBEAR_DROPBEAR build/dropbearmulti /bin/dropbear $(ROMFSINST) -e CONFIG_USER_DROPBEAR_DROPBEAR -s dropbear /bin/dropbearkey $(ROMFSINST) -e CONFIG_USER_DROPBEAR_DROPBEAR -s dropbear /bin/dbclient + $(ROMFSINST) -e CONFIG_USER_DROPBEAR_DROPBEAR -s dropbear /bin/ssh + $(ROMFSINST) -e CONFIG_USER_DROPBEAR_DROPBEAR -s dropbear /bin/scp $(ROMFSINST) -e CONFIG_USER_DROPBEAR_DROPBEAR \ -a "ssh stream tcp nowait root /bin/dropbear -i 2 > /dev/null" /etc/inetd.conf --- user/dropbear/svr-main.c_orig 2007-10-28 19:57:51.000000000 +0800 +++ user/dropbear/svr-main.c 2007-10-28 19:55:04.000000000 +0800 @@ -264,7 +264,11 @@ goto out; } +#ifdef __uClinux__ + fork_ret = vfork(); +#else fork_ret = fork(); +#endif if (fork_ret < 0) { dropbear_log(LOG_WARNING, "error forking: %s", strerror(errno)); goto out; --- user/dropbear/compat.c_orig 2007-10-28 19:59:39.000000000 +0800 +++ user/dropbear/compat.c 2007-10-28 20:00:13.000000000 +0800 @@ -162,7 +162,11 @@ int fd; +#ifdef __uClinux__ + switch (vfork()) { +#else switch (fork()) { +#endif case -1: return (-1); case 0: --- user/dropbear/cli-authpasswd.c_orig 2007-10-28 19:59:17.000000000 +0800 +++ user/dropbear/cli-authpasswd.c 2007-10-28 19:57:00.000000000 +0800 @@ -64,7 +64,11 @@ return NULL; } +#ifdef __uClinux__ + pid = vfork(); +#else pid = fork(); +#endif if (pid < 0) { TRACE(("fork error")) --- user/dropbear/options.h_orig 2007-11-21 22:14:07.000000000 +0800 +++ user/dropbear/options.h 2007-11-21 22:14:04.000000000 +0800 @@ -111,7 +111,7 @@ /* Whether to print the message of the day (MOTD). This doesn't add much code * size */ -#define DO_MOTD +/*#define DO_MOTD*/ /* The MOTD file path */ #ifndef MOTD_FILENAME @@ -197,7 +197,7 @@ /* This is used by the scp binary when used as a client binary. If you're * not using the Dropbear client, you'll need to change it */ -#define _PATH_SSH_PROGRAM "/usr/bin/dbclient" +#define _PATH_SSH_PROGRAM "/bin/dbclient" /* Multi-purpose binary configuration has now moved. Look at the top * of the Makefile for instructions, or INSTALL */ --- user/dropbear/scp.c_orig 2006-09-30 09:14:49.000000000 +0800 +++ user/dropbear/scp.c 2007-11-27 21:34:24.000000000 +0800 @@ -130,7 +130,11 @@ fprintf(stderr, " %s", a->list[i]); fprintf(stderr, "\n"); } +#ifdef __uClinux__ + if ((pid = vfork()) == -1) +#else if ((pid = fork()) == -1) +#endif fatal("do_local_cmd: fork: %s", strerror(errno)); if (pid == 0) { @@ -191,7 +195,7 @@ /* uClinux needs to build the args here before vforking, otherwise we do it later on. */ -#ifdef __uClinux__ +#ifndef __uClinux__ replacearg(&args, 0, "%s", ssh_program); if (remuser != NULL) addargs(&args, "-l%s", remuser); @@ -200,7 +204,7 @@ #endif /* __uClinux__ */ /* Fork a child to execute the command on the remote host using ssh. */ -#ifndef __uClinux__ +#ifdef __uClinux__ do_cmd_pid = vfork(); #else do_cmd_pid = fork(); @@ -215,7 +219,7 @@ close(pin[0]); close(pout[1]); -#ifndef __uClinux__ +#ifdef __uClinux__ replacearg(&args, 0, "%s", ssh_program); if (remuser != NULL) addargs(&args, "-l%s", remuser); @@ -308,10 +312,12 @@ memset(&args, '\0', sizeof(args)); args.list = NULL; addargs(&args, "%s", ssh_program); +#ifndef __uClinux__ addargs(&args, "-x"); addargs(&args, "-oForwardAgent no"); addargs(&args, "-oPermitLocalCommand no"); addargs(&args, "-oClearAllForwardings yes"); +#endif fflag = tflag = 0; while ((ch = getopt(argc, argv, "dfl:prtvBCc:i:P:q1246S:o:F:")) != -1)