aboutsummaryrefslogtreecommitdiff
path: root/src/krb5-auth-dbus.c
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2009-03-01 15:00:15 +0100
committerGuido Günther <agx@sigxcpu.org>2009-03-01 15:00:15 +0100
commitd0f7048e94abe3371aeeba6f5cd115959e332b09 (patch)
treec4bca2f9d8c6e2646cee38f6ababc8ac1634887b /src/krb5-auth-dbus.c
parentImported Upstream version 0.8 (diff)
downloadkrb5-auth-dialog-d0f7048e94abe3371aeeba6f5cd115959e332b09.tar.gz
krb5-auth-dialog-d0f7048e94abe3371aeeba6f5cd115959e332b09.tar.bz2
krb5-auth-dialog-d0f7048e94abe3371aeeba6f5cd115959e332b09.zip
Imported Upstream version 0.8+svn128
Diffstat (limited to 'src/krb5-auth-dbus.c')
-rw-r--r--src/krb5-auth-dbus.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/krb5-auth-dbus.c b/src/krb5-auth-dbus.c
index f658c8d..b4c8742 100644
--- a/src/krb5-auth-dbus.c
+++ b/src/krb5-auth-dbus.c
@@ -1,6 +1,6 @@
/* Krb5 Auth Applet -- Acquire and release kerberos tickets
*
- * (C) 2008 Guido Guenther <agx@sigxcpu.org>
+ * (C) 2008,2009 Guido Guenther <agx@sigxcpu.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,13 +23,38 @@
#include <dbus/dbus-glib.h>
#include "krb5-auth-applet.h"
#include "krb5-auth-dbus.h"
+#include "krb5-auth-applet-dbus-glue.h"
+
+static DBusGConnection *session;
+
+gboolean
+ka_dbus_acquire_tgt (KaApplet *applet,
+ const gchar *principal, DBusGMethodInvocation *context)
+{
+ gboolean success;
+
+ KA_DEBUG("Getting TGT for '%s'", principal);
+ success = ka_check_credentials(applet, principal);
+ dbus_g_method_return(context, success);
+ return TRUE;
+}
+
+
+gboolean
+ka_dbus_service(KaApplet* applet)
+{
+ dbus_g_connection_register_g_object (session,
+ "/org/gnome/KrbAuthDialog",
+ G_OBJECT(applet));
+ return TRUE;
+}
+
gboolean
ka_dbus_connect(unsigned int* status)
{
guint request_name_reply;
unsigned int flags;
- DBusGConnection *session;
DBusGProxy *bus_proxy;
GError* error = NULL;
@@ -46,6 +71,9 @@ ka_dbus_connect(unsigned int* status)
"/org/freedesktop/DBus",
"org.freedesktop.DBus");
+ dbus_g_object_type_install_info(KA_TYPE_APPLET,
+ &dbus_glib_krb5_auth_dialog_object_info);
+
if (!dbus_g_proxy_call (bus_proxy,
"RequestName",
&error,
bgstack15