Farhan/openssh
Révision | 980506c2ffeaa6647ce953f691b35432023fcda2 (tree) |
---|---|
l'heure | 2018-08-13 11:41:32 |
Auteur | elliott10 <xiaoluoyuan@163....> |
Commiter | elliott10 |
Fix the segmentation fault of ssh, and configure scp to make it work properly
@@ -1603,4 +1603,4 @@ | ||
1603 | 1603 | |
1604 | 1604 | #define _PATH_PRIVSEP_CHROOT_DIR SSHDIR "/empty" |
1605 | 1605 | |
1606 | -#define _PATH_SSH_PROGRAM "/system/bin/sftp" | |
1606 | +#define _PATH_SSH_PROGRAM "/system/bin/ssh" |
@@ -208,7 +208,10 @@ pwcopy(struct passwd *pw) | ||
208 | 208 | struct passwd *copy = xcalloc(1, sizeof(*copy)); |
209 | 209 | |
210 | 210 | copy->pw_name = xstrdup(pw->pw_name); |
211 | - copy->pw_passwd = xstrdup(pw->pw_passwd); | |
211 | + /* Android does not do passwords and passes NULL for them. This breaks strlen */ | |
212 | + if (pw->pw_passwd) { | |
213 | + copy->pw_passwd = xstrdup(pw->pw_passwd); | |
214 | + } | |
212 | 215 | #ifdef HAVE_STRUCT_PASSWD_PW_GECOS |
213 | 216 | copy->pw_gecos = xstrdup(pw->pw_gecos); |
214 | 217 | #endif |