Lines Matching refs:pwd
36 uv_passwd_t pwd; in TEST_IMPL() local
41 r = uv_os_get_passwd(&pwd); in TEST_IMPL()
43 len = strlen(pwd.username); in TEST_IMPL()
47 ASSERT_NULL(pwd.shell); in TEST_IMPL()
49 len = strlen(pwd.shell); in TEST_IMPL()
55 len = strlen(pwd.homedir); in TEST_IMPL()
59 if (len == 3 && pwd.homedir[1] == ':') in TEST_IMPL()
60 ASSERT_EQ(pwd.homedir[2], '\\'); in TEST_IMPL()
62 ASSERT_NE(pwd.homedir[len - 1], '\\'); in TEST_IMPL()
65 ASSERT_EQ(pwd.homedir[0], '/'); in TEST_IMPL()
67 ASSERT_NE(pwd.homedir[len - 1], '/'); in TEST_IMPL()
71 ASSERT_EQ(pwd.uid, (unsigned)-1); in TEST_IMPL()
72 ASSERT_EQ(pwd.gid, (unsigned)-1); in TEST_IMPL()
74 ASSERT_NE(pwd.uid, (unsigned)-1); in TEST_IMPL()
75 ASSERT_NE(pwd.gid, (unsigned)-1); in TEST_IMPL()
76 ASSERT_EQ(pwd.uid, geteuid()); in TEST_IMPL()
77 if (pwd.uid != 0 && pwd.gid != getgid()) in TEST_IMPL()
79 ASSERT_EQ(pwd.gid, getegid()); in TEST_IMPL()
83 uv_os_free_passwd(&pwd); in TEST_IMPL()
85 ASSERT_NULL(pwd.username); in TEST_IMPL()
86 ASSERT_NULL(pwd.shell); in TEST_IMPL()
87 ASSERT_NULL(pwd.homedir); in TEST_IMPL()
90 uv_os_free_passwd(&pwd); in TEST_IMPL()
92 ASSERT_NULL(pwd.username); in TEST_IMPL()
93 ASSERT_NULL(pwd.shell); in TEST_IMPL()
94 ASSERT_NULL(pwd.homedir); in TEST_IMPL()
110 uv_passwd_t pwd; in TEST_IMPL() local
116 r = uv_os_get_passwd(&pwd); in TEST_IMPL()
119 r = uv_os_get_passwd2(&pwd2, pwd.uid); in TEST_IMPL()
127 ASSERT_EQ(pwd.uid, pwd2.uid); in TEST_IMPL()
128 ASSERT_STR_EQ(pwd.username, pwd2.username); in TEST_IMPL()
129 ASSERT_STR_EQ(pwd.shell, pwd2.shell); in TEST_IMPL()
130 ASSERT_STR_EQ(pwd.homedir, pwd2.homedir); in TEST_IMPL()
156 uv_os_free_passwd(&pwd); in TEST_IMPL()
159 r = uv_os_get_passwd2(NULL, pwd.uid); in TEST_IMPL()
176 uv_passwd_t pwd; in TEST_IMPL() local
181 r = uv_os_get_passwd(&pwd); in TEST_IMPL()
184 r = uv_os_get_group(&grp, pwd.gid); in TEST_IMPL()
192 ASSERT_EQ(pwd.gid, grp.gid); in TEST_IMPL()
200 uv_os_free_passwd(&pwd); in TEST_IMPL()
203 r = uv_os_get_group(NULL, pwd.gid); in TEST_IMPL()