Lines Matching full:null
25 return NULL; in test_get_passwd_entry()
46 g_autoptr(GError) err = NULL; in get_passwd_entry()
50 if (p == NULL) { in get_passwd_entry()
53 return NULL; in get_passwd_entry()
88 g_autofree char *contents = NULL; in write_authkeys()
89 g_autoptr(GError) err = NULL; in write_authkeys()
117 g_autofree struct passwd *p = NULL; in qmp_guest_ssh_add_authorized_keys()
118 g_autofree char *ssh_path = NULL; in qmp_guest_ssh_add_authorized_keys()
119 g_autofree char *authkeys_path = NULL; in qmp_guest_ssh_add_authorized_keys()
120 g_auto(GStrv) authkeys = NULL; 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()
136 authkeys_path = g_build_filename(ssh_path, "authorized_keys", NULL); in qmp_guest_ssh_add_authorized_keys()
139 authkeys = read_authkeys(authkeys_path, NULL); in qmp_guest_ssh_add_authorized_keys()
141 if (authkeys == NULL) { in qmp_guest_ssh_add_authorized_keys()
152 for (k = keys; k != NULL; k = k->next) { in qmp_guest_ssh_add_authorized_keys()
166 g_autofree struct passwd *p = NULL; in qmp_guest_ssh_remove_authorized_keys()
167 g_autofree char *authkeys_path = NULL; in qmp_guest_ssh_remove_authorized_keys()
168 g_autofree GStrv new_keys = NULL; /* do not own the strings */ in qmp_guest_ssh_remove_authorized_keys()
169 g_auto(GStrv) authkeys = NULL; in qmp_guest_ssh_remove_authorized_keys()
173 if (!check_openssh_pub_keys(keys, NULL, errp)) { in qmp_guest_ssh_remove_authorized_keys()
178 if (p == NULL) { in qmp_guest_ssh_remove_authorized_keys()
183 "authorized_keys", NULL); in qmp_guest_ssh_remove_authorized_keys()
188 if (authkeys == NULL) { in qmp_guest_ssh_remove_authorized_keys()
193 for (a = authkeys; *a != NULL; a++) { in qmp_guest_ssh_remove_authorized_keys()
196 for (k = keys; k != NULL; k = k->next) { in qmp_guest_ssh_remove_authorized_keys()
201 if (k != NULL) { in qmp_guest_ssh_remove_authorized_keys()
214 g_autofree struct passwd *p = NULL; in qmp_guest_ssh_get_authorized_keys()
215 g_autofree char *authkeys_path = NULL; in qmp_guest_ssh_get_authorized_keys()
216 g_auto(GStrv) authkeys = NULL; in qmp_guest_ssh_get_authorized_keys()
217 g_autoptr(GuestAuthorizedKeys) ret = NULL; in qmp_guest_ssh_get_authorized_keys()
221 if (p == NULL) { in qmp_guest_ssh_get_authorized_keys()
222 return NULL; in qmp_guest_ssh_get_authorized_keys()
226 "authorized_keys", NULL); in qmp_guest_ssh_get_authorized_keys()
228 if (authkeys == NULL) { in qmp_guest_ssh_get_authorized_keys()
229 return NULL; in qmp_guest_ssh_get_authorized_keys()
233 for (i = 0; authkeys[i] != NULL; i++) { in qmp_guest_ssh_get_authorized_keys()
258 return g_build_filename(g_get_home_dir(), ".ssh", "authorized_keys", NULL); in test_get_authorized_keys_path()
264 g_autoptr(GError) err = NULL; in test_authorized_keys_set()
265 g_autofree char *path = NULL; in test_authorized_keys_set()
268 path = g_build_filename(g_get_home_dir(), ".ssh", NULL); in test_authorized_keys_set()
275 g_assert(err == NULL); in test_authorized_keys_set()
281 g_autoptr(GError) err = NULL; in test_authorized_keys_equal()
282 g_autofree char *path = NULL; in test_authorized_keys_equal()
283 g_autofree char *contents = NULL; in test_authorized_keys_equal()
286 g_file_get_contents(path, &contents, NULL, &err); in test_authorized_keys_equal()
287 g_assert(err == NULL); in test_authorized_keys_equal()
295 Error *err = NULL; in test_invalid_user()
297 qmp_guest_ssh_add_authorized_keys("", NULL, FALSE, FALSE, &err); in test_invalid_user()
300 qmp_guest_ssh_remove_authorized_keys("", NULL, &err); in test_invalid_user()
310 Error *err = NULL; in test_invalid_key()
323 Error *err = NULL; in test_add_keys()
329 g_assert(err == NULL); in test_add_keys()
337 g_assert(err == NULL); in test_add_keys()
347 Error *err = NULL; in test_add_reset_keys()
353 g_assert(err == NULL); in test_add_reset_keys()
363 g_assert(err == NULL); in test_add_reset_keys()
369 (strList *)NULL, in test_add_reset_keys()
372 g_assert(err == NULL); in test_add_reset_keys()
380 Error *err = NULL; in test_remove_keys()
391 g_assert(err == NULL); in test_remove_keys()
396 g_assert(err == NULL); in test_remove_keys()
404 Error *err = NULL; in test_get_keys()
409 g_autoptr(GuestAuthorizedKeys) ret = NULL; in test_get_keys()
416 g_assert(err == NULL); in test_get_keys()
418 for (len = 0, k = ret->keys; k != NULL; k = k->next) { in test_get_keys()
430 g_test_init(&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL); in main()