From 980506c2ffeaa6647ce953f691b35432023fcda2 Mon Sep 17 00:00:00 2001 From: elliott10 Date: Fri, 10 Aug 2018 07:24:39 +0000 Subject: [PATCH] Fix the segmentation fault of ssh, and configure scp to make it work properly --- config.h | 2 +- misc.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) 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 -- 2.11.0