GDBus: Allow tcp: and nonce-tcp: addresses without any arguments

This was broken in this commit

 http://git.gnome.org/browse/glib/commit/?id=0729260141bb585943ad1c6efa8ab7ee9058b0aa

The test case for catching this is unfortunately commented out (so it
didn't catch it) due to this bug

 https://bugzilla.gnome.org/show_bug.cgi?id=631379

still being unresolved.

Signed-off-by: David Zeuthen <davidz@redhat.com>
This commit is contained in:
David Zeuthen 2011-04-13 17:49:19 -04:00
parent 68b16deb1f
commit 25c57d31c5

View File

@ -258,25 +258,13 @@ is_valid_nonce_tcp (const gchar *address_entry,
goto out;
}
if (nonce_file == NULL)
if (host != NULL)
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_INVALID_ARGUMENT,
_("Error in address `%s' - missing noncefile attribute"),
address_entry);
goto out;
}
if (host == NULL)
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_INVALID_ARGUMENT,
_("Error in address `%s' - missing host attribute"),
address_entry);
goto out;
/* TODO: validate host */
}
nonce_file = nonce_file; /* To avoid -Wunused-but-set-variable */
ret= TRUE;
out:
@ -351,14 +339,9 @@ is_valid_tcp (const gchar *address_entry,
goto out;
}
if (host == NULL)
if (host != NULL)
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_INVALID_ARGUMENT,
_("Error in address `%s' - missing host attribute"),
address_entry);
goto out;
/* TODO: validate host */
}
ret= TRUE;