Merge "Support oem_#### users/groups for host_init_verifier"

This commit is contained in:
Tom Cherry 2018-06-18 15:50:52 +00:00 committed by Gerrit Code Review
commit fe80d069a0

View file

@ -103,6 +103,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;
}