group* getgrnam(const char* name) { // NOLINT: implementing bad function. stubs_state_t* state = __stubs_state(); if (state == NULL) { return NULL; } if (android_name_to_group(&state->group_, name) != 0) { return &state->group_; } return app_id_to_group(app_id_from_name(name), state); }
passwd* getpwnam(const char* login) { // NOLINT: implementing bad function. stubs_state_t* state = __stubs_state(); if (state == NULL) { return NULL; } passwd* pw = android_name_to_passwd(state, login); if (pw != NULL) { return pw; } return app_id_to_passwd(app_id_from_name(login), state); }
passwd* getpwuid(uid_t uid) { // NOLINT: implementing bad function. stubs_state_t* state = __stubs_state(); if (state == NULL) { return NULL; } passwd* pw = android_id_to_passwd(state, uid); if (pw != NULL) { return pw; } return app_id_to_passwd(uid, state); }
group* getgrgid(gid_t gid) { // NOLINT: implementing bad function. stubs_state_t* state = __stubs_state(); if (state == NULL) { return NULL; } group* gr = android_id_to_group(&state->group_, gid); if (gr != NULL) { return gr; } return app_id_to_group(gid, state); }
struct passwd* getpwnam(const char *login) { stubs_state_t* state = __stubs_state(); if (state == NULL) return NULL; if (android_name_to_passwd(&state->passwd, login) != NULL) return &state->passwd; return app_id_to_passwd( app_id_from_name(login), state ); }
struct group* getgrnam(const char *name) { stubs_state_t* state = __stubs_state(); unsigned id; if (state == NULL) return NULL; if (android_name_to_group(&state->group, name) != 0) return &state->group; return app_id_to_group( app_id_from_name(name), state ); }
struct group* getgrgid(gid_t gid) { stubs_state_t* state = __stubs_state(); struct group* gr; if (state == NULL) return NULL; gr = android_id_to_group(&state->group, gid); if (gr != NULL) return gr; return app_id_to_group(gid, state); }
struct passwd* getpwuid(uid_t uid) { stubs_state_t* state = __stubs_state(); struct passwd* pw; if (state == NULL) return NULL; pw = &state->passwd; if ( android_id_to_passwd(pw, uid) != NULL ) return pw; return app_id_to_passwd(uid, state); }