summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorTom Cherry2018-06-14 15:40:20 -0500
committerTom Cherry2018-06-14 16:12:02 -0500
commit290427b442f25651d835e97fe6706cafb75d84e7 (patch)
tree4f2d5fa9540250a89ef51f020645c4b17bee5f17 /init
parentca57890a8049c0100d91f9974f446ad904b4cec4 (diff)
downloadplatform-system-core-290427b442f25651d835e97fe6706cafb75d84e7.tar.gz
platform-system-core-290427b442f25651d835e97fe6706cafb75d84e7.tar.xz
platform-system-core-290427b442f25651d835e97fe6706cafb75d84e7.zip
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
Diffstat (limited to 'init')
-rw-r--r--init/host_init_verifier.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/init/host_init_verifier.cpp b/init/host_init_verifier.cpp
index d6884af91..ba8ebfbb3 100644
--- a/init/host_init_verifier.cpp
+++ b/init/host_init_verifier.cpp
@@ -102,6 +102,14 @@ passwd* getpwnam(const char* login) { // NOLINT: implementing bad function.
102 } 102 }
103 } 103 }
104 104
105 unsigned int oem_uid;
106 if (sscanf(login, "oem_%u", &oem_uid) == 1) {
107 snprintf(static_name, sizeof(static_name), "%s", login);
108 static_passwd.pw_uid = oem_uid;
109 static_passwd.pw_gid = oem_uid;
110 return &static_passwd;
111 }
112
105 errno = ENOENT; 113 errno = ENOENT;
106 return nullptr; 114 return nullptr;
107} 115}