Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fe80d069 authored by Tom Cherry's avatar Tom Cherry Committed by Gerrit Code Review
Browse files

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

parents c733e5af 290427b4
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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;
}