• Home
  • Raw
  • Download

Lines Matching refs:pwd

57 static void check_passwd(const passwd* pwd, const char* username, uid_t uid, uid_type_t uid_type,  in check_passwd()  argument
59 ASSERT_TRUE(pwd != nullptr); in check_passwd()
61 EXPECT_STREQ(username, pwd->pw_name); in check_passwd()
63 EXPECT_EQ(uid, pwd->pw_uid); in check_passwd()
64 EXPECT_EQ(uid, pwd->pw_gid); in check_passwd()
65 EXPECT_EQ(nullptr, pwd->pw_passwd); in check_passwd()
67 EXPECT_EQ(nullptr, pwd->pw_gecos); in check_passwd()
71 EXPECT_STREQ("/data", pwd->pw_dir); in check_passwd()
73 EXPECT_STREQ("/", pwd->pw_dir); in check_passwd()
77 EXPECT_STREQ("/vendor/bin/sh", pwd->pw_shell); in check_passwd()
79 EXPECT_STREQ("/system/bin/sh", pwd->pw_shell); in check_passwd()
86 passwd* pwd = getpwuid(uid); in check_getpwuid() local
89 check_passwd(pwd, username, uid, uid_type, check_username); in check_getpwuid()
95 passwd* pwd = getpwnam(username); in check_getpwnam() local
98 check_passwd(pwd, username, uid, uid_type, check_username); in check_getpwnam()
108 passwd* pwd = nullptr; in check_getpwuid_r() local
109 result = getpwuid_r(uid, &pwd_storage, buf, sizeof(buf), &pwd); in check_getpwuid_r()
113 check_passwd(pwd, username, uid, uid_type, check_username); in check_getpwuid_r()
123 passwd* pwd = nullptr; in check_getpwnam_r() local
124 result = getpwnam_r(username, &pwd_storage, buf, sizeof(buf), &pwd); in check_getpwnam_r()
128 check_passwd(pwd, username, uid, uid_type, check_username); in check_getpwnam_r()
152 TEST(pwd, getpwnam_system_id_root) { in TEST() argument
156 TEST(pwd, getpwnam_system_id_system) { in TEST() argument
160 TEST(pwd, getpwnam_app_id_radio) { in TEST() argument
164 TEST(pwd, getpwnam_oem_id_5000) { in TEST() argument
168 TEST(pwd, getpwnam_oem_id_5999) { in TEST() argument
172 TEST(pwd, getpwnam_oem_id_2900) { in TEST() argument
176 TEST(pwd, getpwnam_oem_id_2999) { in TEST() argument
180 TEST(pwd, getpwnam_app_id_nobody) { in TEST() argument
184 TEST(pwd, getpwnam_app_id_u0_a0) { in TEST() argument
188 TEST(pwd, getpwnam_app_id_u0_a1234) { in TEST() argument
193 TEST(pwd, getpwnam_app_id_u0_a49999) { in TEST() argument
197 TEST(pwd, getpwnam_app_id_u0_i1) { in TEST() argument
201 TEST(pwd, getpwnam_app_id_u1_root) { in TEST() argument
205 TEST(pwd, getpwnam_app_id_u1_radio) { in TEST() argument
209 TEST(pwd, getpwnam_app_id_u1_a0) { in TEST() argument
213 TEST(pwd, getpwnam_app_id_u1_a40000) { in TEST() argument
217 TEST(pwd, getpwnam_app_id_u1_i0) { in TEST() argument
275 TEST(pwd, getpwent_iterate) { in TEST() argument
277 passwd* pwd; in TEST() local
281 while ((pwd = getpwent()) != nullptr) { in TEST()
282 ASSERT_TRUE(nullptr != pwd->pw_name); in TEST()
284 EXPECT_EQ(pwd->pw_gid, pwd->pw_uid) << "pwd->pw_uid: " << pwd->pw_uid; in TEST()
285 EXPECT_EQ(nullptr, pwd->pw_passwd) << "pwd->pw_uid: " << pwd->pw_uid; in TEST()
287 EXPECT_TRUE(nullptr == pwd->pw_gecos) << "pwd->pw_uid: " << pwd->pw_uid; in TEST()
289 EXPECT_TRUE(nullptr != pwd->pw_shell); in TEST()
290 if (pwd->pw_uid < AID_APP_START || pwd->pw_uid == AID_OVERFLOWUID) { in TEST()
291 EXPECT_STREQ("/", pwd->pw_dir) << "pwd->pw_uid: " << pwd->pw_uid; in TEST()
293 EXPECT_STREQ("/data", pwd->pw_dir) << "pwd->pw_uid: " << pwd->pw_uid; in TEST()
300 if (!(pwd->pw_uid >= 2900 && pwd->pw_uid <= 2999) && in TEST()
301 !(pwd->pw_uid >= 5000 && pwd->pw_uid <= 5999)) { in TEST()
302 EXPECT_EQ(0U, uids.count(pwd->pw_uid)) << "pwd->pw_uid: " << pwd->pw_uid; in TEST()
304 uids.emplace(pwd->pw_uid); in TEST()
577 TEST(pwd, vendor_prefix_users) { in TEST() argument
589 TEST(pwd, vendor_prefix_groups) { in TEST() argument