gdbus: Clean up sockets and nonces from filesystem

When we close the GDBusServer, it should remove any non-abstract Unix
sockets or TCP nonce files it created from the filesystem.

Fixes #1808
This commit is contained in:
Michael Catanzaro
2019-06-12 13:55:06 -05:00
parent f5631ecb94
commit beac9fe211
2 changed files with 26 additions and 8 deletions

View File

@@ -1351,12 +1351,16 @@ test_nonce_tcp (void)
g_error_free (error);
g_assert (c == NULL);
g_free (nonce_file);
/* Recreate the nonce-file so we can ensure the server deletes it when stopped. */
g_assert_cmpint (g_creat (nonce_file, 0600), !=, -1);
g_dbus_server_stop (server);
g_object_unref (server);
server = NULL;
g_assert_false (g_file_test (nonce_file, G_FILE_TEST_EXISTS));
g_free (nonce_file);
g_main_loop_quit (service_loop);
g_thread_join (service_thread);