Skip to content

Commit

Permalink
Map unknown users to shell for Android GCE.
Browse files Browse the repository at this point in the history
Change-Id: I5a1f2aaa9c6a7ed04b22d2a1e71c2573f324ceae
  • Loading branch information
ghartman17022 committed Nov 10, 2015
1 parent 3337c70 commit 95194cb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions auth.c
Expand Up @@ -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)
Expand Down

0 comments on commit 95194cb

Please sign in to comment.