Support oem_#### users/groups for host_init_verifier

Bug: 36970783
Test: oem_#### users and groups no longer fail in host_init_verifier
Change-Id: I48174f528994d1b225ed897328cc207bdebf07a8
This commit is contained in:
Tom Cherry 2018-06-14 13:40:20 -07:00
parent ca57890a80
commit 290427b442

View file

@ -102,6 +102,14 @@ passwd* getpwnam(const char* login) { // NOLINT: implementing bad function.
}
}
unsigned int oem_uid;
if (sscanf(login, "oem_%u", &oem_uid) == 1) {
snprintf(static_name, sizeof(static_name), "%s", login);
static_passwd.pw_uid = oem_uid;
static_passwd.pw_gid = oem_uid;
return &static_passwd;
}
errno = ENOENT;
return nullptr;
}