From: elliott10 Date: Fri, 10 Aug 2018 07:24:39 +0000 (+0000) Subject: Fix the segmentation fault of ssh, and configure scp to make it work properly X-Git-Tag: android-x86-8.1-r1 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=HEAD;p=android-x86%2Fexternal-openssh.git Fix the segmentation fault of ssh, and configure scp to make it work properly --- diff --git a/config.h b/config.h index aeb2663..afdf3ed 100644 --- a/config.h +++ b/config.h @@ -1603,4 +1603,4 @@ #define _PATH_PRIVSEP_CHROOT_DIR SSHDIR "/empty" -#define _PATH_SSH_PROGRAM "/system/bin/sftp" +#define _PATH_SSH_PROGRAM "/system/bin/ssh" diff --git a/misc.c b/misc.c index cfd3272..f71bebb 100644 --- a/misc.c +++ b/misc.c @@ -208,7 +208,10 @@ pwcopy(struct passwd *pw) struct passwd *copy = xcalloc(1, sizeof(*copy)); copy->pw_name = xstrdup(pw->pw_name); - copy->pw_passwd = xstrdup(pw->pw_passwd); + /* Android does not do passwords and passes NULL for them. This breaks strlen */ + if (pw->pw_passwd) { + copy->pw_passwd = xstrdup(pw->pw_passwd); + } #ifdef HAVE_STRUCT_PASSWD_PW_GECOS copy->pw_gecos = xstrdup(pw->pw_gecos); #endif