diff options
author | Tom Cherry <tomcherry@google.com> | 2018-06-18 15:50:52 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-06-18 15:50:52 +0000 |
commit | fe80d069a0ebc8d3f3288f26adf8db733c571118 (patch) | |
tree | bc6bb0a16800d5ec629d73c409d63cc7d2f2d36a /init/host_init_verifier.cpp | |
parent | c733e5af3c4e5d712380d37f7ffcd74862c62b14 (diff) | |
parent | 290427b442f25651d835e97fe6706cafb75d84e7 (diff) | |
download | system_core-fe80d069a0ebc8d3f3288f26adf8db733c571118.tar.gz system_core-fe80d069a0ebc8d3f3288f26adf8db733c571118.tar.bz2 system_core-fe80d069a0ebc8d3f3288f26adf8db733c571118.zip |
Merge "Support oem_#### users/groups for host_init_verifier"
Diffstat (limited to 'init/host_init_verifier.cpp')
-rw-r--r-- | init/host_init_verifier.cpp | 8 |
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. } } + 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; } |