Commit 6eeb077b authored by David Zeuthen's avatar David Zeuthen

Port PolkitBackendInteractiveAuthority to gdbus

Signed-off-by: default avatarDavid Zeuthen <davidz@redhat.com>
parent 6486dea3
......@@ -262,8 +262,34 @@ polkit_identity_get_real (PolkitIdentity *identity)
GVariant *
polkit_identity_to_gvariant (PolkitIdentity *identity)
{
g_assert_not_reached ();
return NULL;
GVariantBuilder builder;
GVariant *dict;
GVariant *ret;
const gchar *kind;
kind = "";
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
if (POLKIT_IS_UNIX_USER (identity))
{
kind = "unix-user";
g_variant_builder_add (&builder, "{sv}", "uid",
g_variant_new_uint32 (polkit_unix_user_get_uid (POLKIT_UNIX_USER (identity))));
}
else if (POLKIT_IS_UNIX_GROUP (identity))
{
kind = "unix-group";
g_variant_builder_add (&builder, "{sv}", "gid",
g_variant_new_uint32 (polkit_unix_group_get_gid (POLKIT_UNIX_GROUP (identity))));
}
else
{
g_warning ("Unknown class %s implementing PolkitIdentity", g_type_name (G_TYPE_FROM_INSTANCE (identity)));
}
dict = g_variant_builder_end (&builder);
ret = g_variant_new ("(s@a{sv})", kind, dict);
return ret;
}
static GVariant *
......
......@@ -382,7 +382,7 @@ polkit_subject_to_gvariant (PolkitSubject *subject)
}
else if (POLKIT_IS_UNIX_SESSION (subject))
{
kind = "unix-process";
kind = "unix-session";
g_variant_builder_add (&builder, "{sv}", "session-id",
g_variant_new_string (polkit_unix_session_get_session_id (POLKIT_UNIX_SESSION (subject))));
}
......
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