summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorTom Cherry2018-06-18 10:50:52 -0500
committerGerrit Code Review2018-06-18 10:50:52 -0500
commitfe80d069a0ebc8d3f3288f26adf8db733c571118 (patch)
treebc6bb0a16800d5ec629d73c409d63cc7d2f2d36a /init
parentc733e5af3c4e5d712380d37f7ffcd74862c62b14 (diff)
parent290427b442f25651d835e97fe6706cafb75d84e7 (diff)
downloadplatform-system-core-fe80d069a0ebc8d3f3288f26adf8db733c571118.tar.gz
platform-system-core-fe80d069a0ebc8d3f3288f26adf8db733c571118.tar.xz
platform-system-core-fe80d069a0ebc8d3f3288f26adf8db733c571118.zip
Merge "Support oem_#### users/groups for host_init_verifier"
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 3e510e72c..7e93b448c 100644
--- a/init/host_init_verifier.cpp
+++ b/init/host_init_verifier.cpp
@@ -103,6 +103,14 @@ passwd* getpwnam(const char* login) { // NOLINT: implementing bad function.
103 } 103 }
104 } 104 }
105 105
106 unsigned int oem_uid;
107 if (sscanf(login, "oem_%u", &oem_uid) == 1) {
108 snprintf(static_name, sizeof(static_name), "%s", login);
109 static_passwd.pw_uid = oem_uid;
110 static_passwd.pw_gid = oem_uid;
111 return &static_passwd;
112 }
113
106 errno = ENOENT; 114 errno = ENOENT;
107 return nullptr; 115 return nullptr;
108} 116}