Lines Matching refs:p
20 struct passwd *p; in test_get_passwd_entry() local
28 p = g_new0(struct passwd, 1); in test_get_passwd_entry()
29 p->pw_dir = (char *)g_get_home_dir(); in test_get_passwd_entry()
30 p->pw_uid = geteuid(); in test_get_passwd_entry()
31 p->pw_gid = getegid(); in test_get_passwd_entry()
33 ret = g_mkdir_with_parents(p->pw_dir, 0700); in test_get_passwd_entry()
36 return p; in test_get_passwd_entry()
47 struct passwd *p; in get_passwd_entry() local
49 p = g_unix_get_passwd_entry(username, &err); in get_passwd_entry()
50 if (p == NULL) { in get_passwd_entry()
56 return p; in get_passwd_entry()
60 mkdir_for_user(const char *path, const struct passwd *p, in mkdir_for_user() argument
69 if (chown(path, p->pw_uid, p->pw_gid) == -1) { in mkdir_for_user()
86 const struct passwd *p, Error **errp) in write_authkeys() argument
97 if (chown(path, p->pw_uid, p->pw_gid) == -1) { in write_authkeys()
117 g_autofree struct passwd *p = NULL; in qmp_guest_ssh_add_authorized_keys() local
130 p = get_passwd_entry(username, errp); in qmp_guest_ssh_add_authorized_keys()
131 if (p == NULL) { in qmp_guest_ssh_add_authorized_keys()
135 ssh_path = g_build_filename(p->pw_dir, ".ssh", NULL); in qmp_guest_ssh_add_authorized_keys()
143 !mkdir_for_user(ssh_path, p, 0700, errp)) { in qmp_guest_ssh_add_authorized_keys()
159 write_authkeys(authkeys_path, authkeys, p, errp); in qmp_guest_ssh_add_authorized_keys()
166 g_autofree struct passwd *p = NULL; in qmp_guest_ssh_remove_authorized_keys() local
177 p = get_passwd_entry(username, errp); in qmp_guest_ssh_remove_authorized_keys()
178 if (p == NULL) { in qmp_guest_ssh_remove_authorized_keys()
182 authkeys_path = g_build_filename(p->pw_dir, ".ssh", in qmp_guest_ssh_remove_authorized_keys()
208 write_authkeys(authkeys_path, new_keys, p, errp); in qmp_guest_ssh_remove_authorized_keys()
214 g_autofree struct passwd *p = NULL; in qmp_guest_ssh_get_authorized_keys() local
220 p = get_passwd_entry(username, errp); in qmp_guest_ssh_get_authorized_keys()
221 if (p == NULL) { in qmp_guest_ssh_get_authorized_keys()
225 authkeys_path = g_build_filename(p->pw_dir, ".ssh", in qmp_guest_ssh_get_authorized_keys()