Commit 130d6a4a authored by David King's avatar David King

Remove choices from authentication-methods setting

The "authentication-methods" setting was intended to list the valid
authentication methods. In practice, only VNC authentication is
supported. Remove the incorrect choices listed in the schema, and set
the default method to be the empty list rather than ['none'].

Fixes bug 683103.
parent a4bd8886
......@@ -68,9 +68,9 @@ set_inverted (const GValue *value,
return g_variant_new_boolean (!g_value_get_boolean (value));
}
/* Next, one that maps between the array-of-strings list of
* authentication mechanisms and a boolean that is FALSE if the 'none'
* and TRUE otherwise (ie: for 'vnc' in the list).
/* Next, one that maps between the array-of-strings list of authentication
* mechanisms and a boolean that is TRUE only if "vnc" is in the list and FALSE
* otherwise.
*/
static gboolean
get_authtype (GValue *value,
......@@ -81,11 +81,11 @@ get_authtype (GValue *value,
const gchar *type;
g_variant_iter_init (&iter, variant);
g_value_set_boolean (value, TRUE);
g_value_set_boolean (value, FALSE);
while (g_variant_iter_next (&iter, "s", &type))
if (strcmp (type, "none") == 0)
g_value_set_boolean (value, FALSE);
if (strcmp (type, "vnc") == 0)
g_value_set_boolean (value, TRUE);
return TRUE;
}
......@@ -95,14 +95,12 @@ set_authtype (const GValue *value,
const GVariantType *type,
gpointer user_data)
{
const gchar *authtype;
const gchar *vnc_auth = "vnc";
if (g_value_get_boolean (value))
authtype = "vnc";
return g_variant_new_strv (&vnc_auth, 1);
else
authtype = "none";
return g_variant_new_strv (&authtype, 1);
return g_variant_new_strv (NULL, 0);
}
......
......@@ -82,11 +82,7 @@
specified by the vnc-password key) before connecting and "none"
which allows any remote user to connect.
</description>
<choices>
<choice value='none'/>
<choice value='vnc'/>
</choices>
<default>['none']</default>
<default>[]</default>
</key>
<key name='vnc-password' type='s'>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment