Lines Matching refs:username
61 static void check_passwd(const passwd* pwd, const char* username, uid_t uid, uid_type_t uid_type, in check_passwd() argument
65 EXPECT_STREQ(username, pwd->pw_name); in check_passwd()
87 static void check_getpwuid(const char* username, uid_t uid, uid_type_t uid_type, in check_getpwuid() argument
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
99 passwd* pwd = getpwnam(username); in check_getpwnam()
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
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
128 result = getpwnam_r(username, &pwd_storage, buf, sizeof(buf), &pwd); in check_getpwnam_r()
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
137 SCOPED_TRACE("username '"s + username + "'"); in check_get_passwd()
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()
158 static void expect_no_passwd_name(const char* username) { in expect_no_passwd_name() argument
159 SCOPED_TRACE("username '"s + username + "'"); in expect_no_passwd_name()
162 passwd = getpwnam(username); in expect_no_passwd_name()
168 EXPECT_EQ(ENOENT, getpwnam_r(username, &passwd_storage, buf, sizeof(buf), &passwd)); in expect_no_passwd_name()