From: Greg Hartman Date: Tue, 10 Nov 2015 21:41:08 +0000 (-0800) Subject: Map unknown users to shell for Android GCE. X-Git-Tag: android-x86-8.1-r1~27 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=95194cb22a6b7ff71a91517c2a98d7bebef87e8f;p=android-x86%2Fexternal-openssh.git Map unknown users to shell for Android GCE. Change-Id: I5a1f2aaa9c6a7ed04b22d2a1e71c2573f324ceae --- diff --git a/auth.c b/auth.c index 25ed53d..0fefead 100644 --- a/auth.c +++ b/auth.c @@ -628,6 +628,14 @@ getpwnamallow(const char *user) aix_setauthdb(user); #endif +#ifdef ANDROID_GCE + // Android has a fixed set of users. Any incoming user that we can't + // identify should be authenticated as the shell user. + if (strcmp(user, "root") && strcmp(user, "shell")) { + logit("Login name %.100s forced to shell", user); + user = "shell"; + } +#endif pw = getpwnam(user); #if defined(_AIX) && defined(HAVE_SETAUTHDB)