Lines Matching refs:uid
61 static void check_passwd(const passwd* pwd, const char* username, uid_t uid, uid_type_t uid_type, in check_passwd() argument
67 EXPECT_EQ(uid, pwd->pw_uid); in check_passwd()
68 EXPECT_EQ(uid, pwd->pw_gid); in check_passwd()
87 static void check_getpwuid(const char* username, uid_t uid, uid_type_t uid_type, in check_getpwuid() argument
90 passwd* pwd = getpwuid(uid); in check_getpwuid()
93 check_passwd(pwd, username, uid, uid_type, check_username); in check_getpwuid()
96 static void check_getpwnam(const char* username, uid_t uid, uid_type_t uid_type, in check_getpwnam() argument
102 check_passwd(pwd, username, uid, uid_type, check_username); in check_getpwnam()
105 static void check_getpwuid_r(const char* username, uid_t uid, uid_type_t uid_type, in check_getpwuid_r() argument
113 result = getpwuid_r(uid, &pwd_storage, buf, sizeof(buf), &pwd); in check_getpwuid_r()
117 check_passwd(pwd, username, uid, uid_type, check_username); in check_getpwuid_r()
120 static void check_getpwnam_r(const char* username, uid_t uid, uid_type_t uid_type, in check_getpwnam_r() argument
132 check_passwd(pwd, username, uid, uid_type, check_username); in check_getpwnam_r()
135 static void check_get_passwd(const char* username, uid_t uid, uid_type_t uid_type, in check_get_passwd() argument
138 check_getpwuid(username, uid, uid_type, check_username); in check_get_passwd()
139 check_getpwnam(username, uid, uid_type, check_username); in check_get_passwd()
140 check_getpwuid_r(username, uid, uid_type, check_username); in check_get_passwd()
141 check_getpwnam_r(username, uid, uid_type, check_username); in check_get_passwd()
144 static void expect_no_passwd_id(uid_t uid) { in expect_no_passwd_id() argument
145 SCOPED_TRACE("uid '" + std::to_string(uid) + "'"); in expect_no_passwd_id()
148 passwd = getpwuid(uid); in expect_no_passwd_id()
154 EXPECT_EQ(ENOENT, getpwuid_r(uid, &passwd_storage, buf, sizeof(buf), &passwd)); in expect_no_passwd_id()