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
diff --git a/init/host_init_verifier.cpp b/init/host_init_verifier.cpp
index d6884af..ba8ebfb 100644
--- a/init/host_init_verifier.cpp
+++ b/init/host_init_verifier.cpp
@@ -102,6 +102,14 @@
}
}
+ 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;
}