From 29320e2db78ba6e6b56af39219b0ce213b77592b Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Tue, 4 May 2010 07:51:21 +0200 Subject: Imported Upstream version 0.16~rc1 --- ChangeLog | 387 +++++++++ Makefile.am | 2 +- Makefile.in | 6 +- README | 10 + aclocal.m4 | 23 +- config.h.in | 7 +- configure | 314 +++++++- configure.ac | 60 +- etpo/Makefile.in | 4 + examples/Makefile.am | 5 +- examples/Makefile.in | 8 +- gnome-doc-utils.make | 24 +- gtksecentry/Makefile.in | 4 + help/Makefile.in | 25 +- icons/22x22/Makefile.in | 4 + icons/48x48/Makefile.in | 4 + icons/Makefile.in | 4 + icons/scalable/Makefile.in | 4 + krb5-auth-dialog.spec | 2 +- plugins/Makefile.am | 49 ++ plugins/Makefile.in | 679 ++++++++++++++++ plugins/ka-plugin-dummy.c | 105 +++ plugins/ka-plugin-dummy.h | 57 ++ plugins/ka-plugin-pam.c | 128 +++ plugins/ka-plugin-pam.h | 59 ++ po/POTFILES.in | 12 +- po/de.po | 116 +-- po/es.po | 131 ++-- po/sl.po | 126 +-- preferences/Makefile.am | 10 +- preferences/Makefile.in | 87 ++- preferences/ka-preferences.c | 843 ++++++++++++++++++++ preferences/krb5-auth-dialog-preferences.c | 843 -------------------- secmem/Makefile.in | 4 + src/Makefile.am | 50 +- src/Makefile.in | 304 +++++--- src/ka-applet-priv.h | 72 ++ src/ka-applet.c | 942 ++++++++++++++++++++++ src/ka-applet.h | 48 ++ src/ka-closures.c | 105 +++ src/ka-closures.h | 38 + src/ka-dbus.c | 119 +++ src/ka-dbus.h | 37 + src/ka-dbus.xml | 30 + src/ka-dialog.c | 1171 ++++++++++++++++++++++++++++ src/ka-dialog.h | 32 + src/ka-gconf-tools.c | 149 ++++ src/ka-gconf-tools.h | 48 ++ src/ka-gconf.c | 211 +++++ src/ka-gconf.h | 29 + src/ka-plugin-loader.c | 204 +++++ src/ka-plugin-loader.h | 58 ++ src/ka-plugin.c | 133 ++++ src/ka-plugin.h | 75 ++ src/ka-pwdialog.c | 309 ++++++++ src/ka-pwdialog.h | 65 ++ src/ka-tickets.c | 115 +++ src/ka-tickets.h | 39 + src/ka-tools.c | 57 ++ src/ka-tools.h | 32 + src/krb5-auth-applet-dbus.xml | 31 - src/krb5-auth-applet.c | 919 ---------------------- src/krb5-auth-applet.h | 85 -- src/krb5-auth-dbus.c | 120 --- src/krb5-auth-dbus.h | 37 - src/krb5-auth-dialog.c | 1171 ---------------------------- src/krb5-auth-dialog.h | 33 - src/krb5-auth-dialog.schemas.in | 13 + src/krb5-auth-gconf-tools.c | 126 --- src/krb5-auth-gconf-tools.h | 46 -- src/krb5-auth-gconf.c | 210 ----- src/krb5-auth-gconf.h | 29 - src/krb5-auth-pwdialog.c | 310 -------- src/krb5-auth-pwdialog.h | 65 -- src/krb5-auth-tickets.c | 116 --- src/krb5-auth-tickets.h | 39 - src/krb5-auth-tools.c | 58 -- src/krb5-auth-tools.h | 33 - 78 files changed, 7341 insertions(+), 4718 deletions(-) create mode 100644 plugins/Makefile.am create mode 100644 plugins/Makefile.in create mode 100644 plugins/ka-plugin-dummy.c create mode 100644 plugins/ka-plugin-dummy.h create mode 100644 plugins/ka-plugin-pam.c create mode 100644 plugins/ka-plugin-pam.h create mode 100644 preferences/ka-preferences.c delete mode 100644 preferences/krb5-auth-dialog-preferences.c create mode 100644 src/ka-applet-priv.h create mode 100644 src/ka-applet.c create mode 100644 src/ka-applet.h create mode 100644 src/ka-closures.c create mode 100644 src/ka-closures.h create mode 100644 src/ka-dbus.c create mode 100644 src/ka-dbus.h create mode 100644 src/ka-dbus.xml create mode 100644 src/ka-dialog.c create mode 100644 src/ka-dialog.h create mode 100644 src/ka-gconf-tools.c create mode 100644 src/ka-gconf-tools.h create mode 100644 src/ka-gconf.c create mode 100644 src/ka-gconf.h create mode 100644 src/ka-plugin-loader.c create mode 100644 src/ka-plugin-loader.h create mode 100644 src/ka-plugin.c create mode 100644 src/ka-plugin.h create mode 100644 src/ka-pwdialog.c create mode 100644 src/ka-pwdialog.h create mode 100644 src/ka-tickets.c create mode 100644 src/ka-tickets.h create mode 100644 src/ka-tools.c create mode 100644 src/ka-tools.h delete mode 100644 src/krb5-auth-applet-dbus.xml delete mode 100644 src/krb5-auth-applet.c delete mode 100644 src/krb5-auth-applet.h delete mode 100644 src/krb5-auth-dbus.c delete mode 100644 src/krb5-auth-dbus.h delete mode 100644 src/krb5-auth-dialog.c delete mode 100644 src/krb5-auth-dialog.h delete mode 100644 src/krb5-auth-gconf-tools.c delete mode 100644 src/krb5-auth-gconf-tools.h delete mode 100644 src/krb5-auth-gconf.c delete mode 100644 src/krb5-auth-gconf.h delete mode 100644 src/krb5-auth-pwdialog.c delete mode 100644 src/krb5-auth-pwdialog.h delete mode 100644 src/krb5-auth-tickets.c delete mode 100644 src/krb5-auth-tickets.h delete mode 100644 src/krb5-auth-tools.c delete mode 100644 src/krb5-auth-tools.h diff --git a/ChangeLog b/ChangeLog index facaee7..e811cac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,392 @@ # Generated by Makefile. Do not edit. +commit 9a1e5a769be82454c134ca189a274af13b561d79 +Author: Guido Günther +Date: Tue May 4 07:30:38 2010 +0200 + + Check for PAM libs + + and auto enable PAM plugin if found. + + configure.ac | 31 +++++++++++++++++++------------ + 1 files changed, 19 insertions(+), 12 deletions(-) + +commit cc597ad513a935902830c1d25e282c202176d6ec +Author: Mario Blättermann +Date: Sun May 2 12:13:34 2010 +0200 + + Updated German translation + + po/de.po | 116 ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 60 insertions(+), 56 deletions(-) + +commit c81ecf1285f1bd9c5a2688d071731ccbc5b30cc5 +Author: Andrej Žnidaršič +Date: Sun May 2 11:43:13 2010 +0200 + + Updated Slovenian translation + + po/sl.po | 126 +++++++++++++++++++++++++++++++++----------------------------- + 1 files changed, 67 insertions(+), 59 deletions(-) + +commit 0752fea0ab5ce01f50b2483f0d10ea61b324539b +Author: Guido Günther +Date: Wed Apr 28 21:27:06 2010 +0200 + + Rename KRB5_AUTH_* to KA_* in headers + + src/ka-applet-priv.h | 4 ++-- + src/ka-dbus.h | 6 +++--- + src/ka-dialog.h | 4 ++-- + src/ka-gconf-tools.h | 4 ++-- + src/ka-gconf.h | 4 ++-- + src/ka-pwdialog.h | 4 ++-- + src/ka-tickets.h | 4 ++-- + src/ka-tools.h | 4 ++-- + 8 files changed, 17 insertions(+), 17 deletions(-) + +commit 5b57a60b197877630b4d3427f4337b11701e2e0a +Author: Guido Günther +Date: Wed Apr 28 20:59:07 2010 +0200 + + Update potfile names too + + po/POTFILES.in | 12 ++++++------ + 1 files changed, 6 insertions(+), 6 deletions(-) + +commit 2a2b10c6d55ae13dbc4c0474005673950bf97f45 +Author: Guido Günther +Date: Wed Apr 28 17:48:14 2010 +0200 + + Rename krb5-auth-applet.[ch] + + Rename krb5-auth-applet.h to ka-applet-priv.h since these parts + shouldn't be used by modules. + + src/Makefile.am | 4 +- + src/ka-applet-priv.h | 72 ++++ + src/ka-applet.c | 942 +++++++++++++++++++++++++++++++++++++++++++++++ + src/ka-dbus.c | 2 +- + src/ka-dbus.h | 2 +- + src/ka-dialog.c | 2 +- + src/ka-dialog.h | 2 +- + src/ka-gconf.c | 2 +- + src/ka-gconf.h | 2 +- + src/ka-plugin-loader.c | 2 +- + src/ka-pwdialog.c | 2 +- + src/krb5-auth-applet.c | 943 ------------------------------------------------ + src/krb5-auth-applet.h | 70 ---- + 13 files changed, 1024 insertions(+), 1023 deletions(-) + +commit 8ddcf3681b8a9a06a50b570497d9d49562cf9cfb +Author: Guido Günther +Date: Wed Apr 28 17:45:06 2010 +0200 + + Rename krb5-auth-dialog.[ch] to ka-dialog.[ch] + + krb5-auth-dialog rename fix + + autogen.sh | 2 +- + configure.ac | 2 +- + src/Makefile.am | 4 +- + src/ka-dbus.c | 2 +- + src/ka-dialog.c | 1171 ++++++++++++++++++++++++++++++++++++++++++++++++ + src/ka-dialog.h | 32 ++ + src/ka-pwdialog.c | 2 +- + src/ka-tickets.c | 2 +- + src/krb5-auth-applet.c | 2 +- + src/krb5-auth-dialog.c | 1171 ------------------------------------------------ + src/krb5-auth-dialog.h | 33 -- + 11 files changed, 1211 insertions(+), 1212 deletions(-) + +commit 01f5263f9eb76a11fb1c1207a323973e3b7c5efe +Author: Guido Günther +Date: Wed Apr 28 17:35:28 2010 +0200 + + Reneme krb5-auth-applet-dbus.xml to ka-dbus.xml + + src/.gitignore | 2 +- + src/Makefile.am | 8 ++++---- + src/ka-dbus.c | 2 +- + src/ka-dbus.xml | 30 ++++++++++++++++++++++++++++++ + src/krb5-auth-applet-dbus.xml | 31 ------------------------------- + 5 files changed, 36 insertions(+), 37 deletions(-) + +commit 26cfffab3ee5795c6216c31dd8030958fb20a01c +Author: Guido Günther +Date: Wed Apr 28 17:30:13 2010 +0200 + + Rename krb5-auth-pwdialog.[ch] to ka-pwdialog.[ch] + + src/Makefile.am | 4 +- + src/ka-pwdialog.c | 309 +++++++++++++++++++++++++++++++++++++++++++++ + src/ka-pwdialog.h | 65 ++++++++++ + src/krb5-auth-applet.h | 2 +- + src/krb5-auth-dialog.c | 2 +- + src/krb5-auth-pwdialog.c | 310 ---------------------------------------------- + src/krb5-auth-pwdialog.h | 65 ---------- + 7 files changed, 378 insertions(+), 379 deletions(-) + +commit ef9bb4179fba5c7fb77a2908aa618b0a204e518a +Author: Guido Günther +Date: Wed Apr 28 17:27:54 2010 +0200 + + Rename krb5-auth-gconf.[ch] to ka-gconf.[ch] + + src/Makefile.am | 4 +- + src/ka-gconf.c | 211 ++++++++++++++++++++++++++++++++++++++++++++++++ + src/ka-gconf.h | 29 +++++++ + src/krb5-auth-applet.c | 2 +- + src/krb5-auth-gconf.c | 211 ------------------------------------------------ + src/krb5-auth-gconf.h | 29 ------- + 6 files changed, 243 insertions(+), 243 deletions(-) + +commit 2e6c29f113947f03b096e5f15c609712eaa01f4d +Author: Guido Günther +Date: Wed Apr 28 17:26:13 2010 +0200 + + Rename krb5-auth-dialog-preferences.[ch] to ka-preferences.[ch] + + preferences/Makefile.am | 2 +- + preferences/ka-preferences.c | 843 ++++++++++++++++++++++++++++ + preferences/krb5-auth-dialog-preferences.c | 843 ---------------------------- + 3 files changed, 844 insertions(+), 844 deletions(-) + +commit 26f51d8504f5ceaca538fbdb9dc0e94f74176a51 +Author: Guido Günther +Date: Wed Apr 28 17:24:45 2010 +0200 + + Rename krb5-auth-gconf-tools.[ch] to ka-gconf-tools.[ch] + + preferences/Makefile.am | 4 +- + preferences/krb5-auth-dialog-preferences.c | 2 +- + src/Makefile.am | 4 +- + src/ka-gconf-tools.c | 149 +++++++++++++++++++++++++++ + src/ka-gconf-tools.h | 48 +++++++++ + src/ka-plugin-loader.c | 2 +- + src/krb5-auth-applet.c | 2 +- + src/krb5-auth-gconf-tools.c | 150 ---------------------------- + src/krb5-auth-gconf-tools.h | 48 --------- + src/krb5-auth-gconf.c | 2 +- + 10 files changed, 205 insertions(+), 206 deletions(-) + +commit 7a282065467e986c3d0483be9720ca863d93c8e5 +Author: Guido Günther +Date: Wed Apr 28 17:12:13 2010 +0200 + + Rename krb5-auth-dbus.[ch] to ka-dbus.[ch] + + src/Makefile.am | 4 +- + src/ka-dbus.c | 119 +++++++++++++++++++++++++++++++++++++++++++++++ + src/ka-dbus.h | 37 +++++++++++++++ + src/krb5-auth-dbus.c | 120 ------------------------------------------------ + src/krb5-auth-dbus.h | 37 --------------- + src/krb5-auth-dialog.c | 2 +- + 6 files changed, 159 insertions(+), 160 deletions(-) + +commit 7b20693fbe233fa6832bfa734f603cc46c3a5a72 +Author: Guido Günther +Date: Tue Apr 27 22:27:21 2010 +0200 + + Rename krb5-auth-tools.[ch] to ka-tools.[ch] + + preferences/Makefile.am | 4 +- + preferences/krb5-auth-dialog-preferences.c | 2 +- + src/Makefile.am | 4 +- + src/ka-tools.c | 57 +++++++++++++++++++++++++++ + src/ka-tools.h | 32 +++++++++++++++ + src/krb5-auth-applet.c | 2 +- + src/krb5-auth-dialog.c | 2 +- + src/krb5-auth-tools.c | 58 ---------------------------- + src/krb5-auth-tools.h | 33 ---------------- + 9 files changed, 96 insertions(+), 98 deletions(-) + +commit a437955775ad6d795ba206ec178a57255201399f +Author: Guido Günther +Date: Tue Apr 27 22:23:21 2010 +0200 + + Rename krb5-auth-tickets.[ch] to ka-tickets.[ch] + + src/Makefile.am | 4 +- + src/ka-tickets.c | 115 ++++++++++++++++++++++++++++++++++++++++++++++ + src/ka-tickets.h | 39 ++++++++++++++++ + src/krb5-auth-applet.c | 2 +- + src/krb5-auth-dialog.c | 2 +- + src/krb5-auth-tickets.c | 116 ----------------------------------------------- + src/krb5-auth-tickets.h | 39 ---------------- + 7 files changed, 158 insertions(+), 159 deletions(-) + +commit a3189fbe66795304751520338bf4b8013f5928bf +Author: Jorge González +Date: Wed Apr 28 08:26:55 2010 +0200 + + Updated Spanish translation + + po/es.po | 81 ++++++++++++++++++++++++++++++++++--------------------------- + 1 files changed, 45 insertions(+), 36 deletions(-) + +commit 2d268123bb3c69bae947cb2a9bae0d54e7af0e32 +Author: Guido Günther +Date: Mon Apr 26 22:38:51 2010 +0200 + + Document plugin gconf keys + + README | 10 ++++++++++ + 1 files changed, 10 insertions(+), 0 deletions(-) + +commit 3501a11b57a3ea7d43282262ab6768c5a397dba0 +Author: Guido Günther +Date: Sun Apr 25 09:43:42 2010 +0200 + + Load plugins from gconf + + and deactivate them on loader disposal. + + src/ka-plugin-loader.c | 85 +++++++++++++++++++++++++++++---------- + src/krb5-auth-dialog.schemas.in | 13 ++++++ + src/krb5-auth-gconf-tools.h | 1 + + src/krb5-auth-gconf.c | 5 +- + 4 files changed, 81 insertions(+), 23 deletions(-) + +commit 0c5190a9f2161ab25f6081d6e179b4e6317954fa +Author: Guido Günther +Date: Tue Apr 20 22:23:01 2010 +0200 + + Add simple PAM plugin + + BZ: #347034 + + configure.ac | 28 ++++++++++- + plugins/Makefile.am | 26 ++++++++++ + plugins/ka-plugin-pam.c | 128 +++++++++++++++++++++++++++++++++++++++++++++++ + plugins/ka-plugin-pam.h | 59 ++++++++++++++++++++++ + 4 files changed, 239 insertions(+), 2 deletions(-) + +commit b2956aa5a9a2e7de4fe9844cba54427f2d53de4c +Author: Guido Günther +Date: Tue Apr 20 22:23:30 2010 +0200 + + Add dummy plugin + + as example for new plugins. + + Makefile.am | 2 +- + configure.ac | 1 + + plugins/.gitignore | 3 + + plugins/Makefile.am | 23 ++++++++++ + plugins/ka-plugin-dummy.c | 105 +++++++++++++++++++++++++++++++++++++++++++++ + plugins/ka-plugin-dummy.h | 57 ++++++++++++++++++++++++ + 6 files changed, 190 insertions(+), 1 deletions(-) + +commit 69ce38151c7a08fe980d981108c782762bf72e81 +Author: Guido Günther +Date: Tue Apr 20 22:21:54 2010 +0200 + + Add plugin infrastructure + + configure.ac | 10 +++- + src/Makefile.am | 7 ++ + src/ka-plugin-loader.c | 161 ++++++++++++++++++++++++++++++++++++++++++++++++ + src/ka-plugin-loader.h | 58 +++++++++++++++++ + src/ka-plugin.c | 133 +++++++++++++++++++++++++++++++++++++++ + src/ka-plugin.h | 75 ++++++++++++++++++++++ + src/krb5-auth-applet.c | 10 +++- + 7 files changed, 452 insertions(+), 2 deletions(-) + +commit a7f0bdf074c437f98dffd4541d4e6426202e1d69 +Author: Guido Günther +Date: Sun Apr 25 09:42:54 2010 +0200 + + Add getter for gconf client + + src/krb5-auth-applet.c | 6 ++++++ + src/krb5-auth-applet.h | 2 ++ + 2 files changed, 8 insertions(+), 0 deletions(-) + +commit 14c574f60f33f03b5c92b902479bfd1cd3d95b12 +Author: Guido Günther +Date: Sat Apr 24 22:28:29 2010 +0200 + + Add gconf helper to fetch a list of strings + + src/krb5-auth-gconf-tools.c | 24 ++++++++++++++++++++++++ + src/krb5-auth-gconf-tools.h | 1 + + 2 files changed, 25 insertions(+), 0 deletions(-) + +commit 07748e8cd58c014c4577806350b3d7c3e61647a8 +Author: Guido Günther +Date: Sat Apr 10 10:26:00 2010 +0200 + + Move KaApplet into a separate header + + so the headers used by plugins are self contained. + + src/Makefile.am | 1 + + src/ka-applet.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ + src/krb5-auth-applet.h | 21 ++------------------- + 3 files changed, 51 insertions(+), 19 deletions(-) + +commit 92c76a9c50169a5b06129c8b2bba88a5d4853030 +Author: Guido Günther +Date: Thu Apr 22 08:18:08 2010 +0200 + + Send a tgt-renewed signal if the ticket lifetime gets extended + + This way we also send a singal if the user extends the ticket liftetime + by reentering his password of by running kinit on the console. + + src/krb5-auth-applet.c | 23 ++++++++++++++++------- + 1 files changed, 16 insertions(+), 7 deletions(-) + +commit d81f5f55376ecc9b8a64c58122ab69a0142105a8 +Author: Guido Günther +Date: Wed Apr 21 21:26:55 2010 +0200 + + Add correct closures for signals + + src/Makefile.am | 2 + + src/ka-closures.c | 105 ++++++++++++++++++++++++++++++++++++++++++++++++ + src/ka-closures.h | 38 +++++++++++++++++ + src/krb5-auth-applet.c | 3 +- + 4 files changed, 147 insertions(+), 1 deletions(-) + +commit 3e82c4e2113c3c9b1246fe56c4e1851c180e6d07 +Author: Guido Günther +Date: Sat Apr 17 17:35:35 2010 +0200 + + Minor autoconf/automake cleanups + + configure.ac | 10 +++++----- + examples/Makefile.am | 5 ++++- + 2 files changed, 9 insertions(+), 6 deletions(-) + +commit 13f243879a2c4f77d5f48611461324f7338199a2 +Author: Olav Vitters +Date: Sun Apr 18 12:12:05 2010 +0200 + + Fix doap file + + krb5-auth-dialog.doap | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 909f8e6b51ce70d07a26d9b7d4c8c6ab2ec1d66e +Author: Jorge González +Date: Sun Apr 11 16:32:04 2010 +0200 + + Updated Spanish translation + + po/es.po | 64 +++++++++++++++++++++++++++++++------------------------------- + 1 files changed, 32 insertions(+), 32 deletions(-) + +commit 275ce728387cda5c2c32ed396b22de81586f4713 +Author: Jorge González +Date: Sun Apr 11 16:01:01 2010 +0200 + + Updated Spanish translation + + po/es.po | 24 ++++++++++++++---------- + 1 files changed, 14 insertions(+), 10 deletions(-) + commit c69b7aed3f4a7801bdded38d3b3cc5d2ab33baad Author: Guido Günther Date: Sat Apr 3 17:32:31 2010 +0200 diff --git a/Makefile.am b/Makefile.am index c6adefb..6a9ff8b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ NULL = -SUBDIRS = secmem gtksecentry src po etpo icons preferences help examples +SUBDIRS = secmem gtksecentry src po etpo icons preferences help examples plugins EXTRA_DIST = \ krb5-auth-dialog.spec \ diff --git a/Makefile.in b/Makefile.in index 4ac1689..c46f122 100644 --- a/Makefile.in +++ b/Makefile.in @@ -154,6 +154,8 @@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ @@ -171,6 +173,7 @@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +KA_PLUGINS_DIR = @KA_PLUGINS_DIR@ KRB5_CFLAGS = @KRB5_CFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ KRB5_LIBS = @KRB5_LIBS@ @@ -211,6 +214,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_LIBS = @PAM_LIBS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ @@ -286,7 +290,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ NULL = -SUBDIRS = secmem gtksecentry src po etpo icons preferences help examples +SUBDIRS = secmem gtksecentry src po etpo icons preferences help examples plugins EXTRA_DIST = \ krb5-auth-dialog.spec \ MAINTAINERS \ diff --git a/README b/README index 6ee4ac7..aadbd9f 100644 --- a/README +++ b/README @@ -41,3 +41,13 @@ If the sent principal doesn't match the one currently in the ticket cache the request fails. To request a TGT for the "default" principal use string:''. See examples/tgt-signals.py for information about sent DBus signals. + +Plugins +======= +Plugins are currently disabled by default. To enable them you have to set the gconf key: + +Enable pam and dummy plugions: +gconftool-2 --set --list-type=string --type=list /apps/krb5-auth-dialog/plugins/enabled [pam,dummy] + +To list currently enabled plugins: +gconftool-2 --get --list-type=string /apps/krb5-auth-dialog/plugins/enabled diff --git a/aclocal.m4 b/aclocal.m4 index d6b5022..b9bac44 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -648,7 +648,7 @@ IT_PO_SUBDIR([po]) AC_DEFUN([IT_PO_SUBDIR], [AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS. dnl -dnl The following CONFIG_COMMANDS should be exetuted at the very end +dnl The following CONFIG_COMMANDS should be executed at the very end dnl of config.status. AC_CONFIG_COMMANDS_PRE([ AC_CONFIG_COMMANDS([$1/stamp-it], [ @@ -9427,27 +9427,6 @@ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) -# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 5 - -# AM_PROG_LEX -# ----------- -# Autoconf leaves LEX=: if lex or flex can't be found. Change that to a -# "missing" invocation, for better error output. -AC_DEFUN([AM_PROG_LEX], -[AC_PREREQ(2.50)dnl -AC_REQUIRE([AM_MISSING_HAS_RUN])dnl -AC_REQUIRE([AC_PROG_LEX])dnl -if test "$LEX" = :; then - LEX=${am_missing_run}flex -fi]) - # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering diff --git a/config.h.in b/config.h.in index ad4dcae..a95567b 100644 --- a/config.h.in +++ b/config.h.in @@ -96,6 +96,9 @@ /* use libnotify for status messages */ #undef HAVE_LIBNOTIFY +/* Define to 1 if you have the `pam' library (-lpam). */ +#undef HAVE_LIBPAM + /* Define to 1 if you have the `rt' library (-lrt). */ #undef HAVE_LIBRT @@ -151,8 +154,8 @@ */ #undef LT_OBJDIR -/* Define the to the minimum amount of time (m) a credential will have to be - valid before we'll ask the user to get fresh credentials. */ +/* Define to the minimum amount of time (m) a credential will have to be valid + before we will ask the user to get fresh credentials. */ #undef MINUTES_BEFORE_PROMPTING /* Define to 1 if your C compiler doesn't accept -c and -o together. */ diff --git a/configure b/configure index e8036d8..7dc0851 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65 for krb5-auth-dialog 0.15. +# Generated by GNU Autoconf 2.65 for krb5-auth-dialog 0.16. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -698,12 +698,12 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='krb5-auth-dialog' PACKAGE_TARNAME='krb5-auth-dialog' -PACKAGE_VERSION='0.15' -PACKAGE_STRING='krb5-auth-dialog 0.15' +PACKAGE_VERSION='0.16' +PACKAGE_STRING='krb5-auth-dialog 0.16' PACKAGE_BUGREPORT='' PACKAGE_URL='' -ac_unique_file="src/krb5-auth-dialog.c" +ac_unique_file="src/ka-dialog.c" # Factoring default headers for most tests. ac_includes_default="\ #include @@ -744,6 +744,10 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +ENABLE_PAM_PLUGIN_FALSE +ENABLE_PAM_PLUGIN_TRUE +PAM_LIBS +KA_PLUGINS_DIR minimum_lifetime check_interval LIBCAP @@ -767,6 +771,8 @@ GCONF_SCHEMAS_INSTALL_FALSE GCONF_SCHEMAS_INSTALL_TRUE GCONF_SCHEMA_FILE_DIR GCONF_SCHEMA_CONFIG_SOURCE +GMODULE_LIBS +GMODULE_CFLAGS GIO_LIBS GIO_CFLAGS GIO_UNIX_LIBS @@ -974,6 +980,7 @@ enable_pkinit enable_network_manager with_libnotify with_libcap +with_pam ' ac_precious_vars='build_alias host_alias @@ -997,6 +1004,8 @@ GIO_UNIX_CFLAGS GIO_UNIX_LIBS GIO_CFLAGS GIO_LIBS +GMODULE_CFLAGS +GMODULE_LIBS NETWORK_MANAGER_CFLAGS NETWORK_MANAGER_LIBS LIBNOTIFY_CFLAGS @@ -1542,7 +1551,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures krb5-auth-dialog 0.15 to adapt to many kinds of systems. +\`configure' configures krb5-auth-dialog 0.16 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1613,7 +1622,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of krb5-auth-dialog 0.15:";; + short | recursive ) echo "Configuration of krb5-auth-dialog 0.16:";; esac cat <<\_ACEOF @@ -1663,6 +1672,7 @@ Optional Packages: [default=/usr/lib/opensc/opensc-pkcs11.so] --with-libnotify use libnotify for status messages --without-libcap Disable support for capabilities library + --with-pam use PAM [default=check] Some influential environment variables: CC C compiler command @@ -1692,6 +1702,10 @@ Some influential environment variables: linker flags for GIO_UNIX, overriding pkg-config GIO_CFLAGS C compiler flags for GIO, overriding pkg-config GIO_LIBS linker flags for GIO, overriding pkg-config + GMODULE_CFLAGS + C compiler flags for GMODULE, overriding pkg-config + GMODULE_LIBS + linker flags for GMODULE, overriding pkg-config NETWORK_MANAGER_CFLAGS C compiler flags for NETWORK_MANAGER, overriding pkg-config NETWORK_MANAGER_LIBS @@ -1767,7 +1781,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -krb5-auth-dialog configure 0.15 +krb5-auth-dialog configure 0.16 generated by GNU Autoconf 2.65 Copyright (C) 2009 Free Software Foundation, Inc. @@ -2189,7 +2203,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by krb5-auth-dialog $as_me 0.15, which was +It was created by krb5-auth-dialog $as_me 0.16, which was generated by GNU Autoconf 2.65. Invocation command line was $ $0 $@ @@ -2998,7 +3012,7 @@ fi # Define the identity of the package. PACKAGE='krb5-auth-dialog' - VERSION='0.15' + VERSION='0.16' cat >>confdefs.h <<_ACEOF @@ -7113,13 +7127,13 @@ if test "${lt_cv_nm_interface+set}" = set; then : else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:7116: $ac_compile\"" >&5) + (eval echo "\"\$as_me:7130: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:7119: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:7133: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:7122: output\"" >&5) + (eval echo "\"\$as_me:7136: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -8324,7 +8338,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 8327 "configure"' > conftest.$ac_ext + echo '#line 8341 "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -9582,11 +9596,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9585: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9599: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:9589: \$? = $ac_status" >&5 + echo "$as_me:9603: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -9921,11 +9935,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9924: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9938: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:9928: \$? = $ac_status" >&5 + echo "$as_me:9942: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -10026,11 +10040,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10029: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10043: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:10033: \$? = $ac_status" >&5 + echo "$as_me:10047: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -10081,11 +10095,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10084: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10098: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:10088: \$? = $ac_status" >&5 + echo "$as_me:10102: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12465,7 +12479,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12468 "configure" +#line 12482 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12561,7 +12575,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12564 "configure" +#line 12578 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12944,9 +12958,6 @@ $as_echo "#define YYTEXT_POINTER 1" >>confdefs.h fi rm -f conftest.l $LEX_OUTPUT_ROOT.c -fi -if test "$LEX" = :; then - LEX=${am_missing_run}flex fi for ac_prog in 'bison -y' byacc do @@ -13929,6 +13940,96 @@ $as_echo "yes" >&6; } : fi +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GMODULE" >&5 +$as_echo_n "checking for GMODULE... " >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$GMODULE_CFLAGS"; then + pkg_cv_GMODULE_CFLAGS="$GMODULE_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmodule-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gmodule-2.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GMODULE_CFLAGS=`$PKG_CONFIG --cflags "gmodule-2.0" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$GMODULE_LIBS"; then + pkg_cv_GMODULE_LIBS="$GMODULE_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmodule-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gmodule-2.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GMODULE_LIBS=`$PKG_CONFIG --libs "gmodule-2.0" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GMODULE_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "gmodule-2.0"` + else + GMODULE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gmodule-2.0"` + fi + # Put the nasty error message in config.log where it belongs + echo "$GMODULE_PKG_ERRORS" >&5 + + as_fn_error "Package requirements (gmodule-2.0) were not met: + +$GMODULE_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables GMODULE_CFLAGS +and GMODULE_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" "$LINENO" 5 +elif test $pkg_failed = untried; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables GMODULE_CFLAGS +and GMODULE_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." "$LINENO" 5; } +else + GMODULE_CFLAGS=$pkg_cv_GMODULE_CFLAGS + GMODULE_LIBS=$pkg_cv_GMODULE_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + : +fi + if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source` @@ -14925,7 +15026,131 @@ _ACEOF -ac_config_files="$ac_config_files Makefile krb5-auth-dialog.spec src/Makefile src/krb5-auth-dialog.1 secmem/Makefile gtksecentry/Makefile icons/Makefile icons/22x22/Makefile icons/48x48/Makefile icons/scalable/Makefile etpo/Makefile po/Makefile.in preferences/Makefile preferences/krb5-auth-dialog-preferences.1 help/Makefile examples/Makefile" +KA_PLUGINS_DIR="$libdir/krb5-auth-dialog/plugins" + + +PAM_LIBS= + +# Check whether --with-pam was given. +if test "${with_pam+set}" = set; then : + withval=$with_pam; +else + with_pam=check +fi + + +if test "$with_pam" != "no"; then + if test "$with_pam" = "check"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pam_start in -lpam" >&5 +$as_echo_n "checking for pam_start in -lpam... " >&6; } +if test "${ac_cv_lib_pam_pam_start+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpam $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pam_start (); +int +main () +{ +return pam_start (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pam_pam_start=yes +else + ac_cv_lib_pam_pam_start=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pam_pam_start" >&5 +$as_echo "$ac_cv_lib_pam_pam_start" >&6; } +if test "x$ac_cv_lib_pam_pam_start" = x""yes; then : + with_pam=yes +else + with_pam=no +fi + + else + fail=0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pam_start in -lpam" >&5 +$as_echo_n "checking for pam_start in -lpam... " >&6; } +if test "${ac_cv_lib_pam_pam_start+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpam $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pam_start (); +int +main () +{ +return pam_start (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pam_pam_start=yes +else + ac_cv_lib_pam_pam_start=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pam_pam_start" >&5 +$as_echo "$ac_cv_lib_pam_pam_start" >&6; } +if test "x$ac_cv_lib_pam_pam_start" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPAM 1 +_ACEOF + + LIBS="-lpam $LIBS" + +else + fail=1 +fi + + test $fail = 1 && + as_fn_error "You must install the PAM development package in order to compile krb5-auth-dialog" "$LINENO" 5 + fi +fi + +if test "$with_pam" = "yes"; then + PAM_LIBS="${PAM_LIBS} -lpam" +fi + + if test "$with_pam" = "yes"; then + ENABLE_PAM_PLUGIN_TRUE= + ENABLE_PAM_PLUGIN_FALSE='#' +else + ENABLE_PAM_PLUGIN_TRUE='#' + ENABLE_PAM_PLUGIN_FALSE= +fi + + +ac_config_files="$ac_config_files Makefile krb5-auth-dialog.spec src/Makefile src/krb5-auth-dialog.1 secmem/Makefile gtksecentry/Makefile icons/Makefile icons/22x22/Makefile icons/48x48/Makefile icons/scalable/Makefile etpo/Makefile po/Makefile.in preferences/Makefile preferences/krb5-auth-dialog-preferences.1 help/Makefile examples/Makefile plugins/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -15076,6 +15301,10 @@ if test -z "${HAVE_LIBNOTIFY_TRUE}" && test -z "${HAVE_LIBNOTIFY_FALSE}"; then as_fn_error "conditional \"HAVE_LIBNOTIFY\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${ENABLE_PAM_PLUGIN_TRUE}" && test -z "${ENABLE_PAM_PLUGIN_FALSE}"; then + as_fn_error "conditional \"ENABLE_PAM_PLUGIN\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 @@ -15484,7 +15713,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by krb5-auth-dialog $as_me 0.15, which was +This file was extended by krb5-auth-dialog $as_me 0.16, which was generated by GNU Autoconf 2.65. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15550,7 +15779,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -krb5-auth-dialog config.status 0.15 +krb5-auth-dialog config.status 0.16 configured by $0, generated by GNU Autoconf 2.65, with options \\"\$ac_cs_config\\" @@ -15949,6 +16178,7 @@ do "preferences/krb5-auth-dialog-preferences.1") CONFIG_FILES="$CONFIG_FILES preferences/krb5-auth-dialog-preferences.1" ;; "help/Makefile") CONFIG_FILES="$CONFIG_FILES help/Makefile" ;; "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; + "plugins/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/Makefile" ;; "po/stamp-it") CONFIG_COMMANDS="$CONFIG_COMMANDS po/stamp-it" ;; *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; @@ -17338,12 +17568,12 @@ $as_echo "$as_me: " >&6;} $as_echo "$as_me: Libraries" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: " >&5 $as_echo "$as_me: " >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: kerberos: $KRB5_CFLAGS $KRB5_LIBS" >&5 -$as_echo "$as_me: kerberos: $KRB5_CFLAGS $KRB5_LIBS" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: gtk: $GTK_CFLAGS $GTK_LIBS" >&5 -$as_echo "$as_me: gtk: $GTK_CFLAGS $GTK_LIBS" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: dbus: $DBUS_CFLAGS $DBUS_LIBS" >&5 -$as_echo "$as_me: dbus: $DBUS_CFLAGS $DBUS_LIBS" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: Kerberos: $KRB5_CFLAGS $KRB5_LIBS" >&5 +$as_echo "$as_me: Kerberos: $KRB5_CFLAGS $KRB5_LIBS" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: GTK: $GTK_CFLAGS $GTK_LIBS" >&5 +$as_echo "$as_me: GTK: $GTK_CFLAGS $GTK_LIBS" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: DBus: $DBUS_CFLAGS $DBUS_LIBS" >&5 +$as_echo "$as_me: DBus: $DBUS_CFLAGS $DBUS_LIBS" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: gconf: $GCONF_CFLAGS $GCONF_LIBS" >&5 $as_echo "$as_me: gconf: $GCONF_CFLAGS $GCONF_LIBS" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: gio-unix: $GIO_UNIX_CFLAGS $GIO_UNIX_LIBS $GIO_CFLAGS $GIO_LIBS" >&5 @@ -17378,4 +17608,16 @@ $as_echo "$as_me: Minimum Lifetime: $minimum_lifetime minutes" >&6;} $as_echo "$as_me: Check Interval: $check_interval seconds" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: " >&5 $as_echo "$as_me: " >&6;} - +{ $as_echo "$as_me:${as_lineno-$LINENO}: Plugins" >&5 +$as_echo "$as_me: Plugins" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5 +$as_echo "$as_me: " >&6;} +if test "$with_pam" = "yes" ; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: PAM plugin: $PAM_LIBS" >&5 +$as_echo "$as_me: PAM plugin: $PAM_LIBS" >&6;} +else +{ $as_echo "$as_me:${as_lineno-$LINENO}: PAM plugin: no" >&5 +$as_echo "$as_me: PAM plugin: no" >&6;} +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5 +$as_echo "$as_me: " >&6;} diff --git a/configure.ac b/configure.ac index 0c3911c..9d4f39b 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ -AC_INIT([krb5-auth-dialog], [0.15]) -AC_CONFIG_SRCDIR(src/krb5-auth-dialog.c) +AC_INIT([krb5-auth-dialog], [0.16]) +AC_CONFIG_SRCDIR(src/ka-dialog.c) dnl Make automake keep quiet about wildcards & other GNUmake-isms AM_INIT_AUTOMAKE([-Wno-portability]) AM_CONFIG_HEADER(config.h) @@ -18,8 +18,8 @@ AM_GLIB_GNU_GETTEXT AC_PROG_CC AC_ISC_POSIX AC_HEADER_STDC -AM_PROG_LIBTOOL -AM_PROG_LEX +AC_PROG_LIBTOOL +AC_PROG_LEX AC_PROG_YACC AM_PROG_CC_C_O @@ -42,6 +42,7 @@ PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= $DBUS_REQUIRED) PKG_CHECK_MODULES(GCONF, gconf-2.0 >= $GCONF_REQUIRED) PKG_CHECK_MODULES(GIO_UNIX, gio-unix-2.0 >= $GIO_UNIX_REQUIRED) PKG_CHECK_MODULES(GIO, gio-2.0 >= $GIO_REQUIRED) +PKG_CHECK_MODULES(GMODULE, gmodule-2.0) AM_GCONF_SOURCE_2 @@ -217,11 +218,42 @@ AC_SUBST(check_interval) minimum_lifetime=30 AC_DEFINE_UNQUOTED(MINUTES_BEFORE_PROMPTING,[$minimum_lifetime], - [Define the to the minimum amount of time (m) a credential - will have to be valid before we'll ask the user to get + [Define to the minimum amount of time (m) a credential + will have to be valid before we will ask the user to get fresh credentials.]) AC_SUBST(minimum_lifetime) +dnl +dnl Plugins +dnl +KA_PLUGINS_DIR="$libdir/krb5-auth-dialog/plugins" +AC_SUBST(KA_PLUGINS_DIR) + +dnl PAM Plugin +PAM_LIBS= +AC_ARG_WITH([pam], + AC_HELP_STRING([--with-pam], [use PAM @<:@default=check@:>@]), + [], + [with_pam=check]) + +if test "$with_pam" != "no"; then + if test "$with_pam" = "check"; then + AC_CHECK_LIB([pam], [pam_start], [with_pam=yes], [with_pam=no]) + else + fail=0 + AC_CHECK_LIB([pam], [pam_start], [], [fail=1]) + test $fail = 1 && + AC_MSG_ERROR([You must install the PAM development package in order to compile krb5-auth-dialog]) + fi +fi + +if test "$with_pam" = "yes"; then + PAM_LIBS="${PAM_LIBS} -lpam" +fi +AC_SUBST(PAM_LIBS) +AM_CONDITIONAL([ENABLE_PAM_PLUGIN],[test "$with_pam" = "yes"]) + +dnl Final stage AC_OUTPUT([ Makefile krb5-auth-dialog.spec @@ -239,6 +271,7 @@ preferences/Makefile preferences/krb5-auth-dialog-preferences.1 help/Makefile examples/Makefile +plugins/Makefile ]) AC_MSG_NOTICE([]) @@ -247,9 +280,9 @@ AC_MSG_NOTICE([=====================]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -AC_MSG_NOTICE([ kerberos: $KRB5_CFLAGS $KRB5_LIBS]) -AC_MSG_NOTICE([ gtk: $GTK_CFLAGS $GTK_LIBS]) -AC_MSG_NOTICE([ dbus: $DBUS_CFLAGS $DBUS_LIBS]) +AC_MSG_NOTICE([ Kerberos: $KRB5_CFLAGS $KRB5_LIBS]) +AC_MSG_NOTICE([ GTK: $GTK_CFLAGS $GTK_LIBS]) +AC_MSG_NOTICE([ DBus: $DBUS_CFLAGS $DBUS_LIBS]) AC_MSG_NOTICE([ gconf: $GCONF_CFLAGS $GCONF_LIBS]) AC_MSG_NOTICE([ gio-unix: $GIO_UNIX_CFLAGS $GIO_UNIX_LIBS $GIO_CFLAGS $GIO_LIBS]) if test "$with_libnotify" = "yes" ; then @@ -270,4 +303,11 @@ AC_MSG_NOTICE([ Debug : $enable_debug]) AC_MSG_NOTICE([ Minimum Lifetime: $minimum_lifetime minutes]) AC_MSG_NOTICE([ Check Interval: $check_interval seconds]) AC_MSG_NOTICE([]) - +AC_MSG_NOTICE([Plugins]) +AC_MSG_NOTICE([]) +if test "$with_pam" = "yes" ; then +AC_MSG_NOTICE([ PAM plugin: $PAM_LIBS]) +else +AC_MSG_NOTICE([ PAM plugin: no]) +fi +AC_MSG_NOTICE([]) diff --git a/etpo/Makefile.in b/etpo/Makefile.in index 0ffe9e5..ec96b7b 100644 --- a/etpo/Makefile.in +++ b/etpo/Makefile.in @@ -144,6 +144,8 @@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ @@ -161,6 +163,7 @@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +KA_PLUGINS_DIR = @KA_PLUGINS_DIR@ KRB5_CFLAGS = @KRB5_CFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ KRB5_LIBS = @KRB5_LIBS@ @@ -201,6 +204,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_LIBS = @PAM_LIBS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ diff --git a/examples/Makefile.am b/examples/Makefile.am index ed8137b..c0d930a 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -1,2 +1,5 @@ +NULL = + EXTRA_DIST = \ - tgt-signals.py + tgt-signals.py \ + $(NULL) diff --git a/examples/Makefile.in b/examples/Makefile.in index 3e682a7..4c6785c 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -97,6 +97,8 @@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ @@ -114,6 +116,7 @@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +KA_PLUGINS_DIR = @KA_PLUGINS_DIR@ KRB5_CFLAGS = @KRB5_CFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ KRB5_LIBS = @KRB5_LIBS@ @@ -154,6 +157,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_LIBS = @PAM_LIBS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ @@ -228,8 +232,10 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +NULL = EXTRA_DIST = \ - tgt-signals.py + tgt-signals.py \ + $(NULL) all: all-am diff --git a/gnome-doc-utils.make b/gnome-doc-utils.make index ec8f698..97fd549 100644 --- a/gnome-doc-utils.make +++ b/gnome-doc-utils.make @@ -266,6 +266,13 @@ _DOC_POFILES = $(if $(DOC_MODULE)$(DOC_ID), \ .PHONY: po po: $(_DOC_POFILES) +## @ _DOC_MOFILES +## The .mo files used for translating the document +_DOC_MOFILES = $(patsubst %.po,%.mo,$(_DOC_POFILES)) + +.PHONY: mo +mo: $(_DOC_MOFILES) + ## @ _DOC_LC_MODULES ## The top-level documentation files in all other locales _DOC_LC_MODULES = $(if $(DOC_MODULE), \ @@ -332,16 +339,23 @@ $(_DOC_POFILES): $(_xml2po) -m $(_xml2po_mode) -e -u $(notdir $@) $$docs); \ fi +$(_DOC_MOFILES): %.mo: %.po + @if ! test -d $(dir $@); then \ + echo "mkdir $(dir $@)"; \ + mkdir "$(dir $@)"; \ + fi + msgfmt -o $@ $< + # FIXME: fix the dependancy # FIXME: hook xml2po up -$(_DOC_LC_DOCS) : $(_DOC_POFILES) +$(_DOC_LC_DOCS) : $(_DOC_MOFILES) $(_DOC_LC_DOCS) : $(_DOC_C_DOCS) if ! test -d $(dir $@); then mkdir $(dir $@); fi if [ -f "C/$(notdir $@)" ]; then d="../"; else d="$(_DOC_ABS_SRCDIR)/"; fi; \ - po="$(dir $@)$(patsubst %/$(notdir $@),%,$@).po"; \ - if [ -f "$${po}" ]; then po="../$${po}"; else po="$(_DOC_ABS_SRCDIR)/$${po}"; fi; \ + mo="$(dir $@)$(patsubst %/$(notdir $@),%,$@).mo"; \ + if [ -f "$${mo}" ]; then mo="../$${mo}"; else mo="$(_DOC_ABS_SRCDIR)/$${mo}"; fi; \ (cd $(dir $@) && \ - $(_xml2po) -m $(_xml2po_mode) -e -p "$${po}" \ + $(_xml2po) -m $(_xml2po_mode) -e -t "$${mo}" \ "$${d}C/$(notdir $@)" > $(notdir $@).tmp && \ cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp) @@ -386,12 +400,14 @@ clean-doc-omf: ; rm -f $(_DOC_OMF_DB) $(_DOC_OMF_HTML) clean-doc-dsk: ; rm -f $(_DOC_DSK_DB) $(_DOC_DSK_HTML) clean-doc-lc: rm -f $(_DOC_LC_DOCS) + rm -f $(_DOC_MOFILES) @list='$(_DOC_POFILES)'; for po in $$list; do \ if ! test "$$po" -ef "$(srcdir)/$$po"; then \ echo "rm -f $$po"; \ rm -f "$$po"; \ fi; \ done +# .xml2.po.mo cleaning is obsolete as of 0.18.1 and could be removed in 0.20.x @for lc in C $(_DOC_REAL_LINGUAS); do \ if test -f "$$lc/.xml2po.mo"; then \ echo "rm -f $$lc/.xml2po.mo"; \ diff --git a/gtksecentry/Makefile.in b/gtksecentry/Makefile.in index 4ea70a7..5d13085 100644 --- a/gtksecentry/Makefile.in +++ b/gtksecentry/Makefile.in @@ -132,6 +132,8 @@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ @@ -149,6 +151,7 @@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +KA_PLUGINS_DIR = @KA_PLUGINS_DIR@ KRB5_CFLAGS = @KRB5_CFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ KRB5_LIBS = @KRB5_LIBS@ @@ -189,6 +192,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_LIBS = @PAM_LIBS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ diff --git a/help/Makefile.in b/help/Makefile.in index 2ec9b8a..d66e50a 100644 --- a/help/Makefile.in +++ b/help/Makefile.in @@ -122,6 +122,8 @@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ @@ -139,6 +141,7 @@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +KA_PLUGINS_DIR = @KA_PLUGINS_DIR@ KRB5_CFLAGS = @KRB5_CFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ KRB5_LIBS = @KRB5_LIBS@ @@ -179,6 +182,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_LIBS = @PAM_LIBS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ @@ -323,6 +327,7 @@ _DOC_C_HTML = $(foreach f, \ _DOC_POFILES = $(if $(DOC_MODULE)$(DOC_ID), \ $(foreach lc,$(_DOC_REAL_LINGUAS),$(lc)/$(lc).po)) +_DOC_MOFILES = $(patsubst %.po,%.mo,$(_DOC_POFILES)) _DOC_LC_MODULES = $(if $(DOC_MODULE), \ $(foreach lc,$(_DOC_REAL_LINGUAS),$(lc)/$(DOC_MODULE).xml)) @@ -678,6 +683,9 @@ omf: $(_DOC_OMF_ALL) .PHONY: po po: $(_DOC_POFILES) +.PHONY: mo +mo: $(_DOC_MOFILES) + $(_DOC_POFILES): @if ! test -d $(dir $@); then \ echo "mkdir $(dir $@)"; \ @@ -705,16 +713,23 @@ $(_DOC_POFILES): $(_xml2po) -m $(_xml2po_mode) -e -u $(notdir $@) $$docs); \ fi +$(_DOC_MOFILES): %.mo: %.po + @if ! test -d $(dir $@); then \ + echo "mkdir $(dir $@)"; \ + mkdir "$(dir $@)"; \ + fi + msgfmt -o $@ $< + # FIXME: fix the dependancy # FIXME: hook xml2po up -$(_DOC_LC_DOCS) : $(_DOC_POFILES) +$(_DOC_LC_DOCS) : $(_DOC_MOFILES) $(_DOC_LC_DOCS) : $(_DOC_C_DOCS) if ! test -d $(dir $@); then mkdir $(dir $@); fi if [ -f "C/$(notdir $@)" ]; then d="../"; else d="$(_DOC_ABS_SRCDIR)/"; fi; \ - po="$(dir $@)$(patsubst %/$(notdir $@),%,$@).po"; \ - if [ -f "$${po}" ]; then po="../$${po}"; else po="$(_DOC_ABS_SRCDIR)/$${po}"; fi; \ + mo="$(dir $@)$(patsubst %/$(notdir $@),%,$@).mo"; \ + if [ -f "$${mo}" ]; then mo="../$${mo}"; else mo="$(_DOC_ABS_SRCDIR)/$${mo}"; fi; \ (cd $(dir $@) && \ - $(_xml2po) -m $(_xml2po_mode) -e -p "$${po}" \ + $(_xml2po) -m $(_xml2po_mode) -e -t "$${mo}" \ "$${d}C/$(notdir $@)" > $(notdir $@).tmp && \ cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp) .PHONY: pot @@ -740,12 +755,14 @@ clean-doc-omf: ; rm -f $(_DOC_OMF_DB) $(_DOC_OMF_HTML) clean-doc-dsk: ; rm -f $(_DOC_DSK_DB) $(_DOC_DSK_HTML) clean-doc-lc: rm -f $(_DOC_LC_DOCS) + rm -f $(_DOC_MOFILES) @list='$(_DOC_POFILES)'; for po in $$list; do \ if ! test "$$po" -ef "$(srcdir)/$$po"; then \ echo "rm -f $$po"; \ rm -f "$$po"; \ fi; \ done +# .xml2.po.mo cleaning is obsolete as of 0.18.1 and could be removed in 0.20.x @for lc in C $(_DOC_REAL_LINGUAS); do \ if test -f "$$lc/.xml2po.mo"; then \ echo "rm -f $$lc/.xml2po.mo"; \ diff --git a/icons/22x22/Makefile.in b/icons/22x22/Makefile.in index 5b0fba2..d23d014 100644 --- a/icons/22x22/Makefile.in +++ b/icons/22x22/Makefile.in @@ -121,6 +121,8 @@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ @@ -138,6 +140,7 @@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +KA_PLUGINS_DIR = @KA_PLUGINS_DIR@ KRB5_CFLAGS = @KRB5_CFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ KRB5_LIBS = @KRB5_LIBS@ @@ -178,6 +181,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_LIBS = @PAM_LIBS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ diff --git a/icons/48x48/Makefile.in b/icons/48x48/Makefile.in index 06fcf64..3cf1ae4 100644 --- a/icons/48x48/Makefile.in +++ b/icons/48x48/Makefile.in @@ -121,6 +121,8 @@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ @@ -138,6 +140,7 @@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +KA_PLUGINS_DIR = @KA_PLUGINS_DIR@ KRB5_CFLAGS = @KRB5_CFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ KRB5_LIBS = @KRB5_LIBS@ @@ -178,6 +181,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_LIBS = @PAM_LIBS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ diff --git a/icons/Makefile.in b/icons/Makefile.in index 40e6dde..4cd3dec 100644 --- a/icons/Makefile.in +++ b/icons/Makefile.in @@ -137,6 +137,8 @@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ @@ -154,6 +156,7 @@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +KA_PLUGINS_DIR = @KA_PLUGINS_DIR@ KRB5_CFLAGS = @KRB5_CFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ KRB5_LIBS = @KRB5_LIBS@ @@ -194,6 +197,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_LIBS = @PAM_LIBS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ diff --git a/icons/scalable/Makefile.in b/icons/scalable/Makefile.in index da379a8..2e56926 100644 --- a/icons/scalable/Makefile.in +++ b/icons/scalable/Makefile.in @@ -121,6 +121,8 @@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ @@ -138,6 +140,7 @@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +KA_PLUGINS_DIR = @KA_PLUGINS_DIR@ KRB5_CFLAGS = @KRB5_CFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ KRB5_LIBS = @KRB5_LIBS@ @@ -178,6 +181,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_LIBS = @PAM_LIBS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ diff --git a/krb5-auth-dialog.spec b/krb5-auth-dialog.spec index 696c2dd..a885a49 100644 --- a/krb5-auth-dialog.spec +++ b/krb5-auth-dialog.spec @@ -1,6 +1,6 @@ Summary: Kerberos 5 authentication dialog Name: krb5-auth-dialog -Version: 0.15 +Version: 0.16 Release: 1 License: GPL Group: User Interface/X diff --git a/plugins/Makefile.am b/plugins/Makefile.am new file mode 100644 index 0000000..8fecd5c --- /dev/null +++ b/plugins/Makefile.am @@ -0,0 +1,49 @@ +NULL = + +pkglibdir = $(KA_PLUGINS_DIR) + +if ENABLE_PAM_PLUGIN + PAM_PLUGIN = libka-plugin-pam.la +else + PAM_PLUGIN = +endif + +pkglib_LTLIBRARIES = \ + libka-plugin-dummy.la \ + $(PAM_PLUGIN) \ + $(NULL) + +# Dummy example plugin +libka_plugin_dummy_la_SOURCES = \ + ka-plugin-dummy.c \ + ka-plugin-dummy.h \ + $(NULL) + +libka_plugin_dummy_la_CPPFLAGS = \ + $(GTK_CFLAGS) \ + -I$(top_srcdir)/src \ + $(NULL) + +libka_plugin_dummy_la_LDFLAGS = \ + -module \ + -avoid-version \ + $(NULL) + +# PAM plugin +if ENABLE_PAM_PLUGIN +libka_plugin_pam_la_SOURCES = \ + ka-plugin-pam.c \ + ka-plugin-pam.h \ + $(NULL) + +libka_plugin_pam_la_CPPFLAGS = \ + $(GTK_CFLAGS) \ + -I$(top_srcdir)/src \ + $(NULL) + +libka_plugin_pam_la_LDFLAGS = \ + -module \ + -avoid-version \ + $(PAM_LIBS) \ + $(NULL) +endif diff --git a/plugins/Makefile.in b/plugins/Makefile.in new file mode 100644 index 0000000..a2ca6c5 --- /dev/null +++ b/plugins/Makefile.in @@ -0,0 +1,679 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = plugins +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/m4/compiler-flags.m4 \ + $(top_srcdir)/m4/gnome-doc-utils.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(pkglibdir)" +LTLIBRARIES = $(pkglib_LTLIBRARIES) +libka_plugin_dummy_la_LIBADD = +am__objects_1 = +am_libka_plugin_dummy_la_OBJECTS = \ + libka_plugin_dummy_la-ka-plugin-dummy.lo $(am__objects_1) +libka_plugin_dummy_la_OBJECTS = $(am_libka_plugin_dummy_la_OBJECTS) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +libka_plugin_dummy_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libka_plugin_dummy_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +libka_plugin_pam_la_LIBADD = +am__libka_plugin_pam_la_SOURCES_DIST = ka-plugin-pam.c ka-plugin-pam.h +@ENABLE_PAM_PLUGIN_TRUE@am_libka_plugin_pam_la_OBJECTS = \ +@ENABLE_PAM_PLUGIN_TRUE@ libka_plugin_pam_la-ka-plugin-pam.lo \ +@ENABLE_PAM_PLUGIN_TRUE@ $(am__objects_1) +libka_plugin_pam_la_OBJECTS = $(am_libka_plugin_pam_la_OBJECTS) +libka_plugin_pam_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libka_plugin_pam_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +@ENABLE_PAM_PLUGIN_TRUE@am_libka_plugin_pam_la_rpath = -rpath \ +@ENABLE_PAM_PLUGIN_TRUE@ $(pkglibdir) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = $(libka_plugin_dummy_la_SOURCES) \ + $(libka_plugin_pam_la_SOURCES) +DIST_SOURCES = $(libka_plugin_dummy_la_SOURCES) \ + $(am__libka_plugin_pam_la_SOURCES_DIST) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +pkglibdir = $(KA_PLUGINS_DIR) +ACLOCAL = @ACLOCAL@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +COMPILER_FLAGS = @COMPILER_FLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ +DOC_USER_FORMATS = @DOC_USER_FORMATS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GCONFTOOL = @GCONFTOOL@ +GCONF_CFLAGS = @GCONF_CFLAGS@ +GCONF_LIBS = @GCONF_LIBS@ +GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@ +GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ +GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GREP = @GREP@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +HELP_DIR = @HELP_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +KA_PLUGINS_DIR = @KA_PLUGINS_DIR@ +KRB5_CFLAGS = @KRB5_CFLAGS@ +KRB5_CONFIG = @KRB5_CONFIG@ +KRB5_LIBS = @KRB5_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBCAP = @LIBCAP@ +LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@ +LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NETWORK_MANAGER_CFLAGS = @NETWORK_MANAGER_CFLAGS@ +NETWORK_MANAGER_LIBS = @NETWORK_MANAGER_LIBS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OMF_DIR = @OMF_DIR@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_LIBS = @PAM_LIBS@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +RANLIB = @RANLIB@ +SC_PKCS11 = @SC_PKCS11@ +SED = @SED@ +SETCAP = @SETCAP@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +WARN_PYTHON_CFLAGS = @WARN_PYTHON_CFLAGS@ +XGETTEXT = @XGETTEXT@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +check_interval = @check_interval@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +minimum_lifetime = @minimum_lifetime@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +NULL = +@ENABLE_PAM_PLUGIN_FALSE@PAM_PLUGIN = +@ENABLE_PAM_PLUGIN_TRUE@PAM_PLUGIN = libka-plugin-pam.la +pkglib_LTLIBRARIES = \ + libka-plugin-dummy.la \ + $(PAM_PLUGIN) \ + $(NULL) + + +# Dummy example plugin +libka_plugin_dummy_la_SOURCES = \ + ka-plugin-dummy.c \ + ka-plugin-dummy.h \ + $(NULL) + +libka_plugin_dummy_la_CPPFLAGS = \ + $(GTK_CFLAGS) \ + -I$(top_srcdir)/src \ + $(NULL) + +libka_plugin_dummy_la_LDFLAGS = \ + -module \ + -avoid-version \ + $(NULL) + + +# PAM plugin +@ENABLE_PAM_PLUGIN_TRUE@libka_plugin_pam_la_SOURCES = \ +@ENABLE_PAM_PLUGIN_TRUE@ ka-plugin-pam.c \ +@ENABLE_PAM_PLUGIN_TRUE@ ka-plugin-pam.h \ +@ENABLE_PAM_PLUGIN_TRUE@ $(NULL) + +@ENABLE_PAM_PLUGIN_TRUE@libka_plugin_pam_la_CPPFLAGS = \ +@ENABLE_PAM_PLUGIN_TRUE@ $(GTK_CFLAGS) \ +@ENABLE_PAM_PLUGIN_TRUE@ -I$(top_srcdir)/src \ +@ENABLE_PAM_PLUGIN_TRUE@ $(NULL) + +@ENABLE_PAM_PLUGIN_TRUE@libka_plugin_pam_la_LDFLAGS = \ +@ENABLE_PAM_PLUGIN_TRUE@ -module \ +@ENABLE_PAM_PLUGIN_TRUE@ -avoid-version \ +@ENABLE_PAM_PLUGIN_TRUE@ $(PAM_LIBS) \ +@ENABLE_PAM_PLUGIN_TRUE@ $(NULL) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ + } + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libka-plugin-dummy.la: $(libka_plugin_dummy_la_OBJECTS) $(libka_plugin_dummy_la_DEPENDENCIES) + $(AM_V_CCLD)$(libka_plugin_dummy_la_LINK) -rpath $(pkglibdir) $(libka_plugin_dummy_la_OBJECTS) $(libka_plugin_dummy_la_LIBADD) $(LIBS) +libka-plugin-pam.la: $(libka_plugin_pam_la_OBJECTS) $(libka_plugin_pam_la_DEPENDENCIES) + $(AM_V_CCLD)$(libka_plugin_pam_la_LINK) $(am_libka_plugin_pam_la_rpath) $(libka_plugin_pam_la_OBJECTS) $(libka_plugin_pam_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libka_plugin_dummy_la-ka-plugin-dummy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libka_plugin_pam_la-ka-plugin-pam.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libka_plugin_dummy_la-ka-plugin-dummy.lo: ka-plugin-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libka_plugin_dummy_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libka_plugin_dummy_la-ka-plugin-dummy.lo -MD -MP -MF $(DEPDIR)/libka_plugin_dummy_la-ka-plugin-dummy.Tpo -c -o libka_plugin_dummy_la-ka-plugin-dummy.lo `test -f 'ka-plugin-dummy.c' || echo '$(srcdir)/'`ka-plugin-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libka_plugin_dummy_la-ka-plugin-dummy.Tpo $(DEPDIR)/libka_plugin_dummy_la-ka-plugin-dummy.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ka-plugin-dummy.c' object='libka_plugin_dummy_la-ka-plugin-dummy.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libka_plugin_dummy_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libka_plugin_dummy_la-ka-plugin-dummy.lo `test -f 'ka-plugin-dummy.c' || echo '$(srcdir)/'`ka-plugin-dummy.c + +libka_plugin_pam_la-ka-plugin-pam.lo: ka-plugin-pam.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libka_plugin_pam_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libka_plugin_pam_la-ka-plugin-pam.lo -MD -MP -MF $(DEPDIR)/libka_plugin_pam_la-ka-plugin-pam.Tpo -c -o libka_plugin_pam_la-ka-plugin-pam.lo `test -f 'ka-plugin-pam.c' || echo '$(srcdir)/'`ka-plugin-pam.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libka_plugin_pam_la-ka-plugin-pam.Tpo $(DEPDIR)/libka_plugin_pam_la-ka-plugin-pam.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ka-plugin-pam.c' object='libka_plugin_pam_la-ka-plugin-pam.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libka_plugin_pam_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libka_plugin_pam_la-ka-plugin-pam.lo `test -f 'ka-plugin-pam.c' || echo '$(srcdir)/'`ka-plugin-pam.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pkglibLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-pkglibLTLIBRARIES \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/plugins/ka-plugin-dummy.c b/plugins/ka-plugin-dummy.c new file mode 100644 index 0000000..6485c0d --- /dev/null +++ b/plugins/ka-plugin-dummy.c @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2010 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "ka-plugin-dummy.h" +#include + +G_DEFINE_TYPE (KaPluginDummy, ka_plugin_dummy, KA_TYPE_PLUGIN) + +#define GET_PRIVATE(o) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((o), KA_TYPE_PLUGIN_DUMMY, KaPluginDummyPrivate)) + +int ka_plugin_major_version = KA_PLUGIN_MAJOR_VERSION; +int ka_plugin_minor_version = KA_PLUGIN_MINOR_VERSION; + +G_MODULE_EXPORT KaPlugin* +ka_plugin_create (void) +{ + return KA_PLUGIN (ka_plugin_dummy_new()); +} + +typedef struct _KaPluginDummyPrivate KaPluginDummyPrivate; + +struct _KaPluginDummyPrivate { + gulong handlers[3]; +}; + +event_cb (gpointer* applet, gchar* princ, guint when, gpointer user_data) +{ + g_message("%s %s @%d", user_data, princ, when); +} + +static void +ka_plugin_dummy_finalize (GObject *object) +{ + G_OBJECT_CLASS (ka_plugin_dummy_parent_class)->finalize (object); +} + +static void +ka_plugin_dummy_activate (KaPlugin *self, KaApplet* applet) +{ + KaPluginDummyPrivate *priv = GET_PRIVATE (self); + + priv->handlers[0] = g_signal_connect (applet, + "krb-tgt-expired", + G_CALLBACK (event_cb), + "Expired"); + priv->handlers[1] = g_signal_connect (applet, + "krb-tgt-acquired", + G_CALLBACK (event_cb), + "Acquired"); + priv->handlers[2] = g_signal_connect (applet, + "krb-tgt-renewed", + G_CALLBACK (event_cb), + "Renewed"); +} + +static void +ka_plugin_dummy_deactivate (KaPlugin *self, KaApplet* applet) +{ + int i; + KaPluginDummyPrivate *priv = GET_PRIVATE (self); + + for (i = 0; i < G_N_ELEMENTS(priv->handlers); i++) + g_signal_handler_disconnect (applet, priv->handlers[i]); +} + +static void +ka_plugin_dummy_class_init (KaPluginDummyClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + KaPluginClass *plugin_class = KA_PLUGIN_CLASS (klass); + + g_type_class_add_private (klass, sizeof (KaPluginDummyPrivate)); + + plugin_class->activate = ka_plugin_dummy_activate; + plugin_class->deactivate = ka_plugin_dummy_deactivate; + object_class->finalize = ka_plugin_dummy_finalize; +} + +static void +ka_plugin_dummy_init (KaPluginDummy *self) +{ +} + +KaPluginDummy* +ka_plugin_dummy_new (void) +{ + return g_object_new (KA_TYPE_PLUGIN_DUMMY, KA_PLUGIN_PROP_NAME, + "dummy", NULL); +} diff --git a/plugins/ka-plugin-dummy.h b/plugins/ka-plugin-dummy.h new file mode 100644 index 0000000..311861a --- /dev/null +++ b/plugins/ka-plugin-dummy.h @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2010 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef _KA_PLUGIN_DUMMY +#define _KA_PLUGIN_DUMMY + +#include "ka-plugin.h" + +G_BEGIN_DECLS + +#define KA_TYPE_PLUGIN_DUMMY ka_plugin_dummy_get_type() + +#define KA_PLUGIN_DUMMY(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), KA_TYPE_PLUGIN_DUMMY, KaPluginDummy)) + +#define KA_PLUGIN_DUMMY_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), KA_TYPE_PLUGIN_DUMMY, KaPluginDummyClass)) + +#define KA_IS_PLUGIN_DUMMY(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), KA_TYPE_PLUGIN_DUMMY)) + +#define KA_IS_PLUGIN_DUMMY_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), KA_TYPE_PLUGIN_DUMMY)) + +#define KA_PLUGIN_DUMMY_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), KA_TYPE_PLUGIN_DUMMY, KaPluginDummyClass)) + +typedef struct { + KaPlugin parent; +} KaPluginDummy; + +typedef struct { + KaPluginClass parent_class; +} KaPluginDummyClass; + +GType ka_plugin_dummy_get_type (void); + +KaPluginDummy* ka_plugin_dummy_new (void); + +G_END_DECLS + +#endif /* _KA_PLUGIN_DUMMY */ diff --git a/plugins/ka-plugin-pam.c b/plugins/ka-plugin-pam.c new file mode 100644 index 0000000..53d1f06 --- /dev/null +++ b/plugins/ka-plugin-pam.c @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2010 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "ka-plugin-pam.h" +#include + +#include + +G_DEFINE_TYPE (KaPluginPam, ka_plugin_pam, KA_TYPE_PLUGIN) + +#define GET_PRIVATE(o) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((o), KA_TYPE_PLUGIN_PAM, KaPluginPamPrivate)) + +typedef struct _KaPluginPamPrivate KaPluginPamPrivate; + +int ka_plugin_major_version = KA_PLUGIN_MAJOR_VERSION; +int ka_plugin_minor_version = KA_PLUGIN_MINOR_VERSION; + +G_MODULE_EXPORT KaPlugin* +ka_plugin_create (void) +{ + return KA_PLUGIN (ka_plugin_pam_new()); +} + +struct _KaPluginPamPrivate { + gulong handlers[2]; +}; + +static void +ka_plugin_pam_finalize (GObject *object) +{ + G_OBJECT_CLASS (ka_plugin_pam_parent_class)->finalize (object); +} + +static int simple_conv( int n, const struct pam_message **msg, struct pam_response **resp, void *data) +{ + return (PAM_CONV_ERR); +} + +static struct pam_conv simplepamconv = { simple_conv, NULL }; + +static void +renewed_event_cb (gpointer* applet, gchar* princ, guint when, gpointer user_data) +{ + const char *user; + pam_handle_t *pamh = NULL; + int retval = 0; + + user = g_get_user_name (); + retval = pam_start("ka-plugin-pam", user, &simplepamconv, &pamh); + if (retval) + goto out; + + retval = pam_setcred(pamh, PAM_ESTABLISH_CRED); + if (retval) + goto out; + +out: + if (retval) + g_warning("PAM plugin: %s", pam_strerror(pamh, retval)); + + if (pamh) + pam_end(pamh, PAM_SUCCESS); +} + +static void +ka_plugin_pam_activate (KaPlugin *self, KaApplet* applet) +{ + KaPluginPamPrivate *priv = GET_PRIVATE (self); + + priv->handlers[1] = g_signal_connect (applet, + "krb-tgt-acquired", + G_CALLBACK (renewed_event_cb), + NULL); + priv->handlers[0] = g_signal_connect (applet, + "krb-tgt-renewed", + G_CALLBACK (renewed_event_cb), + NULL); +} + + +static void +ka_plugin_pam_deactivate (KaPlugin *self, KaApplet* applet) +{ + KaPluginPamPrivate *priv = GET_PRIVATE (self); + + g_signal_handler_disconnect (applet, priv->handlers[0]); + g_signal_handler_disconnect (applet, priv->handlers[1]); +} + +static void +ka_plugin_pam_class_init (KaPluginPamClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + KaPluginClass *plugin_class = KA_PLUGIN_CLASS (klass); + + g_type_class_add_private (klass, sizeof (KaPluginPamPrivate)); + + plugin_class->activate = ka_plugin_pam_activate; + plugin_class->deactivate = ka_plugin_pam_deactivate; + object_class->finalize = ka_plugin_pam_finalize; +} + +static void +ka_plugin_pam_init (KaPluginPam *self) +{ +} + +KaPluginPam* +ka_plugin_pam_new (void) +{ + return g_object_new (KA_TYPE_PLUGIN_PAM, KA_PLUGIN_PROP_NAME, "pam", NULL); +} diff --git a/plugins/ka-plugin-pam.h b/plugins/ka-plugin-pam.h new file mode 100644 index 0000000..c693121 --- /dev/null +++ b/plugins/ka-plugin-pam.h @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2010 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef _KA_PLUGIN_PAM +#define _KA_PLUGIN_PAM + +#include + +G_BEGIN_DECLS + +#define KA_TYPE_PLUGIN_PAM ka_plugin_pam_get_type() + +#define KA_PLUGIN_PAM(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), KA_TYPE_PLUGIN_PAM, KaPluginPam)) + +#define KA_PLUGIN_PAM_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), KA_TYPE_PLUGIN_PAM, KaPluginPamClass)) + +#define KA_IS_PLUGIN_PAM(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), KA_TYPE_PLUGIN_PAM)) + +#define KA_IS_PLUGIN_PAM_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), KA_TYPE_PLUGIN_PAM)) + +#define KA_PLUGIN_PAM_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), KA_TYPE_PLUGIN_PAM, KaPluginPamClass)) + +typedef struct { + KaPlugin parent; +} KaPluginPam; + +typedef struct { + KaPluginClass parent_class; +} KaPluginPamClass; + +GType ka_plugin_pam_get_type (void); + +KaPluginPam* ka_plugin_pam_new (void); + +G_END_DECLS + +#endif /* _KA_PLUGIN_PAM */ + +/* ka-plugin-pam.c */ diff --git a/po/POTFILES.in b/po/POTFILES.in index 040ebc6..d2073d3 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,14 +1,14 @@ [type: gettext/glade]src/krb5-auth-dialog.xml -src/krb5-auth-dialog.c -src/krb5-auth-pwdialog.c +src/ka-dialog.c +src/ka-pwdialog.c src/dummy-strings.c -src/krb5-auth-applet.c -src/krb5-auth-tools.c -src/krb5-auth-tickets.c +src/ka-applet.c +src/ka-tools.c +src/ka-tickets.c src/krb5-auth-dialog.desktop.in src/krb5-auth-dialog.schemas.in gtksecentry/gtksecentry.c secmem/util.c -preferences/krb5-auth-dialog-preferences.c +preferences/ka-preferences.c preferences/krb5-auth-dialog-preferences.desktop.in [type: gettext/glade]preferences/krb5-auth-dialog-preferences.xml diff --git a/po/de.po b/po/de.po index 6ca5f32..f8baa70 100644 --- a/po/de.po +++ b/po/de.po @@ -11,17 +11,17 @@ # dem Client und Server und verifiziert selbst deren Identität. # # Guido Günther , 2009. -# Mario Blättermann , 2009. +# Mario Blättermann , 2009, 2010. # Christian Kirbach , 2009. # msgid "" msgstr "" -"Project-Id-Version: krb5-auth-dialog 0.8\n" +"Project-Id-Version: krb5-auth-dialog master\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=krb5-" "auth-dialog&component=general\n" -"POT-Creation-Date: 2009-10-16 21:53+0000\n" -"PO-Revision-Date: 2009-10-18 15:48+0200\n" -"Last-Translator: Christian Kirbach \n" +"POT-Creation-Date: 2010-04-27 17:51+0000\n" +"PO-Revision-Date: 2010-05-02 12:11+0100\n" +"Last-Translator: Mario Blättermann \n" "Language-Team: German \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -51,36 +51,36 @@ msgstr "Unbekannter Fehler" msgid "Expired" msgstr "Abgelaufen" -#: ../src/krb5-auth-pwdialog.c:170 +#: ../src/krb5-auth-pwdialog.c:173 #, c-format msgid "Couldn't acquire kerberos ticket: '%s'" msgstr "Kerberos-Ticket konnte nicht erlangt werden: »%s«" -#: ../src/krb5-auth-pwdialog.c:207 ../src/krb5-auth-applet.c:359 +#: ../src/krb5-auth-pwdialog.c:210 ../src/krb5-auth-applet.c:390 #, c-format msgid "Your credentials expire in %d minute" msgid_plural "Your credentials expire in %d minutes" msgstr[0] "Ihre Anmeldeinformationen laufen in %d Minute ab" msgstr[1] "Ihre Anmeldeinformationen laufen in %d Minuten ab" -#: ../src/krb5-auth-pwdialog.c:212 ../src/krb5-auth-applet.c:364 +#: ../src/krb5-auth-pwdialog.c:215 ../src/krb5-auth-applet.c:395 msgid "Your credentials have expired" msgstr "Anmeldeinformationen abgelaufen" -#: ../src/krb5-auth-pwdialog.c:233 +#: ../src/krb5-auth-pwdialog.c:236 msgid "Please enter your Kerberos password:" msgstr "Bitte geben Sie ihr Kerberos-Passwort ein:" -#: ../src/krb5-auth-pwdialog.c:244 +#: ../src/krb5-auth-pwdialog.c:247 #, c-format msgid "Please enter the password for '%s':" msgstr "Bitte geben Sie das Passwort für »%s« ein:" -#: ../src/krb5-auth-pwdialog.c:264 +#: ../src/krb5-auth-pwdialog.c:267 msgid "The password you entered is invalid" msgstr "Das eingegebene Passwort ist nicht gültig" -#: ../src/krb5-auth-pwdialog.c:280 +#: ../src/krb5-auth-pwdialog.c:283 #, c-format msgid "%s Error" msgstr "%s-Fehler" @@ -650,8 +650,7 @@ msgstr "Kerberos-Dienst ist unbekannt" #: ../src/dummy-strings.c:120 msgid "Cannot contact any KDC for requested realm" msgstr "" -"Es kann kein KDC des angeforderten Administrationsbereiches kontaktiert " -"werden" +"Es kann kein KDC des angeforderten Administrationsbereiches kontaktiert werden" #. krb5_err.et:krb5:KRB5_KDC_UNREACH #: ../src/dummy-strings.c:121 @@ -951,8 +950,7 @@ msgstr "" #: ../src/dummy-strings.c:177 msgid "Unsupported key table format version number" msgstr "" -"Nicht unterstützte Formatversionsnummer des Schlüsseltabelle-" -"Zwischenspeichers" +"Nicht unterstützte Formatversionsnummer des Schlüsseltabelle-Zwischenspeichers" #. krb5_err.et:krb5:KRB5_KEYTAB_BADVNO #: ../src/dummy-strings.c:178 @@ -978,7 +976,7 @@ msgstr "Administrationsbereich kann nicht für den Rechner bestimmt werden" #. krb5_err.et:krb5:KRB5_ERR_HOST_REALM_UNKNOWN #: ../src/dummy-strings.c:182 msgid "Conversion to service principal undefined for name type" -msgstr "" +msgstr "Umwandlung des Dienst-Principals ist für den Namenstyp nicht definiert" #. krb5_err.et:krb5:KRB5_SNAME_UNSUPP_NAMETYPE #: ../src/dummy-strings.c:183 @@ -1023,19 +1021,16 @@ msgstr "Ungültige SAM-Flags in obtain_sam_padata" #. krb5_err.et:krb5:KRB5_SAM_UNSUPPORTED #: ../src/dummy-strings.c:190 -#, fuzzy msgid "Invalid encryption type in SAM challenge" msgstr "Ungültige Verschlüsselungsart in SAM-Challenge" #. krb5_err.et:krb5:KRB5_SAM_INVALID_ETYPE #: ../src/dummy-strings.c:191 -#, fuzzy msgid "Missing checksum in SAM challenge" msgstr "Fehlende Prüfsumme in SAM-Challenge" #. krb5_err.et:krb5:KRB5_SAM_NO_CHECKSUM #: ../src/dummy-strings.c:192 -#, fuzzy msgid "Bad checksum in SAM challenge" msgstr "Falsche Prüfsumme in SAM-Challenge" @@ -1048,6 +1043,7 @@ msgstr "Name der Schlüsseltabelle ist zu lang" #: ../src/dummy-strings.c:194 msgid "Key version number for principal in key table is incorrect" msgstr "" +"Versionsnummer des Schlüssels für Principal in Schlüsseltabelle ist fehlerhaft" #. krb5_err.et:krb5:KRB5_KT_KVNONOTFOUND #: ../src/dummy-strings.c:195 @@ -1435,41 +1431,41 @@ msgid "Bad magic number for GSSAPI QUEUE" msgstr "Falsche magische Zahl für GSSAPI QUEUE" #. Translators: First number is hours, second number is minutes -#: ../src/krb5-auth-applet.c:355 +#: ../src/krb5-auth-applet.c:386 #, c-format msgid "Your credentials expire in %.2d:%.2dh" msgstr "Anmeldeinformationen laufen in %.2d:%.2dh ab." -#: ../src/krb5-auth-applet.c:460 +#: ../src/krb5-auth-applet.c:491 msgid "Don't show me this again" msgstr "Dies nicht mehr anzeigen" -#: ../src/krb5-auth-applet.c:497 +#: ../src/krb5-auth-applet.c:533 msgid "Network credentials valid" msgstr "Anmeldeinformationen sind gültig" -#: ../src/krb5-auth-applet.c:498 +#: ../src/krb5-auth-applet.c:534 msgid "You've refreshed your Kerberos credentials." msgstr "Sie haben Ihre Kerberos-Anmeldeinformationen erneuert." -#: ../src/krb5-auth-applet.c:511 +#: ../src/krb5-auth-applet.c:550 msgid "Network credentials expiring" msgstr "Anmeldeinformationen laufen ab" -#: ../src/krb5-auth-applet.c:526 +#: ../src/krb5-auth-applet.c:569 msgid "Network credentials expired" msgstr "Anmeldeinformationen abgelaufen" -#: ../src/krb5-auth-applet.c:527 +#: ../src/krb5-auth-applet.c:570 msgid "Your Kerberos credentails have expired." msgstr "Ihre Kerberos-Anmeldeinformationen sind abgelaufen." -#: ../src/krb5-auth-applet.c:570 +#: ../src/krb5-auth-applet.c:615 #, c-format msgid "There was an error launching the preferences dialog: %s" msgstr "Fehler beim Öffnen des Einstellungsdialogs: %s" -#: ../src/krb5-auth-applet.c:611 +#: ../src/krb5-auth-applet.c:656 #, c-format msgid "" "There was an error displaying %s:\n" @@ -1479,7 +1475,7 @@ msgstr "" "%s" #. Translators: add the translators of your language here -#: ../src/krb5-auth-applet.c:647 +#: ../src/krb5-auth-applet.c:692 msgid "translator-credits" msgstr "" "Guido Günther \n" @@ -1487,7 +1483,7 @@ msgstr "" "Christian Kirbach " #. kdestroy -#: ../src/krb5-auth-applet.c:689 +#: ../src/krb5-auth-applet.c:734 msgid "Remove Credentials _Cache" msgstr "_Anmeldeinformationen löschen" @@ -1533,93 +1529,101 @@ msgid "Kerberos Network Authentication Dialog" msgstr "Kerberos Netzwerkanmeldungsdialog" #: ../src/krb5-auth-dialog.schemas.in.h:1 +msgid "Enabled plugins" +msgstr "Aktivierte Plugins" + +#: ../src/krb5-auth-dialog.schemas.in.h:2 msgid "Forwardable ticket" msgstr "Weiterleitbares Ticket" -#: ../src/krb5-auth-dialog.schemas.in.h:2 +#: ../src/krb5-auth-dialog.schemas.in.h:3 msgid "Kerberos principal" msgstr "Kerberos-Principal" -#: ../src/krb5-auth-dialog.schemas.in.h:3 +#: ../src/krb5-auth-dialog.schemas.in.h:4 +msgid "List of plugins that should be loaded and activated on startup." +msgstr "" +"Liste der Plugins, welche beim Start geladen und aktiviert werden sollen." + +#: ../src/krb5-auth-dialog.schemas.in.h:5 msgid "Notify user when ticket becomes valid" msgstr "Nutzer benachrichtigen, wenn Ticket gültig wird" -#: ../src/krb5-auth-dialog.schemas.in.h:4 +#: ../src/krb5-auth-dialog.schemas.in.h:6 msgid "Notify user when ticket has expired" msgstr "Nutzer benachrichtigen, wenn Ticket abgelaufen ist" -#: ../src/krb5-auth-dialog.schemas.in.h:5 +#: ../src/krb5-auth-dialog.schemas.in.h:7 msgid "Notify user when ticket is about to expire" msgstr "Nutzer benachrichtigen, wenn Ticket kurz vor Ablauf ist" # Mit Protokollerweiterungen namens PKinit wurde die Verwendung von Zertifikaten in Kerberos integriert -#: ../src/krb5-auth-dialog.schemas.in.h:6 +#: ../src/krb5-auth-dialog.schemas.in.h:8 msgid "PKINIT CA certificates" msgstr "PKINIT-Zertifikate einer Zertifizierungsstelle" -#: ../src/krb5-auth-dialog.schemas.in.h:7 +#: ../src/krb5-auth-dialog.schemas.in.h:9 msgid "PKINIT identifier" msgstr "PKINIT-Bezeichner" -#: ../src/krb5-auth-dialog.schemas.in.h:8 +#: ../src/krb5-auth-dialog.schemas.in.h:10 msgid "PKINIT trust anchors" msgstr "" -#: ../src/krb5-auth-dialog.schemas.in.h:9 +#: ../src/krb5-auth-dialog.schemas.in.h:11 msgid "Prompt minutes before expiry" msgstr "Minuten vor Ablauf nachfragen" -#: ../src/krb5-auth-dialog.schemas.in.h:10 +#: ../src/krb5-auth-dialog.schemas.in.h:12 msgid "Proxiable ticket" msgstr "" -#: ../src/krb5-auth-dialog.schemas.in.h:11 +#: ../src/krb5-auth-dialog.schemas.in.h:13 msgid "Renewable ticket" msgstr "Erneuerbares Ticket" -#: ../src/krb5-auth-dialog.schemas.in.h:12 +#: ../src/krb5-auth-dialog.schemas.in.h:14 msgid "Requested tickets should be forwardable" msgstr "" -#: ../src/krb5-auth-dialog.schemas.in.h:13 +#: ../src/krb5-auth-dialog.schemas.in.h:15 msgid "Requested tickets should be proxiable" msgstr "" -#: ../src/krb5-auth-dialog.schemas.in.h:14 +#: ../src/krb5-auth-dialog.schemas.in.h:16 msgid "Requested tickets should be renewable" msgstr "" -#: ../src/krb5-auth-dialog.schemas.in.h:15 +#: ../src/krb5-auth-dialog.schemas.in.h:17 msgid "Show a trayicon in the status area of the panel" msgstr "Ein Symbol im Benachrichtigungsfeld des Panels anzeigen" -#: ../src/krb5-auth-dialog.schemas.in.h:16 +#: ../src/krb5-auth-dialog.schemas.in.h:18 msgid "Show trayicon" msgstr "Benachrichtigungssymbol anzeigen" -#: ../src/krb5-auth-dialog.schemas.in.h:17 -msgid "" -"Start prompting/displaying notifications that many minutes before expiry" +#: ../src/krb5-auth-dialog.schemas.in.h:19 +msgid "Start prompting/displaying notifications that many minutes before expiry" msgstr "So viele Minuten vor Ablauf benachrichtigen/anzeigen" -#: ../src/krb5-auth-dialog.schemas.in.h:18 +#: ../src/krb5-auth-dialog.schemas.in.h:20 msgid "The kerberos principal to acquire the ticket for" msgstr "Der Kerberos-Principal, für den das Ticket erlangt werden soll" -#: ../src/krb5-auth-dialog.schemas.in.h:19 +#: ../src/krb5-auth-dialog.schemas.in.h:21 msgid "The principal's public/private/certificate identifier when using PKINIT" msgstr "" "Die öffentliche/private/Zertifikatsbezeichnung bei Verwendung von PKINIT" -#: ../src/krb5-auth-dialog.schemas.in.h:20 +#: ../src/krb5-auth-dialog.schemas.in.h:22 msgid "ticket expired notification" msgstr "Benachrichtigung über abgelaufenes Ticket" -#: ../src/krb5-auth-dialog.schemas.in.h:21 +#: ../src/krb5-auth-dialog.schemas.in.h:23 msgid "ticket expiring notification" msgstr "Benachrichtigung über bald ablaufendes Ticket" -#: ../src/krb5-auth-dialog.schemas.in.h:22 +#: ../src/krb5-auth-dialog.schemas.in.h:24 msgid "valid ticket notification" msgstr "Benachrichtigung über gültiges Ticket" @@ -1675,8 +1679,8 @@ msgstr "Legt fest, ob erneuerbare Tickets angefordert werden sollen" #: ../preferences/krb5-auth-dialog-preferences.xml.h:8 msgid "If checked, use a security token (Smartcard) to authenticate." msgstr "" -"Legt fest, ob ein Sicherheits-Token (Smartcard) zur Identifizierung " -"verwendet wird" +"Legt fest, ob ein Sicherheits-Token (Smartcard) zur Identifizierung verwendet " +"wird" #: ../preferences/krb5-auth-dialog-preferences.xml.h:9 msgid "Kerberos" diff --git a/po/es.po b/po/es.po index 149ca2c..6006bce 100644 --- a/po/es.po +++ b/po/es.po @@ -4,19 +4,20 @@ # # Daniel Mustieles , 2009. # Jorge González , 2009, 2010. +# msgid "" msgstr "" "Project-Id-Version: krb5-auth-dialog.master\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=krb5-" "auth-dialog&component=general\n" -"POT-Creation-Date: 2009-11-02 11:26+0000\n" -"PO-Revision-Date: 2010-02-20 09:48+0100\n" +"POT-Creation-Date: 2010-04-27 17:51+0000\n" +"PO-Revision-Date: 2010-04-28 08:26+0200\n" "Last-Translator: Jorge González \n" "Language-Team: Español \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: KBabel 1.11.4\n" #: ../src/krb5-auth-dialog.xml.h:1 ../src/krb5-auth-dialog.desktop.in.h:2 @@ -40,36 +41,36 @@ msgstr "error desconocido" msgid "Expired" msgstr "Caducado" -#: ../src/krb5-auth-pwdialog.c:170 +#: ../src/krb5-auth-pwdialog.c:173 #, c-format msgid "Couldn't acquire kerberos ticket: '%s'" msgstr "No se pudo obtener el tique de Kerberos: «%s»" -#: ../src/krb5-auth-pwdialog.c:207 ../src/krb5-auth-applet.c:359 +#: ../src/krb5-auth-pwdialog.c:210 ../src/krb5-auth-applet.c:390 #, c-format msgid "Your credentials expire in %d minute" msgid_plural "Your credentials expire in %d minutes" msgstr[0] "Sus credenciales caducan en %d minuto" msgstr[1] "Sus credenciales caducan en %d minutos" -#: ../src/krb5-auth-pwdialog.c:212 ../src/krb5-auth-applet.c:364 +#: ../src/krb5-auth-pwdialog.c:215 ../src/krb5-auth-applet.c:395 msgid "Your credentials have expired" msgstr "Sus credenciales han caducado" -#: ../src/krb5-auth-pwdialog.c:233 +#: ../src/krb5-auth-pwdialog.c:236 msgid "Please enter your Kerberos password:" msgstr "Introduzca su contraseña de Kerberos:" -#: ../src/krb5-auth-pwdialog.c:244 +#: ../src/krb5-auth-pwdialog.c:247 #, c-format msgid "Please enter the password for '%s':" msgstr "Introduzca la contraseña para «%s»:" -#: ../src/krb5-auth-pwdialog.c:264 +#: ../src/krb5-auth-pwdialog.c:267 msgid "The password you entered is invalid" msgstr "La contraseña que ha introducido no es válida" -#: ../src/krb5-auth-pwdialog.c:280 +#: ../src/krb5-auth-pwdialog.c:283 #, c-format msgid "%s Error" msgstr "Error %s" @@ -813,12 +814,12 @@ msgstr "La caché de credenciales ya está registrada." #. krb5_err.et:krb5:KRB5_CC_TYPE_EXISTS #: ../src/dummy-strings.c:156 msgid "Key table type is already registered." -msgstr "" +msgstr "El tipo de tabla de claves ya está registrado." #. krb5_err.et:krb5:KRB5_KT_TYPE_EXISTS #: ../src/dummy-strings.c:157 msgid "Credentials cache I/O operation failed XXX" -msgstr "" +msgstr "Falló la operación XXX de credenciales de caché de E/S" #. krb5_err.et:krb5:KRB5_CC_IO #: ../src/dummy-strings.c:158 @@ -844,31 +845,32 @@ msgstr "Error al escribir en la caché de credenciales" #: ../src/dummy-strings.c:162 msgid "No more memory to allocate (in credentials cache code)" msgstr "" +"No hay más memoria para asignar (en el código de la caché de credenciales)" #. krb5_err.et:krb5:KRB5_CC_NOMEM #: ../src/dummy-strings.c:163 msgid "Bad format in credentials cache" -msgstr "" +msgstr "Formato erróneo en la caché de credenciales" #. krb5_err.et:krb5:KRB5_CC_FORMAT #: ../src/dummy-strings.c:164 msgid "No credentials found with supported encryption types" -msgstr "" +msgstr "No se encontraron credenciales con los tipos de cifrado soportados" #. krb5_err.et:krb5:KRB5_CC_NOT_KTYPE #: ../src/dummy-strings.c:165 msgid "Invalid KDC option combination (library internal error)" -msgstr "" +msgstr "Combinación de opción KDC no válida (error interno de la biblioteca)" #. krb5_err.et:krb5:KRB5_INVALID_FLAGS #: ../src/dummy-strings.c:166 msgid "Request missing second ticket" -msgstr "" +msgstr "Solicitar el segundo tique faltante" #. krb5_err.et:krb5:KRB5_NO_2ND_TKT #: ../src/dummy-strings.c:167 msgid "No credentials supplied to library routine" -msgstr "" +msgstr "No se proporcionaron credenciales a la rutina de la biblioteca" #. krb5_err.et:krb5:KRB5_NOCREDS_SUPPLIED #: ../src/dummy-strings.c:168 @@ -910,16 +912,19 @@ msgstr "Falló general de preautenticación" #: ../src/dummy-strings.c:175 msgid "Unsupported replay cache format version number" msgstr "" +"El número de versión de formato de la caché de repetición no está soportado" #. krb5_err.et:krb5:KRB5_RCACHE_BADVNO #: ../src/dummy-strings.c:176 msgid "Unsupported credentials cache format version number" msgstr "" +"El número de versión de formato de la caché de repetición no está soportado" #. krb5_err.et:krb5:KRB5_CCACHE_BADVNO #: ../src/dummy-strings.c:177 msgid "Unsupported key table format version number" msgstr "" +"El número de versión de formato de la tabla de claves no está soportado" #. krb5_err.et:krb5:KRB5_KEYTAB_BADVNO #: ../src/dummy-strings.c:178 @@ -1003,7 +1008,7 @@ msgstr "Suma de verificación errónea en el desafío SAM" #. krb5_err.et:krb5:KRB5_SAM_BAD_CHECKSUM #: ../src/dummy-strings.c:193 msgid "Keytab name too long" -msgstr "" +msgstr "El nombre de la tabla de claves es demasiado largo" #. krb5_err.et:krb5:KRB5_KT_NAME_TOOLONG #: ../src/dummy-strings.c:194 @@ -1035,7 +1040,7 @@ msgstr "Falló el cambio de contraseña" #. krb5_err.et:krb5:KRB5_CHPW_FAIL #: ../src/dummy-strings.c:199 msgid "Bad format in keytab" -msgstr "" +msgstr "Formato erróneo en la tabla de claves" #. krb5_err.et:krb5:KRB5_KT_FORMAT #: ../src/dummy-strings.c:200 @@ -1398,41 +1403,41 @@ msgid "Bad magic number for GSSAPI QUEUE" msgstr "Número mágico erróneo para GSSAPI QUEUE" #. Translators: First number is hours, second number is minutes -#: ../src/krb5-auth-applet.c:355 +#: ../src/krb5-auth-applet.c:386 #, c-format msgid "Your credentials expire in %.2d:%.2dh" msgstr "Sus credenciales caducan en %.2d:%.2dh" -#: ../src/krb5-auth-applet.c:460 +#: ../src/krb5-auth-applet.c:491 msgid "Don't show me this again" msgstr "No mostrar este mensaje de nuevo" -#: ../src/krb5-auth-applet.c:497 +#: ../src/krb5-auth-applet.c:533 msgid "Network credentials valid" msgstr "Credenciales de red válidas" -#: ../src/krb5-auth-applet.c:498 +#: ../src/krb5-auth-applet.c:534 msgid "You've refreshed your Kerberos credentials." msgstr "Ha actualizado sus credenciales de Kerberos." -#: ../src/krb5-auth-applet.c:511 +#: ../src/krb5-auth-applet.c:550 msgid "Network credentials expiring" msgstr "Las credenciales de red van a caducar" -#: ../src/krb5-auth-applet.c:526 +#: ../src/krb5-auth-applet.c:569 msgid "Network credentials expired" msgstr "Las credenciales de red han caducado" -#: ../src/krb5-auth-applet.c:527 +#: ../src/krb5-auth-applet.c:570 msgid "Your Kerberos credentails have expired." msgstr "Sus credenciales Kerberos han caducado" -#: ../src/krb5-auth-applet.c:570 +#: ../src/krb5-auth-applet.c:615 #, c-format msgid "There was an error launching the preferences dialog: %s" msgstr "Hubo un error al lanzar el diálogo de preferencias: %s" -#: ../src/krb5-auth-applet.c:611 +#: ../src/krb5-auth-applet.c:656 #, c-format msgid "" "There was an error displaying %s:\n" @@ -1442,14 +1447,14 @@ msgstr "" "%s" #. Translators: add the translators of your language here -#: ../src/krb5-auth-applet.c:647 +#: ../src/krb5-auth-applet.c:692 msgid "translator-credits" msgstr "" -"Jorge González , 2009\n" +"Jorge González , 2009-2010\n" "Daniel Mustieles , 2009" #. kdestroy -#: ../src/krb5-auth-applet.c:689 +#: ../src/krb5-auth-applet.c:734 msgid "Remove Credentials _Cache" msgstr "Quitar la _caché de credenciales" @@ -1464,123 +1469,131 @@ msgstr "" #: ../src/krb5-auth-tickets.c:54 msgid "Principal" -msgstr "" +msgstr "Principal" #: ../src/krb5-auth-tickets.c:60 msgid "Start Time" -msgstr "" +msgstr "Tiempo de inicio" #: ../src/krb5-auth-tickets.c:66 msgid "End Time" -msgstr "" +msgstr "Tiempo de finalización" #: ../src/krb5-auth-tickets.c:72 msgid "Fwd" -msgstr "" +msgstr "Rnv" #: ../src/krb5-auth-tickets.c:78 msgid "Proxy" -msgstr "" +msgstr "Proxy" #: ../src/krb5-auth-tickets.c:84 msgid "Renew" -msgstr "" +msgstr "Renovar" #: ../src/krb5-auth-tickets.c:107 msgid "Error displaying service ticket information" -msgstr "" +msgstr "Error al mostrar la información del tique de servicio" #: ../src/krb5-auth-dialog.desktop.in.h:1 msgid "Kerberos Network Authentication Dialog" msgstr "Diálogo de autenticación de red de Kerberos" #: ../src/krb5-auth-dialog.schemas.in.h:1 +msgid "Enabled plugins" +msgstr "Complementos activados" + +#: ../src/krb5-auth-dialog.schemas.in.h:2 msgid "Forwardable ticket" msgstr "Tique reenviable" -#: ../src/krb5-auth-dialog.schemas.in.h:2 +#: ../src/krb5-auth-dialog.schemas.in.h:3 msgid "Kerberos principal" msgstr "Principal de Kerberos" -#: ../src/krb5-auth-dialog.schemas.in.h:3 +#: ../src/krb5-auth-dialog.schemas.in.h:4 +msgid "List of plugins that should be loaded and activated on startup." +msgstr "Lista de complementos que se debería cargar y activar al inicio." + +#: ../src/krb5-auth-dialog.schemas.in.h:5 msgid "Notify user when ticket becomes valid" msgstr "Notificar al usuario cuando un tique se convierta en válido" -#: ../src/krb5-auth-dialog.schemas.in.h:4 +#: ../src/krb5-auth-dialog.schemas.in.h:6 msgid "Notify user when ticket has expired" msgstr "Notificar al usuario cuando un tique ha caducado" -#: ../src/krb5-auth-dialog.schemas.in.h:5 +#: ../src/krb5-auth-dialog.schemas.in.h:7 msgid "Notify user when ticket is about to expire" msgstr "Notificar al usuario cuando un tique va a caducar" -#: ../src/krb5-auth-dialog.schemas.in.h:6 +#: ../src/krb5-auth-dialog.schemas.in.h:8 msgid "PKINIT CA certificates" msgstr "Certificados PKINIT CA" -#: ../src/krb5-auth-dialog.schemas.in.h:7 +#: ../src/krb5-auth-dialog.schemas.in.h:9 msgid "PKINIT identifier" msgstr "Identificador PKINIT" -#: ../src/krb5-auth-dialog.schemas.in.h:8 +#: ../src/krb5-auth-dialog.schemas.in.h:10 msgid "PKINIT trust anchors" msgstr "Anclas de confianza de PKINIT" -#: ../src/krb5-auth-dialog.schemas.in.h:9 +#: ../src/krb5-auth-dialog.schemas.in.h:11 msgid "Prompt minutes before expiry" msgstr "Mostrar minutos antes de caducar" -#: ../src/krb5-auth-dialog.schemas.in.h:10 +#: ../src/krb5-auth-dialog.schemas.in.h:12 msgid "Proxiable ticket" msgstr "Tique vía proxy" -#: ../src/krb5-auth-dialog.schemas.in.h:11 +#: ../src/krb5-auth-dialog.schemas.in.h:13 msgid "Renewable ticket" msgstr "Tique renovable" -#: ../src/krb5-auth-dialog.schemas.in.h:12 +#: ../src/krb5-auth-dialog.schemas.in.h:14 msgid "Requested tickets should be forwardable" msgstr "Los tiques solicitados deberán ser reenviables" -#: ../src/krb5-auth-dialog.schemas.in.h:13 +#: ../src/krb5-auth-dialog.schemas.in.h:15 msgid "Requested tickets should be proxiable" msgstr "Los tiques solicitados deberán ser vía proxy" -#: ../src/krb5-auth-dialog.schemas.in.h:14 +#: ../src/krb5-auth-dialog.schemas.in.h:16 msgid "Requested tickets should be renewable" msgstr "Los tiques solicitados deberán ser renovables" -#: ../src/krb5-auth-dialog.schemas.in.h:15 +#: ../src/krb5-auth-dialog.schemas.in.h:17 msgid "Show a trayicon in the status area of the panel" msgstr "Mostrar un icono en la bandeja del sistema en el área del panel" -#: ../src/krb5-auth-dialog.schemas.in.h:16 +#: ../src/krb5-auth-dialog.schemas.in.h:18 msgid "Show trayicon" msgstr "Mostrar icono en la bandeja" -#: ../src/krb5-auth-dialog.schemas.in.h:17 +#: ../src/krb5-auth-dialog.schemas.in.h:19 msgid "" "Start prompting/displaying notifications that many minutes before expiry" msgstr "Dejar de mostrar notificaciones esos minutos antes de que caduque" -#: ../src/krb5-auth-dialog.schemas.in.h:18 +#: ../src/krb5-auth-dialog.schemas.in.h:20 msgid "The kerberos principal to acquire the ticket for" msgstr "El principal de Kerberos para el que adquirir el tique" -#: ../src/krb5-auth-dialog.schemas.in.h:19 +#: ../src/krb5-auth-dialog.schemas.in.h:21 msgid "The principal's public/private/certificate identifier when using PKINIT" msgstr "" "El identificador público/privado/certificado del principal al usar PKINIT" -#: ../src/krb5-auth-dialog.schemas.in.h:20 +#: ../src/krb5-auth-dialog.schemas.in.h:22 msgid "ticket expired notification" msgstr "notificación de tique caducado" -#: ../src/krb5-auth-dialog.schemas.in.h:21 +#: ../src/krb5-auth-dialog.schemas.in.h:23 msgid "ticket expiring notification" msgstr "notificación de caducidad de tique" -#: ../src/krb5-auth-dialog.schemas.in.h:22 +#: ../src/krb5-auth-dialog.schemas.in.h:24 msgid "valid ticket notification" msgstr "tique de notificación válido" diff --git a/po/sl.po b/po/sl.po index 82fb753..1216fc6 100644 --- a/po/sl.po +++ b/po/sl.po @@ -8,9 +8,9 @@ msgid "" msgstr "" "Project-Id-Version: krb5-auth-dialog\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=krb5-auth-dialog&component=general\n" -"POT-Creation-Date: 2010-04-02 14:19+0000\n" -"PO-Revision-Date: 2010-04-03 10:01+0100\n" -"Last-Translator: Matej Urbančič \n" +"POT-Creation-Date: 2010-04-29 08:29+0000\n" +"PO-Revision-Date: 2010-05-01 09:34+0100\n" +"Last-Translator: Andrej Žnidaršič \n" "Language-Team: Slovenian GNOME Translation Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -34,21 +34,21 @@ msgstr "Storitvene vstopnice" msgid "_Renew Ticket" msgstr "_Obnovi vstopnico" -#: ../src/krb5-auth-dialog.c:172 +#: ../src/ka-dialog.c:172 msgid "unknown error" msgstr "neznana napaka" -#: ../src/krb5-auth-dialog.c:328 +#: ../src/ka-dialog.c:328 msgid "Expired" msgstr "Pretečeno" -#: ../src/krb5-auth-pwdialog.c:173 +#: ../src/ka-pwdialog.c:173 #, c-format msgid "Couldn't acquire kerberos ticket: '%s'" msgstr "Ni mogoče pridobiti vstopnice kerberos: '%s'" -#: ../src/krb5-auth-pwdialog.c:210 -#: ../src/krb5-auth-applet.c:383 +#: ../src/ka-pwdialog.c:210 +#: ../src/ka-applet.c:390 #, c-format msgid "Your credentials expire in %d minute" msgid_plural "Your credentials expire in %d minutes" @@ -57,25 +57,25 @@ msgstr[1] "Vaša poverila potečejo v %d minuti" msgstr[2] "Vaša poverila potečejo v %d minutah" msgstr[3] "Vaša poverila potečejo v %d minutah" -#: ../src/krb5-auth-pwdialog.c:215 -#: ../src/krb5-auth-applet.c:388 +#: ../src/ka-pwdialog.c:215 +#: ../src/ka-applet.c:395 msgid "Your credentials have expired" msgstr "Vaša poverila so potekla" -#: ../src/krb5-auth-pwdialog.c:236 +#: ../src/ka-pwdialog.c:236 msgid "Please enter your Kerberos password:" msgstr "Vnesite svoje geslo Kerberos:" -#: ../src/krb5-auth-pwdialog.c:247 +#: ../src/ka-pwdialog.c:247 #, c-format msgid "Please enter the password for '%s':" msgstr "Vnesite geslo za '%s':" -#: ../src/krb5-auth-pwdialog.c:267 +#: ../src/ka-pwdialog.c:267 msgid "The password you entered is invalid" msgstr "Vneseno geslo je neveljavno" -#: ../src/krb5-auth-pwdialog.c:283 +#: ../src/ka-pwdialog.c:283 #, c-format msgid "%s Error" msgstr "%s napaka" @@ -291,7 +291,7 @@ msgstr "Storitev zahtevana za obdelavo zahteve ni na voljo" #. krb5_err.et:krb5:KRB5KDC_ERR_SVC_UNAVAILABLE #: ../src/dummy-strings.c:51 msgid "Decrypt integrity check failed" -msgstr "Preverjanje celovitosti dešifriranja je spodletlo" +msgstr "Preverjanje celovitosti dešifriranja je spodletelo" #. krb5_err.et:krb5:KRB5KRB_AP_ERR_BAD_INTEGRITY #: ../src/dummy-strings.c:52 @@ -316,7 +316,7 @@ msgstr "Vstopnica ni za nas" #. krb5_err.et:krb5:KRB5KRB_AP_ERR_NOT_US #: ../src/dummy-strings.c:56 msgid "Ticket/authenticator don't match" -msgstr "Vstopnica in overitelj se ne skladana" +msgstr "Vstopnica in pooblastitelj overitve se ne skladata" #. krb5_err.et:krb5:KRB5KRB_AP_ERR_BADMATCH #: ../src/dummy-strings.c:57 @@ -1388,41 +1388,41 @@ msgid "Bad magic number for GSSAPI QUEUE" msgstr "Slabo čarobno število od GSSAPI VRSTE" #. Translators: First number is hours, second number is minutes -#: ../src/krb5-auth-applet.c:379 +#: ../src/ka-applet.c:386 #, c-format msgid "Your credentials expire in %.2d:%.2dh" msgstr "Vaša poverila potečejo v %.2d%.2dh" -#: ../src/krb5-auth-applet.c:484 +#: ../src/ka-applet.c:491 msgid "Don't show me this again" msgstr "Tega ne prikaži več" -#: ../src/krb5-auth-applet.c:524 +#: ../src/ka-applet.c:533 msgid "Network credentials valid" msgstr "Omrežna varovala so veljavna" -#: ../src/krb5-auth-applet.c:525 +#: ../src/ka-applet.c:534 msgid "You've refreshed your Kerberos credentials." msgstr "Osvežili ste svoja poverila Kerberos" -#: ../src/krb5-auth-applet.c:539 +#: ../src/ka-applet.c:550 msgid "Network credentials expiring" msgstr "Omrežna varovala bodo potekla" -#: ../src/krb5-auth-applet.c:554 +#: ../src/ka-applet.c:569 msgid "Network credentials expired" msgstr "Omrežna varovala so potekla" -#: ../src/krb5-auth-applet.c:555 +#: ../src/ka-applet.c:570 msgid "Your Kerberos credentails have expired." msgstr "Vaša varovala Kerberos so potekla." -#: ../src/krb5-auth-applet.c:599 +#: ../src/ka-applet.c:615 #, c-format msgid "There was an error launching the preferences dialog: %s" msgstr "Prišlo je do napake med zagonom pogovornega okna možnosti: %s" -#: ../src/krb5-auth-applet.c:640 +#: ../src/ka-applet.c:656 #, c-format msgid "" "There was an error displaying %s:\n" @@ -1432,18 +1432,18 @@ msgstr "" "%s" #. Translators: add the translators of your language here -#: ../src/krb5-auth-applet.c:676 +#: ../src/ka-applet.c:692 msgid "translator-credits" msgstr "" "Andrej Žnidaršič\n" "Matej Urbančič" #. kdestroy -#: ../src/krb5-auth-applet.c:718 +#: ../src/ka-applet.c:734 msgid "Remove Credentials _Cache" msgstr "Odstrani _predpomnilnik varoval" -#: ../src/krb5-auth-tools.c:45 +#: ../src/ka-tools.c:45 #, c-format msgid "" "There was an error displaying help:\n" @@ -1452,31 +1452,31 @@ msgstr "" "Prišlo je do napake med prikazovanjem pomoči:\n" "%s" -#: ../src/krb5-auth-tickets.c:54 +#: ../src/ka-tickets.c:54 msgid "Principal" msgstr "Ravnatelj" -#: ../src/krb5-auth-tickets.c:60 +#: ../src/ka-tickets.c:60 msgid "Start Time" msgstr "Začetni čas" -#: ../src/krb5-auth-tickets.c:66 +#: ../src/ka-tickets.c:66 msgid "End Time" msgstr "Končni čas" -#: ../src/krb5-auth-tickets.c:72 +#: ../src/ka-tickets.c:72 msgid "Fwd" msgstr "Posreduj" -#: ../src/krb5-auth-tickets.c:78 +#: ../src/ka-tickets.c:78 msgid "Proxy" msgstr "Posredovalni strežnik" -#: ../src/krb5-auth-tickets.c:84 +#: ../src/ka-tickets.c:84 msgid "Renew" msgstr "Obnovi" -#: ../src/krb5-auth-tickets.c:107 +#: ../src/ka-tickets.c:107 msgid "Error displaying service ticket information" msgstr "Napaka med prikazovanjem podrobnosti storitvene vstopnice" @@ -1485,90 +1485,98 @@ msgid "Kerberos Network Authentication Dialog" msgstr "Pogovorno okno Kerberos omrežne overitve" #: ../src/krb5-auth-dialog.schemas.in.h:1 +msgid "Enabled plugins" +msgstr "Omogočeni vstavki" + +#: ../src/krb5-auth-dialog.schemas.in.h:2 msgid "Forwardable ticket" msgstr "Prenosljiva vstopnica" -#: ../src/krb5-auth-dialog.schemas.in.h:2 +#: ../src/krb5-auth-dialog.schemas.in.h:3 msgid "Kerberos principal" msgstr "Kerberos ravnatelj" -#: ../src/krb5-auth-dialog.schemas.in.h:3 +#: ../src/krb5-auth-dialog.schemas.in.h:4 +msgid "List of plugins that should be loaded and activated on startup." +msgstr "Seznam vstavkov, ki bodo naloženi in omogočeni ob zagonu." + +#: ../src/krb5-auth-dialog.schemas.in.h:5 msgid "Notify user when ticket becomes valid" msgstr "Obvesti uporabnika, ko vstopnica postane veljavna" -#: ../src/krb5-auth-dialog.schemas.in.h:4 +#: ../src/krb5-auth-dialog.schemas.in.h:6 msgid "Notify user when ticket has expired" msgstr "Obvesti uporabnika ob poteku vstopnice" -#: ../src/krb5-auth-dialog.schemas.in.h:5 +#: ../src/krb5-auth-dialog.schemas.in.h:7 msgid "Notify user when ticket is about to expire" msgstr "Obvesti uporabnika, ko bo vstopnica potekla" -#: ../src/krb5-auth-dialog.schemas.in.h:6 +#: ../src/krb5-auth-dialog.schemas.in.h:8 msgid "PKINIT CA certificates" msgstr "CA potrdila PKINIT" -#: ../src/krb5-auth-dialog.schemas.in.h:7 +#: ../src/krb5-auth-dialog.schemas.in.h:9 msgid "PKINIT identifier" msgstr "Določilnik PKINIT" -#: ../src/krb5-auth-dialog.schemas.in.h:8 +#: ../src/krb5-auth-dialog.schemas.in.h:10 msgid "PKINIT trust anchors" msgstr "Sidra zaupanja PKINIT" -#: ../src/krb5-auth-dialog.schemas.in.h:9 +#: ../src/krb5-auth-dialog.schemas.in.h:11 msgid "Prompt minutes before expiry" msgstr "Opozorilo pred potekom v minutah" -#: ../src/krb5-auth-dialog.schemas.in.h:10 +#: ../src/krb5-auth-dialog.schemas.in.h:12 msgid "Proxiable ticket" msgstr "Posredovalna vstopnica" -#: ../src/krb5-auth-dialog.schemas.in.h:11 +#: ../src/krb5-auth-dialog.schemas.in.h:13 msgid "Renewable ticket" msgstr "Obnovljiva vstopnica" -#: ../src/krb5-auth-dialog.schemas.in.h:12 +#: ../src/krb5-auth-dialog.schemas.in.h:14 msgid "Requested tickets should be forwardable" msgstr "Zahtevane vstopnice bi morale biti prenosljive" -#: ../src/krb5-auth-dialog.schemas.in.h:13 +#: ../src/krb5-auth-dialog.schemas.in.h:15 msgid "Requested tickets should be proxiable" msgstr "Zahtevano vstopnico bi moralo biti mogoče posredovati" -#: ../src/krb5-auth-dialog.schemas.in.h:14 +#: ../src/krb5-auth-dialog.schemas.in.h:16 msgid "Requested tickets should be renewable" msgstr "Zahtevane vstopnice bi morale biti obnovljive" -#: ../src/krb5-auth-dialog.schemas.in.h:15 +#: ../src/krb5-auth-dialog.schemas.in.h:17 msgid "Show a trayicon in the status area of the panel" msgstr "Prikaz ikone sistemske vrstice v področju stanja na pultu" -#: ../src/krb5-auth-dialog.schemas.in.h:16 +#: ../src/krb5-auth-dialog.schemas.in.h:18 msgid "Show trayicon" msgstr "Pokaži ikono sistemske vrstice" -#: ../src/krb5-auth-dialog.schemas.in.h:17 +#: ../src/krb5-auth-dialog.schemas.in.h:19 msgid "Start prompting/displaying notifications that many minutes before expiry" msgstr "Začetek prikazovanja obvestil toliko minut pred potekom" -#: ../src/krb5-auth-dialog.schemas.in.h:18 +#: ../src/krb5-auth-dialog.schemas.in.h:20 msgid "The kerberos principal to acquire the ticket for" msgstr "Kerberos ravnatelj za izdajo vstopnice" -#: ../src/krb5-auth-dialog.schemas.in.h:19 +#: ../src/krb5-auth-dialog.schemas.in.h:21 msgid "The principal's public/private/certificate identifier when using PKINIT" msgstr "Ravnateljevo javno/zasebno/potrdilno določilo ob uporabi PKINIT" -#: ../src/krb5-auth-dialog.schemas.in.h:20 +#: ../src/krb5-auth-dialog.schemas.in.h:22 msgid "ticket expired notification" msgstr "obvestilo potekle vstopnice" -#: ../src/krb5-auth-dialog.schemas.in.h:21 +#: ../src/krb5-auth-dialog.schemas.in.h:23 msgid "ticket expiring notification" msgstr "obvestilo o pretekanju vstopnice" -#: ../src/krb5-auth-dialog.schemas.in.h:22 +#: ../src/krb5-auth-dialog.schemas.in.h:24 msgid "valid ticket notification" msgstr "obvestilo veljavne vstopnice" @@ -1577,15 +1585,15 @@ msgstr "obvestilo veljavne vstopnice" msgid "Warning: running q-agent setuid on this system is dangerous\n" msgstr "Opozorilo: poganjanje q-agent setuid na tem sistemu je nevarno\n" -#: ../preferences/krb5-auth-dialog-preferences.c:345 +#: ../preferences/ka-preferences.c:345 msgid "Choose Certificate" msgstr "Izbor potrdila" -#: ../preferences/krb5-auth-dialog-preferences.c:361 +#: ../preferences/ka-preferences.c:361 msgid "X509 Certificates" msgstr "X509 potrdila" -#: ../preferences/krb5-auth-dialog-preferences.c:365 +#: ../preferences/ka-preferences.c:365 msgid "all files" msgstr "vse datoteke" diff --git a/preferences/Makefile.am b/preferences/Makefile.am index fafb357..8a7187d 100644 --- a/preferences/Makefile.am +++ b/preferences/Makefile.am @@ -4,11 +4,11 @@ bin_PROGRAMS = krb5-auth-dialog-preferences man_MANS = krb5-auth-dialog-preferences.1 krb5_auth_dialog_preferences_SOURCES = \ - krb5-auth-dialog-preferences.c \ - $(top_srcdir)/src/krb5-auth-gconf-tools.c \ - $(top_srcdir)/src/krb5-auth-gconf-tools.h \ - $(top_srcdir)/src/krb5-auth-tools.c \ - $(top_srcdir)/src/krb5-auth-tools.h \ + ka-preferences.c \ + $(top_srcdir)/src/ka-gconf-tools.c \ + $(top_srcdir)/src/ka-gconf-tools.h \ + $(top_srcdir)/src/ka-tools.c \ + $(top_srcdir)/src/ka-tools.h \ $(NULL) krb5_auth_dialog_preferences_CPPFLAGS = \ diff --git a/preferences/Makefile.in b/preferences/Makefile.in index 053e45a..a95522f 100644 --- a/preferences/Makefile.in +++ b/preferences/Makefile.in @@ -52,9 +52,10 @@ am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \ "$(DESTDIR)$(desktopdir)" "$(DESTDIR)$(pkgdatadir)" PROGRAMS = $(bin_PROGRAMS) am__objects_1 = -am_krb5_auth_dialog_preferences_OBJECTS = krb5_auth_dialog_preferences-krb5-auth-dialog-preferences.$(OBJEXT) \ - krb5_auth_dialog_preferences-krb5-auth-gconf-tools.$(OBJEXT) \ - krb5_auth_dialog_preferences-krb5-auth-tools.$(OBJEXT) \ +am_krb5_auth_dialog_preferences_OBJECTS = \ + krb5_auth_dialog_preferences-ka-preferences.$(OBJEXT) \ + krb5_auth_dialog_preferences-ka-gconf-tools.$(OBJEXT) \ + krb5_auth_dialog_preferences-ka-tools.$(OBJEXT) \ $(am__objects_1) krb5_auth_dialog_preferences_OBJECTS = \ $(am_krb5_auth_dialog_preferences_OBJECTS) @@ -168,6 +169,8 @@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ @@ -185,6 +188,7 @@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +KA_PLUGINS_DIR = @KA_PLUGINS_DIR@ KRB5_CFLAGS = @KRB5_CFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ KRB5_LIBS = @KRB5_LIBS@ @@ -225,6 +229,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_LIBS = @PAM_LIBS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ @@ -302,11 +307,11 @@ top_srcdir = @top_srcdir@ NULL = man_MANS = krb5-auth-dialog-preferences.1 krb5_auth_dialog_preferences_SOURCES = \ - krb5-auth-dialog-preferences.c \ - $(top_srcdir)/src/krb5-auth-gconf-tools.c \ - $(top_srcdir)/src/krb5-auth-gconf-tools.h \ - $(top_srcdir)/src/krb5-auth-tools.c \ - $(top_srcdir)/src/krb5-auth-tools.h \ + ka-preferences.c \ + $(top_srcdir)/src/ka-gconf-tools.c \ + $(top_srcdir)/src/ka-gconf-tools.h \ + $(top_srcdir)/src/ka-tools.c \ + $(top_srcdir)/src/ka-tools.h \ $(NULL) krb5_auth_dialog_preferences_CPPFLAGS = \ @@ -435,9 +440,9 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5_auth_dialog_preferences-krb5-auth-dialog-preferences.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5_auth_dialog_preferences-krb5-auth-gconf-tools.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5_auth_dialog_preferences-krb5-auth-tools.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5_auth_dialog_preferences-ka-gconf-tools.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5_auth_dialog_preferences-ka-preferences.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5_auth_dialog_preferences-ka-tools.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -463,53 +468,53 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< -krb5_auth_dialog_preferences-krb5-auth-dialog-preferences.o: krb5-auth-dialog-preferences.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_preferences_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_preferences_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog_preferences-krb5-auth-dialog-preferences.o -MD -MP -MF $(DEPDIR)/krb5_auth_dialog_preferences-krb5-auth-dialog-preferences.Tpo -c -o krb5_auth_dialog_preferences-krb5-auth-dialog-preferences.o `test -f 'krb5-auth-dialog-preferences.c' || echo '$(srcdir)/'`krb5-auth-dialog-preferences.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog_preferences-krb5-auth-dialog-preferences.Tpo $(DEPDIR)/krb5_auth_dialog_preferences-krb5-auth-dialog-preferences.Po +krb5_auth_dialog_preferences-ka-preferences.o: ka-preferences.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_preferences_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_preferences_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog_preferences-ka-preferences.o -MD -MP -MF $(DEPDIR)/krb5_auth_dialog_preferences-ka-preferences.Tpo -c -o krb5_auth_dialog_preferences-ka-preferences.o `test -f 'ka-preferences.c' || echo '$(srcdir)/'`ka-preferences.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog_preferences-ka-preferences.Tpo $(DEPDIR)/krb5_auth_dialog_preferences-ka-preferences.Po @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='krb5-auth-dialog-preferences.c' object='krb5_auth_dialog_preferences-krb5-auth-dialog-preferences.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ka-preferences.c' object='krb5_auth_dialog_preferences-ka-preferences.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_preferences_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_preferences_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog_preferences-krb5-auth-dialog-preferences.o `test -f 'krb5-auth-dialog-preferences.c' || echo '$(srcdir)/'`krb5-auth-dialog-preferences.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_preferences_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_preferences_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog_preferences-ka-preferences.o `test -f 'ka-preferences.c' || echo '$(srcdir)/'`ka-preferences.c -krb5_auth_dialog_preferences-krb5-auth-dialog-preferences.obj: krb5-auth-dialog-preferences.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_preferences_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_preferences_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog_preferences-krb5-auth-dialog-preferences.obj -MD -MP -MF $(DEPDIR)/krb5_auth_dialog_preferences-krb5-auth-dialog-preferences.Tpo -c -o krb5_auth_dialog_preferences-krb5-auth-dialog-preferences.obj `if test -f 'krb5-auth-dialog-preferences.c'; then $(CYGPATH_W) 'krb5-auth-dialog-preferences.c'; else $(CYGPATH_W) '$(srcdir)/krb5-auth-dialog-preferences.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog_preferences-krb5-auth-dialog-preferences.Tpo $(DEPDIR)/krb5_auth_dialog_preferences-krb5-auth-dialog-preferences.Po +krb5_auth_dialog_preferences-ka-preferences.obj: ka-preferences.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_preferences_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_preferences_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog_preferences-ka-preferences.obj -MD -MP -MF $(DEPDIR)/krb5_auth_dialog_preferences-ka-preferences.Tpo -c -o krb5_auth_dialog_preferences-ka-preferences.obj `if test -f 'ka-preferences.c'; then $(CYGPATH_W) 'ka-preferences.c'; else $(CYGPATH_W) '$(srcdir)/ka-preferences.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog_preferences-ka-preferences.Tpo $(DEPDIR)/krb5_auth_dialog_preferences-ka-preferences.Po @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='krb5-auth-dialog-preferences.c' object='krb5_auth_dialog_preferences-krb5-auth-dialog-preferences.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ka-preferences.c' object='krb5_auth_dialog_preferences-ka-preferences.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_preferences_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_preferences_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog_preferences-krb5-auth-dialog-preferences.obj `if test -f 'krb5-auth-dialog-preferences.c'; then $(CYGPATH_W) 'krb5-auth-dialog-preferences.c'; else $(CYGPATH_W) '$(srcdir)/krb5-auth-dialog-preferences.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_preferences_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_preferences_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog_preferences-ka-preferences.obj `if test -f 'ka-preferences.c'; then $(CYGPATH_W) 'ka-preferences.c'; else $(CYGPATH_W) '$(srcdir)/ka-preferences.c'; fi` -krb5_auth_dialog_preferences-krb5-auth-gconf-tools.o: $(top_srcdir)/src/krb5-auth-gconf-tools.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_preferences_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_preferences_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog_preferences-krb5-auth-gconf-tools.o -MD -MP -MF $(DEPDIR)/krb5_auth_dialog_preferences-krb5-auth-gconf-tools.Tpo -c -o krb5_auth_dialog_preferences-krb5-auth-gconf-tools.o `test -f '$(top_srcdir)/src/krb5-auth-gconf-tools.c' || echo '$(srcdir)/'`$(top_srcdir)/src/krb5-auth-gconf-tools.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog_preferences-krb5-auth-gconf-tools.Tpo $(DEPDIR)/krb5_auth_dialog_preferences-krb5-auth-gconf-tools.Po +krb5_auth_dialog_preferences-ka-gconf-tools.o: $(top_srcdir)/src/ka-gconf-tools.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_preferences_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_preferences_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog_preferences-ka-gconf-tools.o -MD -MP -MF $(DEPDIR)/krb5_auth_dialog_preferences-ka-gconf-tools.Tpo -c -o krb5_auth_dialog_preferences-ka-gconf-tools.o `test -f '$(top_srcdir)/src/ka-gconf-tools.c' || echo '$(srcdir)/'`$(top_srcdir)/src/ka-gconf-tools.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog_preferences-ka-gconf-tools.Tpo $(DEPDIR)/krb5_auth_dialog_preferences-ka-gconf-tools.Po @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/krb5-auth-gconf-tools.c' object='krb5_auth_dialog_preferences-krb5-auth-gconf-tools.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/ka-gconf-tools.c' object='krb5_auth_dialog_preferences-ka-gconf-tools.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_preferences_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_preferences_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog_preferences-krb5-auth-gconf-tools.o `test -f '$(top_srcdir)/src/krb5-auth-gconf-tools.c' || echo '$(srcdir)/'`$(top_srcdir)/src/krb5-auth-gconf-tools.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_preferences_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_preferences_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog_preferences-ka-gconf-tools.o `test -f '$(top_srcdir)/src/ka-gconf-tools.c' || echo '$(srcdir)/'`$(top_srcdir)/src/ka-gconf-tools.c -krb5_auth_dialog_preferences-krb5-auth-gconf-tools.obj: $(top_srcdir)/src/krb5-auth-gconf-tools.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_preferences_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_preferences_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog_preferences-krb5-auth-gconf-tools.obj -MD -MP -MF $(DEPDIR)/krb5_auth_dialog_preferences-krb5-auth-gconf-tools.Tpo -c -o krb5_auth_dialog_preferences-krb5-auth-gconf-tools.obj `if test -f '$(top_srcdir)/src/krb5-auth-gconf-tools.c'; then $(CYGPATH_W) '$(top_srcdir)/src/krb5-auth-gconf-tools.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/krb5-auth-gconf-tools.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog_preferences-krb5-auth-gconf-tools.Tpo $(DEPDIR)/krb5_auth_dialog_preferences-krb5-auth-gconf-tools.Po +krb5_auth_dialog_preferences-ka-gconf-tools.obj: $(top_srcdir)/src/ka-gconf-tools.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_preferences_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_preferences_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog_preferences-ka-gconf-tools.obj -MD -MP -MF $(DEPDIR)/krb5_auth_dialog_preferences-ka-gconf-tools.Tpo -c -o krb5_auth_dialog_preferences-ka-gconf-tools.obj `if test -f '$(top_srcdir)/src/ka-gconf-tools.c'; then $(CYGPATH_W) '$(top_srcdir)/src/ka-gconf-tools.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/ka-gconf-tools.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog_preferences-ka-gconf-tools.Tpo $(DEPDIR)/krb5_auth_dialog_preferences-ka-gconf-tools.Po @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/krb5-auth-gconf-tools.c' object='krb5_auth_dialog_preferences-krb5-auth-gconf-tools.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/ka-gconf-tools.c' object='krb5_auth_dialog_preferences-ka-gconf-tools.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_preferences_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_preferences_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog_preferences-krb5-auth-gconf-tools.obj `if test -f '$(top_srcdir)/src/krb5-auth-gconf-tools.c'; then $(CYGPATH_W) '$(top_srcdir)/src/krb5-auth-gconf-tools.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/krb5-auth-gconf-tools.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_preferences_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_preferences_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog_preferences-ka-gconf-tools.obj `if test -f '$(top_srcdir)/src/ka-gconf-tools.c'; then $(CYGPATH_W) '$(top_srcdir)/src/ka-gconf-tools.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/ka-gconf-tools.c'; fi` -krb5_auth_dialog_preferences-krb5-auth-tools.o: $(top_srcdir)/src/krb5-auth-tools.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_preferences_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_preferences_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog_preferences-krb5-auth-tools.o -MD -MP -MF $(DEPDIR)/krb5_auth_dialog_preferences-krb5-auth-tools.Tpo -c -o krb5_auth_dialog_preferences-krb5-auth-tools.o `test -f '$(top_srcdir)/src/krb5-auth-tools.c' || echo '$(srcdir)/'`$(top_srcdir)/src/krb5-auth-tools.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog_preferences-krb5-auth-tools.Tpo $(DEPDIR)/krb5_auth_dialog_preferences-krb5-auth-tools.Po +krb5_auth_dialog_preferences-ka-tools.o: $(top_srcdir)/src/ka-tools.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_preferences_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_preferences_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog_preferences-ka-tools.o -MD -MP -MF $(DEPDIR)/krb5_auth_dialog_preferences-ka-tools.Tpo -c -o krb5_auth_dialog_preferences-ka-tools.o `test -f '$(top_srcdir)/src/ka-tools.c' || echo '$(srcdir)/'`$(top_srcdir)/src/ka-tools.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog_preferences-ka-tools.Tpo $(DEPDIR)/krb5_auth_dialog_preferences-ka-tools.Po @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/krb5-auth-tools.c' object='krb5_auth_dialog_preferences-krb5-auth-tools.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/ka-tools.c' object='krb5_auth_dialog_preferences-ka-tools.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_preferences_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_preferences_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog_preferences-krb5-auth-tools.o `test -f '$(top_srcdir)/src/krb5-auth-tools.c' || echo '$(srcdir)/'`$(top_srcdir)/src/krb5-auth-tools.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_preferences_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_preferences_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog_preferences-ka-tools.o `test -f '$(top_srcdir)/src/ka-tools.c' || echo '$(srcdir)/'`$(top_srcdir)/src/ka-tools.c -krb5_auth_dialog_preferences-krb5-auth-tools.obj: $(top_srcdir)/src/krb5-auth-tools.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_preferences_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_preferences_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog_preferences-krb5-auth-tools.obj -MD -MP -MF $(DEPDIR)/krb5_auth_dialog_preferences-krb5-auth-tools.Tpo -c -o krb5_auth_dialog_preferences-krb5-auth-tools.obj `if test -f '$(top_srcdir)/src/krb5-auth-tools.c'; then $(CYGPATH_W) '$(top_srcdir)/src/krb5-auth-tools.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/krb5-auth-tools.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog_preferences-krb5-auth-tools.Tpo $(DEPDIR)/krb5_auth_dialog_preferences-krb5-auth-tools.Po +krb5_auth_dialog_preferences-ka-tools.obj: $(top_srcdir)/src/ka-tools.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_preferences_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_preferences_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog_preferences-ka-tools.obj -MD -MP -MF $(DEPDIR)/krb5_auth_dialog_preferences-ka-tools.Tpo -c -o krb5_auth_dialog_preferences-ka-tools.obj `if test -f '$(top_srcdir)/src/ka-tools.c'; then $(CYGPATH_W) '$(top_srcdir)/src/ka-tools.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/ka-tools.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog_preferences-ka-tools.Tpo $(DEPDIR)/krb5_auth_dialog_preferences-ka-tools.Po @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/krb5-auth-tools.c' object='krb5_auth_dialog_preferences-krb5-auth-tools.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/ka-tools.c' object='krb5_auth_dialog_preferences-ka-tools.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_preferences_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_preferences_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog_preferences-krb5-auth-tools.obj `if test -f '$(top_srcdir)/src/krb5-auth-tools.c'; then $(CYGPATH_W) '$(top_srcdir)/src/krb5-auth-tools.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/krb5-auth-tools.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_preferences_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_preferences_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog_preferences-ka-tools.obj `if test -f '$(top_srcdir)/src/ka-tools.c'; then $(CYGPATH_W) '$(top_srcdir)/src/ka-tools.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/ka-tools.c'; fi` mostlyclean-libtool: -rm -f *.lo diff --git a/preferences/ka-preferences.c b/preferences/ka-preferences.c new file mode 100644 index 0000000..f925b7e --- /dev/null +++ b/preferences/ka-preferences.c @@ -0,0 +1,843 @@ +/* + * Copyright (C) 2009 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * Author: + * Guido Guenther + * + * based on the vino capplet which is: + * + * Copyright (C) 2003 Sun Microsystems, Inc. + * Copyright (C) 2006 Jonh Wendell + * + * Authors: + * Mark McLoughlin + * Jonh Wendell + */ + +#include "config.h" + +#include +#include + +#include "ka-gconf-tools.h" +#include "ka-tools.h" + +#define PKINIT_SMARTCARD "PKCS11:" SC_PKCS11 +#define PKINIT_FILE "FILE:" + +#define N_LISTENERS 8 + +typedef struct { + GtkBuilder *xml; + GConfClient *client; + + GtkWidget *dialog; + GtkWidget *principal_entry; + GtkWidget *pkuserid_entry; + GtkWidget *pkuserid_button; + GtkWidget *smartcard_toggle; + GtkWidget *pkanchors_entry; + GtkWidget *pkanchors_button; + GtkWidget *forwardable_toggle; + GtkWidget *proxiable_toggle; + GtkWidget *renewable_toggle; + GtkWidget *trayicon_toggle; + GtkWidget *prompt_mins_entry; + + guint listeners [N_LISTENERS]; + int n_listeners; +} KaPreferencesDialog; + + +static void +ka_preferences_principal_notify (GConfClient *client G_GNUC_UNUSED, + guint cnx_id G_GNUC_UNUSED, + GConfEntry *entry, + KaPreferencesDialog *dialog) +{ + const char *principal; + + if (!entry->value || entry->value->type != GCONF_VALUE_STRING) + return; + + principal = gconf_value_get_string (entry->value); + + if (!principal || !strlen(principal)) + gtk_entry_set_text (GTK_ENTRY (dialog->principal_entry), ""); + else { + const char *old_principal; + + old_principal = gtk_entry_get_text (GTK_ENTRY (dialog->principal_entry)); + if (!old_principal || (old_principal && strcmp (old_principal, principal))) + gtk_entry_set_text (GTK_ENTRY (dialog->principal_entry), principal); + } +} + + +static void +ka_preferences_dialog_principal_changed (GtkEntry *entry, + KaPreferencesDialog *dialog) +{ + const char *principal; + + principal = gtk_entry_get_text (entry); + + if (!principal || !strlen(principal)) + gconf_client_unset (dialog->client, KA_GCONF_KEY_PRINCIPAL, NULL); + else + gconf_client_set_string (dialog->client, KA_GCONF_KEY_PRINCIPAL, principal, NULL); +} + + +static void +ka_preferences_dialog_setup_principal_entry (KaPreferencesDialog *dialog) +{ + char *principal = NULL; + + dialog->principal_entry = GTK_WIDGET(gtk_builder_get_object (dialog->xml, "principal_entry")); + g_assert (dialog->principal_entry != NULL); + + if (!ka_gconf_get_string (dialog->client, KA_GCONF_KEY_PRINCIPAL, &principal)) + g_warning ("Getting principal failed"); + + if (principal && strlen(principal)) + gtk_entry_set_text (GTK_ENTRY (dialog->principal_entry), principal); + if (principal) + g_free (principal); + + g_signal_connect (dialog->principal_entry, "changed", + G_CALLBACK (ka_preferences_dialog_principal_changed), dialog); + + if (!gconf_client_key_is_writable (dialog->client, KA_GCONF_KEY_PRINCIPAL, NULL)) { + gtk_widget_set_sensitive (dialog->principal_entry, FALSE); + } + + dialog->listeners [dialog->n_listeners] = gconf_client_notify_add (dialog->client, + KA_GCONF_KEY_PRINCIPAL, + (GConfClientNotifyFunc) ka_preferences_principal_notify, + dialog, NULL, NULL); + dialog->n_listeners++; +} + + +static void +ka_preferences_pkuserid_notify (GConfClient *client G_GNUC_UNUSED, + guint cnx_id G_GNUC_UNUSED, + GConfEntry *entry, + KaPreferencesDialog *dialog) +{ + const char *pkuserid; + + if (!entry->value || entry->value->type != GCONF_VALUE_STRING) + return; + + pkuserid = gconf_value_get_string (entry->value); + + if (!pkuserid || !strlen(pkuserid)) + gtk_entry_set_text (GTK_ENTRY (dialog->pkuserid_entry), ""); + else { + const char *old_pkuserid; + + old_pkuserid = gtk_entry_get_text (GTK_ENTRY (dialog->pkuserid_entry)); + if (!old_pkuserid || (old_pkuserid && strcmp (old_pkuserid, pkuserid))) + gtk_entry_set_text (GTK_ENTRY (dialog->pkuserid_entry), pkuserid); + } +} + + +static void +ka_preferences_dialog_pkuserid_changed (GtkEntry *entry, + KaPreferencesDialog *dialog) +{ + const char *pkuserid; + + pkuserid = gtk_entry_get_text (entry); + + if (!pkuserid || !strlen(pkuserid)) + gconf_client_unset (dialog->client, KA_GCONF_KEY_PK_USERID, NULL); + else + gconf_client_set_string (dialog->client, KA_GCONF_KEY_PK_USERID, pkuserid, NULL); +} + + +static void +ka_preferences_dialog_setup_pkuserid_entry (KaPreferencesDialog *dialog) +{ + char *pkuserid = NULL; + + dialog->pkuserid_entry = GTK_WIDGET(gtk_builder_get_object (dialog->xml, "pkuserid_entry")); + g_assert (dialog->pkuserid_entry != NULL); + + if (!ka_gconf_get_string (dialog->client, KA_GCONF_KEY_PK_USERID, &pkuserid)) + g_warning ("Getting pkuserid failed"); + + if (pkuserid && strlen(pkuserid)) + gtk_entry_set_text (GTK_ENTRY (dialog->pkuserid_entry), pkuserid); + if (pkuserid) + g_free (pkuserid); + + g_signal_connect (dialog->pkuserid_entry, "changed", + G_CALLBACK (ka_preferences_dialog_pkuserid_changed), dialog); + if (!gconf_client_key_is_writable (dialog->client, KA_GCONF_KEY_PK_USERID, NULL)) { + gtk_widget_set_sensitive (dialog->pkuserid_entry, FALSE); + } + + dialog->listeners [dialog->n_listeners] = gconf_client_notify_add (dialog->client, + KA_GCONF_KEY_PK_USERID, + (GConfClientNotifyFunc) ka_preferences_pkuserid_notify, + dialog, NULL, NULL); + dialog->n_listeners++; +} + + +static void +ka_preferences_pkanchors_notify (GConfClient *client G_GNUC_UNUSED, + guint cnx_id G_GNUC_UNUSED, + GConfEntry *entry, + KaPreferencesDialog *dialog) +{ + const char *pkanchors; + + if (!entry->value || entry->value->type != GCONF_VALUE_STRING) + return; + + pkanchors = gconf_value_get_string (entry->value); + + if (!pkanchors || !strlen(pkanchors)) + gtk_entry_set_text (GTK_ENTRY (dialog->pkanchors_entry), ""); + else { + const char *old_pkanchors; + + old_pkanchors = gtk_entry_get_text (GTK_ENTRY (dialog->pkanchors_entry)); + if (!old_pkanchors || (old_pkanchors && strcmp (old_pkanchors, pkanchors))) + gtk_entry_set_text (GTK_ENTRY (dialog->pkanchors_entry), pkanchors); + } +} + + +static void +ka_preferences_dialog_pkanchors_changed (GtkEntry *entry, + KaPreferencesDialog *dialog) +{ + const char *pkanchors; + + pkanchors = gtk_entry_get_text (entry); + + if (!pkanchors || !strlen(pkanchors)) + gconf_client_unset (dialog->client, KA_GCONF_KEY_PK_ANCHORS, NULL); + else + gconf_client_set_string (dialog->client, KA_GCONF_KEY_PK_ANCHORS, pkanchors, NULL); +} + + +static void +ka_preferences_dialog_setup_pkanchors_entry (KaPreferencesDialog *dialog) +{ + char *pkanchors = NULL; + + dialog->pkanchors_entry = GTK_WIDGET(gtk_builder_get_object (dialog->xml, "pkanchors_entry")); + g_assert (dialog->pkanchors_entry != NULL); + + if (!ka_gconf_get_string (dialog->client, KA_GCONF_KEY_PK_ANCHORS, &pkanchors)) + g_warning ("Getting pkanchors failed"); + + if (pkanchors && strlen(pkanchors)) + gtk_entry_set_text (GTK_ENTRY (dialog->pkanchors_entry), pkanchors); + if (pkanchors) + g_free (pkanchors); + + g_signal_connect (dialog->pkanchors_entry, "changed", + G_CALLBACK (ka_preferences_dialog_pkanchors_changed), dialog); + if (!gconf_client_key_is_writable (dialog->client, KA_GCONF_KEY_PK_ANCHORS, NULL)) { + gtk_widget_set_sensitive (dialog->pkanchors_entry, FALSE); + } + + dialog->listeners [dialog->n_listeners] = gconf_client_notify_add (dialog->client, + KA_GCONF_KEY_PK_ANCHORS, + (GConfClientNotifyFunc) ka_preferences_pkanchors_notify, + dialog, NULL, NULL); + dialog->n_listeners++; +} + + +static void +ka_preferences_toggle_pkuserid_entry (gboolean state, KaPreferencesDialog *dialog) +{ + gtk_widget_set_sensitive (dialog->pkuserid_entry, state); + gtk_widget_set_sensitive (dialog->pkuserid_button, state); +} + + +static void +ka_preferences_dialog_smartcard_toggled (GtkToggleButton *toggle, + KaPreferencesDialog *dialog) +{ + gboolean smartcard = gtk_toggle_button_get_active (toggle); + static gchar *old_path = NULL; + + if (smartcard) { + const char *path; + + path = gtk_entry_get_text (GTK_ENTRY(dialog->pkuserid_entry)); + if (g_strcmp0 (path, PKINIT_SMARTCARD)) { + g_free (old_path); + old_path = g_strdup (path); + } + ka_preferences_toggle_pkuserid_entry (FALSE, dialog); + gconf_client_set_string (dialog->client, KA_GCONF_KEY_PK_USERID, PKINIT_SMARTCARD, NULL); + } else { + ka_preferences_toggle_pkuserid_entry (TRUE, dialog); + if (old_path) + gconf_client_set_string (dialog->client, KA_GCONF_KEY_PK_USERID, old_path, NULL); + else + gconf_client_unset (dialog->client, KA_GCONF_KEY_PK_USERID, NULL); + } +} + + +static void +ka_preferences_dialog_setup_smartcard_toggle(KaPreferencesDialog *dialog) +{ + char *pkuserid = NULL; + + dialog->smartcard_toggle = GTK_WIDGET(gtk_builder_get_object (dialog->xml, "smartcard_toggle")); + g_assert (dialog->smartcard_toggle != NULL); + + if (!ka_gconf_get_string (dialog->client, KA_GCONF_KEY_PK_USERID, &pkuserid)) + g_warning ("Getting pkanchors failed"); + + g_signal_connect (dialog->smartcard_toggle, "toggled", + G_CALLBACK (ka_preferences_dialog_smartcard_toggled), dialog); + + if (!g_strcmp0 (pkuserid, PKINIT_SMARTCARD)) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->smartcard_toggle), TRUE); + else + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->smartcard_toggle), FALSE); + + if (pkuserid) + g_free (pkuserid); +} + + +static void +ka_preferences_dialog_browse_certs (KaPreferencesDialog *dialog, GtkEntry *entry) +{ + GtkWidget *filechooser; + GtkFileFilter *cert_filter, *all_filter; + gchar *filename = NULL; + const gchar *current; + gint ret; + + filechooser = gtk_file_chooser_dialog_new(_("Choose Certificate"), + GTK_WINDOW(dialog->dialog), + GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, + NULL); + + current = gtk_entry_get_text (entry); + if (current && g_str_has_prefix (current, PKINIT_FILE) && + strlen(current) > strlen (PKINIT_FILE)) { + gtk_file_chooser_select_filename (GTK_FILE_CHOOSER(filechooser), + (const gchar*)¤t[strlen(PKINIT_FILE)]); + } + + cert_filter = g_object_ref_sink (gtk_file_filter_new ()); + gtk_file_filter_add_mime_type (cert_filter, "application/x-x509-ca-cert"); + gtk_file_filter_set_name (cert_filter, _("X509 Certificates")); + gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (filechooser), cert_filter); + all_filter = g_object_ref_sink (gtk_file_filter_new ()); + gtk_file_filter_add_pattern (all_filter, "*"); + gtk_file_filter_set_name (all_filter, _("all files")); + gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (filechooser), all_filter); + + ret = gtk_dialog_run (GTK_DIALOG(filechooser)); + if (ret == GTK_RESPONSE_ACCEPT) + filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(filechooser)); + gtk_widget_destroy (GTK_WIDGET(filechooser)); + + if (filename) { + gchar *cert = g_strconcat( PKINIT_FILE, filename, NULL); + gtk_entry_set_text (entry, cert); + g_free (filename); + g_free (cert); + } + g_object_unref (cert_filter); + g_object_unref (all_filter); +} + +static void +ka_preferences_dialog_browse_pkuserids (GtkButton *button G_GNUC_UNUSED, + KaPreferencesDialog *dialog) +{ + ka_preferences_dialog_browse_certs (dialog, + GTK_ENTRY(dialog->pkuserid_entry)); +} + +static void +ka_preferences_dialog_browse_pkanchors(GtkButton *button G_GNUC_UNUSED, + KaPreferencesDialog *dialog) +{ + ka_preferences_dialog_browse_certs (dialog, + GTK_ENTRY(dialog->pkanchors_entry)); +} + +static void +ka_preferences_dialog_setup_pkuserid_button (KaPreferencesDialog *dialog) +{ + dialog->pkuserid_button = GTK_WIDGET(gtk_builder_get_object (dialog->xml, "pkuserid_button")); + g_assert (dialog->pkuserid_button != NULL); + + g_signal_connect (dialog->pkuserid_button, "clicked", + G_CALLBACK (ka_preferences_dialog_browse_pkuserids), dialog); + +} + +static void +ka_preferences_dialog_setup_pkanchors_button (KaPreferencesDialog *dialog) +{ + dialog->pkanchors_button = GTK_WIDGET(gtk_builder_get_object (dialog->xml, "pkanchors_button")); + g_assert (dialog->pkanchors_button != NULL); + + g_signal_connect (dialog->pkanchors_button, "clicked", + G_CALLBACK (ka_preferences_dialog_browse_pkanchors), dialog); + +} + + +static void +ka_preferences_dialog_forwardable_toggled (GtkToggleButton *toggle, + KaPreferencesDialog *dialog) +{ + gboolean forwardable; + + forwardable = gtk_toggle_button_get_active (toggle); + + gconf_client_set_bool (dialog->client, KA_GCONF_KEY_FORWARDABLE, forwardable, NULL); +} + + +static void +ka_preferences_dialog_forwardable_notify (GConfClient *client G_GNUC_UNUSED, + guint cnx_id G_GNUC_UNUSED, + GConfEntry *entry, + KaPreferencesDialog *dialog) +{ + gboolean forwardable; + + if (!entry->value || entry->value->type != GCONF_VALUE_BOOL) + return; + + forwardable = gconf_value_get_bool (entry->value) != FALSE; + + if (forwardable != gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->forwardable_toggle))) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->forwardable_toggle), forwardable); +} + + +static gboolean +ka_preferences_dialog_setup_forwardable_toggle (KaPreferencesDialog *dialog) +{ + gboolean forwardable; + + dialog->forwardable_toggle = GTK_WIDGET(gtk_builder_get_object (dialog->xml, "forwardable_toggle")); + g_assert (dialog->forwardable_toggle != NULL); + + forwardable = gconf_client_get_bool (dialog->client, KA_GCONF_KEY_FORWARDABLE, NULL); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->forwardable_toggle), forwardable); + + g_signal_connect (dialog->forwardable_toggle, "toggled", + G_CALLBACK (ka_preferences_dialog_forwardable_toggled), dialog); + + if (!gconf_client_key_is_writable (dialog->client, KA_GCONF_KEY_FORWARDABLE, NULL)) { + gtk_widget_set_sensitive (dialog->forwardable_toggle, FALSE); + } + + dialog->listeners [dialog->n_listeners] = gconf_client_notify_add (dialog->client, + KA_GCONF_KEY_FORWARDABLE, + (GConfClientNotifyFunc) ka_preferences_dialog_forwardable_notify, + dialog, NULL, NULL); + dialog->n_listeners++; + return forwardable; +} + + +static void +ka_preferences_dialog_proxiable_toggled (GtkToggleButton *toggle, + KaPreferencesDialog *dialog) +{ + gboolean proxiable; + + proxiable = gtk_toggle_button_get_active (toggle); + + gconf_client_set_bool (dialog->client, KA_GCONF_KEY_PROXIABLE, proxiable, NULL); +} + + +static void +ka_preferences_dialog_proxiable_notify (GConfClient *client G_GNUC_UNUSED, + guint cnx_id G_GNUC_UNUSED, + GConfEntry *entry, + KaPreferencesDialog *dialog) +{ + gboolean proxiable; + + if (!entry->value || entry->value->type != GCONF_VALUE_BOOL) + return; + + proxiable = gconf_value_get_bool (entry->value) != FALSE; + + if (proxiable != gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->proxiable_toggle))) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->proxiable_toggle), proxiable); +} + + +static gboolean +ka_preferences_dialog_setup_proxiable_toggle (KaPreferencesDialog *dialog) +{ + gboolean proxiable; + + dialog->proxiable_toggle = GTK_WIDGET(gtk_builder_get_object (dialog->xml, "proxiable_toggle")); + g_assert (dialog->proxiable_toggle != NULL); + + proxiable = gconf_client_get_bool (dialog->client, KA_GCONF_KEY_PROXIABLE, NULL); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->proxiable_toggle), proxiable); + + g_signal_connect (dialog->proxiable_toggle, "toggled", + G_CALLBACK (ka_preferences_dialog_proxiable_toggled), dialog); + + if (!gconf_client_key_is_writable (dialog->client, KA_GCONF_KEY_PROXIABLE, NULL)) { + gtk_widget_set_sensitive (dialog->proxiable_toggle, FALSE); + } + + dialog->listeners [dialog->n_listeners] = gconf_client_notify_add (dialog->client, + KA_GCONF_KEY_PROXIABLE, + (GConfClientNotifyFunc) ka_preferences_dialog_proxiable_notify, + dialog, NULL, NULL); + dialog->n_listeners++; + return proxiable; +} + + +static void +ka_preferences_dialog_renewable_toggled (GtkToggleButton *toggle, + KaPreferencesDialog *dialog) +{ + gboolean renewable; + + renewable = gtk_toggle_button_get_active (toggle); + + gconf_client_set_bool (dialog->client, KA_GCONF_KEY_RENEWABLE, renewable, NULL); +} + + +static void +ka_preferences_dialog_renewable_notify (GConfClient *client G_GNUC_UNUSED, + guint cnx_id G_GNUC_UNUSED, + GConfEntry *entry, + KaPreferencesDialog *dialog) +{ + gboolean renewable; + + if (!entry->value || entry->value->type != GCONF_VALUE_BOOL) + return; + + renewable = gconf_value_get_bool (entry->value) != FALSE; + + if (renewable != gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->renewable_toggle))) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->renewable_toggle), renewable); +} + + +static gboolean +ka_preferences_dialog_setup_renewable_toggle (KaPreferencesDialog *dialog) +{ + gboolean renewable; + + dialog->renewable_toggle = GTK_WIDGET(gtk_builder_get_object (dialog->xml, "renewable_toggle")); + g_assert (dialog->renewable_toggle != NULL); + + renewable = gconf_client_get_bool (dialog->client, KA_GCONF_KEY_RENEWABLE, NULL); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->renewable_toggle), renewable); + + g_signal_connect (dialog->renewable_toggle, "toggled", + G_CALLBACK (ka_preferences_dialog_renewable_toggled), dialog); + + if (!gconf_client_key_is_writable (dialog->client, KA_GCONF_KEY_RENEWABLE, NULL)) { + gtk_widget_set_sensitive (dialog->renewable_toggle, FALSE); + } + + dialog->listeners [dialog->n_listeners] = gconf_client_notify_add (dialog->client, + KA_GCONF_KEY_RENEWABLE, + (GConfClientNotifyFunc) ka_preferences_dialog_renewable_notify, + dialog, NULL, NULL); + dialog->n_listeners++; + return renewable; +} + +static void +ka_preferences_dialog_trayicon_toggled (GtkToggleButton *toggle, + KaPreferencesDialog *dialog) +{ + gboolean trayicon; + + trayicon = gtk_toggle_button_get_active (toggle); + gconf_client_set_bool (dialog->client, KA_GCONF_KEY_SHOW_TRAYICON, trayicon, NULL); +} + + +static void +ka_preferences_dialog_trayicon_notify (GConfClient *client G_GNUC_UNUSED, + guint cnx_id G_GNUC_UNUSED, + GConfEntry *entry, + KaPreferencesDialog *dialog) +{ + gboolean trayicon; + + if (!entry->value || entry->value->type != GCONF_VALUE_BOOL) + return; + + trayicon = gconf_value_get_bool (entry->value) != FALSE; + + if (trayicon != gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->trayicon_toggle))) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->trayicon_toggle), trayicon); +} + + +static gboolean +ka_preferences_dialog_setup_trayicon_toggle (KaPreferencesDialog *dialog) +{ + gboolean trayicon; + + dialog->trayicon_toggle = GTK_WIDGET(gtk_builder_get_object (dialog->xml, "trayicon_toggle")); + g_assert (dialog->trayicon_toggle != NULL); + + trayicon = gconf_client_get_bool (dialog->client, KA_GCONF_KEY_SHOW_TRAYICON, NULL); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->trayicon_toggle), trayicon); + + g_signal_connect (dialog->trayicon_toggle, "toggled", + G_CALLBACK (ka_preferences_dialog_trayicon_toggled), dialog); + + if (!gconf_client_key_is_writable (dialog->client, KA_GCONF_KEY_SHOW_TRAYICON, NULL)) { + gtk_widget_set_sensitive (dialog->trayicon_toggle, FALSE); + } + + dialog->listeners [dialog->n_listeners] = gconf_client_notify_add (dialog->client, + KA_GCONF_KEY_SHOW_TRAYICON, + (GConfClientNotifyFunc) ka_preferences_dialog_trayicon_notify, + dialog, NULL, NULL); + dialog->n_listeners++; + return trayicon; +} + + +static void +ka_preferences_dialog_prompt_mins_changed (GtkSpinButton *button, + KaPreferencesDialog *dialog) +{ + gint prompt_mins; + + prompt_mins = gtk_spin_button_get_value_as_int (button); + gconf_client_set_int (dialog->client, KA_GCONF_KEY_PROMPT_MINS, prompt_mins, NULL); +} + + +static void +ka_preferences_dialog_prompt_mins_notify (GConfClient *client G_GNUC_UNUSED, + guint cnx_id G_GNUC_UNUSED, + GConfEntry *entry, + KaPreferencesDialog *dialog) +{ + gint prompt_mins; + + if (!entry->value || entry->value->type != GCONF_VALUE_INT) + return; + + prompt_mins = gconf_value_get_int (entry->value); + + if (prompt_mins != gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dialog->prompt_mins_entry))) + gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->prompt_mins_entry), prompt_mins); +} + + +static gint +ka_preferences_dialog_setup_prompt_mins_entry (KaPreferencesDialog *dialog) +{ + gint prompt_mins; + + dialog->prompt_mins_entry = GTK_WIDGET(gtk_builder_get_object (dialog->xml, "prompt_mins_entry")); + g_assert (dialog->prompt_mins_entry != NULL); + + prompt_mins = gconf_client_get_int (dialog->client, KA_GCONF_KEY_PROMPT_MINS, NULL); + + gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->prompt_mins_entry), prompt_mins); + + g_signal_connect (dialog->prompt_mins_entry, "value-changed", + G_CALLBACK (ka_preferences_dialog_prompt_mins_changed), dialog); + + if (!gconf_client_key_is_writable (dialog->client, KA_GCONF_KEY_PROMPT_MINS, NULL)) { + gtk_widget_set_sensitive (dialog->prompt_mins_entry, FALSE); + } + + dialog->listeners [dialog->n_listeners] = gconf_client_notify_add (dialog->client, + KA_GCONF_KEY_PROMPT_MINS, + (GConfClientNotifyFunc) ka_preferences_dialog_prompt_mins_notify, + dialog, NULL, NULL); + dialog->n_listeners++; + return prompt_mins; +} + + + +static void +ka_preferences_dialog_response (GtkWidget *widget, + int response, + KaPreferencesDialog *dialog) +{ + if (response != GTK_RESPONSE_HELP) { + gtk_widget_destroy (widget); + return; + } + + ka_show_help (gtk_window_get_screen (GTK_WINDOW (dialog->dialog)), + "#preferences", GTK_WINDOW(dialog->dialog)); +} + + +static void +ka_preferences_dialog_destroyed (GtkWidget *widget G_GNUC_UNUSED, + KaPreferencesDialog *dialog) +{ + dialog->dialog = NULL; + + gtk_main_quit (); +} + + +static gboolean +ka_preferences_dialog_init(KaPreferencesDialog* dialog) +{ + GError *error = NULL; + gboolean ret; + + dialog->xml = gtk_builder_new (); + + ret = gtk_builder_add_from_file(dialog->xml, KA_DATA_DIR G_DIR_SEPARATOR_S + PACKAGE "-preferences.xml", &error); + if (!ret) { + g_assert (error); + g_assert (error->message); + g_error ("Failed to load UI XML: %s", error->message); + } + + dialog->dialog = GTK_WIDGET(gtk_builder_get_object (dialog->xml, "krb5_auth_dialog_prefs")); + g_assert (dialog->dialog); + + g_signal_connect (dialog->dialog, "response", + G_CALLBACK (ka_preferences_dialog_response), dialog); + g_signal_connect (dialog->dialog, "destroy", + G_CALLBACK (ka_preferences_dialog_destroyed), dialog); + + dialog->client = gconf_client_get_default (); + gconf_client_add_dir (dialog->client, KA_GCONF_PATH, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); + + ka_preferences_dialog_setup_principal_entry (dialog); + ka_preferences_dialog_setup_pkuserid_entry (dialog); + ka_preferences_dialog_setup_pkuserid_button (dialog); + ka_preferences_dialog_setup_smartcard_toggle (dialog); + ka_preferences_dialog_setup_pkanchors_entry(dialog); + ka_preferences_dialog_setup_pkanchors_button (dialog); + ka_preferences_dialog_setup_forwardable_toggle (dialog); + ka_preferences_dialog_setup_proxiable_toggle (dialog); + ka_preferences_dialog_setup_renewable_toggle (dialog); + ka_preferences_dialog_setup_trayicon_toggle (dialog); + ka_preferences_dialog_setup_prompt_mins_entry (dialog); + + g_assert (dialog->n_listeners == N_LISTENERS); + + gtk_widget_show (dialog->dialog); + return TRUE; +} + + +static void +ka_preferences_dialog_finalize (KaPreferencesDialog *dialog) +{ + if (dialog->dialog) + gtk_widget_destroy (dialog->dialog); + dialog->dialog = NULL; + + if (dialog->client) { + int i; + + for (i = 0; i < dialog->n_listeners; i++) { + if (dialog->listeners [i]) + gconf_client_notify_remove (dialog->client, dialog->listeners [i]); + dialog->listeners [i] = 0; + } + dialog->n_listeners = 0; + + gconf_client_remove_dir (dialog->client, KA_GCONF_PATH, NULL); + + g_object_unref (dialog->client); + dialog->client = NULL; + } + + if (dialog->xml) + g_object_unref (dialog->xml); + dialog->xml = NULL; +} + +int +main (int argc, char *argv[]) +{ + GOptionContext *context; + GError *error = NULL; + KaPreferencesDialog dialog = { NULL, }; + + const char *help_msg = "Run '" PACKAGE " --help' to see a full list of available command line options"; + const GOptionEntry options [] = { + { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL } + }; + + context = g_option_context_new ("- Kerberos Authentication Configuration"); + g_option_context_add_main_entries (context, options, NULL); + g_option_context_add_group (context, gtk_get_option_group (TRUE)); + g_option_context_parse (context, &argc, &argv, &error); + if (error) { + g_print ("%s\n%s\n", + error->message, + help_msg); + g_error_free (error); + return 1; + } + textdomain (PACKAGE); + bind_textdomain_codeset (PACKAGE, "UTF-8"); + bindtextdomain (PACKAGE, LOCALE_DIR); + + gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (), + DATA_DIR G_DIR_SEPARATOR_S "icons"); + + ka_preferences_dialog_init(&dialog); + gtk_main (); + ka_preferences_dialog_finalize(&dialog); + return 0; +} diff --git a/preferences/krb5-auth-dialog-preferences.c b/preferences/krb5-auth-dialog-preferences.c deleted file mode 100644 index 0b5ff13..0000000 --- a/preferences/krb5-auth-dialog-preferences.c +++ /dev/null @@ -1,843 +0,0 @@ -/* - * Copyright (C) 2009 Guido Guenther - * - * 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 - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * Author: - * Guido Guenther - * - * based on the vino capplet which is: - * - * Copyright (C) 2003 Sun Microsystems, Inc. - * Copyright (C) 2006 Jonh Wendell - * - * Authors: - * Mark McLoughlin - * Jonh Wendell - */ - -#include "config.h" - -#include -#include - -#include "krb5-auth-gconf-tools.h" -#include "krb5-auth-tools.h" - -#define PKINIT_SMARTCARD "PKCS11:" SC_PKCS11 -#define PKINIT_FILE "FILE:" - -#define N_LISTENERS 8 - -typedef struct { - GtkBuilder *xml; - GConfClient *client; - - GtkWidget *dialog; - GtkWidget *principal_entry; - GtkWidget *pkuserid_entry; - GtkWidget *pkuserid_button; - GtkWidget *smartcard_toggle; - GtkWidget *pkanchors_entry; - GtkWidget *pkanchors_button; - GtkWidget *forwardable_toggle; - GtkWidget *proxiable_toggle; - GtkWidget *renewable_toggle; - GtkWidget *trayicon_toggle; - GtkWidget *prompt_mins_entry; - - guint listeners [N_LISTENERS]; - int n_listeners; -} KaPreferencesDialog; - - -static void -ka_preferences_principal_notify (GConfClient *client G_GNUC_UNUSED, - guint cnx_id G_GNUC_UNUSED, - GConfEntry *entry, - KaPreferencesDialog *dialog) -{ - const char *principal; - - if (!entry->value || entry->value->type != GCONF_VALUE_STRING) - return; - - principal = gconf_value_get_string (entry->value); - - if (!principal || !strlen(principal)) - gtk_entry_set_text (GTK_ENTRY (dialog->principal_entry), ""); - else { - const char *old_principal; - - old_principal = gtk_entry_get_text (GTK_ENTRY (dialog->principal_entry)); - if (!old_principal || (old_principal && strcmp (old_principal, principal))) - gtk_entry_set_text (GTK_ENTRY (dialog->principal_entry), principal); - } -} - - -static void -ka_preferences_dialog_principal_changed (GtkEntry *entry, - KaPreferencesDialog *dialog) -{ - const char *principal; - - principal = gtk_entry_get_text (entry); - - if (!principal || !strlen(principal)) - gconf_client_unset (dialog->client, KA_GCONF_KEY_PRINCIPAL, NULL); - else - gconf_client_set_string (dialog->client, KA_GCONF_KEY_PRINCIPAL, principal, NULL); -} - - -static void -ka_preferences_dialog_setup_principal_entry (KaPreferencesDialog *dialog) -{ - char *principal = NULL; - - dialog->principal_entry = GTK_WIDGET(gtk_builder_get_object (dialog->xml, "principal_entry")); - g_assert (dialog->principal_entry != NULL); - - if (!ka_gconf_get_string (dialog->client, KA_GCONF_KEY_PRINCIPAL, &principal)) - g_warning ("Getting principal failed"); - - if (principal && strlen(principal)) - gtk_entry_set_text (GTK_ENTRY (dialog->principal_entry), principal); - if (principal) - g_free (principal); - - g_signal_connect (dialog->principal_entry, "changed", - G_CALLBACK (ka_preferences_dialog_principal_changed), dialog); - - if (!gconf_client_key_is_writable (dialog->client, KA_GCONF_KEY_PRINCIPAL, NULL)) { - gtk_widget_set_sensitive (dialog->principal_entry, FALSE); - } - - dialog->listeners [dialog->n_listeners] = gconf_client_notify_add (dialog->client, - KA_GCONF_KEY_PRINCIPAL, - (GConfClientNotifyFunc) ka_preferences_principal_notify, - dialog, NULL, NULL); - dialog->n_listeners++; -} - - -static void -ka_preferences_pkuserid_notify (GConfClient *client G_GNUC_UNUSED, - guint cnx_id G_GNUC_UNUSED, - GConfEntry *entry, - KaPreferencesDialog *dialog) -{ - const char *pkuserid; - - if (!entry->value || entry->value->type != GCONF_VALUE_STRING) - return; - - pkuserid = gconf_value_get_string (entry->value); - - if (!pkuserid || !strlen(pkuserid)) - gtk_entry_set_text (GTK_ENTRY (dialog->pkuserid_entry), ""); - else { - const char *old_pkuserid; - - old_pkuserid = gtk_entry_get_text (GTK_ENTRY (dialog->pkuserid_entry)); - if (!old_pkuserid || (old_pkuserid && strcmp (old_pkuserid, pkuserid))) - gtk_entry_set_text (GTK_ENTRY (dialog->pkuserid_entry), pkuserid); - } -} - - -static void -ka_preferences_dialog_pkuserid_changed (GtkEntry *entry, - KaPreferencesDialog *dialog) -{ - const char *pkuserid; - - pkuserid = gtk_entry_get_text (entry); - - if (!pkuserid || !strlen(pkuserid)) - gconf_client_unset (dialog->client, KA_GCONF_KEY_PK_USERID, NULL); - else - gconf_client_set_string (dialog->client, KA_GCONF_KEY_PK_USERID, pkuserid, NULL); -} - - -static void -ka_preferences_dialog_setup_pkuserid_entry (KaPreferencesDialog *dialog) -{ - char *pkuserid = NULL; - - dialog->pkuserid_entry = GTK_WIDGET(gtk_builder_get_object (dialog->xml, "pkuserid_entry")); - g_assert (dialog->pkuserid_entry != NULL); - - if (!ka_gconf_get_string (dialog->client, KA_GCONF_KEY_PK_USERID, &pkuserid)) - g_warning ("Getting pkuserid failed"); - - if (pkuserid && strlen(pkuserid)) - gtk_entry_set_text (GTK_ENTRY (dialog->pkuserid_entry), pkuserid); - if (pkuserid) - g_free (pkuserid); - - g_signal_connect (dialog->pkuserid_entry, "changed", - G_CALLBACK (ka_preferences_dialog_pkuserid_changed), dialog); - if (!gconf_client_key_is_writable (dialog->client, KA_GCONF_KEY_PK_USERID, NULL)) { - gtk_widget_set_sensitive (dialog->pkuserid_entry, FALSE); - } - - dialog->listeners [dialog->n_listeners] = gconf_client_notify_add (dialog->client, - KA_GCONF_KEY_PK_USERID, - (GConfClientNotifyFunc) ka_preferences_pkuserid_notify, - dialog, NULL, NULL); - dialog->n_listeners++; -} - - -static void -ka_preferences_pkanchors_notify (GConfClient *client G_GNUC_UNUSED, - guint cnx_id G_GNUC_UNUSED, - GConfEntry *entry, - KaPreferencesDialog *dialog) -{ - const char *pkanchors; - - if (!entry->value || entry->value->type != GCONF_VALUE_STRING) - return; - - pkanchors = gconf_value_get_string (entry->value); - - if (!pkanchors || !strlen(pkanchors)) - gtk_entry_set_text (GTK_ENTRY (dialog->pkanchors_entry), ""); - else { - const char *old_pkanchors; - - old_pkanchors = gtk_entry_get_text (GTK_ENTRY (dialog->pkanchors_entry)); - if (!old_pkanchors || (old_pkanchors && strcmp (old_pkanchors, pkanchors))) - gtk_entry_set_text (GTK_ENTRY (dialog->pkanchors_entry), pkanchors); - } -} - - -static void -ka_preferences_dialog_pkanchors_changed (GtkEntry *entry, - KaPreferencesDialog *dialog) -{ - const char *pkanchors; - - pkanchors = gtk_entry_get_text (entry); - - if (!pkanchors || !strlen(pkanchors)) - gconf_client_unset (dialog->client, KA_GCONF_KEY_PK_ANCHORS, NULL); - else - gconf_client_set_string (dialog->client, KA_GCONF_KEY_PK_ANCHORS, pkanchors, NULL); -} - - -static void -ka_preferences_dialog_setup_pkanchors_entry (KaPreferencesDialog *dialog) -{ - char *pkanchors = NULL; - - dialog->pkanchors_entry = GTK_WIDGET(gtk_builder_get_object (dialog->xml, "pkanchors_entry")); - g_assert (dialog->pkanchors_entry != NULL); - - if (!ka_gconf_get_string (dialog->client, KA_GCONF_KEY_PK_ANCHORS, &pkanchors)) - g_warning ("Getting pkanchors failed"); - - if (pkanchors && strlen(pkanchors)) - gtk_entry_set_text (GTK_ENTRY (dialog->pkanchors_entry), pkanchors); - if (pkanchors) - g_free (pkanchors); - - g_signal_connect (dialog->pkanchors_entry, "changed", - G_CALLBACK (ka_preferences_dialog_pkanchors_changed), dialog); - if (!gconf_client_key_is_writable (dialog->client, KA_GCONF_KEY_PK_ANCHORS, NULL)) { - gtk_widget_set_sensitive (dialog->pkanchors_entry, FALSE); - } - - dialog->listeners [dialog->n_listeners] = gconf_client_notify_add (dialog->client, - KA_GCONF_KEY_PK_ANCHORS, - (GConfClientNotifyFunc) ka_preferences_pkanchors_notify, - dialog, NULL, NULL); - dialog->n_listeners++; -} - - -static void -ka_preferences_toggle_pkuserid_entry (gboolean state, KaPreferencesDialog *dialog) -{ - gtk_widget_set_sensitive (dialog->pkuserid_entry, state); - gtk_widget_set_sensitive (dialog->pkuserid_button, state); -} - - -static void -ka_preferences_dialog_smartcard_toggled (GtkToggleButton *toggle, - KaPreferencesDialog *dialog) -{ - gboolean smartcard = gtk_toggle_button_get_active (toggle); - static gchar *old_path = NULL; - - if (smartcard) { - const char *path; - - path = gtk_entry_get_text (GTK_ENTRY(dialog->pkuserid_entry)); - if (g_strcmp0 (path, PKINIT_SMARTCARD)) { - g_free (old_path); - old_path = g_strdup (path); - } - ka_preferences_toggle_pkuserid_entry (FALSE, dialog); - gconf_client_set_string (dialog->client, KA_GCONF_KEY_PK_USERID, PKINIT_SMARTCARD, NULL); - } else { - ka_preferences_toggle_pkuserid_entry (TRUE, dialog); - if (old_path) - gconf_client_set_string (dialog->client, KA_GCONF_KEY_PK_USERID, old_path, NULL); - else - gconf_client_unset (dialog->client, KA_GCONF_KEY_PK_USERID, NULL); - } -} - - -static void -ka_preferences_dialog_setup_smartcard_toggle(KaPreferencesDialog *dialog) -{ - char *pkuserid = NULL; - - dialog->smartcard_toggle = GTK_WIDGET(gtk_builder_get_object (dialog->xml, "smartcard_toggle")); - g_assert (dialog->smartcard_toggle != NULL); - - if (!ka_gconf_get_string (dialog->client, KA_GCONF_KEY_PK_USERID, &pkuserid)) - g_warning ("Getting pkanchors failed"); - - g_signal_connect (dialog->smartcard_toggle, "toggled", - G_CALLBACK (ka_preferences_dialog_smartcard_toggled), dialog); - - if (!g_strcmp0 (pkuserid, PKINIT_SMARTCARD)) - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->smartcard_toggle), TRUE); - else - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->smartcard_toggle), FALSE); - - if (pkuserid) - g_free (pkuserid); -} - - -static void -ka_preferences_dialog_browse_certs (KaPreferencesDialog *dialog, GtkEntry *entry) -{ - GtkWidget *filechooser; - GtkFileFilter *cert_filter, *all_filter; - gchar *filename = NULL; - const gchar *current; - gint ret; - - filechooser = gtk_file_chooser_dialog_new(_("Choose Certificate"), - GTK_WINDOW(dialog->dialog), - GTK_FILE_CHOOSER_ACTION_OPEN, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, - NULL); - - current = gtk_entry_get_text (entry); - if (current && g_str_has_prefix (current, PKINIT_FILE) && - strlen(current) > strlen (PKINIT_FILE)) { - gtk_file_chooser_select_filename (GTK_FILE_CHOOSER(filechooser), - (const gchar*)¤t[strlen(PKINIT_FILE)]); - } - - cert_filter = g_object_ref_sink (gtk_file_filter_new ()); - gtk_file_filter_add_mime_type (cert_filter, "application/x-x509-ca-cert"); - gtk_file_filter_set_name (cert_filter, _("X509 Certificates")); - gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (filechooser), cert_filter); - all_filter = g_object_ref_sink (gtk_file_filter_new ()); - gtk_file_filter_add_pattern (all_filter, "*"); - gtk_file_filter_set_name (all_filter, _("all files")); - gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (filechooser), all_filter); - - ret = gtk_dialog_run (GTK_DIALOG(filechooser)); - if (ret == GTK_RESPONSE_ACCEPT) - filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(filechooser)); - gtk_widget_destroy (GTK_WIDGET(filechooser)); - - if (filename) { - gchar *cert = g_strconcat( PKINIT_FILE, filename, NULL); - gtk_entry_set_text (entry, cert); - g_free (filename); - g_free (cert); - } - g_object_unref (cert_filter); - g_object_unref (all_filter); -} - -static void -ka_preferences_dialog_browse_pkuserids (GtkButton *button G_GNUC_UNUSED, - KaPreferencesDialog *dialog) -{ - ka_preferences_dialog_browse_certs (dialog, - GTK_ENTRY(dialog->pkuserid_entry)); -} - -static void -ka_preferences_dialog_browse_pkanchors(GtkButton *button G_GNUC_UNUSED, - KaPreferencesDialog *dialog) -{ - ka_preferences_dialog_browse_certs (dialog, - GTK_ENTRY(dialog->pkanchors_entry)); -} - -static void -ka_preferences_dialog_setup_pkuserid_button (KaPreferencesDialog *dialog) -{ - dialog->pkuserid_button = GTK_WIDGET(gtk_builder_get_object (dialog->xml, "pkuserid_button")); - g_assert (dialog->pkuserid_button != NULL); - - g_signal_connect (dialog->pkuserid_button, "clicked", - G_CALLBACK (ka_preferences_dialog_browse_pkuserids), dialog); - -} - -static void -ka_preferences_dialog_setup_pkanchors_button (KaPreferencesDialog *dialog) -{ - dialog->pkanchors_button = GTK_WIDGET(gtk_builder_get_object (dialog->xml, "pkanchors_button")); - g_assert (dialog->pkanchors_button != NULL); - - g_signal_connect (dialog->pkanchors_button, "clicked", - G_CALLBACK (ka_preferences_dialog_browse_pkanchors), dialog); - -} - - -static void -ka_preferences_dialog_forwardable_toggled (GtkToggleButton *toggle, - KaPreferencesDialog *dialog) -{ - gboolean forwardable; - - forwardable = gtk_toggle_button_get_active (toggle); - - gconf_client_set_bool (dialog->client, KA_GCONF_KEY_FORWARDABLE, forwardable, NULL); -} - - -static void -ka_preferences_dialog_forwardable_notify (GConfClient *client G_GNUC_UNUSED, - guint cnx_id G_GNUC_UNUSED, - GConfEntry *entry, - KaPreferencesDialog *dialog) -{ - gboolean forwardable; - - if (!entry->value || entry->value->type != GCONF_VALUE_BOOL) - return; - - forwardable = gconf_value_get_bool (entry->value) != FALSE; - - if (forwardable != gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->forwardable_toggle))) - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->forwardable_toggle), forwardable); -} - - -static gboolean -ka_preferences_dialog_setup_forwardable_toggle (KaPreferencesDialog *dialog) -{ - gboolean forwardable; - - dialog->forwardable_toggle = GTK_WIDGET(gtk_builder_get_object (dialog->xml, "forwardable_toggle")); - g_assert (dialog->forwardable_toggle != NULL); - - forwardable = gconf_client_get_bool (dialog->client, KA_GCONF_KEY_FORWARDABLE, NULL); - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->forwardable_toggle), forwardable); - - g_signal_connect (dialog->forwardable_toggle, "toggled", - G_CALLBACK (ka_preferences_dialog_forwardable_toggled), dialog); - - if (!gconf_client_key_is_writable (dialog->client, KA_GCONF_KEY_FORWARDABLE, NULL)) { - gtk_widget_set_sensitive (dialog->forwardable_toggle, FALSE); - } - - dialog->listeners [dialog->n_listeners] = gconf_client_notify_add (dialog->client, - KA_GCONF_KEY_FORWARDABLE, - (GConfClientNotifyFunc) ka_preferences_dialog_forwardable_notify, - dialog, NULL, NULL); - dialog->n_listeners++; - return forwardable; -} - - -static void -ka_preferences_dialog_proxiable_toggled (GtkToggleButton *toggle, - KaPreferencesDialog *dialog) -{ - gboolean proxiable; - - proxiable = gtk_toggle_button_get_active (toggle); - - gconf_client_set_bool (dialog->client, KA_GCONF_KEY_PROXIABLE, proxiable, NULL); -} - - -static void -ka_preferences_dialog_proxiable_notify (GConfClient *client G_GNUC_UNUSED, - guint cnx_id G_GNUC_UNUSED, - GConfEntry *entry, - KaPreferencesDialog *dialog) -{ - gboolean proxiable; - - if (!entry->value || entry->value->type != GCONF_VALUE_BOOL) - return; - - proxiable = gconf_value_get_bool (entry->value) != FALSE; - - if (proxiable != gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->proxiable_toggle))) - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->proxiable_toggle), proxiable); -} - - -static gboolean -ka_preferences_dialog_setup_proxiable_toggle (KaPreferencesDialog *dialog) -{ - gboolean proxiable; - - dialog->proxiable_toggle = GTK_WIDGET(gtk_builder_get_object (dialog->xml, "proxiable_toggle")); - g_assert (dialog->proxiable_toggle != NULL); - - proxiable = gconf_client_get_bool (dialog->client, KA_GCONF_KEY_PROXIABLE, NULL); - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->proxiable_toggle), proxiable); - - g_signal_connect (dialog->proxiable_toggle, "toggled", - G_CALLBACK (ka_preferences_dialog_proxiable_toggled), dialog); - - if (!gconf_client_key_is_writable (dialog->client, KA_GCONF_KEY_PROXIABLE, NULL)) { - gtk_widget_set_sensitive (dialog->proxiable_toggle, FALSE); - } - - dialog->listeners [dialog->n_listeners] = gconf_client_notify_add (dialog->client, - KA_GCONF_KEY_PROXIABLE, - (GConfClientNotifyFunc) ka_preferences_dialog_proxiable_notify, - dialog, NULL, NULL); - dialog->n_listeners++; - return proxiable; -} - - -static void -ka_preferences_dialog_renewable_toggled (GtkToggleButton *toggle, - KaPreferencesDialog *dialog) -{ - gboolean renewable; - - renewable = gtk_toggle_button_get_active (toggle); - - gconf_client_set_bool (dialog->client, KA_GCONF_KEY_RENEWABLE, renewable, NULL); -} - - -static void -ka_preferences_dialog_renewable_notify (GConfClient *client G_GNUC_UNUSED, - guint cnx_id G_GNUC_UNUSED, - GConfEntry *entry, - KaPreferencesDialog *dialog) -{ - gboolean renewable; - - if (!entry->value || entry->value->type != GCONF_VALUE_BOOL) - return; - - renewable = gconf_value_get_bool (entry->value) != FALSE; - - if (renewable != gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->renewable_toggle))) - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->renewable_toggle), renewable); -} - - -static gboolean -ka_preferences_dialog_setup_renewable_toggle (KaPreferencesDialog *dialog) -{ - gboolean renewable; - - dialog->renewable_toggle = GTK_WIDGET(gtk_builder_get_object (dialog->xml, "renewable_toggle")); - g_assert (dialog->renewable_toggle != NULL); - - renewable = gconf_client_get_bool (dialog->client, KA_GCONF_KEY_RENEWABLE, NULL); - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->renewable_toggle), renewable); - - g_signal_connect (dialog->renewable_toggle, "toggled", - G_CALLBACK (ka_preferences_dialog_renewable_toggled), dialog); - - if (!gconf_client_key_is_writable (dialog->client, KA_GCONF_KEY_RENEWABLE, NULL)) { - gtk_widget_set_sensitive (dialog->renewable_toggle, FALSE); - } - - dialog->listeners [dialog->n_listeners] = gconf_client_notify_add (dialog->client, - KA_GCONF_KEY_RENEWABLE, - (GConfClientNotifyFunc) ka_preferences_dialog_renewable_notify, - dialog, NULL, NULL); - dialog->n_listeners++; - return renewable; -} - -static void -ka_preferences_dialog_trayicon_toggled (GtkToggleButton *toggle, - KaPreferencesDialog *dialog) -{ - gboolean trayicon; - - trayicon = gtk_toggle_button_get_active (toggle); - gconf_client_set_bool (dialog->client, KA_GCONF_KEY_SHOW_TRAYICON, trayicon, NULL); -} - - -static void -ka_preferences_dialog_trayicon_notify (GConfClient *client G_GNUC_UNUSED, - guint cnx_id G_GNUC_UNUSED, - GConfEntry *entry, - KaPreferencesDialog *dialog) -{ - gboolean trayicon; - - if (!entry->value || entry->value->type != GCONF_VALUE_BOOL) - return; - - trayicon = gconf_value_get_bool (entry->value) != FALSE; - - if (trayicon != gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->trayicon_toggle))) - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->trayicon_toggle), trayicon); -} - - -static gboolean -ka_preferences_dialog_setup_trayicon_toggle (KaPreferencesDialog *dialog) -{ - gboolean trayicon; - - dialog->trayicon_toggle = GTK_WIDGET(gtk_builder_get_object (dialog->xml, "trayicon_toggle")); - g_assert (dialog->trayicon_toggle != NULL); - - trayicon = gconf_client_get_bool (dialog->client, KA_GCONF_KEY_SHOW_TRAYICON, NULL); - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->trayicon_toggle), trayicon); - - g_signal_connect (dialog->trayicon_toggle, "toggled", - G_CALLBACK (ka_preferences_dialog_trayicon_toggled), dialog); - - if (!gconf_client_key_is_writable (dialog->client, KA_GCONF_KEY_SHOW_TRAYICON, NULL)) { - gtk_widget_set_sensitive (dialog->trayicon_toggle, FALSE); - } - - dialog->listeners [dialog->n_listeners] = gconf_client_notify_add (dialog->client, - KA_GCONF_KEY_SHOW_TRAYICON, - (GConfClientNotifyFunc) ka_preferences_dialog_trayicon_notify, - dialog, NULL, NULL); - dialog->n_listeners++; - return trayicon; -} - - -static void -ka_preferences_dialog_prompt_mins_changed (GtkSpinButton *button, - KaPreferencesDialog *dialog) -{ - gint prompt_mins; - - prompt_mins = gtk_spin_button_get_value_as_int (button); - gconf_client_set_int (dialog->client, KA_GCONF_KEY_PROMPT_MINS, prompt_mins, NULL); -} - - -static void -ka_preferences_dialog_prompt_mins_notify (GConfClient *client G_GNUC_UNUSED, - guint cnx_id G_GNUC_UNUSED, - GConfEntry *entry, - KaPreferencesDialog *dialog) -{ - gint prompt_mins; - - if (!entry->value || entry->value->type != GCONF_VALUE_INT) - return; - - prompt_mins = gconf_value_get_int (entry->value); - - if (prompt_mins != gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dialog->prompt_mins_entry))) - gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->prompt_mins_entry), prompt_mins); -} - - -static gint -ka_preferences_dialog_setup_prompt_mins_entry (KaPreferencesDialog *dialog) -{ - gint prompt_mins; - - dialog->prompt_mins_entry = GTK_WIDGET(gtk_builder_get_object (dialog->xml, "prompt_mins_entry")); - g_assert (dialog->prompt_mins_entry != NULL); - - prompt_mins = gconf_client_get_int (dialog->client, KA_GCONF_KEY_PROMPT_MINS, NULL); - - gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->prompt_mins_entry), prompt_mins); - - g_signal_connect (dialog->prompt_mins_entry, "value-changed", - G_CALLBACK (ka_preferences_dialog_prompt_mins_changed), dialog); - - if (!gconf_client_key_is_writable (dialog->client, KA_GCONF_KEY_PROMPT_MINS, NULL)) { - gtk_widget_set_sensitive (dialog->prompt_mins_entry, FALSE); - } - - dialog->listeners [dialog->n_listeners] = gconf_client_notify_add (dialog->client, - KA_GCONF_KEY_PROMPT_MINS, - (GConfClientNotifyFunc) ka_preferences_dialog_prompt_mins_notify, - dialog, NULL, NULL); - dialog->n_listeners++; - return prompt_mins; -} - - - -static void -ka_preferences_dialog_response (GtkWidget *widget, - int response, - KaPreferencesDialog *dialog) -{ - if (response != GTK_RESPONSE_HELP) { - gtk_widget_destroy (widget); - return; - } - - ka_show_help (gtk_window_get_screen (GTK_WINDOW (dialog->dialog)), - "#preferences", GTK_WINDOW(dialog->dialog)); -} - - -static void -ka_preferences_dialog_destroyed (GtkWidget *widget G_GNUC_UNUSED, - KaPreferencesDialog *dialog) -{ - dialog->dialog = NULL; - - gtk_main_quit (); -} - - -static gboolean -ka_preferences_dialog_init(KaPreferencesDialog* dialog) -{ - GError *error = NULL; - gboolean ret; - - dialog->xml = gtk_builder_new (); - - ret = gtk_builder_add_from_file(dialog->xml, KA_DATA_DIR G_DIR_SEPARATOR_S - PACKAGE "-preferences.xml", &error); - if (!ret) { - g_assert (error); - g_assert (error->message); - g_error ("Failed to load UI XML: %s", error->message); - } - - dialog->dialog = GTK_WIDGET(gtk_builder_get_object (dialog->xml, "krb5_auth_dialog_prefs")); - g_assert (dialog->dialog); - - g_signal_connect (dialog->dialog, "response", - G_CALLBACK (ka_preferences_dialog_response), dialog); - g_signal_connect (dialog->dialog, "destroy", - G_CALLBACK (ka_preferences_dialog_destroyed), dialog); - - dialog->client = gconf_client_get_default (); - gconf_client_add_dir (dialog->client, KA_GCONF_PATH, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); - - ka_preferences_dialog_setup_principal_entry (dialog); - ka_preferences_dialog_setup_pkuserid_entry (dialog); - ka_preferences_dialog_setup_pkuserid_button (dialog); - ka_preferences_dialog_setup_smartcard_toggle (dialog); - ka_preferences_dialog_setup_pkanchors_entry(dialog); - ka_preferences_dialog_setup_pkanchors_button (dialog); - ka_preferences_dialog_setup_forwardable_toggle (dialog); - ka_preferences_dialog_setup_proxiable_toggle (dialog); - ka_preferences_dialog_setup_renewable_toggle (dialog); - ka_preferences_dialog_setup_trayicon_toggle (dialog); - ka_preferences_dialog_setup_prompt_mins_entry (dialog); - - g_assert (dialog->n_listeners == N_LISTENERS); - - gtk_widget_show (dialog->dialog); - return TRUE; -} - - -static void -ka_preferences_dialog_finalize (KaPreferencesDialog *dialog) -{ - if (dialog->dialog) - gtk_widget_destroy (dialog->dialog); - dialog->dialog = NULL; - - if (dialog->client) { - int i; - - for (i = 0; i < dialog->n_listeners; i++) { - if (dialog->listeners [i]) - gconf_client_notify_remove (dialog->client, dialog->listeners [i]); - dialog->listeners [i] = 0; - } - dialog->n_listeners = 0; - - gconf_client_remove_dir (dialog->client, KA_GCONF_PATH, NULL); - - g_object_unref (dialog->client); - dialog->client = NULL; - } - - if (dialog->xml) - g_object_unref (dialog->xml); - dialog->xml = NULL; -} - -int -main (int argc, char *argv[]) -{ - GOptionContext *context; - GError *error = NULL; - KaPreferencesDialog dialog = { NULL, }; - - const char *help_msg = "Run '" PACKAGE " --help' to see a full list of available command line options"; - const GOptionEntry options [] = { - { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL } - }; - - context = g_option_context_new ("- Kerberos Authentication Configuration"); - g_option_context_add_main_entries (context, options, NULL); - g_option_context_add_group (context, gtk_get_option_group (TRUE)); - g_option_context_parse (context, &argc, &argv, &error); - if (error) { - g_print ("%s\n%s\n", - error->message, - help_msg); - g_error_free (error); - return 1; - } - textdomain (PACKAGE); - bind_textdomain_codeset (PACKAGE, "UTF-8"); - bindtextdomain (PACKAGE, LOCALE_DIR); - - gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (), - DATA_DIR G_DIR_SEPARATOR_S "icons"); - - ka_preferences_dialog_init(&dialog); - gtk_main (); - ka_preferences_dialog_finalize(&dialog); - return 0; -} diff --git a/secmem/Makefile.in b/secmem/Makefile.in index 9ba08dd..8c13706 100644 --- a/secmem/Makefile.in +++ b/secmem/Makefile.in @@ -151,6 +151,8 @@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ @@ -168,6 +170,7 @@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +KA_PLUGINS_DIR = @KA_PLUGINS_DIR@ KRB5_CFLAGS = @KRB5_CFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ KRB5_LIBS = @KRB5_LIBS@ @@ -208,6 +211,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_LIBS = @PAM_LIBS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ diff --git a/src/Makefile.am b/src/Makefile.am index e0068fb..591c69f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,22 +21,29 @@ $(service_DATA): $(service_in_files) Makefile sed -e "s|\@BINDIR\@|$(bindir)|" $< > $@ krb5_auth_dialog_SOURCES = \ - krb5-auth-dialog.c \ - krb5-auth-dialog.h \ - krb5-auth-applet.c \ - krb5-auth-applet.h \ - krb5-auth-pwdialog.c \ - krb5-auth-pwdialog.h \ - krb5-auth-gconf.c \ - krb5-auth-gconf.h \ - krb5-auth-gconf-tools.c \ - krb5-auth-gconf-tools.h \ - krb5-auth-dbus.c \ - krb5-auth-dbus.h \ - krb5-auth-tools.c \ - krb5-auth-tools.h \ - krb5-auth-tickets.c \ - krb5-auth-tickets.h \ + ka-dialog.c \ + ka-dialog.h \ + ka-applet.c \ + ka-applet-priv.h \ + ka-applet.h \ + ka-pwdialog.c \ + ka-pwdialog.h \ + ka-gconf.c \ + ka-gconf.h \ + ka-gconf-tools.c \ + ka-gconf-tools.h \ + ka-dbus.c \ + ka-dbus.h \ + ka-tools.c \ + ka-tools.h \ + ka-tickets.c \ + ka-tickets.h \ + ka-plugin.c \ + ka-plugin.h \ + ka-plugin-loader.c \ + ka-plugin-loader.h \ + ka-closures.h \ + ka-closures.c \ dummy-strings.c \ $(NULL) @@ -47,10 +54,12 @@ krb5_auth_dialog_CPPFLAGS = \ -DDATA_DIR=\""$(datadir)"\" \ -DLOCALE_DIR=\""$(localedir)/"\" \ -DBIN_DIR=\""$(bindir)/"\" \ + -DKA_PLUGINS_DIR=\""$(KA_PLUGINS_DIR)"\" \ $(AM_CPPFLAGS) \ $(NULL) krb5_auth_dialog_CFLAGS = \ + $(GMODULE_CFLAGS) \ $(GTK_CFLAGS) \ $(DBUS_CFLAGS) \ $(GCONF_CFLAGS) \ @@ -71,14 +80,15 @@ krb5_auth_dialog_LDADD = \ $(DBUS_LIBS) \ $(GCONF_LIBS) \ $(GIO_LIBS) \ + $(GMODULE_LIBS) \ $(GTK_LIBS) \ $(NULL) BUILT_SOURCES = \ - krb5-auth-applet-dbus-glue.h \ + ka-dbus-glue.h \ $(NULL) -krb5-auth-applet-dbus-glue.h: $(srcdir)/krb5-auth-applet-dbus.xml +ka-dbus-glue.h: $(srcdir)/ka-dbus.xml dbus-binding-tool \ --mode=glib-server \ --prefix=krb5_auth_dialog \ @@ -100,14 +110,14 @@ EXTRA_DIST = \ $(schema_in_files) \ $(autostart_in_files) \ $(service_in_files) \ - $(srcdir)/krb5-auth-applet-dbus.xml \ + $(srcdir)/ka-dbus.xml \ krb5-auth-dialog.1.in \ $(NULL) CLEANFILES = $(schema_DATA) $(service_DATA) DISTCLEANFILES = \ krb5-auth-dialog.desktop \ - krb5-auth-applet-dbus-glue.h \ + ka-dbus-glue.h \ $(NULL) install-data-local: $(schema_DATA) diff --git a/src/Makefile.in b/src/Makefile.in index 89ddf2e..b812d80 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -53,15 +53,17 @@ am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \ "$(DESTDIR)$(schemadir)" "$(DESTDIR)$(servicedir)" PROGRAMS = $(bin_PROGRAMS) am__objects_1 = -am_krb5_auth_dialog_OBJECTS = \ - krb5_auth_dialog-krb5-auth-dialog.$(OBJEXT) \ - krb5_auth_dialog-krb5-auth-applet.$(OBJEXT) \ - krb5_auth_dialog-krb5-auth-pwdialog.$(OBJEXT) \ - krb5_auth_dialog-krb5-auth-gconf.$(OBJEXT) \ - krb5_auth_dialog-krb5-auth-gconf-tools.$(OBJEXT) \ - krb5_auth_dialog-krb5-auth-dbus.$(OBJEXT) \ - krb5_auth_dialog-krb5-auth-tools.$(OBJEXT) \ - krb5_auth_dialog-krb5-auth-tickets.$(OBJEXT) \ +am_krb5_auth_dialog_OBJECTS = krb5_auth_dialog-ka-dialog.$(OBJEXT) \ + krb5_auth_dialog-ka-applet.$(OBJEXT) \ + krb5_auth_dialog-ka-pwdialog.$(OBJEXT) \ + krb5_auth_dialog-ka-gconf.$(OBJEXT) \ + krb5_auth_dialog-ka-gconf-tools.$(OBJEXT) \ + krb5_auth_dialog-ka-dbus.$(OBJEXT) \ + krb5_auth_dialog-ka-tools.$(OBJEXT) \ + krb5_auth_dialog-ka-tickets.$(OBJEXT) \ + krb5_auth_dialog-ka-plugin.$(OBJEXT) \ + krb5_auth_dialog-ka-plugin-loader.$(OBJEXT) \ + krb5_auth_dialog-ka-closures.$(OBJEXT) \ krb5_auth_dialog-dummy-strings.$(OBJEXT) $(am__objects_1) krb5_auth_dialog_OBJECTS = $(am_krb5_auth_dialog_OBJECTS) am__DEPENDENCIES_1 = @@ -71,7 +73,8 @@ krb5_auth_dialog_DEPENDENCIES = \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_$(V)) am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent @@ -180,6 +183,8 @@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ @@ -197,6 +202,7 @@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +KA_PLUGINS_DIR = @KA_PLUGINS_DIR@ KRB5_CFLAGS = @KRB5_CFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ KRB5_LIBS = @KRB5_LIBS@ @@ -237,6 +243,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_LIBS = @PAM_LIBS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ @@ -323,22 +330,29 @@ servicedir = $(datadir)/dbus-1/services service_in_files = org.gnome.KrbAuthDialog.service.in service_DATA = $(service_in_files:.service.in=.service) krb5_auth_dialog_SOURCES = \ - krb5-auth-dialog.c \ - krb5-auth-dialog.h \ - krb5-auth-applet.c \ - krb5-auth-applet.h \ - krb5-auth-pwdialog.c \ - krb5-auth-pwdialog.h \ - krb5-auth-gconf.c \ - krb5-auth-gconf.h \ - krb5-auth-gconf-tools.c \ - krb5-auth-gconf-tools.h \ - krb5-auth-dbus.c \ - krb5-auth-dbus.h \ - krb5-auth-tools.c \ - krb5-auth-tools.h \ - krb5-auth-tickets.c \ - krb5-auth-tickets.h \ + ka-dialog.c \ + ka-dialog.h \ + ka-applet.c \ + ka-applet-priv.h \ + ka-applet.h \ + ka-pwdialog.c \ + ka-pwdialog.h \ + ka-gconf.c \ + ka-gconf.h \ + ka-gconf-tools.c \ + ka-gconf-tools.h \ + ka-dbus.c \ + ka-dbus.h \ + ka-tools.c \ + ka-tools.h \ + ka-tickets.c \ + ka-tickets.h \ + ka-plugin.c \ + ka-plugin.h \ + ka-plugin-loader.c \ + ka-plugin-loader.h \ + ka-closures.h \ + ka-closures.c \ dummy-strings.c \ $(NULL) @@ -349,10 +363,12 @@ krb5_auth_dialog_CPPFLAGS = \ -DDATA_DIR=\""$(datadir)"\" \ -DLOCALE_DIR=\""$(localedir)/"\" \ -DBIN_DIR=\""$(bindir)/"\" \ + -DKA_PLUGINS_DIR=\""$(KA_PLUGINS_DIR)"\" \ $(AM_CPPFLAGS) \ $(NULL) krb5_auth_dialog_CFLAGS = \ + $(GMODULE_CFLAGS) \ $(GTK_CFLAGS) \ $(DBUS_CFLAGS) \ $(GCONF_CFLAGS) \ @@ -373,11 +389,12 @@ krb5_auth_dialog_LDADD = \ $(DBUS_LIBS) \ $(GCONF_LIBS) \ $(GIO_LIBS) \ + $(GMODULE_LIBS) \ $(GTK_LIBS) \ $(NULL) BUILT_SOURCES = \ - krb5-auth-applet-dbus-glue.h \ + ka-dbus-glue.h \ $(NULL) AM_CPPFLAGS = \ @@ -395,14 +412,14 @@ EXTRA_DIST = \ $(schema_in_files) \ $(autostart_in_files) \ $(service_in_files) \ - $(srcdir)/krb5-auth-applet-dbus.xml \ + $(srcdir)/ka-dbus.xml \ krb5-auth-dialog.1.in \ $(NULL) CLEANFILES = $(schema_DATA) $(service_DATA) DISTCLEANFILES = \ krb5-auth-dialog.desktop \ - krb5-auth-applet-dbus-glue.h \ + ka-dbus-glue.h \ $(NULL) all: $(BUILT_SOURCES) @@ -496,14 +513,17 @@ distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5_auth_dialog-dummy-strings.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5_auth_dialog-krb5-auth-applet.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5_auth_dialog-krb5-auth-dbus.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5_auth_dialog-krb5-auth-dialog.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5_auth_dialog-krb5-auth-gconf-tools.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5_auth_dialog-krb5-auth-gconf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5_auth_dialog-krb5-auth-pwdialog.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5_auth_dialog-krb5-auth-tickets.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5_auth_dialog-krb5-auth-tools.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5_auth_dialog-ka-applet.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5_auth_dialog-ka-closures.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5_auth_dialog-ka-dbus.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5_auth_dialog-ka-dialog.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5_auth_dialog-ka-gconf-tools.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5_auth_dialog-ka-gconf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5_auth_dialog-ka-plugin-loader.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5_auth_dialog-ka-plugin.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5_auth_dialog-ka-pwdialog.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5_auth_dialog-ka-tickets.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5_auth_dialog-ka-tools.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -529,133 +549,181 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< -krb5_auth_dialog-krb5-auth-dialog.o: krb5-auth-dialog.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-krb5-auth-dialog.o -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-krb5-auth-dialog.Tpo -c -o krb5_auth_dialog-krb5-auth-dialog.o `test -f 'krb5-auth-dialog.c' || echo '$(srcdir)/'`krb5-auth-dialog.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-krb5-auth-dialog.Tpo $(DEPDIR)/krb5_auth_dialog-krb5-auth-dialog.Po +krb5_auth_dialog-ka-dialog.o: ka-dialog.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-ka-dialog.o -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-ka-dialog.Tpo -c -o krb5_auth_dialog-ka-dialog.o `test -f 'ka-dialog.c' || echo '$(srcdir)/'`ka-dialog.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-ka-dialog.Tpo $(DEPDIR)/krb5_auth_dialog-ka-dialog.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ka-dialog.c' object='krb5_auth_dialog-ka-dialog.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-ka-dialog.o `test -f 'ka-dialog.c' || echo '$(srcdir)/'`ka-dialog.c + +krb5_auth_dialog-ka-dialog.obj: ka-dialog.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-ka-dialog.obj -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-ka-dialog.Tpo -c -o krb5_auth_dialog-ka-dialog.obj `if test -f 'ka-dialog.c'; then $(CYGPATH_W) 'ka-dialog.c'; else $(CYGPATH_W) '$(srcdir)/ka-dialog.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-ka-dialog.Tpo $(DEPDIR)/krb5_auth_dialog-ka-dialog.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ka-dialog.c' object='krb5_auth_dialog-ka-dialog.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-ka-dialog.obj `if test -f 'ka-dialog.c'; then $(CYGPATH_W) 'ka-dialog.c'; else $(CYGPATH_W) '$(srcdir)/ka-dialog.c'; fi` + +krb5_auth_dialog-ka-applet.o: ka-applet.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-ka-applet.o -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-ka-applet.Tpo -c -o krb5_auth_dialog-ka-applet.o `test -f 'ka-applet.c' || echo '$(srcdir)/'`ka-applet.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-ka-applet.Tpo $(DEPDIR)/krb5_auth_dialog-ka-applet.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ka-applet.c' object='krb5_auth_dialog-ka-applet.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-ka-applet.o `test -f 'ka-applet.c' || echo '$(srcdir)/'`ka-applet.c + +krb5_auth_dialog-ka-applet.obj: ka-applet.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-ka-applet.obj -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-ka-applet.Tpo -c -o krb5_auth_dialog-ka-applet.obj `if test -f 'ka-applet.c'; then $(CYGPATH_W) 'ka-applet.c'; else $(CYGPATH_W) '$(srcdir)/ka-applet.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-ka-applet.Tpo $(DEPDIR)/krb5_auth_dialog-ka-applet.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ka-applet.c' object='krb5_auth_dialog-ka-applet.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-ka-applet.obj `if test -f 'ka-applet.c'; then $(CYGPATH_W) 'ka-applet.c'; else $(CYGPATH_W) '$(srcdir)/ka-applet.c'; fi` + +krb5_auth_dialog-ka-pwdialog.o: ka-pwdialog.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-ka-pwdialog.o -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-ka-pwdialog.Tpo -c -o krb5_auth_dialog-ka-pwdialog.o `test -f 'ka-pwdialog.c' || echo '$(srcdir)/'`ka-pwdialog.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-ka-pwdialog.Tpo $(DEPDIR)/krb5_auth_dialog-ka-pwdialog.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ka-pwdialog.c' object='krb5_auth_dialog-ka-pwdialog.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-ka-pwdialog.o `test -f 'ka-pwdialog.c' || echo '$(srcdir)/'`ka-pwdialog.c + +krb5_auth_dialog-ka-pwdialog.obj: ka-pwdialog.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-ka-pwdialog.obj -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-ka-pwdialog.Tpo -c -o krb5_auth_dialog-ka-pwdialog.obj `if test -f 'ka-pwdialog.c'; then $(CYGPATH_W) 'ka-pwdialog.c'; else $(CYGPATH_W) '$(srcdir)/ka-pwdialog.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-ka-pwdialog.Tpo $(DEPDIR)/krb5_auth_dialog-ka-pwdialog.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ka-pwdialog.c' object='krb5_auth_dialog-ka-pwdialog.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-ka-pwdialog.obj `if test -f 'ka-pwdialog.c'; then $(CYGPATH_W) 'ka-pwdialog.c'; else $(CYGPATH_W) '$(srcdir)/ka-pwdialog.c'; fi` + +krb5_auth_dialog-ka-gconf.o: ka-gconf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-ka-gconf.o -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-ka-gconf.Tpo -c -o krb5_auth_dialog-ka-gconf.o `test -f 'ka-gconf.c' || echo '$(srcdir)/'`ka-gconf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-ka-gconf.Tpo $(DEPDIR)/krb5_auth_dialog-ka-gconf.Po @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='krb5-auth-dialog.c' object='krb5_auth_dialog-krb5-auth-dialog.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ka-gconf.c' object='krb5_auth_dialog-ka-gconf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-krb5-auth-dialog.o `test -f 'krb5-auth-dialog.c' || echo '$(srcdir)/'`krb5-auth-dialog.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-ka-gconf.o `test -f 'ka-gconf.c' || echo '$(srcdir)/'`ka-gconf.c -krb5_auth_dialog-krb5-auth-dialog.obj: krb5-auth-dialog.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-krb5-auth-dialog.obj -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-krb5-auth-dialog.Tpo -c -o krb5_auth_dialog-krb5-auth-dialog.obj `if test -f 'krb5-auth-dialog.c'; then $(CYGPATH_W) 'krb5-auth-dialog.c'; else $(CYGPATH_W) '$(srcdir)/krb5-auth-dialog.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-krb5-auth-dialog.Tpo $(DEPDIR)/krb5_auth_dialog-krb5-auth-dialog.Po +krb5_auth_dialog-ka-gconf.obj: ka-gconf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-ka-gconf.obj -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-ka-gconf.Tpo -c -o krb5_auth_dialog-ka-gconf.obj `if test -f 'ka-gconf.c'; then $(CYGPATH_W) 'ka-gconf.c'; else $(CYGPATH_W) '$(srcdir)/ka-gconf.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-ka-gconf.Tpo $(DEPDIR)/krb5_auth_dialog-ka-gconf.Po @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='krb5-auth-dialog.c' object='krb5_auth_dialog-krb5-auth-dialog.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ka-gconf.c' object='krb5_auth_dialog-ka-gconf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-krb5-auth-dialog.obj `if test -f 'krb5-auth-dialog.c'; then $(CYGPATH_W) 'krb5-auth-dialog.c'; else $(CYGPATH_W) '$(srcdir)/krb5-auth-dialog.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-ka-gconf.obj `if test -f 'ka-gconf.c'; then $(CYGPATH_W) 'ka-gconf.c'; else $(CYGPATH_W) '$(srcdir)/ka-gconf.c'; fi` -krb5_auth_dialog-krb5-auth-applet.o: krb5-auth-applet.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-krb5-auth-applet.o -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-krb5-auth-applet.Tpo -c -o krb5_auth_dialog-krb5-auth-applet.o `test -f 'krb5-auth-applet.c' || echo '$(srcdir)/'`krb5-auth-applet.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-krb5-auth-applet.Tpo $(DEPDIR)/krb5_auth_dialog-krb5-auth-applet.Po +krb5_auth_dialog-ka-gconf-tools.o: ka-gconf-tools.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-ka-gconf-tools.o -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-ka-gconf-tools.Tpo -c -o krb5_auth_dialog-ka-gconf-tools.o `test -f 'ka-gconf-tools.c' || echo '$(srcdir)/'`ka-gconf-tools.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-ka-gconf-tools.Tpo $(DEPDIR)/krb5_auth_dialog-ka-gconf-tools.Po @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='krb5-auth-applet.c' object='krb5_auth_dialog-krb5-auth-applet.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ka-gconf-tools.c' object='krb5_auth_dialog-ka-gconf-tools.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-krb5-auth-applet.o `test -f 'krb5-auth-applet.c' || echo '$(srcdir)/'`krb5-auth-applet.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-ka-gconf-tools.o `test -f 'ka-gconf-tools.c' || echo '$(srcdir)/'`ka-gconf-tools.c -krb5_auth_dialog-krb5-auth-applet.obj: krb5-auth-applet.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-krb5-auth-applet.obj -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-krb5-auth-applet.Tpo -c -o krb5_auth_dialog-krb5-auth-applet.obj `if test -f 'krb5-auth-applet.c'; then $(CYGPATH_W) 'krb5-auth-applet.c'; else $(CYGPATH_W) '$(srcdir)/krb5-auth-applet.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-krb5-auth-applet.Tpo $(DEPDIR)/krb5_auth_dialog-krb5-auth-applet.Po +krb5_auth_dialog-ka-gconf-tools.obj: ka-gconf-tools.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-ka-gconf-tools.obj -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-ka-gconf-tools.Tpo -c -o krb5_auth_dialog-ka-gconf-tools.obj `if test -f 'ka-gconf-tools.c'; then $(CYGPATH_W) 'ka-gconf-tools.c'; else $(CYGPATH_W) '$(srcdir)/ka-gconf-tools.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-ka-gconf-tools.Tpo $(DEPDIR)/krb5_auth_dialog-ka-gconf-tools.Po @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='krb5-auth-applet.c' object='krb5_auth_dialog-krb5-auth-applet.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ka-gconf-tools.c' object='krb5_auth_dialog-ka-gconf-tools.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-krb5-auth-applet.obj `if test -f 'krb5-auth-applet.c'; then $(CYGPATH_W) 'krb5-auth-applet.c'; else $(CYGPATH_W) '$(srcdir)/krb5-auth-applet.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-ka-gconf-tools.obj `if test -f 'ka-gconf-tools.c'; then $(CYGPATH_W) 'ka-gconf-tools.c'; else $(CYGPATH_W) '$(srcdir)/ka-gconf-tools.c'; fi` -krb5_auth_dialog-krb5-auth-pwdialog.o: krb5-auth-pwdialog.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-krb5-auth-pwdialog.o -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-krb5-auth-pwdialog.Tpo -c -o krb5_auth_dialog-krb5-auth-pwdialog.o `test -f 'krb5-auth-pwdialog.c' || echo '$(srcdir)/'`krb5-auth-pwdialog.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-krb5-auth-pwdialog.Tpo $(DEPDIR)/krb5_auth_dialog-krb5-auth-pwdialog.Po +krb5_auth_dialog-ka-dbus.o: ka-dbus.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-ka-dbus.o -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-ka-dbus.Tpo -c -o krb5_auth_dialog-ka-dbus.o `test -f 'ka-dbus.c' || echo '$(srcdir)/'`ka-dbus.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-ka-dbus.Tpo $(DEPDIR)/krb5_auth_dialog-ka-dbus.Po @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='krb5-auth-pwdialog.c' object='krb5_auth_dialog-krb5-auth-pwdialog.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ka-dbus.c' object='krb5_auth_dialog-ka-dbus.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-krb5-auth-pwdialog.o `test -f 'krb5-auth-pwdialog.c' || echo '$(srcdir)/'`krb5-auth-pwdialog.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-ka-dbus.o `test -f 'ka-dbus.c' || echo '$(srcdir)/'`ka-dbus.c -krb5_auth_dialog-krb5-auth-pwdialog.obj: krb5-auth-pwdialog.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-krb5-auth-pwdialog.obj -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-krb5-auth-pwdialog.Tpo -c -o krb5_auth_dialog-krb5-auth-pwdialog.obj `if test -f 'krb5-auth-pwdialog.c'; then $(CYGPATH_W) 'krb5-auth-pwdialog.c'; else $(CYGPATH_W) '$(srcdir)/krb5-auth-pwdialog.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-krb5-auth-pwdialog.Tpo $(DEPDIR)/krb5_auth_dialog-krb5-auth-pwdialog.Po +krb5_auth_dialog-ka-dbus.obj: ka-dbus.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-ka-dbus.obj -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-ka-dbus.Tpo -c -o krb5_auth_dialog-ka-dbus.obj `if test -f 'ka-dbus.c'; then $(CYGPATH_W) 'ka-dbus.c'; else $(CYGPATH_W) '$(srcdir)/ka-dbus.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-ka-dbus.Tpo $(DEPDIR)/krb5_auth_dialog-ka-dbus.Po @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='krb5-auth-pwdialog.c' object='krb5_auth_dialog-krb5-auth-pwdialog.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ka-dbus.c' object='krb5_auth_dialog-ka-dbus.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-krb5-auth-pwdialog.obj `if test -f 'krb5-auth-pwdialog.c'; then $(CYGPATH_W) 'krb5-auth-pwdialog.c'; else $(CYGPATH_W) '$(srcdir)/krb5-auth-pwdialog.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-ka-dbus.obj `if test -f 'ka-dbus.c'; then $(CYGPATH_W) 'ka-dbus.c'; else $(CYGPATH_W) '$(srcdir)/ka-dbus.c'; fi` -krb5_auth_dialog-krb5-auth-gconf.o: krb5-auth-gconf.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-krb5-auth-gconf.o -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-krb5-auth-gconf.Tpo -c -o krb5_auth_dialog-krb5-auth-gconf.o `test -f 'krb5-auth-gconf.c' || echo '$(srcdir)/'`krb5-auth-gconf.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-krb5-auth-gconf.Tpo $(DEPDIR)/krb5_auth_dialog-krb5-auth-gconf.Po +krb5_auth_dialog-ka-tools.o: ka-tools.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-ka-tools.o -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-ka-tools.Tpo -c -o krb5_auth_dialog-ka-tools.o `test -f 'ka-tools.c' || echo '$(srcdir)/'`ka-tools.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-ka-tools.Tpo $(DEPDIR)/krb5_auth_dialog-ka-tools.Po @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='krb5-auth-gconf.c' object='krb5_auth_dialog-krb5-auth-gconf.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ka-tools.c' object='krb5_auth_dialog-ka-tools.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-krb5-auth-gconf.o `test -f 'krb5-auth-gconf.c' || echo '$(srcdir)/'`krb5-auth-gconf.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-ka-tools.o `test -f 'ka-tools.c' || echo '$(srcdir)/'`ka-tools.c -krb5_auth_dialog-krb5-auth-gconf.obj: krb5-auth-gconf.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-krb5-auth-gconf.obj -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-krb5-auth-gconf.Tpo -c -o krb5_auth_dialog-krb5-auth-gconf.obj `if test -f 'krb5-auth-gconf.c'; then $(CYGPATH_W) 'krb5-auth-gconf.c'; else $(CYGPATH_W) '$(srcdir)/krb5-auth-gconf.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-krb5-auth-gconf.Tpo $(DEPDIR)/krb5_auth_dialog-krb5-auth-gconf.Po +krb5_auth_dialog-ka-tools.obj: ka-tools.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-ka-tools.obj -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-ka-tools.Tpo -c -o krb5_auth_dialog-ka-tools.obj `if test -f 'ka-tools.c'; then $(CYGPATH_W) 'ka-tools.c'; else $(CYGPATH_W) '$(srcdir)/ka-tools.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-ka-tools.Tpo $(DEPDIR)/krb5_auth_dialog-ka-tools.Po @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='krb5-auth-gconf.c' object='krb5_auth_dialog-krb5-auth-gconf.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ka-tools.c' object='krb5_auth_dialog-ka-tools.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-krb5-auth-gconf.obj `if test -f 'krb5-auth-gconf.c'; then $(CYGPATH_W) 'krb5-auth-gconf.c'; else $(CYGPATH_W) '$(srcdir)/krb5-auth-gconf.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-ka-tools.obj `if test -f 'ka-tools.c'; then $(CYGPATH_W) 'ka-tools.c'; else $(CYGPATH_W) '$(srcdir)/ka-tools.c'; fi` -krb5_auth_dialog-krb5-auth-gconf-tools.o: krb5-auth-gconf-tools.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-krb5-auth-gconf-tools.o -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-krb5-auth-gconf-tools.Tpo -c -o krb5_auth_dialog-krb5-auth-gconf-tools.o `test -f 'krb5-auth-gconf-tools.c' || echo '$(srcdir)/'`krb5-auth-gconf-tools.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-krb5-auth-gconf-tools.Tpo $(DEPDIR)/krb5_auth_dialog-krb5-auth-gconf-tools.Po +krb5_auth_dialog-ka-tickets.o: ka-tickets.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-ka-tickets.o -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-ka-tickets.Tpo -c -o krb5_auth_dialog-ka-tickets.o `test -f 'ka-tickets.c' || echo '$(srcdir)/'`ka-tickets.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-ka-tickets.Tpo $(DEPDIR)/krb5_auth_dialog-ka-tickets.Po @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='krb5-auth-gconf-tools.c' object='krb5_auth_dialog-krb5-auth-gconf-tools.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ka-tickets.c' object='krb5_auth_dialog-ka-tickets.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-krb5-auth-gconf-tools.o `test -f 'krb5-auth-gconf-tools.c' || echo '$(srcdir)/'`krb5-auth-gconf-tools.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-ka-tickets.o `test -f 'ka-tickets.c' || echo '$(srcdir)/'`ka-tickets.c -krb5_auth_dialog-krb5-auth-gconf-tools.obj: krb5-auth-gconf-tools.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-krb5-auth-gconf-tools.obj -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-krb5-auth-gconf-tools.Tpo -c -o krb5_auth_dialog-krb5-auth-gconf-tools.obj `if test -f 'krb5-auth-gconf-tools.c'; then $(CYGPATH_W) 'krb5-auth-gconf-tools.c'; else $(CYGPATH_W) '$(srcdir)/krb5-auth-gconf-tools.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-krb5-auth-gconf-tools.Tpo $(DEPDIR)/krb5_auth_dialog-krb5-auth-gconf-tools.Po +krb5_auth_dialog-ka-tickets.obj: ka-tickets.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-ka-tickets.obj -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-ka-tickets.Tpo -c -o krb5_auth_dialog-ka-tickets.obj `if test -f 'ka-tickets.c'; then $(CYGPATH_W) 'ka-tickets.c'; else $(CYGPATH_W) '$(srcdir)/ka-tickets.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-ka-tickets.Tpo $(DEPDIR)/krb5_auth_dialog-ka-tickets.Po @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='krb5-auth-gconf-tools.c' object='krb5_auth_dialog-krb5-auth-gconf-tools.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ka-tickets.c' object='krb5_auth_dialog-ka-tickets.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-krb5-auth-gconf-tools.obj `if test -f 'krb5-auth-gconf-tools.c'; then $(CYGPATH_W) 'krb5-auth-gconf-tools.c'; else $(CYGPATH_W) '$(srcdir)/krb5-auth-gconf-tools.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-ka-tickets.obj `if test -f 'ka-tickets.c'; then $(CYGPATH_W) 'ka-tickets.c'; else $(CYGPATH_W) '$(srcdir)/ka-tickets.c'; fi` -krb5_auth_dialog-krb5-auth-dbus.o: krb5-auth-dbus.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-krb5-auth-dbus.o -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-krb5-auth-dbus.Tpo -c -o krb5_auth_dialog-krb5-auth-dbus.o `test -f 'krb5-auth-dbus.c' || echo '$(srcdir)/'`krb5-auth-dbus.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-krb5-auth-dbus.Tpo $(DEPDIR)/krb5_auth_dialog-krb5-auth-dbus.Po +krb5_auth_dialog-ka-plugin.o: ka-plugin.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-ka-plugin.o -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-ka-plugin.Tpo -c -o krb5_auth_dialog-ka-plugin.o `test -f 'ka-plugin.c' || echo '$(srcdir)/'`ka-plugin.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-ka-plugin.Tpo $(DEPDIR)/krb5_auth_dialog-ka-plugin.Po @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='krb5-auth-dbus.c' object='krb5_auth_dialog-krb5-auth-dbus.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ka-plugin.c' object='krb5_auth_dialog-ka-plugin.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-krb5-auth-dbus.o `test -f 'krb5-auth-dbus.c' || echo '$(srcdir)/'`krb5-auth-dbus.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-ka-plugin.o `test -f 'ka-plugin.c' || echo '$(srcdir)/'`ka-plugin.c -krb5_auth_dialog-krb5-auth-dbus.obj: krb5-auth-dbus.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-krb5-auth-dbus.obj -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-krb5-auth-dbus.Tpo -c -o krb5_auth_dialog-krb5-auth-dbus.obj `if test -f 'krb5-auth-dbus.c'; then $(CYGPATH_W) 'krb5-auth-dbus.c'; else $(CYGPATH_W) '$(srcdir)/krb5-auth-dbus.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-krb5-auth-dbus.Tpo $(DEPDIR)/krb5_auth_dialog-krb5-auth-dbus.Po +krb5_auth_dialog-ka-plugin.obj: ka-plugin.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-ka-plugin.obj -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-ka-plugin.Tpo -c -o krb5_auth_dialog-ka-plugin.obj `if test -f 'ka-plugin.c'; then $(CYGPATH_W) 'ka-plugin.c'; else $(CYGPATH_W) '$(srcdir)/ka-plugin.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-ka-plugin.Tpo $(DEPDIR)/krb5_auth_dialog-ka-plugin.Po @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='krb5-auth-dbus.c' object='krb5_auth_dialog-krb5-auth-dbus.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ka-plugin.c' object='krb5_auth_dialog-ka-plugin.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-krb5-auth-dbus.obj `if test -f 'krb5-auth-dbus.c'; then $(CYGPATH_W) 'krb5-auth-dbus.c'; else $(CYGPATH_W) '$(srcdir)/krb5-auth-dbus.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-ka-plugin.obj `if test -f 'ka-plugin.c'; then $(CYGPATH_W) 'ka-plugin.c'; else $(CYGPATH_W) '$(srcdir)/ka-plugin.c'; fi` -krb5_auth_dialog-krb5-auth-tools.o: krb5-auth-tools.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-krb5-auth-tools.o -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-krb5-auth-tools.Tpo -c -o krb5_auth_dialog-krb5-auth-tools.o `test -f 'krb5-auth-tools.c' || echo '$(srcdir)/'`krb5-auth-tools.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-krb5-auth-tools.Tpo $(DEPDIR)/krb5_auth_dialog-krb5-auth-tools.Po +krb5_auth_dialog-ka-plugin-loader.o: ka-plugin-loader.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-ka-plugin-loader.o -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-ka-plugin-loader.Tpo -c -o krb5_auth_dialog-ka-plugin-loader.o `test -f 'ka-plugin-loader.c' || echo '$(srcdir)/'`ka-plugin-loader.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-ka-plugin-loader.Tpo $(DEPDIR)/krb5_auth_dialog-ka-plugin-loader.Po @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='krb5-auth-tools.c' object='krb5_auth_dialog-krb5-auth-tools.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ka-plugin-loader.c' object='krb5_auth_dialog-ka-plugin-loader.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-krb5-auth-tools.o `test -f 'krb5-auth-tools.c' || echo '$(srcdir)/'`krb5-auth-tools.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-ka-plugin-loader.o `test -f 'ka-plugin-loader.c' || echo '$(srcdir)/'`ka-plugin-loader.c -krb5_auth_dialog-krb5-auth-tools.obj: krb5-auth-tools.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-krb5-auth-tools.obj -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-krb5-auth-tools.Tpo -c -o krb5_auth_dialog-krb5-auth-tools.obj `if test -f 'krb5-auth-tools.c'; then $(CYGPATH_W) 'krb5-auth-tools.c'; else $(CYGPATH_W) '$(srcdir)/krb5-auth-tools.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-krb5-auth-tools.Tpo $(DEPDIR)/krb5_auth_dialog-krb5-auth-tools.Po +krb5_auth_dialog-ka-plugin-loader.obj: ka-plugin-loader.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-ka-plugin-loader.obj -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-ka-plugin-loader.Tpo -c -o krb5_auth_dialog-ka-plugin-loader.obj `if test -f 'ka-plugin-loader.c'; then $(CYGPATH_W) 'ka-plugin-loader.c'; else $(CYGPATH_W) '$(srcdir)/ka-plugin-loader.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-ka-plugin-loader.Tpo $(DEPDIR)/krb5_auth_dialog-ka-plugin-loader.Po @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='krb5-auth-tools.c' object='krb5_auth_dialog-krb5-auth-tools.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ka-plugin-loader.c' object='krb5_auth_dialog-ka-plugin-loader.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-krb5-auth-tools.obj `if test -f 'krb5-auth-tools.c'; then $(CYGPATH_W) 'krb5-auth-tools.c'; else $(CYGPATH_W) '$(srcdir)/krb5-auth-tools.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-ka-plugin-loader.obj `if test -f 'ka-plugin-loader.c'; then $(CYGPATH_W) 'ka-plugin-loader.c'; else $(CYGPATH_W) '$(srcdir)/ka-plugin-loader.c'; fi` -krb5_auth_dialog-krb5-auth-tickets.o: krb5-auth-tickets.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-krb5-auth-tickets.o -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-krb5-auth-tickets.Tpo -c -o krb5_auth_dialog-krb5-auth-tickets.o `test -f 'krb5-auth-tickets.c' || echo '$(srcdir)/'`krb5-auth-tickets.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-krb5-auth-tickets.Tpo $(DEPDIR)/krb5_auth_dialog-krb5-auth-tickets.Po +krb5_auth_dialog-ka-closures.o: ka-closures.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-ka-closures.o -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-ka-closures.Tpo -c -o krb5_auth_dialog-ka-closures.o `test -f 'ka-closures.c' || echo '$(srcdir)/'`ka-closures.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-ka-closures.Tpo $(DEPDIR)/krb5_auth_dialog-ka-closures.Po @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='krb5-auth-tickets.c' object='krb5_auth_dialog-krb5-auth-tickets.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ka-closures.c' object='krb5_auth_dialog-ka-closures.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-krb5-auth-tickets.o `test -f 'krb5-auth-tickets.c' || echo '$(srcdir)/'`krb5-auth-tickets.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-ka-closures.o `test -f 'ka-closures.c' || echo '$(srcdir)/'`ka-closures.c -krb5_auth_dialog-krb5-auth-tickets.obj: krb5-auth-tickets.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-krb5-auth-tickets.obj -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-krb5-auth-tickets.Tpo -c -o krb5_auth_dialog-krb5-auth-tickets.obj `if test -f 'krb5-auth-tickets.c'; then $(CYGPATH_W) 'krb5-auth-tickets.c'; else $(CYGPATH_W) '$(srcdir)/krb5-auth-tickets.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-krb5-auth-tickets.Tpo $(DEPDIR)/krb5_auth_dialog-krb5-auth-tickets.Po +krb5_auth_dialog-ka-closures.obj: ka-closures.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-ka-closures.obj -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-ka-closures.Tpo -c -o krb5_auth_dialog-ka-closures.obj `if test -f 'ka-closures.c'; then $(CYGPATH_W) 'ka-closures.c'; else $(CYGPATH_W) '$(srcdir)/ka-closures.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/krb5_auth_dialog-ka-closures.Tpo $(DEPDIR)/krb5_auth_dialog-ka-closures.Po @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='krb5-auth-tickets.c' object='krb5_auth_dialog-krb5-auth-tickets.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ka-closures.c' object='krb5_auth_dialog-ka-closures.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-krb5-auth-tickets.obj `if test -f 'krb5-auth-tickets.c'; then $(CYGPATH_W) 'krb5-auth-tickets.c'; else $(CYGPATH_W) '$(srcdir)/krb5-auth-tickets.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -c -o krb5_auth_dialog-ka-closures.obj `if test -f 'ka-closures.c'; then $(CYGPATH_W) 'ka-closures.c'; else $(CYGPATH_W) '$(srcdir)/ka-closures.c'; fi` krb5_auth_dialog-dummy-strings.o: dummy-strings.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(krb5_auth_dialog_CPPFLAGS) $(CPPFLAGS) $(krb5_auth_dialog_CFLAGS) $(CFLAGS) -MT krb5_auth_dialog-dummy-strings.o -MD -MP -MF $(DEPDIR)/krb5_auth_dialog-dummy-strings.Tpo -c -o krb5_auth_dialog-dummy-strings.o `test -f 'dummy-strings.c' || echo '$(srcdir)/'`dummy-strings.c @@ -1030,7 +1098,7 @@ uninstall-man: uninstall-man1 $(service_DATA): $(service_in_files) Makefile sed -e "s|\@BINDIR\@|$(bindir)|" $< > $@ -krb5-auth-applet-dbus-glue.h: $(srcdir)/krb5-auth-applet-dbus.xml +ka-dbus-glue.h: $(srcdir)/ka-dbus.xml dbus-binding-tool \ --mode=glib-server \ --prefix=krb5_auth_dialog \ diff --git a/src/ka-applet-priv.h b/src/ka-applet-priv.h new file mode 100644 index 0000000..7e240a7 --- /dev/null +++ b/src/ka-applet-priv.h @@ -0,0 +1,72 @@ +/* Krb5 Auth Applet -- Acquire and release kerberos tickets + * + * (C) 2008,2010 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +/* "Private" header - functions not exported to plugins */ + +#ifndef KA_APPLET_PRIV_H +#define KA_APPLET_PRIV_H + +#include +#include +#include +#include + +#include "config.h" +#include "ka-applet.h" +#include "ka-pwdialog.h" + +G_BEGIN_DECLS + +#define KA_NAME _("Network Authentication") + +/* signals emitted by KaApplet */ +typedef enum { + KA_SIGNAL_ACQUIRED_TGT, /* New TGT acquired */ + KA_SIGNAL_RENEWED_TGT, /* TGT got renewed */ + KA_SIGNAL_EXPIRED_TGT, /* TGT expired or ticket cache got destroyed */ + KA_SIGNAL_COUNT +} KaAppletSignalNumber; + +/* public functions */ +gboolean ka_applet_get_show_trayicon(const KaApplet* applet); +void ka_applet_set_tgt_renewable(KaApplet* applet, gboolean renewable); +gboolean ka_applet_get_tgt_renewable(const KaApplet* applet); +guint ka_applet_get_pw_prompt_secs(const KaApplet* applet); +KaPwDialog* ka_applet_get_pwdialog(const KaApplet* applet); +GConfClient* ka_applet_get_gconf_client(const KaApplet* applet); +void ka_applet_signal_emit(KaApplet* applet, KaAppletSignalNumber signum, + krb5_timestamp expiry); + +/* create the applet */ +KaApplet* ka_applet_create(void); +/* update tooltip and icon */ +int ka_applet_update_status(KaApplet* applet, krb5_timestamp expiry); + +G_END_DECLS + +#ifdef ENABLE_DEBUG +#define KA_DEBUG(fmt,...) \ + g_printf ("DEBUG: %s: " fmt "\n", __func__, ##__VA_ARGS__) +#else +#define KA_DEBUG(fmt,...) \ + do { } while (0) +#endif /* !ENABLE_DEBUG */ + +#endif diff --git a/src/ka-applet.c b/src/ka-applet.c new file mode 100644 index 0000000..472f4f5 --- /dev/null +++ b/src/ka-applet.c @@ -0,0 +1,942 @@ +/* Krb5 Auth Applet -- Acquire and release kerberos tickets + * + * (C) 2008,2009,2010 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#include "config.h" + +#include + +#include "ka-applet-priv.h" +#include "ka-dialog.h" +#include "ka-gconf-tools.h" +#include "ka-gconf.h" +#include "ka-tools.h" +#include "ka-tickets.h" +#include "ka-plugin-loader.h" +#include "ka-closures.h" +#ifdef HAVE_LIBNOTIFY +#include +#endif + +#define NOTIFY_SECONDS 300 + +enum ka_icon { + inv_icon = 0, + exp_icon, + val_icon, +}; + +enum +{ + KA_PROP_0 = 0, + KA_PROP_PRINCIPAL, + KA_PROP_PK_USERID, + KA_PROP_PK_ANCHORS, + KA_PROP_TRAYICON, + KA_PROP_PW_PROMPT_MINS, + KA_PROP_TGT_FORWARDABLE, + KA_PROP_TGT_PROXIABLE, + KA_PROP_TGT_RENEWABLE, +}; + +struct _KaApplet { + GObject parent; + + KaAppletPrivate *priv; +}; + +struct _KaAppletClass { + GObjectClass parent; + + guint signals [KA_SIGNAL_COUNT]; +}; + +G_DEFINE_TYPE(KaApplet, ka_applet, G_TYPE_OBJECT); + +struct _KaAppletPrivate +{ + GtkBuilder *uixml; + GtkStatusIcon* tray_icon; /* the tray icon */ + GtkWidget* context_menu; /* the tray icon's context menu */ + const char* icons[3]; /* for invalid, expiring and valid tickts */ + gboolean show_trayicon; /* show the trayicon */ + + KaPwDialog *pwdialog; /* the password dialog */ + int pw_prompt_secs; /* when to start prompting for a password */ + KaPluginLoader *loader; /* Plugin loader */ + +#ifdef HAVE_LIBNOTIFY + NotifyNotification* notification;/* notification messages */ +#endif /* HAVE_LIBNOTIFY */ + const char* notify_gconf_key; /* disable notification gconf key */ + char* principal; /* the principal to request */ + gboolean renewable; /* credentials renewable? */ + char* pk_userid; /* "userid" for pkint */ + char* pk_anchors; /* trust anchors for pkint */ + gboolean tgt_forwardable; /* request a forwardable ticket */ + gboolean tgt_renewable; /* request a renewable ticket */ + gboolean tgt_proxiable; /* request a proxiable ticket */ + + GConfClient *gconf; /* gconf client */ +}; + +static void +ka_applet_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + KaApplet* self = KA_APPLET (object); + + switch (property_id) { + case KA_PROP_PRINCIPAL: + g_free (self->priv->principal); + self->priv->principal = g_value_dup_string (value); + KA_DEBUG ("%s: %s", pspec->name, self->priv->principal); + break; + + case KA_PROP_PK_USERID: + g_free (self->priv->pk_userid); + self->priv->pk_userid = g_value_dup_string (value); + KA_DEBUG ("%s: %s", pspec->name, self->priv->pk_userid); + break; + + case KA_PROP_PK_ANCHORS: + g_free (self->priv->pk_anchors); + self->priv->pk_anchors = g_value_dup_string (value); + KA_DEBUG ("%s: %s", pspec->name, self->priv->pk_anchors); + break; + + case KA_PROP_TRAYICON: + self->priv->show_trayicon = g_value_get_boolean (value); + KA_DEBUG ("%s: %s", pspec->name, self->priv->show_trayicon ? "True" : "False"); + break; + + case KA_PROP_PW_PROMPT_MINS: + self->priv->pw_prompt_secs = g_value_get_uint (value) * 60; + KA_DEBUG ("%s: %d", pspec->name, self->priv->pw_prompt_secs/60); + break; + + case KA_PROP_TGT_FORWARDABLE: + self->priv->tgt_forwardable = g_value_get_boolean (value); + KA_DEBUG ("%s: %s", pspec->name, self->priv->tgt_forwardable ? "True" : "False"); + break; + + case KA_PROP_TGT_PROXIABLE: + self->priv->tgt_proxiable = g_value_get_boolean (value); + KA_DEBUG ("%s: %s", pspec->name, self->priv->tgt_proxiable ? "True" : "False"); + break; + + case KA_PROP_TGT_RENEWABLE: + self->priv->tgt_renewable = g_value_get_boolean (value); + KA_DEBUG ("%s: %s", pspec->name, self->priv->tgt_renewable ? "True" : "False"); + break; + + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +ka_applet_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + KaApplet *self = KA_APPLET (object); + + switch (property_id) + { + case KA_PROP_PRINCIPAL: + g_value_set_string (value, self->priv->principal); + break; + + case KA_PROP_PK_USERID: + g_value_set_string (value, self->priv->pk_userid); + break; + + case KA_PROP_PK_ANCHORS: + g_value_set_string (value, self->priv->pk_anchors); + break; + + case KA_PROP_TRAYICON: + g_value_set_boolean (value, self->priv->show_trayicon); + break; + + case KA_PROP_PW_PROMPT_MINS: + g_value_set_uint (value, self->priv->pw_prompt_secs / 60); + break; + + case KA_PROP_TGT_FORWARDABLE: + g_value_set_boolean (value, self->priv->tgt_forwardable); + break; + + case KA_PROP_TGT_PROXIABLE: + g_value_set_boolean (value, self->priv->tgt_proxiable); + break; + + case KA_PROP_TGT_RENEWABLE: + g_value_set_boolean (value, self->priv->tgt_renewable); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void +ka_applet_dispose(GObject* object) +{ + KaApplet* applet = KA_APPLET(object); + GObjectClass *parent_class = G_OBJECT_CLASS (ka_applet_parent_class); + + if (applet->priv->tray_icon) { + g_object_unref(applet->priv->tray_icon); + applet->priv->tray_icon = NULL; + } + if (applet->priv->pwdialog) { + g_object_unref(applet->priv->pwdialog); + applet->priv->pwdialog = NULL; + } + if (applet->priv->uixml) { + g_object_unref(applet->priv->uixml); + applet->priv->uixml = NULL; + } + if (applet->priv->loader) { + g_object_unref(applet->priv->loader); + applet->priv->loader = NULL; + } + + if (parent_class->dispose != NULL) + parent_class->dispose (object); +} + + +static void +ka_applet_finalize(GObject *object) +{ + KaApplet* applet = KA_APPLET(object); + GObjectClass *parent_class = G_OBJECT_CLASS (ka_applet_parent_class); + + g_free (applet->priv->principal); + g_free (applet->priv->pk_userid); + g_free (applet->priv->pk_anchors); + /* no need to free applet->priv */ + + if (parent_class->finalize != NULL) + parent_class->finalize (object); +} + +static void +ka_applet_init(KaApplet *applet) +{ + applet->priv = G_TYPE_INSTANCE_GET_PRIVATE(applet, + KA_TYPE_APPLET, + KaAppletPrivate); +} + +static void +ka_applet_class_init(KaAppletClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS(klass); + GParamSpec *pspec; + const gchar *signalNames [ KA_SIGNAL_COUNT ] = { + "krb-tgt-acquired", + "krb-tgt-renewed", + "krb-tgt-expired"}; + int i; + + object_class->dispose = ka_applet_dispose; + object_class->finalize = ka_applet_finalize; + g_type_class_add_private(klass, sizeof(KaAppletPrivate)); + + object_class->set_property = ka_applet_set_property; + object_class->get_property = ka_applet_get_property; + + pspec = g_param_spec_string ("principal", + "Principal", + "Get/Set Kerberos principal", + "", + G_PARAM_CONSTRUCT | G_PARAM_READWRITE); + g_object_class_install_property (object_class, + KA_PROP_PRINCIPAL, + pspec); + + pspec = g_param_spec_string ("pk-userid", + "PKinit identifier", + "Get/Set Pkinit identifier", + "", + G_PARAM_CONSTRUCT | G_PARAM_READWRITE); + g_object_class_install_property (object_class, + KA_PROP_PK_USERID, + pspec); + + pspec = g_param_spec_string ("pk-anchors", + "PKinit trust anchors", + "Get/Set Pkinit trust anchors", + "", + G_PARAM_CONSTRUCT | G_PARAM_READWRITE); + g_object_class_install_property (object_class, + KA_PROP_PK_ANCHORS, + pspec); + + pspec = g_param_spec_boolean("show-trayicon", + "Show tray icon", + "Show/Hide the tray icon", + TRUE, + G_PARAM_CONSTRUCT | G_PARAM_READWRITE); + g_object_class_install_property (object_class, + KA_PROP_TRAYICON, + pspec); + + pspec = g_param_spec_uint ("pw-prompt-mins", + "Password prompting interval", + "Password prompting interval in minutes", + 0, G_MAXUINT, MINUTES_BEFORE_PROMPTING, + G_PARAM_CONSTRUCT | G_PARAM_READWRITE); + g_object_class_install_property (object_class, + KA_PROP_PW_PROMPT_MINS, + pspec); + + pspec = g_param_spec_boolean("tgt-forwardable", + "Forwardable ticket", + "wether to request forwardable tickets", + FALSE, + G_PARAM_CONSTRUCT | G_PARAM_READWRITE); + g_object_class_install_property (object_class, + KA_PROP_TGT_FORWARDABLE, + pspec); + + pspec = g_param_spec_boolean("tgt-proxiable", + "Proxiable ticket", + "wether to request proxiable tickets", + FALSE, + G_PARAM_CONSTRUCT | G_PARAM_READWRITE); + g_object_class_install_property (object_class, + KA_PROP_TGT_PROXIABLE, + pspec); + + pspec = g_param_spec_boolean("tgt-renewable", + "Renewable ticket", + "wether to request renewable tickets", + FALSE, + G_PARAM_CONSTRUCT | G_PARAM_READWRITE); + g_object_class_install_property (object_class, + KA_PROP_TGT_RENEWABLE, + pspec); + + for (i = 0; i < KA_SIGNAL_COUNT ; i++) { + guint signalId; + signalId = + g_signal_new ( signalNames [i], + G_OBJECT_CLASS_TYPE ( klass ), + G_SIGNAL_RUN_LAST, + 0, + NULL, + NULL, + ka_closure_VOID__STRING_UINT, + G_TYPE_NONE, + 2, /* number of parameters */ + G_TYPE_STRING, + G_TYPE_UINT); + klass->signals [i] = signalId ; + } +} + + +static KaApplet* +ka_applet_new(void) +{ + return g_object_new (KA_TYPE_APPLET, NULL); +} + + +/* determine the new tooltip text */ +static char* +ka_applet_tooltip_text(int remaining) +{ + int hours, minutes; + gchar* tooltip_text; + + if (remaining > 0) { + if (remaining >= 3600) { + hours = remaining / 3600; + minutes = (remaining % 3600) / 60; + /* Translators: First number is hours, second number is minutes */ + tooltip_text = g_strdup_printf (_("Your credentials expire in %.2d:%.2dh"), hours, minutes); + } else { + minutes = remaining / 60; + tooltip_text = g_strdup_printf (ngettext( + "Your credentials expire in %d minute", + "Your credentials expire in %d minutes", + minutes), minutes); + } + } else + tooltip_text = g_strdup (_("Your credentials have expired")); + return tooltip_text; +} + + +/* determine the current icon */ +static const char* +ka_applet_select_icon(KaApplet* applet, int remaining) +{ + enum ka_icon tray_icon = inv_icon; + + if (remaining > 0) { + if (remaining < applet->priv->pw_prompt_secs && + !applet->priv->renewable) + tray_icon = exp_icon; + else + tray_icon = val_icon; + } + + return applet->priv->icons[tray_icon]; +} + + +#ifdef HAVE_LIBNOTIFY +static gboolean +ka_show_notification (KaApplet *applet) +{ + /* wait for the panel to be settled before showing a bubble */ + if (gtk_status_icon_is_embedded (applet->priv->tray_icon)) { + GError *error = NULL; + gboolean ret; + + ret = notify_notification_show (applet->priv->notification, &error); + if (!ret) { + g_assert (error); + g_assert (error->message); + g_warning ("Failed to show notification: %s", error->message); + g_clear_error (&error); + } + } else { + g_timeout_add_seconds (5, (GSourceFunc)ka_show_notification, applet); + } + return FALSE; +} + + +static void +ka_notify_action_cb (NotifyNotification *notification G_GNUC_UNUSED, + gchar *action, gpointer user_data) +{ + KaApplet *self = KA_APPLET (user_data); + + if (strcmp (action, "dont-show-again") == 0) { + KA_DEBUG ("turning of notification %s", self->priv->notify_gconf_key); + ka_gconf_set_bool (self->priv->gconf, + self->priv->notify_gconf_key, + FALSE); + self->priv->notify_gconf_key = NULL; + } else { + g_warning("unkonwn action for callback"); + } +} + + +static void +ka_send_event_notification (KaApplet *applet, + const char *summary, + const char *message, + const char *icon, + const char *action) +{ + const char *notify_icon; + + g_return_if_fail (applet != NULL); + g_return_if_fail (summary != NULL); + g_return_if_fail (message != NULL); + + if (!notify_is_initted ()) + notify_init (PACKAGE); + + if (applet->priv->notification != NULL) { + notify_notification_close (applet->priv->notification, NULL); + g_object_unref (applet->priv->notification); + } + + notify_icon = icon ? icon : "krb-valid-ticket"; + + applet->priv->notification = \ + notify_notification_new_with_status_icon(summary, + message, + notify_icon, + applet->priv->tray_icon); + + notify_notification_set_urgency (applet->priv->notification, NOTIFY_URGENCY_NORMAL); + notify_notification_add_action (applet->priv->notification, + action, + _("Don't show me this again"), + (NotifyActionCallback) ka_notify_action_cb, + applet, NULL); + ka_show_notification (applet); +} +#else +static void +ka_send_event_notification (KaApplet *applet G_GNUC_UNUSED, + const char *summary G_GNUC_UNUSED, + const char *message G_GNUC_UNUSED, + const char *icon G_GNUC_UNUSED, + const char *action G_GNUC_UNUSED) +{ +} +#endif /* ! HAVE_LIBNOTIFY */ + + +/* + * update the tray icon's tooltip and icon + * and notify listeners about acquired/expiring tickets via signals + */ +int +ka_applet_update_status(KaApplet* applet, krb5_timestamp expiry) +{ + int now = time(0); + int remaining = expiry - now; + static int last_warn = 0; + static gboolean expiry_notified = FALSE; + static krb5_timestamp old_expiry = 0; + gboolean notify = TRUE; + const char* tray_icon = ka_applet_select_icon (applet, remaining); + char* tooltip_text = ka_applet_tooltip_text (remaining); + + + if (remaining > 0) { + if (expiry_notified) { + ka_gconf_get_bool(applet->priv->gconf, + KA_GCONF_KEY_NOTIFY_VALID, + ¬ify); + if (notify) { + applet->priv->notify_gconf_key = KA_GCONF_KEY_NOTIFY_VALID; + ka_send_event_notification (applet, + _("Network credentials valid"), + _("You've refreshed your Kerberos credentials."), + "krb-valid-ticket", + "dont-show-again"); + } + ka_applet_signal_emit (applet, KA_SIGNAL_ACQUIRED_TGT, expiry); + expiry_notified = FALSE; + } else { + if (remaining < applet->priv->pw_prompt_secs + && (now - last_warn) > NOTIFY_SECONDS + && !applet->priv->renewable) { + ka_gconf_get_bool(applet->priv->gconf, + KA_GCONF_KEY_NOTIFY_EXPIRING, + ¬ify); + if (notify) { + applet->priv->notify_gconf_key = KA_GCONF_KEY_NOTIFY_EXPIRING; + ka_send_event_notification (applet, + _("Network credentials expiring"), + tooltip_text, + "krb-expiring-ticket", + "dont-show-again"); + } + last_warn = now; + } + /* ticket lifetime got longer e.g. by kinit -R */ + if (old_expiry && expiry > old_expiry) + ka_applet_signal_emit (applet, KA_SIGNAL_RENEWED_TGT, expiry); + } + } else { + if (!expiry_notified) { + ka_gconf_get_bool(applet->priv->gconf, + KA_GCONF_KEY_NOTIFY_EXPIRED, + ¬ify); + if (notify) { + applet->priv->notify_gconf_key = KA_GCONF_KEY_NOTIFY_EXPIRED; + ka_send_event_notification (applet, + _("Network credentials expired"), + _("Your Kerberos credentails have expired."), + "krb-no-valid-ticket", + "dont-show-again"); + } + ka_applet_signal_emit (applet, KA_SIGNAL_EXPIRED_TGT, expiry); + expiry_notified = TRUE; + last_warn = 0; + } + } + + old_expiry = expiry; + gtk_status_icon_set_from_icon_name (applet->priv->tray_icon, tray_icon); + gtk_status_icon_set_tooltip_text (applet->priv->tray_icon, tooltip_text); + g_free(tooltip_text); + return 0; +} + + +static void +ka_applet_menu_add_separator_item (GtkWidget* menu) +{ + GtkWidget* menu_item; + + menu_item = gtk_separator_menu_item_new (); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); + gtk_widget_show (menu_item); +} + +static void +ka_applet_cb_preferences (GtkWidget* menuitem G_GNUC_UNUSED, + gpointer user_data G_GNUC_UNUSED) +{ + GError *error = NULL; + + g_spawn_command_line_async (BIN_DIR + G_DIR_SEPARATOR_S + "krb5-auth-dialog-preferences", + &error); + if (error) { + GtkWidget *message_dialog; + + message_dialog = gtk_message_dialog_new (NULL, + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + _("There was an error launching the preferences dialog: %s"), + error->message); + gtk_window_set_resizable (GTK_WINDOW (message_dialog), FALSE); + + g_signal_connect (message_dialog, "response", + G_CALLBACK (gtk_widget_destroy), + NULL); + gtk_widget_show (message_dialog); + g_error_free (error); + } +} + + +/* Free all resources and quit */ +static void +ka_applet_cb_quit (GtkMenuItem* menuitem G_GNUC_UNUSED, gpointer user_data) +{ + KaApplet* applet = KA_APPLET(user_data); + + g_object_unref (applet); + gtk_main_quit (); +} + + +static void +ka_about_dialog_url_hook (GtkAboutDialog *about, + const gchar *alink, + gpointer data G_GNUC_UNUSED) +{ + GError *error = NULL; + + gtk_show_uri(gtk_window_get_screen (GTK_WINDOW (about)), + alink, gtk_get_current_event_time(), &error); + + if (error) { + GtkWidget *message_dialog; + + message_dialog = gtk_message_dialog_new (GTK_WINDOW (about), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + _("There was an error displaying %s:\n%s"), + alink, error->message); + gtk_window_set_resizable (GTK_WINDOW (message_dialog), FALSE); + + g_signal_connect (message_dialog, "response", + G_CALLBACK (gtk_widget_destroy), + NULL); + gtk_widget_show (message_dialog); + g_error_free (error); + } +} + + +static void +ka_applet_cb_about_dialog (GtkMenuItem* menuitem G_GNUC_UNUSED, + gpointer user_data G_GNUC_UNUSED) +{ + const gchar* authors[] = { + "Christopher Aillon ", + "Jonathan Blandford ", + "Colin Walters ", + "Guido Günther ", + NULL }; + + gtk_about_dialog_set_url_hook (ka_about_dialog_url_hook, NULL, NULL); + gtk_show_about_dialog (NULL, + "authors", authors, + "version", VERSION, + "logo-icon-name", "krb-valid-ticket", + "copyright", + "Copyright (C) 2004,2005,2006 Red Hat, Inc.,\n" + "2008,2009 Guido Günther", + "website-label", PACKAGE " website", + "website", "https://honk.sigxcpu.org/piki/projects/krb5-auth-dialog/", + "license", "GNU General Public License Version 2", + /* Translators: add the translators of your language here */ + "translator-credits", _("translator-credits"), + NULL); +} + + +static void +ka_applet_cb_show_help (GtkMenuItem* menuitem G_GNUC_UNUSED, + gpointer user_data) +{ + KaApplet *applet = KA_APPLET(user_data); + + ka_show_help (gtk_status_icon_get_screen(applet->priv->tray_icon), NULL, NULL); +} + + +static void +ka_applet_cb_destroy_ccache(GtkMenuItem* menuitem G_GNUC_UNUSED, + gpointer user_data) +{ + KaApplet *applet = KA_APPLET(user_data); + ka_destroy_ccache(applet); +} + +static void +ka_applet_cb_show_tickets(GtkMenuItem* menuitem G_GNUC_UNUSED, + gpointer user_data G_GNUC_UNUSED) +{ + ka_tickets_dialog_run(); +} + + +/* The tray icon's context menu */ +static gboolean +ka_applet_create_context_menu (KaApplet* applet) +{ + GtkWidget* menu; + GtkWidget* menu_item; + GtkWidget* image; + + menu = gtk_menu_new (); + + /* kdestroy */ + menu_item = gtk_image_menu_item_new_with_mnemonic (_("Remove Credentials _Cache")); + g_signal_connect (G_OBJECT (menu_item), "activate", + G_CALLBACK (ka_applet_cb_destroy_ccache), applet); + image = gtk_image_new_from_stock (GTK_STOCK_CANCEL, GTK_ICON_SIZE_MENU); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), image); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); + + ka_applet_menu_add_separator_item (menu); + + /* Ticket dialog */ + menu_item = gtk_image_menu_item_new_with_mnemonic("_List Tickets"); + g_signal_connect (G_OBJECT (menu_item), "activate", + G_CALLBACK (ka_applet_cb_show_tickets), applet); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); + + /* Preferences */ + menu_item = gtk_image_menu_item_new_from_stock(GTK_STOCK_PREFERENCES, NULL); + g_signal_connect (G_OBJECT (menu_item), "activate", + G_CALLBACK (ka_applet_cb_preferences), applet); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); + + /* About item */ + menu_item = gtk_image_menu_item_new_from_stock(GTK_STOCK_HELP, NULL); + g_signal_connect (G_OBJECT (menu_item), "activate", + G_CALLBACK (ka_applet_cb_show_help), applet); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); + + /* About item */ + menu_item = gtk_image_menu_item_new_from_stock(GTK_STOCK_ABOUT, NULL); + g_signal_connect (G_OBJECT (menu_item), "activate", + G_CALLBACK (ka_applet_cb_about_dialog), applet); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); + + ka_applet_menu_add_separator_item (menu); + + /* Quit */ + menu_item = gtk_image_menu_item_new_from_stock(GTK_STOCK_QUIT, NULL); + g_signal_connect (G_OBJECT (menu_item), "activate", + G_CALLBACK (ka_applet_cb_quit), applet); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); + + gtk_widget_show_all (menu); + applet->priv->context_menu = menu; + + return TRUE; +} + + +static void +ka_tray_icon_on_menu (GtkStatusIcon* status_icon G_GNUC_UNUSED, + guint button, + guint activate_time, + gpointer user_data) +{ + KaApplet *applet = KA_APPLET(user_data); + + KA_DEBUG("Trayicon right clicked: %d", applet->priv->pw_prompt_secs); + gtk_menu_popup (GTK_MENU (applet->priv->context_menu), NULL, NULL, + gtk_status_icon_position_menu, applet->priv->tray_icon, + button, activate_time); +} + + +static gboolean +ka_tray_icon_on_click (GtkStatusIcon* status_icon G_GNUC_UNUSED, + gpointer data) +{ + KaApplet *applet = KA_APPLET(data); + + KA_DEBUG("Trayicon clicked: %d", applet->priv->pw_prompt_secs); + ka_grab_credentials (applet); + return TRUE; +} + + +static gboolean +ka_applet_cb_show_trayicon (KaApplet* applet, + GParamSpec* property G_GNUC_UNUSED, + gpointer data G_GNUC_UNUSED) +{ + g_return_val_if_fail (applet != NULL, FALSE); + g_return_val_if_fail (applet->priv->tray_icon != NULL, FALSE); + + gtk_status_icon_set_visible (applet->priv->tray_icon, applet->priv->show_trayicon); + return TRUE; +} + + +static gboolean +ka_applet_create_tray_icon (KaApplet* applet) +{ + GtkStatusIcon* tray_icon; + + tray_icon = gtk_status_icon_new (); + + g_signal_connect (G_OBJECT(tray_icon), "activate", + G_CALLBACK(ka_tray_icon_on_click), applet); + g_signal_connect (G_OBJECT(tray_icon), + "popup-menu", + G_CALLBACK(ka_tray_icon_on_menu), applet); + gtk_status_icon_set_from_icon_name (tray_icon, applet->priv->icons[exp_icon]); + gtk_status_icon_set_tooltip_text (tray_icon, PACKAGE); + gtk_status_icon_set_title (tray_icon, KA_NAME); + applet->priv->tray_icon = tray_icon; + return TRUE; +} + +static int +ka_applet_setup_icons (KaApplet* applet) +{ + /* Add application specific icons to search path */ + gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (), + DATA_DIR G_DIR_SEPARATOR_S "icons"); + applet->priv->icons[val_icon] = "krb-valid-ticket"; + applet->priv->icons[exp_icon] = "krb-expiring-ticket"; + applet->priv->icons[inv_icon] = "krb-no-valid-ticket"; + return TRUE; +} + +guint +ka_applet_get_pw_prompt_secs(const KaApplet* applet) +{ + return applet->priv->pw_prompt_secs; +} + +gboolean +ka_applet_get_show_trayicon(const KaApplet* applet) +{ + return applet->priv->show_trayicon; +} + +void +ka_applet_set_tgt_renewable(KaApplet* applet, gboolean renewable) +{ + applet->priv->renewable = renewable; +} + +gboolean +ka_applet_get_tgt_renewable(const KaApplet* applet) +{ + return applet->priv->renewable; +} + +KaPwDialog* +ka_applet_get_pwdialog(const KaApplet* applet) +{ + return applet->priv->pwdialog; +} + +GConfClient* +ka_applet_get_gconf_client(const KaApplet* self) +{ + return self->priv->gconf; +} + +void +ka_applet_signal_emit (KaApplet* this, KaAppletSignalNumber signum, + krb5_timestamp expiry) +{ + KaAppletClass *klass = KA_APPLET_GET_CLASS (this); + char *princ; + + princ = ka_unparse_name (); + if (!princ) + return; + + g_signal_emit (this, klass->signals[signum], 0, princ, (guint32)expiry); + g_free (princ); +} + +/* create the tray icon applet */ +KaApplet* +ka_applet_create() +{ + KaApplet* applet = ka_applet_new(); + GError *error = NULL; + gboolean ret; + + if (!(ka_applet_setup_icons (applet))) + g_error ("Failure to setup icons"); + if (!ka_applet_create_tray_icon (applet)) + g_error ("Failure to create tray icon"); + if (!ka_applet_create_context_menu (applet)) + g_error ("Failure to create context menu"); + gtk_window_set_default_icon_name (applet->priv->icons[val_icon]); + g_signal_connect (applet, "notify::show-trayicon", + G_CALLBACK (ka_applet_cb_show_trayicon), NULL); + + applet->priv->uixml = gtk_builder_new(); + ret = gtk_builder_add_from_file(applet->priv->uixml, + KA_DATA_DIR G_DIR_SEPARATOR_S + PACKAGE ".xml", &error); + if (!ret) { + g_assert (error); + g_assert (error->message); + g_error ("Failed to load UI XML: %s", error->message); + } + applet->priv->pwdialog = ka_pwdialog_create(applet->priv->uixml); + g_return_val_if_fail (applet->priv->pwdialog != NULL, NULL); + + applet->priv->gconf = ka_gconf_init (applet); + g_return_val_if_fail (applet->priv->gconf != NULL, NULL); + + ka_tickets_dialog_create (applet->priv->uixml); + applet->priv->loader = ka_plugin_loader_create (applet); + g_return_val_if_fail (applet->priv->loader != NULL, NULL); + + return applet; +} diff --git a/src/ka-applet.h b/src/ka-applet.h new file mode 100644 index 0000000..e9af644 --- /dev/null +++ b/src/ka-applet.h @@ -0,0 +1,48 @@ +/* Krb5 Auth Applet -- Acquire and release kerberos tickets + * + * (C) 2008 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef KA_APPLET_H +#define KA_APPLET_H + +#include + +G_BEGIN_DECLS + +#define KA_TYPE_APPLET (ka_applet_get_type ()) +#define KA_APPLET(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), KA_TYPE_APPLET, KaApplet)) +#define KA_APPLET_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), KA_TYPE_APPLET, KaAppletClass)) +#define KA_IS_APPLET(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), KA_TYPE_APPLET)) +#define KA_IS_APPLET_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), KA_TYPE_APPLET)) +#define KA_APPLET_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), KA_TYPE_APPLET, KaAppletClass)) + +typedef struct _KaApplet KaApplet; +typedef struct _KaAppletClass KaAppletClass; +typedef struct _KaAppletPrivate KaAppletPrivate; + +GType ka_applet_get_type (void); + +G_END_DECLS + +#endif diff --git a/src/ka-closures.c b/src/ka-closures.c new file mode 100644 index 0000000..a3c651b --- /dev/null +++ b/src/ka-closures.c @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2010 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * This file was generated using glib-genmarshal + */ + +#include +#include "ka-closures.h" + + +#ifdef G_ENABLE_DEBUG +#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) +#define g_marshal_value_peek_char(v) g_value_get_char (v) +#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) +#define g_marshal_value_peek_int(v) g_value_get_int (v) +#define g_marshal_value_peek_uint(v) g_value_get_uint (v) +#define g_marshal_value_peek_long(v) g_value_get_long (v) +#define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) +#define g_marshal_value_peek_int64(v) g_value_get_int64 (v) +#define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) +#define g_marshal_value_peek_enum(v) g_value_get_enum (v) +#define g_marshal_value_peek_flags(v) g_value_get_flags (v) +#define g_marshal_value_peek_float(v) g_value_get_float (v) +#define g_marshal_value_peek_double(v) g_value_get_double (v) +#define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) +#define g_marshal_value_peek_param(v) g_value_get_param (v) +#define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) +#define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) +#define g_marshal_value_peek_object(v) g_value_get_object (v) +#else /* !G_ENABLE_DEBUG */ +/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. + * Do not access GValues directly in your code. Instead, use the + * g_value_get_*() functions + */ +#define g_marshal_value_peek_boolean(v) (v)->data[0].v_int +#define g_marshal_value_peek_char(v) (v)->data[0].v_int +#define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint +#define g_marshal_value_peek_int(v) (v)->data[0].v_int +#define g_marshal_value_peek_uint(v) (v)->data[0].v_uint +#define g_marshal_value_peek_long(v) (v)->data[0].v_long +#define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong +#define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 +#define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 +#define g_marshal_value_peek_enum(v) (v)->data[0].v_long +#define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong +#define g_marshal_value_peek_float(v) (v)->data[0].v_float +#define g_marshal_value_peek_double(v) (v)->data[0].v_double +#define g_marshal_value_peek_string(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_param(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_object(v) (v)->data[0].v_pointer +#endif /* !G_ENABLE_DEBUG */ + + +/* VOID:STRING,UINT (src/marshaller:1) */ +void +ka_closure_VOID__STRING_UINT (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__STRING_UINT) (gpointer data1, + gpointer arg_1, + guint arg_2, + gpointer data2); + register GMarshalFunc_VOID__STRING_UINT callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + + g_return_if_fail (n_param_values == 3); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__STRING_UINT) (marshal_data ? marshal_data : cc->callback); + + callback (data1, + g_marshal_value_peek_string (param_values + 1), + g_marshal_value_peek_uint (param_values + 2), + data2); +} diff --git a/src/ka-closures.h b/src/ka-closures.h new file mode 100644 index 0000000..37b0a7d --- /dev/null +++ b/src/ka-closures.h @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2010 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * This file was generated using glib-genmarshal + */ + +#ifndef __ka_closure_MARSHAL_H__ +#define __ka_closure_MARSHAL_H__ + +#include + +G_BEGIN_DECLS + +/* VOID:STRING,UINT (marshaller:1) */ +extern void ka_closure_VOID__STRING_UINT (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +G_END_DECLS + +#endif /* __ka_closure_MARSHAL_H__ */ diff --git a/src/ka-dbus.c b/src/ka-dbus.c new file mode 100644 index 0000000..f8a00d6 --- /dev/null +++ b/src/ka-dbus.c @@ -0,0 +1,119 @@ +/* Krb5 Auth Applet -- Acquire and release kerberos tickets + * + * (C) 2008,2009 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#include "config.h" + +#include +#include "ka-applet-priv.h" +#include "ka-dialog.h" +#include "ka-dbus.h" +#include "ka-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_destroy_ccache(KaApplet* applet, DBusGMethodInvocation *context) +{ + gboolean success; + + KA_DEBUG("Destroying ticket cache"); + success = ka_destroy_ccache (applet); + 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; + DBusGProxy *bus_proxy; + GError *error = NULL; + + /* Connect to the session bus so we get exit-on-disconnect semantics. */ + session = dbus_g_bus_get(DBUS_BUS_SESSION, &error); + if (session == NULL) { + g_error ("couldn't connect to session bus: %s", (error) ? error->message : "(null)"); + *status = 1; + g_clear_error (&error); + return FALSE; + } + flags = DBUS_NAME_FLAG_DO_NOT_QUEUE; + bus_proxy = dbus_g_proxy_new_for_name (session, + "org.freedesktop.DBus", + "/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, + G_TYPE_STRING, + "org.gnome.KrbAuthDialog", + G_TYPE_UINT, + flags, + G_TYPE_INVALID, + G_TYPE_UINT, + &request_name_reply, + G_TYPE_INVALID)) { + g_warning ("Failed to invoke RequestName: %s", + error->message); + } + g_clear_error (&error); + g_object_unref (bus_proxy); + + if (request_name_reply == DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER + || request_name_reply == DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER) + ; + else if (request_name_reply == DBUS_REQUEST_NAME_REPLY_EXISTS + || request_name_reply == DBUS_REQUEST_NAME_REPLY_IN_QUEUE) { + *status = 0; + return FALSE; + } else { + g_assert_not_reached(); + } + return TRUE; +} diff --git a/src/ka-dbus.h b/src/ka-dbus.h new file mode 100644 index 0000000..23828b7 --- /dev/null +++ b/src/ka-dbus.h @@ -0,0 +1,37 @@ +/* Krb5 Auth Applet -- Acquire and release kerberos tickets + * + * (C) 2008 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef KA_DBUS_H +#define KA_DBUS_H + +#include +#include +#include +#include "ka-applet-priv.h" + +gboolean ka_dbus_connect(unsigned int* status); +gboolean ka_dbus_service(KaApplet* applet); +gboolean ka_dbus_acquire_tgt (KaApplet *applet, + const gchar *principal, + DBusGMethodInvocation *context); +gboolean ka_dbus_destroy_ccache(KaApplet* applet, + DBusGMethodInvocation *context); + +#endif /* KA_DBUS_H */ diff --git a/src/ka-dbus.xml b/src/ka-dbus.xml new file mode 100644 index 0000000..9d6b1a4 --- /dev/null +++ b/src/ka-dbus.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/ka-dialog.c b/src/ka-dialog.c new file mode 100644 index 0000000..f8d0fea --- /dev/null +++ b/src/ka-dialog.c @@ -0,0 +1,1171 @@ +/* + * Copyright (C) 2004,2005,2006 Red Hat, Inc. + * Authored by Christopher Aillon + * + * Copyright (C) 2008,2009,2010 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "gtksecentry.h" +#include "secmem-util.h" +#include "memory.h" + +#include "ka-dialog.h" +#include "ka-applet-priv.h" +#include "ka-pwdialog.h" +#include "ka-dbus.h" +#include "ka-tools.h" +#include "ka-tickets.h" + +#ifdef ENABLE_NETWORK_MANAGER +#include +#endif + +#ifdef HAVE_HX509_ERR_H +# include +#endif + +static krb5_context kcontext; +static krb5_principal kprincipal; +static krb5_timestamp creds_expiry; +static krb5_timestamp canceled_creds_expiry; +static gboolean canceled; +static gboolean invalid_auth; +static gboolean always_run; +static gboolean is_online = TRUE; + +static int grab_credentials (KaApplet* applet); +static int ka_renew_credentials (KaApplet* applet); +static gboolean ka_get_tgt_from_ccache (krb5_context context, krb5_creds *creds); + +#ifdef ENABLE_NETWORK_MANAGER +libnm_glib_ctx *nm_context; +#endif + +/* YAY for different Kerberos implementations */ +static int +get_cred_forwardable(krb5_creds *creds) +{ +#if defined(HAVE_KRB5_CREDS_TICKET_FLAGS) && defined(TKT_FLG_FORWARDABLE) + return creds->ticket_flags & TKT_FLG_FORWARDABLE; +#elif defined(HAVE_KRB5_CREDS_FLAGS_B_FORWARDABLE) + return creds->flags.b.forwardable; +#elif defined(HAVE_KRB5_CREDS_FLAGS) && defined(KDC_OPT_FORWARDABLE) + return creds->flags & KDC_OPT_FORWARDABLE; +#endif +} + +static int +get_cred_renewable(krb5_creds *creds) +{ +#if defined(HAVE_KRB5_CREDS_TICKET_FLAGS) && defined(TKT_FLG_RENEWABLE) + return creds->ticket_flags & TKT_FLG_RENEWABLE; +#elif defined(HAVE_KRB5_CREDS_FLAGS_B_RENEWABLE) + return creds->flags.b.renewable; +#elif defined(HAVE_KRB5_CREDS_FLAGS) && defined(KDC_OPT_RENEWABLE) + return creds->flags & KDC_OPT_RENEWABLE; +#endif +} + +static krb5_error_code +get_renewed_creds(krb5_context context, + krb5_creds *creds, + krb5_principal client, + krb5_ccache ccache, + char *in_tkt_service) +{ +#ifdef HAVE_KRB5_GET_RENEWED_CREDS + return krb5_get_renewed_creds (context, creds, client, ccache, in_tkt_service); +#else + return 1; /* XXX is there something better to return? */ +#endif +} + +static int +get_cred_proxiable(krb5_creds *creds) +{ +#if defined(HAVE_KRB5_CREDS_TICKET_FLAGS) && defined(TKT_FLG_PROXIABLE) + return creds->ticket_flags & TKT_FLG_PROXIABLE; +#elif defined(HAVE_KRB5_CREDS_FLAGS_B_PROXIABLE) + return creds->flags.b.proxiable; +#elif defined(HAVE_KRB5_CREDS_FLAGS) && defined(KDC_OPT_PROXIABLE) + return creds->flags & KDC_OPT_PROXIABLE; +#endif +} + +static size_t +get_principal_realm_length(krb5_principal p) +{ +#if defined(HAVE_KRB5_PRINCIPAL_REALM_AS_STRING) + return strlen(p->realm); +#elif defined(HAVE_KRB5_PRINCIPAL_REALM_AS_DATA) + return p->realm.length; +#endif +} + +static const char * +get_principal_realm_data(krb5_principal p) +{ +#if defined(HAVE_KRB5_PRINCIPAL_REALM_AS_STRING) + return p->realm; +#elif defined(HAVE_KRB5_PRINCIPAL_REALM_AS_DATA) + return p->realm.data; +#endif +} + +static void +ka_krb5_free_error_message(krb5_context context, const char* msg) +{ +#if defined(HAVE_KRB5_FREE_ERROR_MESSAGE) + krb5_free_error_message(context, msg); +#elif defined(HAVE_KRB5_FREE_ERROR_STRING) + krb5_free_error_string(context, (char *) msg); +#else +# error No way to free error string. +#endif +} + +/* + * Returns a descriptive error message or kerberos related error + * returned pointer must be freed using g_free(). + */ +static char* +ka_get_error_message(krb5_context context, krb5_error_code err) +{ + char *msg = NULL; +#if defined(HAVE_KRB5_GET_ERROR_MESSAGE) + const char *krberr; + + krberr = krb5_get_error_message(context, err); + msg = g_strdup(krberr); + ka_krb5_free_error_message(context, krberr); +#else +# error No detailed error message information +#endif + if (msg == NULL) + msg = g_strdup(_("unknown error")); + return msg; +} + + +static void +ka_krb5_cc_clear_mcred(krb5_creds* mcred) +{ +#if defined HAVE_KRB5_CC_CLEAR_MCRED + krb5_cc_clear_mcred(mcred); +#else + memset(mcred, 0, sizeof(krb5_creds)); +#endif +} + + +/* ***************************************************************** */ +/* ***************************************************************** */ + +/* log a kerberos error messge */ +static void +ka_log_error_message(const char* prefix, krb5_context context, krb5_error_code err) +{ + char *errmsg = ka_get_error_message(context, err); + + g_warning("%s: %s", prefix, errmsg); + g_free (errmsg); +} + + +static gboolean +credentials_expiring_real (KaApplet* applet) +{ + krb5_creds my_creds; + krb5_timestamp now; + gboolean retval = FALSE; + + ka_applet_set_tgt_renewable(applet, FALSE); + if (!ka_get_tgt_from_ccache (kcontext, &my_creds)) { + creds_expiry = 0; + retval = TRUE; + goto out; + } + + /* copy principal from cache if any */ + if (krb5_principal_compare (kcontext, my_creds.client, kprincipal)) { + krb5_free_principal(kcontext, kprincipal); + krb5_copy_principal(kcontext, my_creds.client, &kprincipal); + } + creds_expiry = my_creds.times.endtime; + if ((krb5_timeofday(kcontext, &now) == 0) && + (now + ka_applet_get_pw_prompt_secs(applet) > my_creds.times.endtime)) + retval = TRUE; + + /* If our creds are expiring, determine whether they are renewable */ + if (retval && get_cred_renewable(&my_creds) && my_creds.times.renew_till > now) { + ka_applet_set_tgt_renewable(applet, TRUE); + } + + krb5_free_cred_contents (kcontext, &my_creds); +out: + ka_applet_update_status(applet, creds_expiry); + return retval; +} + + +/* time in seconds the tgt will be still valid */ +int +ka_tgt_valid_seconds() +{ + krb5_timestamp now; + + if (krb5_timeofday(kcontext, &now)) + return 0; + + return (creds_expiry - now); +} + + +/* return credential cache filename, strip "FILE:" prefix if necessary */ +static const char* +ka_ccache_filename (void) +{ + const gchar *name; + + name = krb5_cc_default_name (kcontext); + if (g_str_has_prefix (name, "FILE:")) + return strchr(name,':')+1; + else if (g_str_has_prefix (name, "SCC:")) + g_warning ("Cannot monitor sqlite based cache '%s'", name); + else + g_warning ("Unsupported cache type for '%s'", name); + return NULL; +} + + +static void +ka_format_time (time_t t, gchar *ts, size_t len) +{ + g_strlcpy(ts, ctime(&t)+ 4, len); + ts[15] = 0; +} + + +/* fill in service tickets data */ +gboolean +ka_get_service_tickets (GtkListStore *tickets) +{ + krb5_cc_cursor cursor; + krb5_creds creds; + krb5_error_code ret; + GtkTreeIter iter; + krb5_ccache ccache; + char *name; + krb5_timestamp sec; + gchar start_time[128], end_time[128], end_time_markup[256]; + gboolean retval = FALSE; + + gtk_list_store_clear(tickets); + + krb5_timeofday (kcontext, &sec); + ret = krb5_cc_default (kcontext, &ccache); + g_return_val_if_fail (!ret, FALSE); + + ret = krb5_cc_start_seq_get (kcontext, ccache, &cursor); + if (ret) { + ka_log_error_message("krb5_cc_start_seq_get", kcontext, ret); + + /* if the file doesn't exist, it's not an error if we can't + * parse it */ + if (!g_file_test(ka_ccache_filename (), + G_FILE_TEST_EXISTS)) + retval = TRUE; + goto out; + } + + while ((ret = krb5_cc_next_cred (kcontext, + ccache, + &cursor, + &creds)) == 0) { + gboolean renewable, proxiable, forwardable; + + if (creds.times.starttime) + ka_format_time(creds.times.starttime, start_time, + sizeof(start_time)); + else + ka_format_time(creds.times.authtime, start_time, + sizeof(start_time)); + + ka_format_time(creds.times.endtime, end_time, + sizeof(end_time)); + if (creds.times.endtime > sec) + strcpy(end_time_markup, end_time); + else + g_snprintf(end_time_markup, sizeof(end_time_markup), + "%s (%s)", + end_time, _("Expired")); + + forwardable = get_cred_forwardable(&creds); + renewable = get_cred_renewable(&creds); + proxiable = get_cred_proxiable(&creds); + + ret = krb5_unparse_name (kcontext, creds.server, &name); + if (!ret) { + gtk_list_store_append(tickets, &iter); + gtk_list_store_set(tickets, &iter, + PRINCIPAL_COLUMN, name, + START_TIME_COLUMN, start_time, + END_TIME_COLUMN, end_time_markup, + FORWARDABLE_COLUMN, forwardable, + RENEWABLE_COLUMN, renewable, + PROXIABLE_COLUMN, proxiable, + -1); + free(name); + } else + ka_log_error_message("krb5_unparse_name", kcontext, ret); + krb5_free_cred_contents (kcontext, &creds); + } + if(ret != KRB5_CC_END) + ka_log_error_message("krb5_cc_get_next", kcontext, ret); + + ret = krb5_cc_end_seq_get (kcontext, ccache, &cursor); + if (ret) + ka_log_error_message("krb5_cc_end_seq_get", kcontext, ret); + + retval = TRUE; +out: + ret = krb5_cc_close (kcontext, ccache); + g_return_val_if_fail (!ret, FALSE); + + return retval; +} + + +/* Check for things we have to do while the password dialog is open */ +static gboolean +krb5_auth_dialog_do_updates (gpointer data) +{ + KaApplet* applet = KA_APPLET(data); + KaPwDialog* pwdialog = ka_applet_get_pwdialog(applet); + + g_return_val_if_fail (pwdialog != NULL, FALSE); + /* Update creds_expiry and close the applet if we got the creds by other means (e.g. kinit) */ + if (!credentials_expiring_real(applet)) + ka_pwdialog_hide(pwdialog, FALSE); + + /* Update the expiry information in the dialog */ + ka_pwdialog_status_update (pwdialog); + return TRUE; +} + + +static krb5_error_code +auth_dialog_prompter (krb5_context ctx G_GNUC_UNUSED, + void *data, + const char *name G_GNUC_UNUSED, + const char *banner G_GNUC_UNUSED, + int num_prompts, + krb5_prompt prompts[]) +{ + KaApplet *applet = KA_APPLET(data); + KaPwDialog *pwdialog = ka_applet_get_pwdialog(applet); + krb5_error_code errcode; + int i; + + errcode = KRB5KRB_ERR_GENERIC; + canceled = FALSE; + canceled_creds_expiry = 0; + + for (i = 0; i < num_prompts; i++) { + const gchar *password = NULL; + int password_len = 0; + int response; + guint32 source_id; + + errcode = KRB5_LIBOS_CANTREADPWD; + + source_id = g_timeout_add_seconds (5, (GSourceFunc)krb5_auth_dialog_do_updates, applet); + ka_pwdialog_setup (pwdialog, (gchar *) prompts[i].prompt, invalid_auth); + response = ka_pwdialog_run (pwdialog); + switch (response) + { + case GTK_RESPONSE_OK: + password = ka_pwdialog_get_password(pwdialog); + password_len = strlen (password); + break; + case GTK_RESPONSE_DELETE_EVENT: + case GTK_RESPONSE_CANCEL: + canceled = TRUE; + break; + case GTK_RESPONSE_NONE: + break; + default: + g_warning ("Unknown Response: %d", response); + g_assert_not_reached (); + } + g_source_remove (source_id); + + if (!password) + goto cleanup; + if (password_len+1 > prompts[i].reply->length) { + g_warning("Password too long %d/%d", password_len+1, prompts[i].reply->length); + goto cleanup; + } + + memcpy(prompts[i].reply->data, (char *) password, password_len + 1); + prompts[i].reply->length = password_len; + errcode = 0; + } +cleanup: + ka_pwdialog_hide (pwdialog, TRUE); + /* Reset this, so we know the next time we get a TRUE value, it is accurate. */ + invalid_auth = FALSE; + + return errcode; +} + + +#ifdef ENABLE_NETWORK_MANAGER +static void +network_state_cb (libnm_glib_ctx *context, + gpointer data) +{ + gboolean *online = (gboolean*) data; + + libnm_glib_state state; + + state = libnm_glib_get_network_state (context); + + switch (state) + { + case LIBNM_NO_DBUS: + case LIBNM_NO_NETWORKMANAGER: + case LIBNM_INVALID_CONTEXT: + /* do nothing */ + break; + case LIBNM_NO_NETWORK_CONNECTION: + *online = FALSE; + break; + case LIBNM_ACTIVE_NETWORK_CONNECTION: + *online = TRUE; + break; + } +} +#endif + +/* credentials expiring timer */ +static gboolean +credentials_expiring (gpointer *data) +{ + int retval; + gboolean give_up; + KaApplet* applet = KA_APPLET(data); + + KA_DEBUG("Checking expiry <%ds", ka_applet_get_pw_prompt_secs(applet)); + if (credentials_expiring_real (applet) && is_online) { + KA_DEBUG("Expiry @ %ld", creds_expiry); + + if (!ka_renew_credentials (applet)) { + KA_DEBUG("Credentials renewed"); + goto out; + } + + /* no popup when using a trayicon */ + if (ka_applet_get_show_trayicon(applet)) + goto out; + + give_up = canceled && (creds_expiry == canceled_creds_expiry); + if (!give_up) { + do { + retval = grab_credentials (applet); + give_up = canceled && + (creds_expiry == canceled_creds_expiry); + } while ((retval != 0) && + (retval != KRB5_REALM_CANT_RESOLVE) && + (retval != KRB5_KDC_UNREACH) && + invalid_auth && + !give_up); + } + } +out: + ka_applet_update_status(applet, creds_expiry); + return TRUE; +} + + +/* + * set ticket options by looking at krb5.conf and gconf + */ +static void +ka_set_ticket_options(KaApplet* applet, krb5_context context, + krb5_get_init_creds_opt *out, + const char* pk_userid G_GNUC_UNUSED, + const char* pk_anchors G_GNUC_UNUSED) +{ + gboolean flag; +#ifdef HAVE_KRB5_GET_INIT_CREDS_OPT_SET_DEFAULT_FLAGS + krb5_get_init_creds_opt_set_default_flags(context, PACKAGE, + krb5_principal_get_realm(context, kprincipal), out); +#endif + g_object_get(applet, "tgt-forwardable", &flag, NULL); + if (flag) + krb5_get_init_creds_opt_set_forwardable(out, flag); + g_object_get(applet, "tgt-proxiable", &flag, NULL); + if (flag) + krb5_get_init_creds_opt_set_proxiable(out, flag); + g_object_get(applet, "tgt-renewable", &flag, NULL); + if (flag) { + krb5_deltat r = 3600*24*30; /* 1 month */ + krb5_get_init_creds_opt_set_renew_life (out, r); + } + +#if ENABLE_PKINIT && HAVE_KRB5_GET_INIT_CREDS_OPT_SET_PA + /* pkinit optins for MIT Kerberos */ + if (pk_userid && strlen(pk_userid)) { + KA_DEBUG("pkinit with '%s'", pk_userid); + krb5_get_init_creds_opt_set_pa(context, out, + "X509_user_identity", pk_userid); + if (pk_anchors && strlen(pk_anchors)) { + KA_DEBUG("pkinit anchors '%s'", pk_anchors); + krb5_get_init_creds_opt_set_pa(context, out, + "X509_anchors", pk_anchors); + } + } +#endif /* HAVE_KRB5_GET_INIT_CREDS_OPT_SET_PA */ +} + + +/* + * set ticket options + * by looking at krb5.conf, the passed in creds and gconf + */ +static void +set_options_from_creds(const KaApplet* applet, + krb5_context context, + krb5_creds *in, + krb5_get_init_creds_opt *out) +{ + krb5_deltat renew_lifetime; + int flag; + +#ifdef HAVE_KRB5_GET_INIT_CREDS_OPT_SET_DEFAULT_FLAGS + krb5_get_init_creds_opt_set_default_flags(context, PACKAGE, + krb5_principal_get_realm(context, kprincipal), out); +#endif + + flag = get_cred_forwardable(in) != 0; + krb5_get_init_creds_opt_set_forwardable(out, flag); + flag = get_cred_proxiable(in) != 0; + krb5_get_init_creds_opt_set_proxiable(out, flag); + flag = get_cred_renewable(in) != 0; + if (flag && (in->times.renew_till > in->times.starttime)) { + renew_lifetime = in->times.renew_till - + in->times.starttime; + krb5_get_init_creds_opt_set_renew_life(out, + renew_lifetime); + } + if (in->times.endtime > + in->times.starttime + ka_applet_get_pw_prompt_secs(applet)) { + krb5_get_init_creds_opt_set_tkt_life(out, + in->times.endtime - + in->times.starttime); + } + /* This doesn't do a deep copy -- fix it later. */ + /* krb5_get_init_creds_opt_set_address_list(out, creds->addresses); */ +} + + +#if ENABLE_PKINIT && HAVE_KRB5_GET_INIT_CREDS_OPT_SET_PKINIT +static krb5_error_code +ka_auth_heimdal_pkinit(KaApplet* applet, krb5_creds* creds, + const char* pk_userid, const char* pk_anchors) +{ + krb5_get_init_creds_opt *opts = NULL; + krb5_error_code retval; + const char* pkinit_anchors = NULL; + + KA_DEBUG("pkinit with '%s'", pk_userid); + if (pk_anchors && strlen (pk_anchors)) { + pkinit_anchors = pk_anchors; + KA_DEBUG("pkinit anchors '%s'", pkinit_anchors); + } + + if ((retval = krb5_get_init_creds_opt_alloc (kcontext, &opts))) + goto out; + + ka_set_ticket_options (applet, kcontext, opts, NULL, NULL); + retval = krb5_get_init_creds_opt_set_pkinit(kcontext, opts, + kprincipal, + pk_userid, + pkinit_anchors, + NULL, + NULL, + 0, /* pk_use_enc_key */ + auth_dialog_prompter, + applet, /* data */ + NULL); /* passwd */ + KA_DEBUG("pkinit returned with %d", retval); + if (retval) + goto out; + + retval = krb5_get_init_creds_password(kcontext, creds, kprincipal, + NULL, auth_dialog_prompter, applet, + 0, NULL, opts); +out: + if (opts) + krb5_get_init_creds_opt_free(kcontext, opts); + return retval; +} +#endif /* ! ENABLE_PKINIT */ + +static krb5_error_code +ka_auth_password(KaApplet* applet, krb5_creds* creds, + const char* pk_userid, const char* pk_anchors) +{ + krb5_error_code retval; + krb5_get_init_creds_opt *opts = NULL; + + if ((retval = krb5_get_init_creds_opt_alloc (kcontext, &opts))) + goto out; + ka_set_ticket_options (applet, kcontext, opts, + pk_userid, pk_anchors); + + retval = krb5_get_init_creds_password(kcontext, creds, kprincipal, + NULL, auth_dialog_prompter, applet, + 0, NULL, opts); +out: + if (opts) + krb5_get_init_creds_opt_free(kcontext, opts); + return retval; +} + +static krb5_error_code +ka_parse_name(KaApplet* applet, krb5_context krbcontext, krb5_principal* kprinc) +{ + krb5_error_code ret; + gchar *principal = NULL; + + if (*kprinc != NULL) + krb5_free_principal(krbcontext, *kprinc); + + g_object_get(applet, "principal", &principal, NULL); + ret = krb5_parse_name(krbcontext, principal, kprinc); + + g_free(principal); + return ret; +} + + +/* + * return current principal in text form + * + * caller needs to free the returned result using g_free(); + */ +char* +ka_unparse_name () +{ + char *princ, *gprinc = NULL; + krb5_error_code err; + + if (!kprincipal) + goto out; + + if ((err = krb5_unparse_name (kcontext, kprincipal, &princ))) { + ka_log_error_message(__func__, kcontext, err); + goto out; + } + + gprinc = g_strdup (princ); + free (princ); +out: + return gprinc; +} + + +static void +ccache_changed_cb (GFileMonitor *monitor G_GNUC_UNUSED, + GFile *file, + GFile *other_file G_GNUC_UNUSED, + GFileMonitorEvent event_type, + gpointer data) +{ + KaApplet *applet = KA_APPLET(data); + gchar *ccache_name = g_file_get_path(file); + + switch (event_type) { + case G_FILE_MONITOR_EVENT_DELETED: + case G_FILE_MONITOR_EVENT_CREATED: + case G_FILE_MONITOR_EVENT_CHANGED: + KA_DEBUG ("%s changed", ccache_name); + credentials_expiring ((gpointer)applet); + break; + default: + KA_DEBUG ("%s unhandled event: %d", ccache_name, event_type); + } + g_free (ccache_name); +} + + +static gboolean +monitor_ccache(KaApplet *applet) +{ + const gchar *ccache_name; + GFile *ccache; + GFileMonitor *monitor; + GError *err = NULL; + gboolean ret = FALSE; + + ccache_name = ka_ccache_filename (); + g_return_val_if_fail (ccache_name != NULL, FALSE); + + ccache = g_file_new_for_path (ccache_name); + monitor = g_file_monitor_file (ccache, G_FILE_MONITOR_NONE, NULL, &err); + g_assert ((!monitor && err) || (monitor && !err)); + if (!monitor) { + /* cache disappeared? */ + if (err->code == G_FILE_ERROR_NOENT) + credentials_expiring ((gpointer)applet); + else + g_warning ("Failed to monitor %s: %s", ccache_name, err->message); + goto out; + } else { + /* g_file_monitor_set_rate_limit(monitor, 10*1000); */ + g_signal_connect (monitor, "changed", G_CALLBACK (ccache_changed_cb), applet); + KA_DEBUG ("Monitoring %s", ccache_name); + ret = TRUE; + } +out: + g_object_unref (ccache); + if (err) + g_error_free (err); + return ret; +} + + +/* grab credentials interactively */ +static int +grab_credentials (KaApplet* applet) +{ + krb5_error_code retval = KRB5_KDC_UNREACH; + krb5_creds my_creds; + krb5_ccache ccache; + gchar *pk_userid = NULL; + gchar *pk_anchors = NULL; + gchar *errmsg = NULL; + gboolean pw_auth = TRUE; + + memset(&my_creds, 0, sizeof(my_creds)); + + retval = ka_parse_name(applet, kcontext, &kprincipal); + if (retval) + goto out2; + + retval = krb5_cc_default (kcontext, &ccache); + if (retval) + goto out2; + + g_object_get(applet, "pk-userid", &pk_userid, + "pk-anchors", &pk_anchors, + NULL); +#if ENABLE_PKINIT && HAVE_HX509_ERR_H && HAVE_KRB5_GET_INIT_CREDS_OPT_SET_PKINIT + /* pk_userid set: try pkinit */ + if (pk_userid && strlen(pk_userid)) { + retval = ka_auth_heimdal_pkinit(applet, &my_creds, + pk_userid, pk_anchors); + /* other error than: "no token found" - no need to try password auth: */ + if (retval != HX509_PKCS11_NO_TOKEN && retval != HX509_PKCS11_NO_SLOT) + pw_auth = FALSE; + } +#endif /* ENABLE_PKINIT */ + if (pw_auth) + retval = ka_auth_password(applet, &my_creds, + pk_userid, pk_anchors); + + creds_expiry = my_creds.times.endtime; + if (canceled) + canceled_creds_expiry = creds_expiry; + if (retval) { + switch (retval) { + case KRB5KDC_ERR_PREAUTH_FAILED: + case KRB5KRB_AP_ERR_BAD_INTEGRITY: +#ifdef HAVE_HX509_ERR_H + case HX509_PKCS11_LOGIN: +#endif /* Invalid password/pin, try again. */ + invalid_auth = TRUE; + break; + default: + errmsg = ka_get_error_message(kcontext, retval); + KA_DEBUG("Auth failed with %d: %s", retval, + errmsg); + g_free(errmsg); + break; + } + goto out; + } + retval = krb5_cc_initialize(kcontext, ccache, kprincipal); + if (retval) + goto out; + + retval = krb5_cc_store_cred(kcontext, ccache, &my_creds); + if (retval) + goto out; +out: + krb5_free_cred_contents (kcontext, &my_creds); + krb5_cc_close (kcontext, ccache); +out2: + g_free(pk_userid); + return retval; +} + +/* try to renew the credentials noninteractively */ +static int +ka_renew_credentials (KaApplet* applet) +{ + krb5_error_code retval; + krb5_creds my_creds; + krb5_ccache ccache; + krb5_get_init_creds_opt opts; + + if (kprincipal == NULL) { + retval = ka_parse_name(applet, kcontext, &kprincipal); + if (retval) + return retval; + } + + retval = krb5_cc_default (kcontext, &ccache); + if (retval) + return retval; + + retval = ka_get_tgt_from_ccache (kcontext, &my_creds); + if (!retval) { + krb5_cc_close (kcontext, ccache); + return -1; + } + + krb5_get_init_creds_opt_init (&opts); + set_options_from_creds (applet, kcontext, &my_creds, &opts); + + if (ka_applet_get_tgt_renewable(applet)) { + + retval = get_renewed_creds (kcontext, &my_creds, kprincipal, ccache, NULL); + if (retval) + goto out; + + retval = krb5_cc_initialize(kcontext, ccache, kprincipal); + if(retval) { + ka_log_error_message("krb5_cc_initialize", kcontext, retval); + goto out; + } + retval = krb5_cc_store_cred(kcontext, ccache, &my_creds); + if (retval) { + ka_log_error_message("krb5_cc_store_cred", kcontext, retval); + goto out; + } + ka_applet_signal_emit (applet, KA_SIGNAL_RENEWED_TGT, + my_creds.times.endtime); + } +out: + creds_expiry = my_creds.times.endtime; + krb5_free_cred_contents (kcontext, &my_creds); + krb5_cc_close (kcontext, ccache); + return retval; +} + + +/* get principal associated with the default credentials cache - if found store + * it in *creds, return FALSE otwerwise */ +static gboolean +ka_get_tgt_from_ccache (krb5_context context, krb5_creds *creds) +{ + krb5_ccache ccache; + krb5_creds pattern; + krb5_principal principal; + gboolean ret = FALSE; + + ka_krb5_cc_clear_mcred(&pattern); + + if (krb5_cc_default(context, &ccache)) + return FALSE; + + if (krb5_cc_get_principal(context, ccache, &principal)) + goto out; + + if (krb5_build_principal_ext(context, &pattern.server, + get_principal_realm_length(principal), + get_principal_realm_data(principal), + KRB5_TGS_NAME_SIZE, + KRB5_TGS_NAME, + get_principal_realm_length(principal), + get_principal_realm_data(principal), 0)) { + goto out_free_princ; + } + + pattern.client = principal; + if (!krb5_cc_retrieve_cred(context, ccache, 0, &pattern, creds)) + ret = TRUE; + krb5_free_principal(context, pattern.server); + +out_free_princ: + krb5_free_principal(context, principal); +out: + krb5_cc_close(context, ccache); + return ret; +} + +static gboolean +using_krb5(void) +{ + krb5_error_code err; + gboolean have_tgt = FALSE; + krb5_creds creds; + + err = krb5_init_context(&kcontext); + if (err) + return FALSE; + + have_tgt = ka_get_tgt_from_ccache(kcontext, &creds); + if (have_tgt) { + krb5_copy_principal(kcontext, creds.client, &kprincipal); + krb5_free_cred_contents (kcontext, &creds); + } + return have_tgt; +} + + +gboolean +ka_destroy_ccache (KaApplet *applet) +{ + krb5_ccache ccache; + const char* cache; + krb5_error_code ret; + + cache = krb5_cc_default_name(kcontext); + ret = krb5_cc_resolve(kcontext, cache, &ccache); + ret = krb5_cc_destroy (kcontext, ccache); + + credentials_expiring_real(applet); + + if (ret) + return FALSE; + else + return TRUE; +} + + +/* + * check if we have valid credentials for the requested principal - if not, grab them + * principal: requested principal - if empty use default + */ +gboolean +ka_check_credentials (KaApplet *applet, const char* newprincipal) +{ + gboolean success = FALSE; + int retval; + char* principal; + + g_object_get(applet, "principal", &principal, NULL); + + if (strlen(newprincipal)) { + krb5_principal knewprinc; + + /* no ticket cache: is requested princ the one from our config? */ + if (!kprincipal && g_strcmp0(principal, newprincipal)) { + KA_DEBUG("Requested principal %s not %s", principal, newprincipal); + goto out; + } + + /* ticket cache: check if the requested principal is the one we have */ + retval = krb5_parse_name(kcontext, newprincipal, &knewprinc); + if (retval) { + g_warning ("Cannot parse principal '%s'", newprincipal); + goto out; + } + if (kprincipal && !krb5_principal_compare (kcontext, kprincipal, knewprinc)) { + KA_DEBUG("Current Principal '%s' not '%s'", principal, newprincipal); + krb5_free_principal(kcontext, knewprinc); + goto out; + } + krb5_free_principal(kcontext, knewprinc); + } + + if (credentials_expiring_real (applet)) { + if (!is_online) + success = FALSE; + else + success = ka_grab_credentials (applet); + } else + success = TRUE; +out: + g_free (principal); + return success; +} + + +/* initiate grabbing of credentials (e.g. on leftclick of tray icon) */ +gboolean +ka_grab_credentials (KaApplet* applet) +{ + int retval; + int success = FALSE; + KaPwDialog *pwdialog = ka_applet_get_pwdialog(applet); + + ka_pwdialog_set_persist(pwdialog, TRUE); + do { + retval = grab_credentials (applet); + if (invalid_auth) + continue; + if (canceled) + break; + if (retval) { + gchar *errmsg; + + errmsg = ka_get_error_message(kcontext, retval); + ka_pwdialog_error(pwdialog, errmsg); + g_free (errmsg); + break; + } else { + success = TRUE; + break; + } + } while(TRUE); + + ka_pwdialog_set_persist(pwdialog, FALSE); + credentials_expiring_real(applet); + + return success; +} + + +static void +ka_secmem_init (void) +{ + /* Initialize secure memory. 1 is too small, so the default size + will be used. */ + secmem_init (1); + secmem_set_flags (SECMEM_WARN); + drop_privs (); + + if (atexit (secmem_term)) + g_error("Couln't register atexit handler"); +} + + +static void +ka_nm_shutdown(void) +{ +#ifdef ENABLE_NETWORK_MANAGER + if (nm_context) { + libnm_glib_shutdown (nm_context); + nm_context = NULL; + } +#endif +} + + +static gboolean +ka_nm_init(void) +{ +#ifdef ENABLE_NETWORK_MANAGER + guint32 nm_callback_id; + + nm_context = libnm_glib_init (); + if (!nm_context) { + g_warning ("Could not initialize libnm_glib"); + } else { + nm_callback_id = libnm_glib_register_callback (nm_context, network_state_cb, &is_online, NULL); + if (nm_callback_id == 0) { + ka_nm_shutdown (); + + g_warning ("Could not connect to NetworkManager, connection status will not be managed!"); + } + } +#endif /* ENABLE_NETWORK_MANAGER */ + return TRUE; +} + + +int +main (int argc, char *argv[]) +{ + KaApplet *applet; + GOptionContext *context; + GError *error = NULL; + + guint status = 0; + gboolean run_auto = FALSE, run_always = FALSE; + + const char *help_msg = "Run '" PACKAGE " --help' to see a full list of available command line options"; + const GOptionEntry options [] = { + {"auto", 'a', 0, G_OPTION_ARG_NONE, &run_auto, + "Only run if an initialized ccache is found (default)", NULL}, + {"always", 'A', 0, G_OPTION_ARG_NONE, &run_always, + "Always run", NULL}, + { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL } + }; + + context = g_option_context_new ("- Kerberos 5 credential checking"); + g_option_context_add_main_entries (context, options, NULL); + g_option_context_add_group (context, gtk_get_option_group (TRUE)); + g_option_context_parse (context, &argc, &argv, &error); + + if (error) { + g_print ("%s\n%s\n", + error->message, + help_msg); + g_error_free (error); + return 1; + } + g_option_context_free (context); + + textdomain (PACKAGE); + bind_textdomain_codeset (PACKAGE, "UTF-8"); + bindtextdomain (PACKAGE, LOCALE_DIR); + ka_secmem_init(); + + if (!ka_dbus_connect (&status)) + exit(status); + + if (run_always && !run_auto) { + always_run = TRUE; + } + + if (using_krb5 () || always_run) { + g_set_application_name (KA_NAME); + + applet = ka_applet_create (); + if (!applet) + return 1; + ka_nm_init(); + + if (credentials_expiring ((gpointer)applet)) { + g_timeout_add_seconds (CREDENTIAL_CHECK_INTERVAL, (GSourceFunc)credentials_expiring, applet); + monitor_ccache (applet); + } + ka_dbus_service(applet); + gtk_main (); + } + ka_nm_shutdown(); + return 0; +} diff --git a/src/ka-dialog.h b/src/ka-dialog.h new file mode 100644 index 0000000..c62acb3 --- /dev/null +++ b/src/ka-dialog.h @@ -0,0 +1,32 @@ +/* Krb5 Auth Applet -- Acquire and release kerberos tickets + * + * (C) 2008 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef KA_DIALOG +#define KA_DIALOG + +#include "ka-applet-priv.h" + +gboolean ka_destroy_ccache (KaApplet* applet); +gboolean ka_grab_credentials(KaApplet* applet); +gboolean ka_check_credentials (KaApplet *applet, const char* principal); +gboolean ka_get_service_tickets(GtkListStore *tickets); +char* ka_unparse_name(void); +int ka_tgt_valid_seconds(void); +#endif diff --git a/src/ka-gconf-tools.c b/src/ka-gconf-tools.c new file mode 100644 index 0000000..60fd567 --- /dev/null +++ b/src/ka-gconf-tools.c @@ -0,0 +1,149 @@ +/* Krb5 Auth Applet -- Acquire and release kerberos tickets + * + * (C) 2008,2009 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ +#include "config.h" + +#include +#include + +gboolean +ka_gconf_get_string (GConfClient* client, + const char* key, + char** value) +{ + GError* error = NULL; + gboolean success = FALSE; + GConfValue* gc_value; + + g_return_val_if_fail (client != NULL, FALSE); + g_return_val_if_fail (key != NULL, FALSE); + g_return_val_if_fail (*value == NULL, FALSE); + + if ((gc_value = gconf_client_get (client, key, &error))) { + if (gc_value->type == GCONF_VALUE_STRING) { + *value = g_strdup (gconf_value_get_string (gc_value)); + success = TRUE; + } else if (error) { + g_print ("%s", error->message); + g_error_free (error); + } + gconf_value_free (gc_value); + } + return success; +} + + +gboolean +ka_gconf_get_string_list (GConfClient* client, + const char* key, + GSList** list) +{ + GError* error = NULL; + gboolean success = FALSE; + + g_return_val_if_fail (client != NULL, FALSE); + g_return_val_if_fail (key != NULL, FALSE); + g_return_val_if_fail (*list == NULL, FALSE); + + if ((*list = gconf_client_get_list (client, key, + GCONF_VALUE_STRING, &error))) { + if (error) { + g_print ("%s", error->message); + g_error_free (error); + } else + success = TRUE; + } + return success; +} + + +gboolean +ka_gconf_get_int (GConfClient* client, + const char* key, + int* value) +{ + GError* error = NULL; + gboolean success = FALSE; + GConfValue* gc_value; + + g_return_val_if_fail (client != NULL, FALSE); + g_return_val_if_fail (key != NULL, FALSE); + g_return_val_if_fail (value != NULL, FALSE); + + if ((gc_value = gconf_client_get (client, key, &error))) + { + if (gc_value->type == GCONF_VALUE_INT) { + *value = gconf_value_get_int (gc_value); + success = TRUE; + } else if (error) { + g_print ("%s", error->message); + g_error_free (error); + } + gconf_value_free (gc_value); + } + return success; +} + + +gboolean +ka_gconf_get_bool (GConfClient* client, + const char* key, + gboolean* value) +{ + GError* error = NULL; + gboolean success = FALSE; + GConfValue* gc_value; + + g_return_val_if_fail (client != NULL, FALSE); + g_return_val_if_fail (key != NULL, FALSE); + g_return_val_if_fail (value != NULL, FALSE); + + if ((gc_value = gconf_client_get (client, key, &error))) { + if (gc_value->type == GCONF_VALUE_BOOL) { + *value = gconf_value_get_bool (gc_value); + success = TRUE; + } else if (error) { + g_print ("%s", error->message); + g_error_free (error); + } + gconf_value_free (gc_value); + } + return success; +} + + +gboolean +ka_gconf_set_bool (GConfClient* client, + const char* key, + gboolean value) +{ + GError* error = NULL; + + g_return_val_if_fail (client != NULL, FALSE); + g_return_val_if_fail (key != NULL, FALSE); + + if(!gconf_client_set_bool (client, key, value, &error)) { + if (error) { + g_print ("%s", error->message); + g_error_free (error); + } + return FALSE; + } + return TRUE; +} diff --git a/src/ka-gconf-tools.h b/src/ka-gconf-tools.h new file mode 100644 index 0000000..1d8151d --- /dev/null +++ b/src/ka-gconf-tools.h @@ -0,0 +1,48 @@ +/* Krb5 Auth Applet -- Acquire and release kerberos tickets + * + * (C) 2008,2009 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef KA_GCONF_TOOLS_H +#define KA_GCONF_TOOLS_H + +#include "config.h" + +#include + +#define KA_GCONF_PATH "/apps/" PACKAGE +#define KA_GCONF_KEY_PRINCIPAL KA_GCONF_PATH "/principal" +#define KA_GCONF_KEY_PK_USERID KA_GCONF_PATH "/pk_userid" +#define KA_GCONF_KEY_PK_ANCHORS KA_GCONF_PATH "/pk_anchors" +#define KA_GCONF_KEY_PROMPT_MINS KA_GCONF_PATH "/prompt_minutes" +#define KA_GCONF_KEY_SHOW_TRAYICON KA_GCONF_PATH "/show_trayicon" +#define KA_GCONF_KEY_FORWARDABLE KA_GCONF_PATH "/forwardable" +#define KA_GCONF_KEY_RENEWABLE KA_GCONF_PATH "/renewable" +#define KA_GCONF_KEY_PROXIABLE KA_GCONF_PATH "/proxiable" +#define KA_GCONF_KEY_NOTIFY_VALID KA_GCONF_PATH "/notify/valid" +#define KA_GCONF_KEY_NOTIFY_EXPIRED KA_GCONF_PATH "/notify/expired" +#define KA_GCONF_KEY_NOTIFY_EXPIRING KA_GCONF_PATH "/notify/expiring" +#define KA_GCONF_KEY_PLUGINS_ENABLED KA_GCONF_PATH "/plugins/enabled" + +gboolean ka_gconf_get_string (GConfClient* client, const char* key, char** value); +gboolean ka_gconf_get_string_list (GConfClient* client, const char* key, GSList** list); +gboolean ka_gconf_get_int (GConfClient* client, const char* key, int* value); +gboolean ka_gconf_get_bool (GConfClient* client, const char* key, gboolean* value); +gboolean ka_gconf_set_bool (GConfClient* client, const char* key, gboolean value); + +#endif diff --git a/src/ka-gconf.c b/src/ka-gconf.c new file mode 100644 index 0000000..10ef703 --- /dev/null +++ b/src/ka-gconf.c @@ -0,0 +1,211 @@ +/* Krb5 Auth Applet -- Acquire and release kerberos tickets + * + * (C) 2008,2009 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ +#include "config.h" + +#include +#include + +#include "ka-applet-priv.h" +#include "ka-gconf-tools.h" +#include "ka-gconf.h" + +static gboolean +ka_gconf_set_principal (GConfClient* client, KaApplet* applet) +{ + gchar* principal = NULL; + + if(!ka_gconf_get_string (client, KA_GCONF_KEY_PRINCIPAL, &principal) + || !strlen(principal)) { + g_free (principal); + principal = g_strdup (g_get_user_name()); + } + g_object_set(applet, "principal", principal, NULL); + g_free (principal); + return TRUE; +} + + +static gboolean +ka_gconf_set_pk_userid (GConfClient* client, KaApplet* applet) +{ + gchar* pk_userid = NULL; + + if(!ka_gconf_get_string (client, KA_GCONF_KEY_PK_USERID, &pk_userid)) { + pk_userid = g_strdup (""); + } + g_object_set(applet, "pk_userid", pk_userid, NULL); + g_free (pk_userid); + return TRUE; +} + + +static gboolean +ka_gconf_set_pk_anchors (GConfClient* client, KaApplet* applet) +{ + gchar* pk_anchors = NULL; + + if(!ka_gconf_get_string (client, KA_GCONF_KEY_PK_ANCHORS, &pk_anchors)) { + pk_anchors = g_strdup (""); + } + g_object_set(applet, "pk_anchors", pk_anchors, NULL); + g_free (pk_anchors); + return TRUE; +} + + +static gboolean +ka_gconf_set_prompt_mins (GConfClient* client, KaApplet* applet) +{ + gint prompt_mins = 0; + + if(!ka_gconf_get_int (client, KA_GCONF_KEY_PROMPT_MINS, &prompt_mins)) { + prompt_mins = MINUTES_BEFORE_PROMPTING; + } + g_object_set(applet, "pw-prompt-mins", prompt_mins, NULL); + return TRUE; +} + + +static gboolean +ka_gconf_set_show_trayicon (GConfClient* client, KaApplet* applet) +{ + gboolean show_trayicon = TRUE; + + if(!ka_gconf_get_bool(client, KA_GCONF_KEY_SHOW_TRAYICON, &show_trayicon)) { + show_trayicon = TRUE; + } + g_object_set(applet, "show-trayicon", show_trayicon, NULL); + return TRUE; +} + + +static gboolean +ka_gconf_set_tgt_forwardable (GConfClient* client, KaApplet* applet) +{ + gboolean forwardable = FALSE; + + if(!ka_gconf_get_bool(client, KA_GCONF_KEY_FORWARDABLE, &forwardable)) { + forwardable = FALSE; + } + g_object_set(applet, "tgt-forwardable", forwardable, NULL); + return TRUE; +} + + +static gboolean +ka_gconf_set_tgt_renewable (GConfClient* client, KaApplet* applet) +{ + gboolean renewable = FALSE; + + if(!ka_gconf_get_bool(client, KA_GCONF_KEY_RENEWABLE, &renewable)) { + renewable = FALSE; + } + g_object_set(applet, "tgt-renewable", renewable, NULL); + return TRUE; +} + + +static gboolean +ka_gconf_set_tgt_proxiable (GConfClient* client, KaApplet* applet) +{ + gboolean proxiable = FALSE; + + if(!ka_gconf_get_bool(client, KA_GCONF_KEY_PROXIABLE, &proxiable)) { + proxiable = FALSE; + } + g_object_set(applet, "tgt-proxiable", proxiable, NULL); + return TRUE; +} + + +static void +ka_gconf_key_changed_callback (GConfClient* client, + guint cnxn_id G_GNUC_UNUSED, + GConfEntry* entry, + gpointer user_data) +{ + const char* key; + + KaApplet* applet = KA_APPLET(user_data); + key = gconf_entry_get_key (entry); + if (!key) + return; + KA_DEBUG("Key %s changed", key); + + if (g_strcmp0 (key, KA_GCONF_KEY_PRINCIPAL) == 0) { + ka_gconf_set_principal (client, applet); + } else if (g_strcmp0 (key, KA_GCONF_KEY_PROMPT_MINS) == 0) { + ka_gconf_set_prompt_mins (client, applet); + } else if (g_strcmp0 (key, KA_GCONF_KEY_SHOW_TRAYICON) == 0) { + ka_gconf_set_show_trayicon (client, applet); + } else if (g_strcmp0 (key, KA_GCONF_KEY_PK_USERID) == 0) { + ka_gconf_set_pk_userid (client, applet); + } else if (g_strcmp0 (key, KA_GCONF_KEY_PK_ANCHORS) == 0) { + ka_gconf_set_pk_anchors(client, applet); + } else if (g_strcmp0 (key, KA_GCONF_KEY_FORWARDABLE) == 0) { + ka_gconf_set_tgt_forwardable (client, applet); + } else if (g_strcmp0 (key, KA_GCONF_KEY_RENEWABLE) == 0) { + ka_gconf_set_tgt_renewable (client, applet); + } else if (g_strcmp0 (key, KA_GCONF_KEY_PROXIABLE) == 0) { + ka_gconf_set_tgt_proxiable (client, applet); + } else if (g_strcmp0 (key, KA_GCONF_KEY_NOTIFY_VALID) + || g_strcmp0 (key, KA_GCONF_KEY_NOTIFY_EXPIRING) + || g_strcmp0 (key, KA_GCONF_KEY_NOTIFY_EXPIRED) + || g_strcmp0 (key, KA_GCONF_KEY_PLUGINS_ENABLED)) { + /* nothing to do */ + } else + g_warning("Received notification for unknown gconf key %s", key); + return; +} + + +GConfClient* +ka_gconf_init (KaApplet* applet) +{ + GError *error = NULL; + GConfClient *client; + + client = gconf_client_get_default (); + gconf_client_add_dir (client, KA_GCONF_PATH, GCONF_CLIENT_PRELOAD_ONELEVEL, &error); + if (error) + goto out; + + gconf_client_notify_add (client, KA_GCONF_PATH, + ka_gconf_key_changed_callback, applet, NULL, &error); + if (error) + goto out; + + /* setup defaults */ + ka_gconf_set_principal (client, applet); + ka_gconf_set_prompt_mins (client, applet); + ka_gconf_set_show_trayicon (client, applet); + ka_gconf_set_pk_userid(client, applet); + ka_gconf_set_pk_anchors(client, applet); + ka_gconf_set_tgt_forwardable(client, applet); + ka_gconf_set_tgt_renewable(client, applet); + ka_gconf_set_tgt_proxiable(client, applet); +out: + if(error) { + client = NULL; + g_print ("%s", error->message); + g_error_free (error); + } + return client; +} diff --git a/src/ka-gconf.h b/src/ka-gconf.h new file mode 100644 index 0000000..a6b3872 --- /dev/null +++ b/src/ka-gconf.h @@ -0,0 +1,29 @@ +/* Krb5 Auth Applet -- Acquire and release kerberos tickets + * + * (C) 2008 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef KA_GCONF_H +#define KA_GCONF_H + +#include +#include "ka-applet-priv.h" + +GConfClient* ka_gconf_init (KaApplet* applet); + +#endif diff --git a/src/ka-plugin-loader.c b/src/ka-plugin-loader.c new file mode 100644 index 0000000..2321215 --- /dev/null +++ b/src/ka-plugin-loader.c @@ -0,0 +1,204 @@ +/* + * Copyright (C) 2010 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include + +#include "ka-plugin-loader.h" +#include "ka-plugin.h" +#include "ka-applet-priv.h" +#include "ka-gconf-tools.h" + +#include + +G_DEFINE_TYPE (KaPluginLoader, ka_plugin_loader, G_TYPE_OBJECT) + +#define GET_PRIVATE(o) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((o), KA_TYPE_PLUGIN_LOADER, KaPluginLoaderPrivate)) + +typedef struct _KaPluginLoaderPrivate KaPluginLoaderPrivate; + +struct _KaPluginLoaderPrivate { + KaApplet *applet; + GSList *active_plugins; +}; + + +static KaPlugin* +load_plugin (const char *path) +{ + KaPlugin *plugin = NULL; + GModule *module; + KaPluginCreateFunc plugin_create_func; + int *major_plugin_version, *minor_plugin_version; + + module = g_module_open (path, G_MODULE_BIND_LAZY); + if (!module) { + g_warning ("Could not load plugin %s: %s", path, g_module_error ()); + return NULL; + } + + if (!g_module_symbol (module, "ka_plugin_major_version",(gpointer *) &major_plugin_version)) { + g_warning ("Could not load plugin %s: Missing major version info", path); + goto out; + } + + if (*major_plugin_version != KA_PLUGIN_MAJOR_VERSION) { + g_warning ("Could not load plugin %s: Plugin major version %d, %d is required", + path, *major_plugin_version, KA_PLUGIN_MAJOR_VERSION); + goto out; + } + + if (!g_module_symbol (module, "ka_plugin_minor_version", (gpointer *) &minor_plugin_version)) { + g_warning ("Could not load plugin %s: Missing minor version info", path); + goto out; + } + + if (*minor_plugin_version != KA_PLUGIN_MINOR_VERSION) { + g_warning ("Could not load plugin %s: Plugin minor version %d, %d is required", + path, *minor_plugin_version, KA_PLUGIN_MINOR_VERSION); + goto out; + } + + if (!g_module_symbol (module, "ka_plugin_create", (gpointer *) &plugin_create_func)) { + g_warning ("Could not load plugin %s: %s", path, g_module_error ()); + goto out; + } + + plugin = (*plugin_create_func) (); + if (plugin) { + g_object_weak_ref (G_OBJECT (plugin), (GWeakNotify) g_module_close, module); + g_message ("Loaded plugin %s", ka_plugin_get_name (plugin)); + } else + g_warning ("Could not load plugin %s: initialization failed", path); +out: + if (!plugin) + g_module_close (module); + + return plugin; +} + + +static void +load_plugins (KaPluginLoader *self) +{ + int i; + KaPluginLoaderPrivate *priv = GET_PRIVATE (self); + const char *pname; + GConfClient *gconf; + GSList *plugins = NULL; + + if (!g_module_supported ()) { + g_warning ("GModules are not supported on your platform!"); + return; + } + gconf = ka_applet_get_gconf_client (priv->applet); + + /* For now we only load the plugins on program startup */ + ka_gconf_get_string_list(gconf, KA_GCONF_KEY_PLUGINS_ENABLED, &plugins); + if (!plugins) { + g_message ("No plugins to load"); + return ; + } + + for (i=0; (pname = g_slist_nth_data (plugins, i)) != NULL; i++) { + char *path; + char *fname; + KaPlugin *plugin; + + fname = g_strdup_printf("libka-plugin-%s.%s", pname, G_MODULE_SUFFIX); + path = g_module_build_path (KA_PLUGINS_DIR, fname); + + plugin = load_plugin (path); + if (plugin) { + ka_plugin_activate(plugin, priv->applet); + priv->active_plugins = g_slist_prepend (priv->active_plugins, plugin); + } + g_free (fname); + g_free (path); + } + g_slist_free (plugins); +} + + +static void +deactivate_plugin(gpointer plugin, gpointer user_data) +{ + KaApplet *applet = KA_APPLET (user_data); + + KA_DEBUG ("Deactivating plugin %s", ka_plugin_get_name (plugin)); + ka_plugin_deactivate (plugin, applet); +} + + +static void +ka_plugin_loader_dispose(GObject *object) +{ + KaPluginLoader *self = KA_PLUGIN_LOADER(object); + KaPluginLoaderPrivate *priv = GET_PRIVATE (self); + GObjectClass *parent_class = G_OBJECT_CLASS (ka_plugin_loader_parent_class); + + /* We need to do this before dropping the ref on applet */ + g_slist_foreach (priv->active_plugins, deactivate_plugin, priv->applet); + g_slist_free (priv->active_plugins); + + if (priv->applet) + priv->applet = NULL; + + if (parent_class->dispose != NULL) + parent_class->dispose (object); +} + + +static void +ka_plugin_loader_class_init (KaPluginLoaderClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS(klass); + + object_class->dispose = ka_plugin_loader_dispose; + g_type_class_add_private (klass, sizeof (KaPluginLoaderPrivate)); +} + + +static void +ka_plugin_loader_init (KaPluginLoader *self) +{ + KaPluginLoaderPrivate *priv = GET_PRIVATE (self); + priv->active_plugins = NULL; +} + + +static KaPluginLoader* +ka_plugin_loader_new (void) +{ + return g_object_new (KA_TYPE_PLUGIN_LOADER, NULL); +} + + +KaPluginLoader* +ka_plugin_loader_create (KaApplet* applet) +{ + KaPluginLoader *loader; + KaPluginLoaderPrivate *priv; + + loader = ka_plugin_loader_new(); + priv = GET_PRIVATE (loader); + priv->applet = applet; + load_plugins (loader); + + return loader; +} diff --git a/src/ka-plugin-loader.h b/src/ka-plugin-loader.h new file mode 100644 index 0000000..6f0560a --- /dev/null +++ b/src/ka-plugin-loader.h @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2010 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef _KA_PLUGIN_LOADER +#define _KA_PLUGIN_LOADER + +#include +#include "ka-applet.h" + +G_BEGIN_DECLS + +#define KA_TYPE_PLUGIN_LOADER ka_plugin_loader_get_type() + +#define KA_PLUGIN_LOADER(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), KA_TYPE_PLUGIN_LOADER, KaPluginLoader)) + +#define KA_PLUGIN_LOADER_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), KA_TYPE_PLUGIN_LOADER, KaPluginLoaderClass)) + +#define KA_IS_PLUGIN_LOADER(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), KA_TYPE_PLUGIN_LOADER)) + +#define KA_IS_PLUGIN_LOADER_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), KA_TYPE_PLUGIN_LOADER)) + +#define KA_PLUGIN_LOADER_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), KA_TYPE_PLUGIN_LOADER, KaPluginLoaderClass)) + +typedef struct { + GObject parent; +} KaPluginLoader; + +typedef struct { + GObjectClass parent_class; +} KaPluginLoaderClass; + +GType ka_plugin_loader_get_type (void); + +KaPluginLoader* ka_plugin_loader_create (KaApplet *applet); + +G_END_DECLS + +#endif /* _KA_PLUGIN_LOADER */ diff --git a/src/ka-plugin.c b/src/ka-plugin.c new file mode 100644 index 0000000..88fec34 --- /dev/null +++ b/src/ka-plugin.c @@ -0,0 +1,133 @@ +/* + * Copyright (C) 2010 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "ka-plugin.h" + +G_DEFINE_TYPE (KaPlugin, ka_plugin, G_TYPE_OBJECT) + +#define GET_PRIVATE(o) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((o), KA_TYPE_PLUGIN, KaPluginPrivate)) + +enum { + PROP_0, + PROP_NAME, + LAST_PROP +}; + +typedef struct _KaPluginPrivate KaPluginPrivate; +struct _KaPluginPrivate { + char *name; +}; + +const char* +ka_plugin_get_name (KaPlugin *self) +{ + g_return_val_if_fail (KA_IS_PLUGIN (self), NULL); + KaPluginPrivate *priv = GET_PRIVATE (self); + + return priv->name; +} + + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + KaPluginPrivate *priv = GET_PRIVATE (object); + + switch (prop_id) { + case PROP_NAME: + /* construct only */ + priv->name = g_value_dup_string (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + KaPluginPrivate *priv = GET_PRIVATE (object); + + switch (prop_id) { + case PROP_NAME: + g_value_set_string (value, priv->name); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + + +static void +finalize (GObject *object) +{ + KaPluginPrivate *priv = GET_PRIVATE (object); + + g_free (priv->name); +} + + +void +ka_plugin_activate (KaPlugin *self, KaApplet *applet) +{ + g_return_if_fail (KA_IS_PLUGIN (self)); + + KA_PLUGIN_GET_CLASS (self)->activate (self, applet); +} + + +void +ka_plugin_deactivate (KaPlugin *self, KaApplet *applet) +{ + g_return_if_fail (KA_IS_PLUGIN (self)); + + KA_PLUGIN_GET_CLASS (self)->deactivate (self, applet); +} + + +static void +ka_plugin_class_init (KaPluginClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (KaPluginPrivate)); + + object_class->get_property = get_property; + object_class->set_property = set_property; + object_class->finalize = finalize; + + g_object_class_install_property + (object_class, PROP_NAME, + g_param_spec_string (KA_PLUGIN_PROP_NAME, + "Name", + "Plugin Name", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); +} + + +static void +ka_plugin_init (KaPlugin *self G_GNUC_UNUSED) +{ +} diff --git a/src/ka-plugin.h b/src/ka-plugin.h new file mode 100644 index 0000000..ead9b96 --- /dev/null +++ b/src/ka-plugin.h @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2010 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef _KA_PLUGIN +#define _KA_PLUGIN + +#include +#include "ka-applet.h" + +G_BEGIN_DECLS + +#define KA_PLUGIN_MAJOR_VERSION 0 +#define KA_PLUGIN_MINOR_VERSION 0 + +#define KA_TYPE_PLUGIN ka_plugin_get_type() + +#define KA_PLUGIN(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), KA_TYPE_PLUGIN, KaPlugin)) + +#define KA_PLUGIN_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), KA_TYPE_PLUGIN, KaPluginClass)) + +#define KA_IS_PLUGIN(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), KA_TYPE_PLUGIN)) + +#define KA_IS_PLUGIN_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), KA_TYPE_PLUGIN)) + +#define KA_PLUGIN_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), KA_TYPE_PLUGIN, KaPluginClass)) + +#define KA_PLUGIN_PROP_NAME "name" + +typedef struct { + GObject parent; +} KaPlugin; + +typedef struct { + GObjectClass parent_class; + + void (*activate) (KaPlugin *self, KaApplet* applet); + void (*deactivate) (KaPlugin *self, KaApplet* applet); + + /* we'll add functions for prefs handling later */ + void (*dummy1) (KaPlugin *self, KaApplet* applet); + void (*dummy2) (KaPlugin *self, KaApplet* applet); +} KaPluginClass; + +GType ka_plugin_get_type (void); + +KaPlugin* ka_plugin_new (void); + +typedef KaPlugin *(*KaPluginCreateFunc) (void); +const char* ka_plugin_get_name (KaPlugin *self); +void ka_plugin_activate (KaPlugin *self, KaApplet *applet); +void ka_plugin_deactivate (KaPlugin *self, KaApplet *applet); + +G_END_DECLS + +#endif /* _KA_PLUGIN */ diff --git a/src/ka-pwdialog.c b/src/ka-pwdialog.c new file mode 100644 index 0000000..2f8463c --- /dev/null +++ b/src/ka-pwdialog.c @@ -0,0 +1,309 @@ +/* Krb5 Auth Applet -- Acquire and release kerberos tickets + * + * (C) 2009 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#include "config.h" + +#include + +#include "ka-applet-priv.h" +#include "ka-dialog.h" +#include "ka-pwdialog.h" + +struct _KaPwDialog { + GObject parent; + + KaPwDialogPrivate *priv; +}; + +struct _KaPwDialogClass { + GObjectClass parent; +}; + +G_DEFINE_TYPE(KaPwDialog, ka_pwdialog, G_TYPE_OBJECT); + +struct _KaPwDialogPrivate +{ + /* The password dialog */ + GtkWidget* dialog; /* the password dialog itself */ + GtkWidget* status_label; /* the wrong password/timeout label */ + GtkWidget* krb_label; /* krb5 passwort prompt label */ + GtkWidget* pw_entry; /* password entry field */ + gboolean persist; /* don't hide the dialog when creds are still valid */ + gboolean grabbed; /* keyboard grabbed? */ + GtkWidget* error_dialog; /* error dialog */ +}; + + +static void +ka_pwdialog_init(KaPwDialog *pwdialog) +{ + pwdialog->priv = G_TYPE_INSTANCE_GET_PRIVATE(pwdialog, + KA_TYPE_PWDIALOG, + KaPwDialogPrivate); +} + +static void +ka_pwdialog_finalize(GObject *object) +{ + KaPwDialog* pwdialog = KA_PWDIALOG (object); + GObjectClass *parent_class = G_OBJECT_CLASS (ka_pwdialog_parent_class); + + gtk_widget_destroy (pwdialog->priv->error_dialog); + pwdialog->priv->error_dialog = NULL; + + if (parent_class->finalize != NULL) + parent_class->finalize (object); +} + +static void +ka_pwdialog_class_init(KaPwDialogClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS(klass); + + object_class->finalize = ka_pwdialog_finalize; + g_type_class_add_private(klass, sizeof(KaPwDialogPrivate)); + +} + +static KaPwDialog* +ka_pwdialog_new(void) +{ + return g_object_new (KA_TYPE_PWDIALOG, NULL); +} + + +static gboolean +grab_keyboard (GtkWidget *win, GdkEvent *event, gpointer data) +{ + KaPwDialog* pwdialog = KA_PWDIALOG(data); + + GdkGrabStatus status; + if (!pwdialog->priv->grabbed) { + status = gdk_keyboard_grab (win->window, FALSE, gdk_event_get_time (event)); + if (status == GDK_GRAB_SUCCESS) + pwdialog->priv->grabbed = TRUE; + else + g_message ("could not grab keyboard: %d", (int)status); + } + return FALSE; +} + + +static gboolean +ungrab_keyboard (GtkWidget *win G_GNUC_UNUSED, + GdkEvent *event, + gpointer data) +{ + KaPwDialog* pwdialog = KA_PWDIALOG(data); + + if (pwdialog->priv->grabbed) + gdk_keyboard_ungrab (gdk_event_get_time (event)); + pwdialog->priv->grabbed = FALSE; + return FALSE; +} + + +static gboolean +window_state_changed (GtkWidget *win, GdkEventWindowState *event, gpointer data) +{ + GdkWindowState state = gdk_window_get_state (win->window); + + if (state & GDK_WINDOW_STATE_WITHDRAWN || + state & GDK_WINDOW_STATE_ICONIFIED || + state & GDK_WINDOW_STATE_FULLSCREEN || + state & GDK_WINDOW_STATE_MAXIMIZED) + ungrab_keyboard (win, (GdkEvent*)event, data); + else + grab_keyboard (win, (GdkEvent*)event, data); + + return FALSE; +} + + +gint +ka_pwdialog_run(KaPwDialog* self) +{ + GtkWidget *dialog = self->priv->dialog; + + /* cleanup old error dialog, if present (e.g. user didn't acknowledge + * the error but clicked the tray icon again) */ + if (self->priv->error_dialog) + gtk_widget_hide (self->priv->error_dialog); + + /* make sure we pop up on top */ + gtk_window_set_keep_above (GTK_WINDOW (dialog), TRUE); + + /* + * grab the keyboard so that people don't accidentally type their + * passwords in other windows. + */ + g_signal_connect (dialog, "map-event", G_CALLBACK (grab_keyboard), self); + g_signal_connect (dialog, "unmap-event", G_CALLBACK (ungrab_keyboard), self); + g_signal_connect (dialog, "window-state-event", G_CALLBACK (window_state_changed), self); + + gtk_widget_grab_focus (self->priv->pw_entry); + gtk_widget_show(dialog); + return gtk_dialog_run (GTK_DIALOG(dialog)); +} + + +void +ka_pwdialog_error(KaPwDialog* self, const char *msg) +{ + GtkWidget *dialog = self->priv->error_dialog; + + gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), + _("Couldn't acquire kerberos ticket: '%s'"), + _(msg)); + gtk_widget_show (GTK_WIDGET(dialog)); + gtk_dialog_run (GTK_DIALOG(dialog)); + gtk_widget_hide(dialog); +} + + +void +ka_pwdialog_set_persist (KaPwDialog* pwdialog, gboolean persist) +{ + pwdialog->priv->persist = persist; +} + +void +ka_pwdialog_hide (const KaPwDialog* pwdialog, gboolean force) +{ + KA_DEBUG("PW Dialog persist: %d", pwdialog->priv->persist); + if (!pwdialog->priv->persist || force) + gtk_widget_hide(pwdialog->priv->dialog); +} + +const gchar* +ka_pwdialog_get_password(KaPwDialog *pwdialog) +{ + return gtk_secure_entry_get_text (GTK_SECURE_ENTRY (pwdialog->priv->pw_entry)); +} + +gboolean +ka_pwdialog_status_update (KaPwDialog* pwdialog) +{ + gchar *expiry_text; + gchar *expiry_markup; + int minutes_left = ka_tgt_valid_seconds() / 60; + + g_return_val_if_fail (pwdialog != NULL, FALSE); + if (minutes_left > 0) { + expiry_text = g_strdup_printf (ngettext("Your credentials expire in %d minute", + "Your credentials expire in %d minutes", + minutes_left), minutes_left); + } else { + expiry_text = g_strdup_printf ("%s", + _("Your credentials have expired")); + } + expiry_markup = g_strdup_printf ("%s", expiry_text); + gtk_label_set_markup (GTK_LABEL(pwdialog->priv->status_label), expiry_markup); + g_free (expiry_text); + g_free (expiry_markup); + + return TRUE; +} + +void +ka_pwdialog_setup (KaPwDialog* pwdialog, const gchar *krb5prompt, + gboolean invalid_auth) +{ + KaPwDialogPrivate *priv = pwdialog->priv; + gchar *wrong_markup = NULL; + GtkWidget *e; + gchar *prompt; + int pw4len; + + if (krb5prompt == NULL) { + prompt = g_strdup (_("Please enter your Kerberos password:")); + } else { + /* Kerberos's prompts are a mess, and basically impossible to + * translate. There's basically no way short of doing a lot of + * string parsing to translate them. The most common prompt is + * "Password for $uid:". We special case that one at least. We + * cannot do any of the fancier strings (like challenges), + * though. */ + pw4len = strlen ("Password for "); + if (strncmp (krb5prompt, "Password for ", pw4len) == 0) { + gchar *uid = (gchar *) (krb5prompt + pw4len); + prompt = g_strdup_printf (_("Please enter the password for '%s':"), uid); + } else { + prompt = g_strdup (krb5prompt); + } + } + + e = gtk_entry_new (); + gtk_secure_entry_set_invisible_char (GTK_SECURE_ENTRY (priv->pw_entry), + gtk_entry_get_invisible_char (GTK_ENTRY (e))); + gtk_widget_destroy (e); + + /* Clear the password entry field */ + gtk_secure_entry_set_text (GTK_SECURE_ENTRY (priv->pw_entry), ""); + + /* Use the prompt label that krb5 provides us */ + gtk_label_set_text (GTK_LABEL (priv->krb_label), prompt); + + /* Add our extra message hints */ + if (invalid_auth) { + wrong_markup = g_strdup_printf ("%s", + _("The password you entered is invalid")); + gtk_label_set_markup (GTK_LABEL (priv->status_label), wrong_markup); + } else + ka_pwdialog_status_update (pwdialog); + + g_free(wrong_markup); + g_free (prompt); +} + + +static GtkWidget* +ka_error_dialog_new(void) +{ + GtkWidget *dialog = gtk_message_dialog_new ( + NULL, GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, + _("%s Error"), KA_NAME); + gtk_window_set_title(GTK_WINDOW(dialog), _(KA_NAME)); + gtk_window_set_skip_taskbar_hint(GTK_WINDOW(dialog), FALSE); + return dialog; +} + + +KaPwDialog* +ka_pwdialog_create(GtkBuilder* xml) +{ + KaPwDialog *pwdialog = ka_pwdialog_new(); + KaPwDialogPrivate *priv = pwdialog->priv; + GtkWidget *entry_hbox = NULL; + + priv->dialog = GTK_WIDGET (gtk_builder_get_object (xml, "krb5_dialog")); + priv->status_label = GTK_WIDGET (gtk_builder_get_object (xml, "krb5_status_label")); + priv->krb_label = GTK_WIDGET (gtk_builder_get_object (xml, "krb5_message_label")); + priv->pw_entry = GTK_WIDGET (gtk_secure_entry_new ()); + priv->error_dialog = ka_error_dialog_new(); + + entry_hbox = GTK_WIDGET (gtk_builder_get_object (xml, "entry_hbox")); + gtk_container_add (GTK_CONTAINER (entry_hbox), priv->pw_entry); + gtk_secure_entry_set_activates_default (GTK_SECURE_ENTRY (priv->pw_entry), TRUE); + gtk_widget_show (priv->pw_entry); + + return pwdialog; +} diff --git a/src/ka-pwdialog.h b/src/ka-pwdialog.h new file mode 100644 index 0000000..8b39402 --- /dev/null +++ b/src/ka-pwdialog.h @@ -0,0 +1,65 @@ +/* Krb5 Auth Applet -- Acquire and release kerberos tickets + * + * (C) 2009 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef KA_PWDIALOG_H +#define KA_PWDIALOG_H + +#include +#include + +#include "config.h" +#include "gtksecentry.h" + +G_BEGIN_DECLS + +#define KA_TYPE_PWDIALOG (ka_pwdialog_get_type ()) +#define KA_PWDIALOG(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), KA_TYPE_PWDIALOG, KaPwDialog)) +#define KA_PWDIALOG_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), KA_TYPE_PWDIALOG, KaPwDialogClass)) +#define KA_IS_PWDIALOG(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), KA_TYPE_PWDIALOG)) +#define KA_IS_PWDIALOG_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), KA_TYPE_PWDIALOG)) +#define KA_PWDIALOG_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), KA_TYPE_PWDIALOG, KaPwDialogClass)) + +typedef struct _KaPwDialog KaPwDialog; +typedef struct _KaPwDialogClass KaPwDialogClass; +typedef struct _KaPwDialogPrivate KaPwDialogPrivate; + +GType ka_pwdialog_get_type (void); + +/* public functions */ +KaPwDialog* ka_pwdialog_create(GtkBuilder *xml); +/* setup everything for the next prompting */ +void ka_pwdialog_setup (KaPwDialog* pwdialog, const gchar *krb5prompt, + gboolean invalid_auth); +gint ka_pwdialog_run(KaPwDialog *pwdialog); +void ka_pwdialog_hide(const KaPwDialog *pwdialog, gboolean force); +void ka_pwdialog_set_persist(KaPwDialog *pwdialog, gboolean persist); +void ka_pwdialog_error (KaPwDialog *pwdialog, const char *msg); +/* update the expiry information in the status entry */ +gboolean ka_pwdialog_status_update (KaPwDialog *pwdialog); +const gchar* ka_pwdialog_get_password(KaPwDialog *dialog); + +G_END_DECLS + +#endif diff --git a/src/ka-tickets.c b/src/ka-tickets.c new file mode 100644 index 0000000..8734546 --- /dev/null +++ b/src/ka-tickets.c @@ -0,0 +1,115 @@ +/* Krb5 Auth Applet -- Acquire and release kerberos tickets + * + * (C) 2009 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#include "config.h" + +#include +#include + +#include "ka-tickets.h" +#include "ka-dialog.h" + +static GtkListStore *tickets; +static GtkWidget *tickets_dialog; + +GtkWidget* +ka_tickets_dialog_create(GtkBuilder *xml) +{ + GtkCellRenderer *text_renderer, *toggle_renderer; + GtkTreeViewColumn *column; + GtkTreeView *tickets_view; + + tickets = gtk_list_store_new (N_COLUMNS, + G_TYPE_STRING, + G_TYPE_STRING, + G_TYPE_STRING, + G_TYPE_BOOLEAN, + G_TYPE_BOOLEAN, + G_TYPE_BOOLEAN); + + tickets_dialog = GTK_WIDGET (gtk_builder_get_object (xml, "krb5_tickets_dialog")); + tickets_view = GTK_TREE_VIEW (gtk_builder_get_object (xml, "krb5_tickets_treeview")); + gtk_tree_view_set_model(GTK_TREE_VIEW(tickets_view), GTK_TREE_MODEL(tickets)); + + text_renderer = gtk_cell_renderer_text_new(); + toggle_renderer = gtk_cell_renderer_toggle_new(); + + column = gtk_tree_view_column_new_with_attributes(_("Principal"), + text_renderer, + "text", + PRINCIPAL_COLUMN, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (tickets_view), column); + column = gtk_tree_view_column_new_with_attributes(_("Start Time"), + text_renderer, + "text", + START_TIME_COLUMN, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (tickets_view), column); + column = gtk_tree_view_column_new_with_attributes(_("End Time"), + text_renderer, + "markup", + END_TIME_COLUMN, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (tickets_view), column); + column = gtk_tree_view_column_new_with_attributes(_("Fwd"), + toggle_renderer, + "active", + FORWARDABLE_COLUMN, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (tickets_view), column); + column = gtk_tree_view_column_new_with_attributes(_("Proxy"), + toggle_renderer, + "active", + PROXIABLE_COLUMN, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (tickets_view), column); + column = gtk_tree_view_column_new_with_attributes(_("Renew"), + toggle_renderer, + "active", + RENEWABLE_COLUMN, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (tickets_view), column); + return tickets_dialog; +} + +void +ka_tickets_dialog_run() +{ + if (ka_get_service_tickets(tickets)) { + gtk_window_present(GTK_WINDOW(tickets_dialog)); + gtk_dialog_run(GTK_DIALOG(tickets_dialog)); + gtk_widget_hide(tickets_dialog); + } else { + GtkWidget *message_dialog; + + message_dialog = gtk_message_dialog_new (NULL, + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + _("Error displaying service ticket information")); + gtk_window_set_resizable (GTK_WINDOW (message_dialog), FALSE); + + g_signal_connect (message_dialog, "response", + G_CALLBACK (gtk_widget_destroy), + NULL); + gtk_widget_show (message_dialog); + } +} diff --git a/src/ka-tickets.h b/src/ka-tickets.h new file mode 100644 index 0000000..a1002f5 --- /dev/null +++ b/src/ka-tickets.h @@ -0,0 +1,39 @@ +/* Krb5 Auth Applet -- Acquire and release kerberos tickets + * + * (C) 2009 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef KA_TICKETS_H +#define KA_TICKETS_H + +enum ticket_columns { + PRINCIPAL_COLUMN, + START_TIME_COLUMN, + END_TIME_COLUMN, + FORWARDABLE_COLUMN, + RENEWABLE_COLUMN, + PROXIABLE_COLUMN, + N_COLUMNS +}; + + +GtkWidget* ka_tickets_dialog_create(GtkBuilder *xml); +void ka_tickets_dialog_run(void); + + +#endif diff --git a/src/ka-tools.c b/src/ka-tools.c new file mode 100644 index 0000000..177e64e --- /dev/null +++ b/src/ka-tools.c @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2009 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include +#include "ka-tools.h" + +void +ka_show_help (GdkScreen* screen, const char* chapter, GtkWindow* window) +{ + GError *error = NULL; + const char *section = ""; + char *url; + + if (chapter) + section = chapter; + + url = g_strdup_printf("ghelp:krb5-auth-dialog%s", section); + + gtk_show_uri (screen, url, gtk_get_current_event_time (), &error); + + if (error) { + GtkWidget *message_dialog; + + message_dialog = gtk_message_dialog_new (GTK_WINDOW (window), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + _("There was an error displaying help:\n%s"), + error->message); + gtk_window_set_resizable (GTK_WINDOW (message_dialog), FALSE); + + g_signal_connect (message_dialog, "response", + G_CALLBACK (gtk_widget_destroy), + NULL); + + gtk_widget_show (message_dialog); + g_error_free (error); + } + g_free (url); +} diff --git a/src/ka-tools.h b/src/ka-tools.h new file mode 100644 index 0000000..f97791b --- /dev/null +++ b/src/ka-tools.h @@ -0,0 +1,32 @@ +/* Krb5 Auth Applet -- Acquire and release kerberos tickets + * + * (C) 2009 Guido Guenther + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef KA_TOOLS +#define KA_TOOLS + +#include + +G_BEGIN_DECLS + +void ka_show_help (GdkScreen* screen, const char* section, GtkWindow* window); + +G_END_DECLS + +#endif diff --git a/src/krb5-auth-applet-dbus.xml b/src/krb5-auth-applet-dbus.xml deleted file mode 100644 index 0908ec6..0000000 --- a/src/krb5-auth-applet-dbus.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/krb5-auth-applet.c b/src/krb5-auth-applet.c deleted file mode 100644 index dd621a0..0000000 --- a/src/krb5-auth-applet.c +++ /dev/null @@ -1,919 +0,0 @@ -/* Krb5 Auth Applet -- Acquire and release kerberos tickets - * - * (C) 2008,2009,2010 Guido Guenther - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -#include "config.h" - -#include - -#include "krb5-auth-applet.h" -#include "krb5-auth-dialog.h" -#include "krb5-auth-gconf-tools.h" -#include "krb5-auth-gconf.h" -#include "krb5-auth-tools.h" -#include "krb5-auth-tickets.h" -#ifdef HAVE_LIBNOTIFY -#include -#endif - -#define NOTIFY_SECONDS 300 - -enum ka_icon { - inv_icon = 0, - exp_icon, - val_icon, -}; - -enum -{ - KA_PROP_0 = 0, - KA_PROP_PRINCIPAL, - KA_PROP_PK_USERID, - KA_PROP_PK_ANCHORS, - KA_PROP_TRAYICON, - KA_PROP_PW_PROMPT_MINS, - KA_PROP_TGT_FORWARDABLE, - KA_PROP_TGT_PROXIABLE, - KA_PROP_TGT_RENEWABLE, -}; - -struct _KaApplet { - GObject parent; - - KaAppletPrivate *priv; -}; - -struct _KaAppletClass { - GObjectClass parent; - - guint signals [KA_SIGNAL_COUNT]; -}; - -G_DEFINE_TYPE(KaApplet, ka_applet, G_TYPE_OBJECT); - -struct _KaAppletPrivate -{ - GtkBuilder *uixml; - GtkStatusIcon* tray_icon; /* the tray icon */ - GtkWidget* context_menu; /* the tray icon's context menu */ - const char* icons[3]; /* for invalid, expiring and valid tickts */ - gboolean show_trayicon; /* show the trayicon */ - - KaPwDialog *pwdialog; /* the password dialog */ - int pw_prompt_secs; /* when to start prompting for a password */ - -#ifdef HAVE_LIBNOTIFY - NotifyNotification* notification;/* notification messages */ -#endif /* HAVE_LIBNOTIFY */ - const char* notify_gconf_key; /* disable notification gconf key */ - char* principal; /* the principal to request */ - gboolean renewable; /* credentials renewable? */ - char* pk_userid; /* "userid" for pkint */ - char* pk_anchors; /* trust anchors for pkint */ - gboolean tgt_forwardable; /* request a forwardable ticket */ - gboolean tgt_renewable; /* request a renewable ticket */ - gboolean tgt_proxiable; /* request a proxiable ticket */ - - GConfClient *gconf; /* gconf client */ -}; - -static void -ka_applet_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec) -{ - KaApplet* self = KA_APPLET (object); - - switch (property_id) { - case KA_PROP_PRINCIPAL: - g_free (self->priv->principal); - self->priv->principal = g_value_dup_string (value); - KA_DEBUG ("%s: %s", pspec->name, self->priv->principal); - break; - - case KA_PROP_PK_USERID: - g_free (self->priv->pk_userid); - self->priv->pk_userid = g_value_dup_string (value); - KA_DEBUG ("%s: %s", pspec->name, self->priv->pk_userid); - break; - - case KA_PROP_PK_ANCHORS: - g_free (self->priv->pk_anchors); - self->priv->pk_anchors = g_value_dup_string (value); - KA_DEBUG ("%s: %s", pspec->name, self->priv->pk_anchors); - break; - - case KA_PROP_TRAYICON: - self->priv->show_trayicon = g_value_get_boolean (value); - KA_DEBUG ("%s: %s", pspec->name, self->priv->show_trayicon ? "True" : "False"); - break; - - case KA_PROP_PW_PROMPT_MINS: - self->priv->pw_prompt_secs = g_value_get_uint (value) * 60; - KA_DEBUG ("%s: %d", pspec->name, self->priv->pw_prompt_secs/60); - break; - - case KA_PROP_TGT_FORWARDABLE: - self->priv->tgt_forwardable = g_value_get_boolean (value); - KA_DEBUG ("%s: %s", pspec->name, self->priv->tgt_forwardable ? "True" : "False"); - break; - - case KA_PROP_TGT_PROXIABLE: - self->priv->tgt_proxiable = g_value_get_boolean (value); - KA_DEBUG ("%s: %s", pspec->name, self->priv->tgt_proxiable ? "True" : "False"); - break; - - case KA_PROP_TGT_RENEWABLE: - self->priv->tgt_renewable = g_value_get_boolean (value); - KA_DEBUG ("%s: %s", pspec->name, self->priv->tgt_renewable ? "True" : "False"); - break; - - default: - /* We don't have any other property... */ - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - break; - } -} - -static void -ka_applet_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec) -{ - KaApplet *self = KA_APPLET (object); - - switch (property_id) - { - case KA_PROP_PRINCIPAL: - g_value_set_string (value, self->priv->principal); - break; - - case KA_PROP_PK_USERID: - g_value_set_string (value, self->priv->pk_userid); - break; - - case KA_PROP_PK_ANCHORS: - g_value_set_string (value, self->priv->pk_anchors); - break; - - case KA_PROP_TRAYICON: - g_value_set_boolean (value, self->priv->show_trayicon); - break; - - case KA_PROP_PW_PROMPT_MINS: - g_value_set_uint (value, self->priv->pw_prompt_secs / 60); - break; - - case KA_PROP_TGT_FORWARDABLE: - g_value_set_boolean (value, self->priv->tgt_forwardable); - break; - - case KA_PROP_TGT_PROXIABLE: - g_value_set_boolean (value, self->priv->tgt_proxiable); - break; - - case KA_PROP_TGT_RENEWABLE: - g_value_set_boolean (value, self->priv->tgt_renewable); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - break; - } -} - - -static void -ka_applet_dispose(GObject* object) -{ - KaApplet* applet = KA_APPLET(object); - GObjectClass *parent_class = G_OBJECT_CLASS (ka_applet_parent_class); - - if (applet->priv->tray_icon) { - g_object_unref(applet->priv->tray_icon); - applet->priv->tray_icon = NULL; - } - if (applet->priv->pwdialog) { - g_object_unref(applet->priv->pwdialog); - applet->priv->pwdialog = NULL; - } - if (applet->priv->uixml) { - g_object_unref(applet->priv->uixml); - applet->priv->uixml = NULL; - } - - if (parent_class->dispose != NULL) - parent_class->dispose (object); -} - - -static void -ka_applet_finalize(GObject *object) -{ - KaApplet* applet = KA_APPLET(object); - GObjectClass *parent_class = G_OBJECT_CLASS (ka_applet_parent_class); - - g_free (applet->priv->principal); - g_free (applet->priv->pk_userid); - g_free (applet->priv->pk_anchors); - /* no need to free applet->priv */ - - if (parent_class->finalize != NULL) - parent_class->finalize (object); -} - -static void -ka_applet_init(KaApplet *applet) -{ - applet->priv = G_TYPE_INSTANCE_GET_PRIVATE(applet, - KA_TYPE_APPLET, - KaAppletPrivate); -} - -static void -ka_applet_class_init(KaAppletClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS(klass); - GParamSpec *pspec; - const gchar *signalNames [ KA_SIGNAL_COUNT ] = { - "krb-tgt-acquired", - "krb-tgt-renewed", - "krb-tgt-expired"}; - int i; - - object_class->dispose = ka_applet_dispose; - object_class->finalize = ka_applet_finalize; - g_type_class_add_private(klass, sizeof(KaAppletPrivate)); - - object_class->set_property = ka_applet_set_property; - object_class->get_property = ka_applet_get_property; - - pspec = g_param_spec_string ("principal", - "Principal", - "Get/Set Kerberos principal", - "", - G_PARAM_CONSTRUCT | G_PARAM_READWRITE); - g_object_class_install_property (object_class, - KA_PROP_PRINCIPAL, - pspec); - - pspec = g_param_spec_string ("pk-userid", - "PKinit identifier", - "Get/Set Pkinit identifier", - "", - G_PARAM_CONSTRUCT | G_PARAM_READWRITE); - g_object_class_install_property (object_class, - KA_PROP_PK_USERID, - pspec); - - pspec = g_param_spec_string ("pk-anchors", - "PKinit trust anchors", - "Get/Set Pkinit trust anchors", - "", - G_PARAM_CONSTRUCT | G_PARAM_READWRITE); - g_object_class_install_property (object_class, - KA_PROP_PK_ANCHORS, - pspec); - - pspec = g_param_spec_boolean("show-trayicon", - "Show tray icon", - "Show/Hide the tray icon", - TRUE, - G_PARAM_CONSTRUCT | G_PARAM_READWRITE); - g_object_class_install_property (object_class, - KA_PROP_TRAYICON, - pspec); - - pspec = g_param_spec_uint ("pw-prompt-mins", - "Password prompting interval", - "Password prompting interval in minutes", - 0, G_MAXUINT, MINUTES_BEFORE_PROMPTING, - G_PARAM_CONSTRUCT | G_PARAM_READWRITE); - g_object_class_install_property (object_class, - KA_PROP_PW_PROMPT_MINS, - pspec); - - pspec = g_param_spec_boolean("tgt-forwardable", - "Forwardable ticket", - "wether to request forwardable tickets", - FALSE, - G_PARAM_CONSTRUCT | G_PARAM_READWRITE); - g_object_class_install_property (object_class, - KA_PROP_TGT_FORWARDABLE, - pspec); - - pspec = g_param_spec_boolean("tgt-proxiable", - "Proxiable ticket", - "wether to request proxiable tickets", - FALSE, - G_PARAM_CONSTRUCT | G_PARAM_READWRITE); - g_object_class_install_property (object_class, - KA_PROP_TGT_PROXIABLE, - pspec); - - pspec = g_param_spec_boolean("tgt-renewable", - "Renewable ticket", - "wether to request renewable tickets", - FALSE, - G_PARAM_CONSTRUCT | G_PARAM_READWRITE); - g_object_class_install_property (object_class, - KA_PROP_TGT_RENEWABLE, - pspec); - - for (i = 0; i < KA_SIGNAL_COUNT ; i++) { - guint signalId; - signalId = - g_signal_new ( signalNames [i], - G_OBJECT_CLASS_TYPE ( klass ), - G_SIGNAL_RUN_LAST, - 0, - NULL, - NULL, - g_cclosure_marshal_VOID__STRING, - G_TYPE_NONE, - 2, /* number of parameters */ - G_TYPE_STRING, - G_TYPE_UINT); - klass->signals [i] = signalId ; - } -} - - -static KaApplet* -ka_applet_new(void) -{ - return g_object_new (KA_TYPE_APPLET, NULL); -} - - -/* determine the new tooltip text */ -static char* -ka_applet_tooltip_text(int remaining) -{ - int hours, minutes; - gchar* tooltip_text; - - if (remaining > 0) { - if (remaining >= 3600) { - hours = remaining / 3600; - minutes = (remaining % 3600) / 60; - /* Translators: First number is hours, second number is minutes */ - tooltip_text = g_strdup_printf (_("Your credentials expire in %.2d:%.2dh"), hours, minutes); - } else { - minutes = remaining / 60; - tooltip_text = g_strdup_printf (ngettext( - "Your credentials expire in %d minute", - "Your credentials expire in %d minutes", - minutes), minutes); - } - } else - tooltip_text = g_strdup (_("Your credentials have expired")); - return tooltip_text; -} - - -/* determine the current icon */ -static const char* -ka_applet_select_icon(KaApplet* applet, int remaining) -{ - enum ka_icon tray_icon = inv_icon; - - if (remaining > 0) { - if (remaining < applet->priv->pw_prompt_secs && - !applet->priv->renewable) - tray_icon = exp_icon; - else - tray_icon = val_icon; - } - - return applet->priv->icons[tray_icon]; -} - - -#ifdef HAVE_LIBNOTIFY -static gboolean -ka_show_notification (KaApplet *applet) -{ - /* wait for the panel to be settled before showing a bubble */ - if (gtk_status_icon_is_embedded (applet->priv->tray_icon)) { - GError *error = NULL; - gboolean ret; - - ret = notify_notification_show (applet->priv->notification, &error); - if (!ret) { - g_assert (error); - g_assert (error->message); - g_warning ("Failed to show notification: %s", error->message); - g_clear_error (&error); - } - } else { - g_timeout_add_seconds (5, (GSourceFunc)ka_show_notification, applet); - } - return FALSE; -} - - -static void -ka_notify_action_cb (NotifyNotification *notification G_GNUC_UNUSED, - gchar *action, gpointer user_data) -{ - KaApplet *self = KA_APPLET (user_data); - - if (strcmp (action, "dont-show-again") == 0) { - KA_DEBUG ("turning of notification %s", self->priv->notify_gconf_key); - ka_gconf_set_bool (self->priv->gconf, - self->priv->notify_gconf_key, - FALSE); - self->priv->notify_gconf_key = NULL; - } else { - g_warning("unkonwn action for callback"); - } -} - - -static void -ka_send_event_notification (KaApplet *applet, - const char *summary, - const char *message, - const char *icon, - const char *action) -{ - const char *notify_icon; - - g_return_if_fail (applet != NULL); - g_return_if_fail (summary != NULL); - g_return_if_fail (message != NULL); - - if (!notify_is_initted ()) - notify_init (PACKAGE); - - if (applet->priv->notification != NULL) { - notify_notification_close (applet->priv->notification, NULL); - g_object_unref (applet->priv->notification); - } - - notify_icon = icon ? icon : "krb-valid-ticket"; - - applet->priv->notification = \ - notify_notification_new_with_status_icon(summary, - message, - notify_icon, - applet->priv->tray_icon); - - notify_notification_set_urgency (applet->priv->notification, NOTIFY_URGENCY_NORMAL); - notify_notification_add_action (applet->priv->notification, - action, - _("Don't show me this again"), - (NotifyActionCallback) ka_notify_action_cb, - applet, NULL); - ka_show_notification (applet); -} -#else -static void -ka_send_event_notification (KaApplet *applet G_GNUC_UNUSED, - const char *summary G_GNUC_UNUSED, - const char *message G_GNUC_UNUSED, - const char *icon G_GNUC_UNUSED, - const char *action G_GNUC_UNUSED) -{ -} -#endif /* ! HAVE_LIBNOTIFY */ - - -/* - * update the tray icon's tooltip and icon - * and notify listeners about acquired/expiring tickets via signals - */ -int -ka_applet_update_status(KaApplet* applet, krb5_timestamp expiry) -{ - int now = time(0); - int remaining = expiry - now; - static int last_warn = 0; - static gboolean expiry_notified = FALSE; - gboolean notify = TRUE; - const char* tray_icon = ka_applet_select_icon (applet, remaining); - char* tooltip_text = ka_applet_tooltip_text (remaining); - - if (remaining > 0) { - if (expiry_notified) { - ka_gconf_get_bool(applet->priv->gconf, - KA_GCONF_KEY_NOTIFY_VALID, - ¬ify); - if (notify) { - applet->priv->notify_gconf_key = KA_GCONF_KEY_NOTIFY_VALID; - ka_send_event_notification (applet, - _("Network credentials valid"), - _("You've refreshed your Kerberos credentials."), - "krb-valid-ticket", - "dont-show-again"); - } - ka_applet_signal_emit (applet, KA_SIGNAL_ACQUIRED_TGT, expiry); - expiry_notified = FALSE; - } else if (remaining < applet->priv->pw_prompt_secs && (now - last_warn) > NOTIFY_SECONDS && - !applet->priv->renewable) { - ka_gconf_get_bool(applet->priv->gconf, - KA_GCONF_KEY_NOTIFY_EXPIRING, - ¬ify); - if (notify) { - applet->priv->notify_gconf_key = KA_GCONF_KEY_NOTIFY_EXPIRING; - ka_send_event_notification (applet, - _("Network credentials expiring"), - tooltip_text, - "krb-expiring-ticket", - "dont-show-again"); - } - last_warn = now; - } - } else { - if (!expiry_notified) { - ka_gconf_get_bool(applet->priv->gconf, - KA_GCONF_KEY_NOTIFY_EXPIRED, - ¬ify); - if (notify) { - applet->priv->notify_gconf_key = KA_GCONF_KEY_NOTIFY_EXPIRED; - ka_send_event_notification (applet, - _("Network credentials expired"), - _("Your Kerberos credentails have expired."), - "krb-no-valid-ticket", - "dont-show-again"); - } - ka_applet_signal_emit (applet, KA_SIGNAL_EXPIRED_TGT, expiry); - expiry_notified = TRUE; - last_warn = 0; - } - } - - gtk_status_icon_set_from_icon_name (applet->priv->tray_icon, tray_icon); - gtk_status_icon_set_tooltip_text (applet->priv->tray_icon, tooltip_text); - g_free(tooltip_text); - return 0; -} - - -static void -ka_applet_menu_add_separator_item (GtkWidget* menu) -{ - GtkWidget* menu_item; - - menu_item = gtk_separator_menu_item_new (); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); - gtk_widget_show (menu_item); -} - -static void -ka_applet_cb_preferences (GtkWidget* menuitem G_GNUC_UNUSED, - gpointer user_data G_GNUC_UNUSED) -{ - GError *error = NULL; - - g_spawn_command_line_async (BIN_DIR - G_DIR_SEPARATOR_S - "krb5-auth-dialog-preferences", - &error); - if (error) { - GtkWidget *message_dialog; - - message_dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - _("There was an error launching the preferences dialog: %s"), - error->message); - gtk_window_set_resizable (GTK_WINDOW (message_dialog), FALSE); - - g_signal_connect (message_dialog, "response", - G_CALLBACK (gtk_widget_destroy), - NULL); - gtk_widget_show (message_dialog); - g_error_free (error); - } -} - - -/* Free all resources and quit */ -static void -ka_applet_cb_quit (GtkMenuItem* menuitem G_GNUC_UNUSED, gpointer user_data) -{ - KaApplet* applet = KA_APPLET(user_data); - - g_object_unref (applet); - gtk_main_quit (); -} - - -static void -ka_about_dialog_url_hook (GtkAboutDialog *about, - const gchar *alink, - gpointer data G_GNUC_UNUSED) -{ - GError *error = NULL; - - gtk_show_uri(gtk_window_get_screen (GTK_WINDOW (about)), - alink, gtk_get_current_event_time(), &error); - - if (error) { - GtkWidget *message_dialog; - - message_dialog = gtk_message_dialog_new (GTK_WINDOW (about), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - _("There was an error displaying %s:\n%s"), - alink, error->message); - gtk_window_set_resizable (GTK_WINDOW (message_dialog), FALSE); - - g_signal_connect (message_dialog, "response", - G_CALLBACK (gtk_widget_destroy), - NULL); - gtk_widget_show (message_dialog); - g_error_free (error); - } -} - - -static void -ka_applet_cb_about_dialog (GtkMenuItem* menuitem G_GNUC_UNUSED, - gpointer user_data G_GNUC_UNUSED) -{ - const gchar* authors[] = { - "Christopher Aillon ", - "Jonathan Blandford ", - "Colin Walters ", - "Guido Günther ", - NULL }; - - gtk_about_dialog_set_url_hook (ka_about_dialog_url_hook, NULL, NULL); - gtk_show_about_dialog (NULL, - "authors", authors, - "version", VERSION, - "logo-icon-name", "krb-valid-ticket", - "copyright", - "Copyright (C) 2004,2005,2006 Red Hat, Inc.,\n" - "2008,2009 Guido Günther", - "website-label", PACKAGE " website", - "website", "https://honk.sigxcpu.org/piki/projects/krb5-auth-dialog/", - "license", "GNU General Public License Version 2", - /* Translators: add the translators of your language here */ - "translator-credits", _("translator-credits"), - NULL); -} - - -static void -ka_applet_cb_show_help (GtkMenuItem* menuitem G_GNUC_UNUSED, - gpointer user_data) -{ - KaApplet *applet = KA_APPLET(user_data); - - ka_show_help (gtk_status_icon_get_screen(applet->priv->tray_icon), NULL, NULL); -} - - -static void -ka_applet_cb_destroy_ccache(GtkMenuItem* menuitem G_GNUC_UNUSED, - gpointer user_data) -{ - KaApplet *applet = KA_APPLET(user_data); - ka_destroy_ccache(applet); -} - -static void -ka_applet_cb_show_tickets(GtkMenuItem* menuitem G_GNUC_UNUSED, - gpointer user_data G_GNUC_UNUSED) -{ - ka_tickets_dialog_run(); -} - - -/* The tray icon's context menu */ -static gboolean -ka_applet_create_context_menu (KaApplet* applet) -{ - GtkWidget* menu; - GtkWidget* menu_item; - GtkWidget* image; - - menu = gtk_menu_new (); - - /* kdestroy */ - menu_item = gtk_image_menu_item_new_with_mnemonic (_("Remove Credentials _Cache")); - g_signal_connect (G_OBJECT (menu_item), "activate", - G_CALLBACK (ka_applet_cb_destroy_ccache), applet); - image = gtk_image_new_from_stock (GTK_STOCK_CANCEL, GTK_ICON_SIZE_MENU); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), image); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); - - ka_applet_menu_add_separator_item (menu); - - /* Ticket dialog */ - menu_item = gtk_image_menu_item_new_with_mnemonic("_List Tickets"); - g_signal_connect (G_OBJECT (menu_item), "activate", - G_CALLBACK (ka_applet_cb_show_tickets), applet); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); - - /* Preferences */ - menu_item = gtk_image_menu_item_new_from_stock(GTK_STOCK_PREFERENCES, NULL); - g_signal_connect (G_OBJECT (menu_item), "activate", - G_CALLBACK (ka_applet_cb_preferences), applet); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); - - /* About item */ - menu_item = gtk_image_menu_item_new_from_stock(GTK_STOCK_HELP, NULL); - g_signal_connect (G_OBJECT (menu_item), "activate", - G_CALLBACK (ka_applet_cb_show_help), applet); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); - - /* About item */ - menu_item = gtk_image_menu_item_new_from_stock(GTK_STOCK_ABOUT, NULL); - g_signal_connect (G_OBJECT (menu_item), "activate", - G_CALLBACK (ka_applet_cb_about_dialog), applet); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); - - ka_applet_menu_add_separator_item (menu); - - /* Quit */ - menu_item = gtk_image_menu_item_new_from_stock(GTK_STOCK_QUIT, NULL); - g_signal_connect (G_OBJECT (menu_item), "activate", - G_CALLBACK (ka_applet_cb_quit), applet); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); - - gtk_widget_show_all (menu); - applet->priv->context_menu = menu; - - return TRUE; -} - - -static void -ka_tray_icon_on_menu (GtkStatusIcon* status_icon G_GNUC_UNUSED, - guint button, - guint activate_time, - gpointer user_data) -{ - KaApplet *applet = KA_APPLET(user_data); - - KA_DEBUG("Trayicon right clicked: %d", applet->priv->pw_prompt_secs); - gtk_menu_popup (GTK_MENU (applet->priv->context_menu), NULL, NULL, - gtk_status_icon_position_menu, applet->priv->tray_icon, - button, activate_time); -} - - -static gboolean -ka_tray_icon_on_click (GtkStatusIcon* status_icon G_GNUC_UNUSED, - gpointer data) -{ - KaApplet *applet = KA_APPLET(data); - - KA_DEBUG("Trayicon clicked: %d", applet->priv->pw_prompt_secs); - ka_grab_credentials (applet); - return TRUE; -} - - -static gboolean -ka_applet_cb_show_trayicon (KaApplet* applet, - GParamSpec* property G_GNUC_UNUSED, - gpointer data G_GNUC_UNUSED) -{ - g_return_val_if_fail (applet != NULL, FALSE); - g_return_val_if_fail (applet->priv->tray_icon != NULL, FALSE); - - gtk_status_icon_set_visible (applet->priv->tray_icon, applet->priv->show_trayicon); - return TRUE; -} - - -static gboolean -ka_applet_create_tray_icon (KaApplet* applet) -{ - GtkStatusIcon* tray_icon; - - tray_icon = gtk_status_icon_new (); - - g_signal_connect (G_OBJECT(tray_icon), "activate", - G_CALLBACK(ka_tray_icon_on_click), applet); - g_signal_connect (G_OBJECT(tray_icon), - "popup-menu", - G_CALLBACK(ka_tray_icon_on_menu), applet); - gtk_status_icon_set_from_icon_name (tray_icon, applet->priv->icons[exp_icon]); - gtk_status_icon_set_tooltip_text (tray_icon, PACKAGE); - gtk_status_icon_set_title (tray_icon, KA_NAME); - applet->priv->tray_icon = tray_icon; - return TRUE; -} - -static int -ka_applet_setup_icons (KaApplet* applet) -{ - /* Add application specific icons to search path */ - gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (), - DATA_DIR G_DIR_SEPARATOR_S "icons"); - applet->priv->icons[val_icon] = "krb-valid-ticket"; - applet->priv->icons[exp_icon] = "krb-expiring-ticket"; - applet->priv->icons[inv_icon] = "krb-no-valid-ticket"; - return TRUE; -} - -guint -ka_applet_get_pw_prompt_secs(const KaApplet* applet) -{ - return applet->priv->pw_prompt_secs; -} - -gboolean -ka_applet_get_show_trayicon(const KaApplet* applet) -{ - return applet->priv->show_trayicon; -} - -void -ka_applet_set_tgt_renewable(KaApplet* applet, gboolean renewable) -{ - applet->priv->renewable = renewable; -} - -gboolean -ka_applet_get_tgt_renewable(const KaApplet* applet) -{ - return applet->priv->renewable; -} - -KaPwDialog* -ka_applet_get_pwdialog(const KaApplet* applet) -{ - return applet->priv->pwdialog; -} - -void -ka_applet_signal_emit (KaApplet* this, KaAppletSignalNumber signum, - krb5_timestamp expiry) -{ - KaAppletClass *klass = KA_APPLET_GET_CLASS (this); - char *princ; - - princ = ka_unparse_name (); - if (!princ) - return; - - g_signal_emit (this, klass->signals[signum], 0, princ, (guint32)expiry); - g_free (princ); -} - -/* create the tray icon applet */ -KaApplet* -ka_applet_create() -{ - KaApplet* applet = ka_applet_new(); - GError *error = NULL; - gboolean ret; - - if (!(ka_applet_setup_icons (applet))) - g_error ("Failure to setup icons"); - if (!ka_applet_create_tray_icon (applet)) - g_error ("Failure to create tray icon"); - if (!ka_applet_create_context_menu (applet)) - g_error ("Failure to create context menu"); - gtk_window_set_default_icon_name (applet->priv->icons[val_icon]); - g_signal_connect (applet, "notify::show-trayicon", - G_CALLBACK (ka_applet_cb_show_trayicon), NULL); - - applet->priv->uixml = gtk_builder_new(); - ret = gtk_builder_add_from_file(applet->priv->uixml, - KA_DATA_DIR G_DIR_SEPARATOR_S - PACKAGE ".xml", &error); - if (!ret) { - g_assert (error); - g_assert (error->message); - g_error ("Failed to load UI XML: %s", error->message); - } - applet->priv->pwdialog = ka_pwdialog_create(applet->priv->uixml); - g_return_val_if_fail (applet->priv->pwdialog != NULL, NULL); - - applet->priv->gconf = ka_gconf_init (applet); - g_return_val_if_fail (applet->priv->gconf != NULL, NULL); - - ka_tickets_dialog_create(applet->priv->uixml); - - return applet; -} - diff --git a/src/krb5-auth-applet.h b/src/krb5-auth-applet.h deleted file mode 100644 index e0f32e4..0000000 --- a/src/krb5-auth-applet.h +++ /dev/null @@ -1,85 +0,0 @@ -/* Krb5 Auth Applet -- Acquire and release kerberos tickets - * - * (C) 2008 Guido Guenther - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef KRB5_AUTH_APPLET_H -#define KRB5_AUTH_APPLET_H - -#include -#include -#include - -#include "config.h" -#include "krb5-auth-pwdialog.h" - -#define KA_NAME _("Network Authentication") - -G_BEGIN_DECLS - -#define KA_TYPE_APPLET (ka_applet_get_type ()) -#define KA_APPLET(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), KA_TYPE_APPLET, KaApplet)) -#define KA_APPLET_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), KA_TYPE_APPLET, KaAppletClass)) -#define KA_IS_APPLET(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), KA_TYPE_APPLET)) -#define KA_IS_APPLET_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), KA_TYPE_APPLET)) -#define KA_APPLET_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), KA_TYPE_APPLET, KaAppletClass)) - -typedef struct _KaApplet KaApplet; -typedef struct _KaAppletClass KaAppletClass; -typedef struct _KaAppletPrivate KaAppletPrivate; - -GType ka_applet_get_type (void); - -/* signals emitted by KaApplet */ -typedef enum { - KA_SIGNAL_ACQUIRED_TGT, /* New TGT acquired */ - KA_SIGNAL_RENEWED_TGT, /* TGT got renewed */ - KA_SIGNAL_EXPIRED_TGT, /* TGT expired or ticket cache got destroyed */ - KA_SIGNAL_COUNT -} KaAppletSignalNumber; - -/* public functions */ -gboolean ka_applet_get_show_trayicon(const KaApplet* applet); -void ka_applet_set_tgt_renewable(KaApplet* applet, gboolean renewable); -gboolean ka_applet_get_tgt_renewable(const KaApplet* applet); -guint ka_applet_get_pw_prompt_secs(const KaApplet* applet); -KaPwDialog* ka_applet_get_pwdialog(const KaApplet* applet); -void ka_applet_signal_emit(KaApplet* applet, KaAppletSignalNumber signum, - krb5_timestamp expiry); - -/* create the applet */ -KaApplet* ka_applet_create(void); -/* update tooltip and icon */ -int ka_applet_update_status(KaApplet* applet, krb5_timestamp expiry); - -G_END_DECLS - -#ifdef ENABLE_DEBUG -#define KA_DEBUG(fmt,...) \ - g_printf ("DEBUG: %s: " fmt "\n", __func__, ##__VA_ARGS__) -#else -#define KA_DEBUG(fmt,...) \ - do { } while (0) -#endif /* !ENABLE_DEBUG */ - -#endif diff --git a/src/krb5-auth-dbus.c b/src/krb5-auth-dbus.c deleted file mode 100644 index 94ab18d..0000000 --- a/src/krb5-auth-dbus.c +++ /dev/null @@ -1,120 +0,0 @@ -/* Krb5 Auth Applet -- Acquire and release kerberos tickets - * - * (C) 2008,2009 Guido Guenther - * - * 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 - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -#include "config.h" - -#include -#include "krb5-auth-applet.h" -#include "krb5-auth-dialog.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_destroy_ccache(KaApplet* applet, DBusGMethodInvocation *context) -{ - gboolean success; - - KA_DEBUG("Destroying ticket cache"); - success = ka_destroy_ccache (applet); - 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; - DBusGProxy *bus_proxy; - GError *error = NULL; - - /* Connect to the session bus so we get exit-on-disconnect semantics. */ - session = dbus_g_bus_get(DBUS_BUS_SESSION, &error); - if (session == NULL) { - g_error ("couldn't connect to session bus: %s", (error) ? error->message : "(null)"); - *status = 1; - g_clear_error (&error); - return FALSE; - } - flags = DBUS_NAME_FLAG_DO_NOT_QUEUE; - bus_proxy = dbus_g_proxy_new_for_name (session, - "org.freedesktop.DBus", - "/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, - G_TYPE_STRING, - "org.gnome.KrbAuthDialog", - G_TYPE_UINT, - flags, - G_TYPE_INVALID, - G_TYPE_UINT, - &request_name_reply, - G_TYPE_INVALID)) { - g_warning ("Failed to invoke RequestName: %s", - error->message); - } - g_clear_error (&error); - g_object_unref (bus_proxy); - - if (request_name_reply == DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER - || request_name_reply == DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER) - ; - else if (request_name_reply == DBUS_REQUEST_NAME_REPLY_EXISTS - || request_name_reply == DBUS_REQUEST_NAME_REPLY_IN_QUEUE) { - *status = 0; - return FALSE; - } else { - g_assert_not_reached(); - } - return TRUE; -} - diff --git a/src/krb5-auth-dbus.h b/src/krb5-auth-dbus.h deleted file mode 100644 index 0d3acd0..0000000 --- a/src/krb5-auth-dbus.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Krb5 Auth Applet -- Acquire and release kerberos tickets - * - * (C) 2008 Guido Guenther - * - * 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 - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef KRB5_AUTH_DBUS_H -#define KRB5_AUTH_DBUS_H - -#include -#include -#include -#include "krb5-auth-applet.h" - -gboolean ka_dbus_connect(unsigned int* status); -gboolean ka_dbus_service(KaApplet* applet); -gboolean ka_dbus_acquire_tgt (KaApplet *applet, - const gchar *principal, - DBusGMethodInvocation *context); -gboolean ka_dbus_destroy_ccache(KaApplet* applet, - DBusGMethodInvocation *context); - -#endif /* KRB5_AUTH_DBUS_H */ diff --git a/src/krb5-auth-dialog.c b/src/krb5-auth-dialog.c deleted file mode 100644 index 7b2933b..0000000 --- a/src/krb5-auth-dialog.c +++ /dev/null @@ -1,1171 +0,0 @@ -/* - * Copyright (C) 2004,2005,2006 Red Hat, Inc. - * Authored by Christopher Aillon - * - * Copyright (C) 2008,2009,2010 Guido Guenther - * - * 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 - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "gtksecentry.h" -#include "secmem-util.h" -#include "memory.h" - -#include "krb5-auth-dialog.h" -#include "krb5-auth-applet.h" -#include "krb5-auth-pwdialog.h" -#include "krb5-auth-dbus.h" -#include "krb5-auth-tools.h" -#include "krb5-auth-tickets.h" - -#ifdef ENABLE_NETWORK_MANAGER -#include -#endif - -#ifdef HAVE_HX509_ERR_H -# include -#endif - -static krb5_context kcontext; -static krb5_principal kprincipal; -static krb5_timestamp creds_expiry; -static krb5_timestamp canceled_creds_expiry; -static gboolean canceled; -static gboolean invalid_auth; -static gboolean always_run; -static gboolean is_online = TRUE; - -static int grab_credentials (KaApplet* applet); -static int ka_renew_credentials (KaApplet* applet); -static gboolean ka_get_tgt_from_ccache (krb5_context context, krb5_creds *creds); - -#ifdef ENABLE_NETWORK_MANAGER -libnm_glib_ctx *nm_context; -#endif - -/* YAY for different Kerberos implementations */ -static int -get_cred_forwardable(krb5_creds *creds) -{ -#if defined(HAVE_KRB5_CREDS_TICKET_FLAGS) && defined(TKT_FLG_FORWARDABLE) - return creds->ticket_flags & TKT_FLG_FORWARDABLE; -#elif defined(HAVE_KRB5_CREDS_FLAGS_B_FORWARDABLE) - return creds->flags.b.forwardable; -#elif defined(HAVE_KRB5_CREDS_FLAGS) && defined(KDC_OPT_FORWARDABLE) - return creds->flags & KDC_OPT_FORWARDABLE; -#endif -} - -static int -get_cred_renewable(krb5_creds *creds) -{ -#if defined(HAVE_KRB5_CREDS_TICKET_FLAGS) && defined(TKT_FLG_RENEWABLE) - return creds->ticket_flags & TKT_FLG_RENEWABLE; -#elif defined(HAVE_KRB5_CREDS_FLAGS_B_RENEWABLE) - return creds->flags.b.renewable; -#elif defined(HAVE_KRB5_CREDS_FLAGS) && defined(KDC_OPT_RENEWABLE) - return creds->flags & KDC_OPT_RENEWABLE; -#endif -} - -static krb5_error_code -get_renewed_creds(krb5_context context, - krb5_creds *creds, - krb5_principal client, - krb5_ccache ccache, - char *in_tkt_service) -{ -#ifdef HAVE_KRB5_GET_RENEWED_CREDS - return krb5_get_renewed_creds (context, creds, client, ccache, in_tkt_service); -#else - return 1; /* XXX is there something better to return? */ -#endif -} - -static int -get_cred_proxiable(krb5_creds *creds) -{ -#if defined(HAVE_KRB5_CREDS_TICKET_FLAGS) && defined(TKT_FLG_PROXIABLE) - return creds->ticket_flags & TKT_FLG_PROXIABLE; -#elif defined(HAVE_KRB5_CREDS_FLAGS_B_PROXIABLE) - return creds->flags.b.proxiable; -#elif defined(HAVE_KRB5_CREDS_FLAGS) && defined(KDC_OPT_PROXIABLE) - return creds->flags & KDC_OPT_PROXIABLE; -#endif -} - -static size_t -get_principal_realm_length(krb5_principal p) -{ -#if defined(HAVE_KRB5_PRINCIPAL_REALM_AS_STRING) - return strlen(p->realm); -#elif defined(HAVE_KRB5_PRINCIPAL_REALM_AS_DATA) - return p->realm.length; -#endif -} - -static const char * -get_principal_realm_data(krb5_principal p) -{ -#if defined(HAVE_KRB5_PRINCIPAL_REALM_AS_STRING) - return p->realm; -#elif defined(HAVE_KRB5_PRINCIPAL_REALM_AS_DATA) - return p->realm.data; -#endif -} - -static void -ka_krb5_free_error_message(krb5_context context, const char* msg) -{ -#if defined(HAVE_KRB5_FREE_ERROR_MESSAGE) - krb5_free_error_message(context, msg); -#elif defined(HAVE_KRB5_FREE_ERROR_STRING) - krb5_free_error_string(context, (char *) msg); -#else -# error No way to free error string. -#endif -} - -/* - * Returns a descriptive error message or kerberos related error - * returned pointer must be freed using g_free(). - */ -static char* -ka_get_error_message(krb5_context context, krb5_error_code err) -{ - char *msg = NULL; -#if defined(HAVE_KRB5_GET_ERROR_MESSAGE) - const char *krberr; - - krberr = krb5_get_error_message(context, err); - msg = g_strdup(krberr); - ka_krb5_free_error_message(context, krberr); -#else -# error No detailed error message information -#endif - if (msg == NULL) - msg = g_strdup(_("unknown error")); - return msg; -} - - -static void -ka_krb5_cc_clear_mcred(krb5_creds* mcred) -{ -#if defined HAVE_KRB5_CC_CLEAR_MCRED - krb5_cc_clear_mcred(mcred); -#else - memset(mcred, 0, sizeof(krb5_creds)); -#endif -} - - -/* ***************************************************************** */ -/* ***************************************************************** */ - -/* log a kerberos error messge */ -static void -ka_log_error_message(const char* prefix, krb5_context context, krb5_error_code err) -{ - char *errmsg = ka_get_error_message(context, err); - - g_warning("%s: %s", prefix, errmsg); - g_free (errmsg); -} - - -static gboolean -credentials_expiring_real (KaApplet* applet) -{ - krb5_creds my_creds; - krb5_timestamp now; - gboolean retval = FALSE; - - ka_applet_set_tgt_renewable(applet, FALSE); - if (!ka_get_tgt_from_ccache (kcontext, &my_creds)) { - creds_expiry = 0; - retval = TRUE; - goto out; - } - - /* copy principal from cache if any */ - if (krb5_principal_compare (kcontext, my_creds.client, kprincipal)) { - krb5_free_principal(kcontext, kprincipal); - krb5_copy_principal(kcontext, my_creds.client, &kprincipal); - } - creds_expiry = my_creds.times.endtime; - if ((krb5_timeofday(kcontext, &now) == 0) && - (now + ka_applet_get_pw_prompt_secs(applet) > my_creds.times.endtime)) - retval = TRUE; - - /* If our creds are expiring, determine whether they are renewable */ - if (retval && get_cred_renewable(&my_creds) && my_creds.times.renew_till > now) { - ka_applet_set_tgt_renewable(applet, TRUE); - } - - krb5_free_cred_contents (kcontext, &my_creds); -out: - ka_applet_update_status(applet, creds_expiry); - return retval; -} - - -/* time in seconds the tgt will be still valid */ -int -ka_tgt_valid_seconds() -{ - krb5_timestamp now; - - if (krb5_timeofday(kcontext, &now)) - return 0; - - return (creds_expiry - now); -} - - -/* return credential cache filename, strip "FILE:" prefix if necessary */ -static const char* -ka_ccache_filename (void) -{ - const gchar *name; - - name = krb5_cc_default_name (kcontext); - if (g_str_has_prefix (name, "FILE:")) - return strchr(name,':')+1; - else if (g_str_has_prefix (name, "SCC:")) - g_warning ("Cannot monitor sqlite based cache '%s'", name); - else - g_warning ("Unsupported cache type for '%s'", name); - return NULL; -} - - -static void -ka_format_time (time_t t, gchar *ts, size_t len) -{ - g_strlcpy(ts, ctime(&t)+ 4, len); - ts[15] = 0; -} - - -/* fill in service tickets data */ -gboolean -ka_get_service_tickets (GtkListStore *tickets) -{ - krb5_cc_cursor cursor; - krb5_creds creds; - krb5_error_code ret; - GtkTreeIter iter; - krb5_ccache ccache; - char *name; - krb5_timestamp sec; - gchar start_time[128], end_time[128], end_time_markup[256]; - gboolean retval = FALSE; - - gtk_list_store_clear(tickets); - - krb5_timeofday (kcontext, &sec); - ret = krb5_cc_default (kcontext, &ccache); - g_return_val_if_fail (!ret, FALSE); - - ret = krb5_cc_start_seq_get (kcontext, ccache, &cursor); - if (ret) { - ka_log_error_message("krb5_cc_start_seq_get", kcontext, ret); - - /* if the file doesn't exist, it's not an error if we can't - * parse it */ - if (!g_file_test(ka_ccache_filename (), - G_FILE_TEST_EXISTS)) - retval = TRUE; - goto out; - } - - while ((ret = krb5_cc_next_cred (kcontext, - ccache, - &cursor, - &creds)) == 0) { - gboolean renewable, proxiable, forwardable; - - if (creds.times.starttime) - ka_format_time(creds.times.starttime, start_time, - sizeof(start_time)); - else - ka_format_time(creds.times.authtime, start_time, - sizeof(start_time)); - - ka_format_time(creds.times.endtime, end_time, - sizeof(end_time)); - if (creds.times.endtime > sec) - strcpy(end_time_markup, end_time); - else - g_snprintf(end_time_markup, sizeof(end_time_markup), - "%s (%s)", - end_time, _("Expired")); - - forwardable = get_cred_forwardable(&creds); - renewable = get_cred_renewable(&creds); - proxiable = get_cred_proxiable(&creds); - - ret = krb5_unparse_name (kcontext, creds.server, &name); - if (!ret) { - gtk_list_store_append(tickets, &iter); - gtk_list_store_set(tickets, &iter, - PRINCIPAL_COLUMN, name, - START_TIME_COLUMN, start_time, - END_TIME_COLUMN, end_time_markup, - FORWARDABLE_COLUMN, forwardable, - RENEWABLE_COLUMN, renewable, - PROXIABLE_COLUMN, proxiable, - -1); - free(name); - } else - ka_log_error_message("krb5_unparse_name", kcontext, ret); - krb5_free_cred_contents (kcontext, &creds); - } - if(ret != KRB5_CC_END) - ka_log_error_message("krb5_cc_get_next", kcontext, ret); - - ret = krb5_cc_end_seq_get (kcontext, ccache, &cursor); - if (ret) - ka_log_error_message("krb5_cc_end_seq_get", kcontext, ret); - - retval = TRUE; -out: - ret = krb5_cc_close (kcontext, ccache); - g_return_val_if_fail (!ret, FALSE); - - return retval; -} - - -/* Check for things we have to do while the password dialog is open */ -static gboolean -krb5_auth_dialog_do_updates (gpointer data) -{ - KaApplet* applet = KA_APPLET(data); - KaPwDialog* pwdialog = ka_applet_get_pwdialog(applet); - - g_return_val_if_fail (pwdialog != NULL, FALSE); - /* Update creds_expiry and close the applet if we got the creds by other means (e.g. kinit) */ - if (!credentials_expiring_real(applet)) - ka_pwdialog_hide(pwdialog, FALSE); - - /* Update the expiry information in the dialog */ - ka_pwdialog_status_update (pwdialog); - return TRUE; -} - - -static krb5_error_code -auth_dialog_prompter (krb5_context ctx G_GNUC_UNUSED, - void *data, - const char *name G_GNUC_UNUSED, - const char *banner G_GNUC_UNUSED, - int num_prompts, - krb5_prompt prompts[]) -{ - KaApplet *applet = KA_APPLET(data); - KaPwDialog *pwdialog = ka_applet_get_pwdialog(applet); - krb5_error_code errcode; - int i; - - errcode = KRB5KRB_ERR_GENERIC; - canceled = FALSE; - canceled_creds_expiry = 0; - - for (i = 0; i < num_prompts; i++) { - const gchar *password = NULL; - int password_len = 0; - int response; - guint32 source_id; - - errcode = KRB5_LIBOS_CANTREADPWD; - - source_id = g_timeout_add_seconds (5, (GSourceFunc)krb5_auth_dialog_do_updates, applet); - ka_pwdialog_setup (pwdialog, (gchar *) prompts[i].prompt, invalid_auth); - response = ka_pwdialog_run (pwdialog); - switch (response) - { - case GTK_RESPONSE_OK: - password = ka_pwdialog_get_password(pwdialog); - password_len = strlen (password); - break; - case GTK_RESPONSE_DELETE_EVENT: - case GTK_RESPONSE_CANCEL: - canceled = TRUE; - break; - case GTK_RESPONSE_NONE: - break; - default: - g_warning ("Unknown Response: %d", response); - g_assert_not_reached (); - } - g_source_remove (source_id); - - if (!password) - goto cleanup; - if (password_len+1 > prompts[i].reply->length) { - g_warning("Password too long %d/%d", password_len+1, prompts[i].reply->length); - goto cleanup; - } - - memcpy(prompts[i].reply->data, (char *) password, password_len + 1); - prompts[i].reply->length = password_len; - errcode = 0; - } -cleanup: - ka_pwdialog_hide (pwdialog, TRUE); - /* Reset this, so we know the next time we get a TRUE value, it is accurate. */ - invalid_auth = FALSE; - - return errcode; -} - - -#ifdef ENABLE_NETWORK_MANAGER -static void -network_state_cb (libnm_glib_ctx *context, - gpointer data) -{ - gboolean *online = (gboolean*) data; - - libnm_glib_state state; - - state = libnm_glib_get_network_state (context); - - switch (state) - { - case LIBNM_NO_DBUS: - case LIBNM_NO_NETWORKMANAGER: - case LIBNM_INVALID_CONTEXT: - /* do nothing */ - break; - case LIBNM_NO_NETWORK_CONNECTION: - *online = FALSE; - break; - case LIBNM_ACTIVE_NETWORK_CONNECTION: - *online = TRUE; - break; - } -} -#endif - -/* credentials expiring timer */ -static gboolean -credentials_expiring (gpointer *data) -{ - int retval; - gboolean give_up; - KaApplet* applet = KA_APPLET(data); - - KA_DEBUG("Checking expiry <%ds", ka_applet_get_pw_prompt_secs(applet)); - if (credentials_expiring_real (applet) && is_online) { - KA_DEBUG("Expiry @ %ld", creds_expiry); - - if (!ka_renew_credentials (applet)) { - KA_DEBUG("Credentials renewed"); - goto out; - } - - /* no popup when using a trayicon */ - if (ka_applet_get_show_trayicon(applet)) - goto out; - - give_up = canceled && (creds_expiry == canceled_creds_expiry); - if (!give_up) { - do { - retval = grab_credentials (applet); - give_up = canceled && - (creds_expiry == canceled_creds_expiry); - } while ((retval != 0) && - (retval != KRB5_REALM_CANT_RESOLVE) && - (retval != KRB5_KDC_UNREACH) && - invalid_auth && - !give_up); - } - } -out: - ka_applet_update_status(applet, creds_expiry); - return TRUE; -} - - -/* - * set ticket options by looking at krb5.conf and gconf - */ -static void -ka_set_ticket_options(KaApplet* applet, krb5_context context, - krb5_get_init_creds_opt *out, - const char* pk_userid G_GNUC_UNUSED, - const char* pk_anchors G_GNUC_UNUSED) -{ - gboolean flag; -#ifdef HAVE_KRB5_GET_INIT_CREDS_OPT_SET_DEFAULT_FLAGS - krb5_get_init_creds_opt_set_default_flags(context, PACKAGE, - krb5_principal_get_realm(context, kprincipal), out); -#endif - g_object_get(applet, "tgt-forwardable", &flag, NULL); - if (flag) - krb5_get_init_creds_opt_set_forwardable(out, flag); - g_object_get(applet, "tgt-proxiable", &flag, NULL); - if (flag) - krb5_get_init_creds_opt_set_proxiable(out, flag); - g_object_get(applet, "tgt-renewable", &flag, NULL); - if (flag) { - krb5_deltat r = 3600*24*30; /* 1 month */ - krb5_get_init_creds_opt_set_renew_life (out, r); - } - -#if ENABLE_PKINIT && HAVE_KRB5_GET_INIT_CREDS_OPT_SET_PA - /* pkinit optins for MIT Kerberos */ - if (pk_userid && strlen(pk_userid)) { - KA_DEBUG("pkinit with '%s'", pk_userid); - krb5_get_init_creds_opt_set_pa(context, out, - "X509_user_identity", pk_userid); - if (pk_anchors && strlen(pk_anchors)) { - KA_DEBUG("pkinit anchors '%s'", pk_anchors); - krb5_get_init_creds_opt_set_pa(context, out, - "X509_anchors", pk_anchors); - } - } -#endif /* HAVE_KRB5_GET_INIT_CREDS_OPT_SET_PA */ -} - - -/* - * set ticket options - * by looking at krb5.conf, the passed in creds and gconf - */ -static void -set_options_from_creds(const KaApplet* applet, - krb5_context context, - krb5_creds *in, - krb5_get_init_creds_opt *out) -{ - krb5_deltat renew_lifetime; - int flag; - -#ifdef HAVE_KRB5_GET_INIT_CREDS_OPT_SET_DEFAULT_FLAGS - krb5_get_init_creds_opt_set_default_flags(context, PACKAGE, - krb5_principal_get_realm(context, kprincipal), out); -#endif - - flag = get_cred_forwardable(in) != 0; - krb5_get_init_creds_opt_set_forwardable(out, flag); - flag = get_cred_proxiable(in) != 0; - krb5_get_init_creds_opt_set_proxiable(out, flag); - flag = get_cred_renewable(in) != 0; - if (flag && (in->times.renew_till > in->times.starttime)) { - renew_lifetime = in->times.renew_till - - in->times.starttime; - krb5_get_init_creds_opt_set_renew_life(out, - renew_lifetime); - } - if (in->times.endtime > - in->times.starttime + ka_applet_get_pw_prompt_secs(applet)) { - krb5_get_init_creds_opt_set_tkt_life(out, - in->times.endtime - - in->times.starttime); - } - /* This doesn't do a deep copy -- fix it later. */ - /* krb5_get_init_creds_opt_set_address_list(out, creds->addresses); */ -} - - -#if ENABLE_PKINIT && HAVE_KRB5_GET_INIT_CREDS_OPT_SET_PKINIT -static krb5_error_code -ka_auth_heimdal_pkinit(KaApplet* applet, krb5_creds* creds, - const char* pk_userid, const char* pk_anchors) -{ - krb5_get_init_creds_opt *opts = NULL; - krb5_error_code retval; - const char* pkinit_anchors = NULL; - - KA_DEBUG("pkinit with '%s'", pk_userid); - if (pk_anchors && strlen (pk_anchors)) { - pkinit_anchors = pk_anchors; - KA_DEBUG("pkinit anchors '%s'", pkinit_anchors); - } - - if ((retval = krb5_get_init_creds_opt_alloc (kcontext, &opts))) - goto out; - - ka_set_ticket_options (applet, kcontext, opts, NULL, NULL); - retval = krb5_get_init_creds_opt_set_pkinit(kcontext, opts, - kprincipal, - pk_userid, - pkinit_anchors, - NULL, - NULL, - 0, /* pk_use_enc_key */ - auth_dialog_prompter, - applet, /* data */ - NULL); /* passwd */ - KA_DEBUG("pkinit returned with %d", retval); - if (retval) - goto out; - - retval = krb5_get_init_creds_password(kcontext, creds, kprincipal, - NULL, auth_dialog_prompter, applet, - 0, NULL, opts); -out: - if (opts) - krb5_get_init_creds_opt_free(kcontext, opts); - return retval; -} -#endif /* ! ENABLE_PKINIT */ - -static krb5_error_code -ka_auth_password(KaApplet* applet, krb5_creds* creds, - const char* pk_userid, const char* pk_anchors) -{ - krb5_error_code retval; - krb5_get_init_creds_opt *opts = NULL; - - if ((retval = krb5_get_init_creds_opt_alloc (kcontext, &opts))) - goto out; - ka_set_ticket_options (applet, kcontext, opts, - pk_userid, pk_anchors); - - retval = krb5_get_init_creds_password(kcontext, creds, kprincipal, - NULL, auth_dialog_prompter, applet, - 0, NULL, opts); -out: - if (opts) - krb5_get_init_creds_opt_free(kcontext, opts); - return retval; -} - -static krb5_error_code -ka_parse_name(KaApplet* applet, krb5_context krbcontext, krb5_principal* kprinc) -{ - krb5_error_code ret; - gchar *principal = NULL; - - if (*kprinc != NULL) - krb5_free_principal(krbcontext, *kprinc); - - g_object_get(applet, "principal", &principal, NULL); - ret = krb5_parse_name(krbcontext, principal, kprinc); - - g_free(principal); - return ret; -} - - -/* - * return current principal in text form - * - * caller needs to free the returned result using g_free(); - */ -char* -ka_unparse_name () -{ - char *princ, *gprinc = NULL; - krb5_error_code err; - - if (!kprincipal) - goto out; - - if ((err = krb5_unparse_name (kcontext, kprincipal, &princ))) { - ka_log_error_message(__func__, kcontext, err); - goto out; - } - - gprinc = g_strdup (princ); - free (princ); -out: - return gprinc; -} - - -static void -ccache_changed_cb (GFileMonitor *monitor G_GNUC_UNUSED, - GFile *file, - GFile *other_file G_GNUC_UNUSED, - GFileMonitorEvent event_type, - gpointer data) -{ - KaApplet *applet = KA_APPLET(data); - gchar *ccache_name = g_file_get_path(file); - - switch (event_type) { - case G_FILE_MONITOR_EVENT_DELETED: - case G_FILE_MONITOR_EVENT_CREATED: - case G_FILE_MONITOR_EVENT_CHANGED: - KA_DEBUG ("%s changed", ccache_name); - credentials_expiring ((gpointer)applet); - break; - default: - KA_DEBUG ("%s unhandled event: %d", ccache_name, event_type); - } - g_free (ccache_name); -} - - -static gboolean -monitor_ccache(KaApplet *applet) -{ - const gchar *ccache_name; - GFile *ccache; - GFileMonitor *monitor; - GError *err = NULL; - gboolean ret = FALSE; - - ccache_name = ka_ccache_filename (); - g_return_val_if_fail (ccache_name != NULL, FALSE); - - ccache = g_file_new_for_path (ccache_name); - monitor = g_file_monitor_file (ccache, G_FILE_MONITOR_NONE, NULL, &err); - g_assert ((!monitor && err) || (monitor && !err)); - if (!monitor) { - /* cache disappeared? */ - if (err->code == G_FILE_ERROR_NOENT) - credentials_expiring ((gpointer)applet); - else - g_warning ("Failed to monitor %s: %s", ccache_name, err->message); - goto out; - } else { - /* g_file_monitor_set_rate_limit(monitor, 10*1000); */ - g_signal_connect (monitor, "changed", G_CALLBACK (ccache_changed_cb), applet); - KA_DEBUG ("Monitoring %s", ccache_name); - ret = TRUE; - } -out: - g_object_unref (ccache); - if (err) - g_error_free (err); - return ret; -} - - -/* grab credentials interactively */ -static int -grab_credentials (KaApplet* applet) -{ - krb5_error_code retval = KRB5_KDC_UNREACH; - krb5_creds my_creds; - krb5_ccache ccache; - gchar *pk_userid = NULL; - gchar *pk_anchors = NULL; - gchar *errmsg = NULL; - gboolean pw_auth = TRUE; - - memset(&my_creds, 0, sizeof(my_creds)); - - retval = ka_parse_name(applet, kcontext, &kprincipal); - if (retval) - goto out2; - - retval = krb5_cc_default (kcontext, &ccache); - if (retval) - goto out2; - - g_object_get(applet, "pk-userid", &pk_userid, - "pk-anchors", &pk_anchors, - NULL); -#if ENABLE_PKINIT && HAVE_HX509_ERR_H && HAVE_KRB5_GET_INIT_CREDS_OPT_SET_PKINIT - /* pk_userid set: try pkinit */ - if (pk_userid && strlen(pk_userid)) { - retval = ka_auth_heimdal_pkinit(applet, &my_creds, - pk_userid, pk_anchors); - /* other error than: "no token found" - no need to try password auth: */ - if (retval != HX509_PKCS11_NO_TOKEN && retval != HX509_PKCS11_NO_SLOT) - pw_auth = FALSE; - } -#endif /* ENABLE_PKINIT */ - if (pw_auth) - retval = ka_auth_password(applet, &my_creds, - pk_userid, pk_anchors); - - creds_expiry = my_creds.times.endtime; - if (canceled) - canceled_creds_expiry = creds_expiry; - if (retval) { - switch (retval) { - case KRB5KDC_ERR_PREAUTH_FAILED: - case KRB5KRB_AP_ERR_BAD_INTEGRITY: -#ifdef HAVE_HX509_ERR_H - case HX509_PKCS11_LOGIN: -#endif /* Invalid password/pin, try again. */ - invalid_auth = TRUE; - break; - default: - errmsg = ka_get_error_message(kcontext, retval); - KA_DEBUG("Auth failed with %d: %s", retval, - errmsg); - g_free(errmsg); - break; - } - goto out; - } - retval = krb5_cc_initialize(kcontext, ccache, kprincipal); - if (retval) - goto out; - - retval = krb5_cc_store_cred(kcontext, ccache, &my_creds); - if (retval) - goto out; -out: - krb5_free_cred_contents (kcontext, &my_creds); - krb5_cc_close (kcontext, ccache); -out2: - g_free(pk_userid); - return retval; -} - -/* try to renew the credentials noninteractively */ -static int -ka_renew_credentials (KaApplet* applet) -{ - krb5_error_code retval; - krb5_creds my_creds; - krb5_ccache ccache; - krb5_get_init_creds_opt opts; - - if (kprincipal == NULL) { - retval = ka_parse_name(applet, kcontext, &kprincipal); - if (retval) - return retval; - } - - retval = krb5_cc_default (kcontext, &ccache); - if (retval) - return retval; - - retval = ka_get_tgt_from_ccache (kcontext, &my_creds); - if (!retval) { - krb5_cc_close (kcontext, ccache); - return -1; - } - - krb5_get_init_creds_opt_init (&opts); - set_options_from_creds (applet, kcontext, &my_creds, &opts); - - if (ka_applet_get_tgt_renewable(applet)) { - - retval = get_renewed_creds (kcontext, &my_creds, kprincipal, ccache, NULL); - if (retval) - goto out; - - retval = krb5_cc_initialize(kcontext, ccache, kprincipal); - if(retval) { - ka_log_error_message("krb5_cc_initialize", kcontext, retval); - goto out; - } - retval = krb5_cc_store_cred(kcontext, ccache, &my_creds); - if (retval) { - ka_log_error_message("krb5_cc_store_cred", kcontext, retval); - goto out; - } - ka_applet_signal_emit (applet, KA_SIGNAL_RENEWED_TGT, - my_creds.times.endtime); - } -out: - creds_expiry = my_creds.times.endtime; - krb5_free_cred_contents (kcontext, &my_creds); - krb5_cc_close (kcontext, ccache); - return retval; -} - - -/* get principal associated with the default credentials cache - if found store - * it in *creds, return FALSE otwerwise */ -static gboolean -ka_get_tgt_from_ccache (krb5_context context, krb5_creds *creds) -{ - krb5_ccache ccache; - krb5_creds pattern; - krb5_principal principal; - gboolean ret = FALSE; - - ka_krb5_cc_clear_mcred(&pattern); - - if (krb5_cc_default(context, &ccache)) - return FALSE; - - if (krb5_cc_get_principal(context, ccache, &principal)) - goto out; - - if (krb5_build_principal_ext(context, &pattern.server, - get_principal_realm_length(principal), - get_principal_realm_data(principal), - KRB5_TGS_NAME_SIZE, - KRB5_TGS_NAME, - get_principal_realm_length(principal), - get_principal_realm_data(principal), 0)) { - goto out_free_princ; - } - - pattern.client = principal; - if (!krb5_cc_retrieve_cred(context, ccache, 0, &pattern, creds)) - ret = TRUE; - krb5_free_principal(context, pattern.server); - -out_free_princ: - krb5_free_principal(context, principal); -out: - krb5_cc_close(context, ccache); - return ret; -} - -static gboolean -using_krb5(void) -{ - krb5_error_code err; - gboolean have_tgt = FALSE; - krb5_creds creds; - - err = krb5_init_context(&kcontext); - if (err) - return FALSE; - - have_tgt = ka_get_tgt_from_ccache(kcontext, &creds); - if (have_tgt) { - krb5_copy_principal(kcontext, creds.client, &kprincipal); - krb5_free_cred_contents (kcontext, &creds); - } - return have_tgt; -} - - -gboolean -ka_destroy_ccache (KaApplet *applet) -{ - krb5_ccache ccache; - const char* cache; - krb5_error_code ret; - - cache = krb5_cc_default_name(kcontext); - ret = krb5_cc_resolve(kcontext, cache, &ccache); - ret = krb5_cc_destroy (kcontext, ccache); - - credentials_expiring_real(applet); - - if (ret) - return FALSE; - else - return TRUE; -} - - -/* - * check if we have valid credentials for the requested principal - if not, grab them - * principal: requested principal - if empty use default - */ -gboolean -ka_check_credentials (KaApplet *applet, const char* newprincipal) -{ - gboolean success = FALSE; - int retval; - char* principal; - - g_object_get(applet, "principal", &principal, NULL); - - if (strlen(newprincipal)) { - krb5_principal knewprinc; - - /* no ticket cache: is requested princ the one from our config? */ - if (!kprincipal && g_strcmp0(principal, newprincipal)) { - KA_DEBUG("Requested principal %s not %s", principal, newprincipal); - goto out; - } - - /* ticket cache: check if the requested principal is the one we have */ - retval = krb5_parse_name(kcontext, newprincipal, &knewprinc); - if (retval) { - g_warning ("Cannot parse principal '%s'", newprincipal); - goto out; - } - if (kprincipal && !krb5_principal_compare (kcontext, kprincipal, knewprinc)) { - KA_DEBUG("Current Principal '%s' not '%s'", principal, newprincipal); - krb5_free_principal(kcontext, knewprinc); - goto out; - } - krb5_free_principal(kcontext, knewprinc); - } - - if (credentials_expiring_real (applet)) { - if (!is_online) - success = FALSE; - else - success = ka_grab_credentials (applet); - } else - success = TRUE; -out: - g_free (principal); - return success; -} - - -/* initiate grabbing of credentials (e.g. on leftclick of tray icon) */ -gboolean -ka_grab_credentials (KaApplet* applet) -{ - int retval; - int success = FALSE; - KaPwDialog *pwdialog = ka_applet_get_pwdialog(applet); - - ka_pwdialog_set_persist(pwdialog, TRUE); - do { - retval = grab_credentials (applet); - if (invalid_auth) - continue; - if (canceled) - break; - if (retval) { - gchar *errmsg; - - errmsg = ka_get_error_message(kcontext, retval); - ka_pwdialog_error(pwdialog, errmsg); - g_free (errmsg); - break; - } else { - success = TRUE; - break; - } - } while(TRUE); - - ka_pwdialog_set_persist(pwdialog, FALSE); - credentials_expiring_real(applet); - - return success; -} - - -static void -ka_secmem_init (void) -{ - /* Initialize secure memory. 1 is too small, so the default size - will be used. */ - secmem_init (1); - secmem_set_flags (SECMEM_WARN); - drop_privs (); - - if (atexit (secmem_term)) - g_error("Couln't register atexit handler"); -} - - -static void -ka_nm_shutdown(void) -{ -#ifdef ENABLE_NETWORK_MANAGER - if (nm_context) { - libnm_glib_shutdown (nm_context); - nm_context = NULL; - } -#endif -} - - -static gboolean -ka_nm_init(void) -{ -#ifdef ENABLE_NETWORK_MANAGER - guint32 nm_callback_id; - - nm_context = libnm_glib_init (); - if (!nm_context) { - g_warning ("Could not initialize libnm_glib"); - } else { - nm_callback_id = libnm_glib_register_callback (nm_context, network_state_cb, &is_online, NULL); - if (nm_callback_id == 0) { - ka_nm_shutdown (); - - g_warning ("Could not connect to NetworkManager, connection status will not be managed!"); - } - } -#endif /* ENABLE_NETWORK_MANAGER */ - return TRUE; -} - - -int -main (int argc, char *argv[]) -{ - KaApplet *applet; - GOptionContext *context; - GError *error = NULL; - - guint status = 0; - gboolean run_auto = FALSE, run_always = FALSE; - - const char *help_msg = "Run '" PACKAGE " --help' to see a full list of available command line options"; - const GOptionEntry options [] = { - {"auto", 'a', 0, G_OPTION_ARG_NONE, &run_auto, - "Only run if an initialized ccache is found (default)", NULL}, - {"always", 'A', 0, G_OPTION_ARG_NONE, &run_always, - "Always run", NULL}, - { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL } - }; - - context = g_option_context_new ("- Kerberos 5 credential checking"); - g_option_context_add_main_entries (context, options, NULL); - g_option_context_add_group (context, gtk_get_option_group (TRUE)); - g_option_context_parse (context, &argc, &argv, &error); - - if (error) { - g_print ("%s\n%s\n", - error->message, - help_msg); - g_error_free (error); - return 1; - } - g_option_context_free (context); - - textdomain (PACKAGE); - bind_textdomain_codeset (PACKAGE, "UTF-8"); - bindtextdomain (PACKAGE, LOCALE_DIR); - ka_secmem_init(); - - if (!ka_dbus_connect (&status)) - exit(status); - - if (run_always && !run_auto) { - always_run = TRUE; - } - - if (using_krb5 () || always_run) { - g_set_application_name (KA_NAME); - - applet = ka_applet_create (); - if (!applet) - return 1; - ka_nm_init(); - - if (credentials_expiring ((gpointer)applet)) { - g_timeout_add_seconds (CREDENTIAL_CHECK_INTERVAL, (GSourceFunc)credentials_expiring, applet); - monitor_ccache (applet); - } - ka_dbus_service(applet); - gtk_main (); - } - ka_nm_shutdown(); - return 0; -} diff --git a/src/krb5-auth-dialog.h b/src/krb5-auth-dialog.h deleted file mode 100644 index 48cd0b0..0000000 --- a/src/krb5-auth-dialog.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Krb5 Auth Applet -- Acquire and release kerberos tickets - * - * (C) 2008 Guido Guenther - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef KRB5_AUTH_DIALOG -#define KRB5_AUTH_DIALOG - -#include "krb5-auth-applet.h" - -gboolean ka_destroy_ccache (KaApplet* applet); -gboolean ka_grab_credentials(KaApplet* applet); -gboolean ka_check_credentials (KaApplet *applet, const char* principal); -gboolean ka_get_service_tickets(GtkListStore *tickets); -char* ka_unparse_name(void); -int ka_tgt_valid_seconds(void); -#endif - diff --git a/src/krb5-auth-dialog.schemas.in b/src/krb5-auth-dialog.schemas.in index f8c7348..bb59f8e 100644 --- a/src/krb5-auth-dialog.schemas.in +++ b/src/krb5-auth-dialog.schemas.in @@ -142,5 +142,18 @@ Notify user when ticket has expired + + + /schemas/apps/krb5-auth-dialog/plugins/enabled + /apps/krb5-auth-dialog/plugins/enabled + krb5-auth-dialog + list + string + + + Enabled plugins + List of plugins that should be loaded and activated on startup. + + diff --git a/src/krb5-auth-gconf-tools.c b/src/krb5-auth-gconf-tools.c deleted file mode 100644 index 01f4d39..0000000 --- a/src/krb5-auth-gconf-tools.c +++ /dev/null @@ -1,126 +0,0 @@ -/* Krb5 Auth Applet -- Acquire and release kerberos tickets - * - * (C) 2008,2009 Guido Guenther - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ -#include "config.h" - -#include -#include - -gboolean -ka_gconf_get_string (GConfClient* client, - const char* key, - char** value) -{ - GError* error = NULL; - gboolean success = FALSE; - GConfValue* gc_value; - - g_return_val_if_fail (client != NULL, FALSE); - g_return_val_if_fail (key != NULL, FALSE); - g_return_val_if_fail (*value == NULL, FALSE); - - if ((gc_value = gconf_client_get (client, key, &error))) { - if (gc_value->type == GCONF_VALUE_STRING) { - *value = g_strdup (gconf_value_get_string (gc_value)); - success = TRUE; - } else if (error) { - g_print ("%s", error->message); - g_error_free (error); - } - gconf_value_free (gc_value); - } - return success; -} - - -gboolean -ka_gconf_get_int (GConfClient* client, - const char* key, - int* value) -{ - GError* error = NULL; - gboolean success = FALSE; - GConfValue* gc_value; - - g_return_val_if_fail (client != NULL, FALSE); - g_return_val_if_fail (key != NULL, FALSE); - g_return_val_if_fail (value != NULL, FALSE); - - if ((gc_value = gconf_client_get (client, key, &error))) - { - if (gc_value->type == GCONF_VALUE_INT) { - *value = gconf_value_get_int (gc_value); - success = TRUE; - } else if (error) { - g_print ("%s", error->message); - g_error_free (error); - } - gconf_value_free (gc_value); - } - return success; -} - - -gboolean -ka_gconf_get_bool (GConfClient* client, - const char* key, - gboolean* value) -{ - GError* error = NULL; - gboolean success = FALSE; - GConfValue* gc_value; - - g_return_val_if_fail (client != NULL, FALSE); - g_return_val_if_fail (key != NULL, FALSE); - g_return_val_if_fail (value != NULL, FALSE); - - if ((gc_value = gconf_client_get (client, key, &error))) { - if (gc_value->type == GCONF_VALUE_BOOL) { - *value = gconf_value_get_bool (gc_value); - success = TRUE; - } else if (error) { - g_print ("%s", error->message); - g_error_free (error); - } - gconf_value_free (gc_value); - } - return success; -} - - -gboolean -ka_gconf_set_bool (GConfClient* client, - const char* key, - gboolean value) -{ - GError* error = NULL; - - g_return_val_if_fail (client != NULL, FALSE); - g_return_val_if_fail (key != NULL, FALSE); - - if(!gconf_client_set_bool (client, key, value, &error)) { - if (error) { - g_print ("%s", error->message); - g_error_free (error); - } - return FALSE; - } - return TRUE; -} - diff --git a/src/krb5-auth-gconf-tools.h b/src/krb5-auth-gconf-tools.h deleted file mode 100644 index 6d9f124..0000000 --- a/src/krb5-auth-gconf-tools.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Krb5 Auth Applet -- Acquire and release kerberos tickets - * - * (C) 2008,2009 Guido Guenther - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef KRB5_AUTH_GCONF_TOOLS_H -#define KRB5_AUTH_GCONF_TOOLS_H - -#include "config.h" - -#include - -#define KA_GCONF_PATH "/apps/" PACKAGE -#define KA_GCONF_KEY_PRINCIPAL KA_GCONF_PATH "/principal" -#define KA_GCONF_KEY_PK_USERID KA_GCONF_PATH "/pk_userid" -#define KA_GCONF_KEY_PK_ANCHORS KA_GCONF_PATH "/pk_anchors" -#define KA_GCONF_KEY_PROMPT_MINS KA_GCONF_PATH "/prompt_minutes" -#define KA_GCONF_KEY_SHOW_TRAYICON KA_GCONF_PATH "/show_trayicon" -#define KA_GCONF_KEY_FORWARDABLE KA_GCONF_PATH "/forwardable" -#define KA_GCONF_KEY_RENEWABLE KA_GCONF_PATH "/renewable" -#define KA_GCONF_KEY_PROXIABLE KA_GCONF_PATH "/proxiable" -#define KA_GCONF_KEY_NOTIFY_VALID KA_GCONF_PATH "/notify/valid" -#define KA_GCONF_KEY_NOTIFY_EXPIRED KA_GCONF_PATH "/notify/expired" -#define KA_GCONF_KEY_NOTIFY_EXPIRING KA_GCONF_PATH "/notify/expiring" - -gboolean ka_gconf_get_string (GConfClient* client, const char* key, char** value); -gboolean ka_gconf_get_int (GConfClient* client, const char* key, int* value); -gboolean ka_gconf_get_bool (GConfClient* client, const char* key, gboolean* value); -gboolean ka_gconf_set_bool (GConfClient* client, const char* key, gboolean value); - -#endif diff --git a/src/krb5-auth-gconf.c b/src/krb5-auth-gconf.c deleted file mode 100644 index 5b9df35..0000000 --- a/src/krb5-auth-gconf.c +++ /dev/null @@ -1,210 +0,0 @@ -/* Krb5 Auth Applet -- Acquire and release kerberos tickets - * - * (C) 2008,2009 Guido Guenther - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ -#include "config.h" - -#include -#include - -#include "krb5-auth-applet.h" -#include "krb5-auth-gconf-tools.h" -#include "krb5-auth-gconf.h" - -static gboolean -ka_gconf_set_principal (GConfClient* client, KaApplet* applet) -{ - gchar* principal = NULL; - - if(!ka_gconf_get_string (client, KA_GCONF_KEY_PRINCIPAL, &principal) - || !strlen(principal)) { - g_free (principal); - principal = g_strdup (g_get_user_name()); - } - g_object_set(applet, "principal", principal, NULL); - g_free (principal); - return TRUE; -} - - -static gboolean -ka_gconf_set_pk_userid (GConfClient* client, KaApplet* applet) -{ - gchar* pk_userid = NULL; - - if(!ka_gconf_get_string (client, KA_GCONF_KEY_PK_USERID, &pk_userid)) { - pk_userid = g_strdup (""); - } - g_object_set(applet, "pk_userid", pk_userid, NULL); - g_free (pk_userid); - return TRUE; -} - - -static gboolean -ka_gconf_set_pk_anchors (GConfClient* client, KaApplet* applet) -{ - gchar* pk_anchors = NULL; - - if(!ka_gconf_get_string (client, KA_GCONF_KEY_PK_ANCHORS, &pk_anchors)) { - pk_anchors = g_strdup (""); - } - g_object_set(applet, "pk_anchors", pk_anchors, NULL); - g_free (pk_anchors); - return TRUE; -} - - -static gboolean -ka_gconf_set_prompt_mins (GConfClient* client, KaApplet* applet) -{ - gint prompt_mins = 0; - - if(!ka_gconf_get_int (client, KA_GCONF_KEY_PROMPT_MINS, &prompt_mins)) { - prompt_mins = MINUTES_BEFORE_PROMPTING; - } - g_object_set(applet, "pw-prompt-mins", prompt_mins, NULL); - return TRUE; -} - - -static gboolean -ka_gconf_set_show_trayicon (GConfClient* client, KaApplet* applet) -{ - gboolean show_trayicon = TRUE; - - if(!ka_gconf_get_bool(client, KA_GCONF_KEY_SHOW_TRAYICON, &show_trayicon)) { - show_trayicon = TRUE; - } - g_object_set(applet, "show-trayicon", show_trayicon, NULL); - return TRUE; -} - - -static gboolean -ka_gconf_set_tgt_forwardable (GConfClient* client, KaApplet* applet) -{ - gboolean forwardable = FALSE; - - if(!ka_gconf_get_bool(client, KA_GCONF_KEY_FORWARDABLE, &forwardable)) { - forwardable = FALSE; - } - g_object_set(applet, "tgt-forwardable", forwardable, NULL); - return TRUE; -} - - -static gboolean -ka_gconf_set_tgt_renewable (GConfClient* client, KaApplet* applet) -{ - gboolean renewable = FALSE; - - if(!ka_gconf_get_bool(client, KA_GCONF_KEY_RENEWABLE, &renewable)) { - renewable = FALSE; - } - g_object_set(applet, "tgt-renewable", renewable, NULL); - return TRUE; -} - - -static gboolean -ka_gconf_set_tgt_proxiable (GConfClient* client, KaApplet* applet) -{ - gboolean proxiable = FALSE; - - if(!ka_gconf_get_bool(client, KA_GCONF_KEY_PROXIABLE, &proxiable)) { - proxiable = FALSE; - } - g_object_set(applet, "tgt-proxiable", proxiable, NULL); - return TRUE; -} - - -static void -ka_gconf_key_changed_callback (GConfClient* client, - guint cnxn_id G_GNUC_UNUSED, - GConfEntry* entry, - gpointer user_data) -{ - const char* key; - - KaApplet* applet = KA_APPLET(user_data); - key = gconf_entry_get_key (entry); - if (!key) - return; - KA_DEBUG("Key %s changed", key); - - if (g_strcmp0 (key, KA_GCONF_KEY_PRINCIPAL) == 0) { - ka_gconf_set_principal (client, applet); - } else if (g_strcmp0 (key, KA_GCONF_KEY_PROMPT_MINS) == 0) { - ka_gconf_set_prompt_mins (client, applet); - } else if (g_strcmp0 (key, KA_GCONF_KEY_SHOW_TRAYICON) == 0) { - ka_gconf_set_show_trayicon (client, applet); - } else if (g_strcmp0 (key, KA_GCONF_KEY_PK_USERID) == 0) { - ka_gconf_set_pk_userid (client, applet); - } else if (g_strcmp0 (key, KA_GCONF_KEY_PK_ANCHORS) == 0) { - ka_gconf_set_pk_anchors(client, applet); - } else if (g_strcmp0 (key, KA_GCONF_KEY_FORWARDABLE) == 0) { - ka_gconf_set_tgt_forwardable (client, applet); - } else if (g_strcmp0 (key, KA_GCONF_KEY_RENEWABLE) == 0) { - ka_gconf_set_tgt_renewable (client, applet); - } else if (g_strcmp0 (key, KA_GCONF_KEY_PROXIABLE) == 0) { - ka_gconf_set_tgt_proxiable (client, applet); - } else if (g_strcmp0 (key, KA_GCONF_KEY_NOTIFY_VALID) - || g_strcmp0 (key,KA_GCONF_KEY_NOTIFY_EXPIRING) - || g_strcmp0 (key,KA_GCONF_KEY_NOTIFY_EXPIRED)) { - /* nothing to do */ - } else - g_warning("Received notification for unknown gconf key %s", key); - return; -} - - -GConfClient* -ka_gconf_init (KaApplet* applet) -{ - GError *error = NULL; - GConfClient *client; - - client = gconf_client_get_default (); - gconf_client_add_dir (client, KA_GCONF_PATH, GCONF_CLIENT_PRELOAD_ONELEVEL, &error); - if (error) - goto out; - - gconf_client_notify_add (client, KA_GCONF_PATH, - ka_gconf_key_changed_callback, applet, NULL, &error); - if (error) - goto out; - - /* setup defaults */ - ka_gconf_set_principal (client, applet); - ka_gconf_set_prompt_mins (client, applet); - ka_gconf_set_show_trayicon (client, applet); - ka_gconf_set_pk_userid(client, applet); - ka_gconf_set_pk_anchors(client, applet); - ka_gconf_set_tgt_forwardable(client, applet); - ka_gconf_set_tgt_renewable(client, applet); - ka_gconf_set_tgt_proxiable(client, applet); -out: - if(error) { - client = NULL; - g_print ("%s", error->message); - g_error_free (error); - } - return client; -} diff --git a/src/krb5-auth-gconf.h b/src/krb5-auth-gconf.h deleted file mode 100644 index e4c3b5a..0000000 --- a/src/krb5-auth-gconf.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Krb5 Auth Applet -- Acquire and release kerberos tickets - * - * (C) 2008 Guido Guenther - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef KRB5_AUTH_GCONF_H -#define KRB5_AUTH_GCONF_H - -#include -#include "krb5-auth-applet.h" - -GConfClient* ka_gconf_init (KaApplet* applet); - -#endif diff --git a/src/krb5-auth-pwdialog.c b/src/krb5-auth-pwdialog.c deleted file mode 100644 index 54fc292..0000000 --- a/src/krb5-auth-pwdialog.c +++ /dev/null @@ -1,310 +0,0 @@ -/* Krb5 Auth Applet -- Acquire and release kerberos tickets - * - * (C) 2009 Guido Guenther - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -#include "config.h" - -#include - -#include "krb5-auth-applet.h" -#include "krb5-auth-dialog.h" -#include "krb5-auth-pwdialog.h" - -struct _KaPwDialog { - GObject parent; - - KaPwDialogPrivate *priv; -}; - -struct _KaPwDialogClass { - GObjectClass parent; -}; - -G_DEFINE_TYPE(KaPwDialog, ka_pwdialog, G_TYPE_OBJECT); - -struct _KaPwDialogPrivate -{ - /* The password dialog */ - GtkWidget* dialog; /* the password dialog itself */ - GtkWidget* status_label; /* the wrong password/timeout label */ - GtkWidget* krb_label; /* krb5 passwort prompt label */ - GtkWidget* pw_entry; /* password entry field */ - gboolean persist; /* don't hide the dialog when creds are still valid */ - gboolean grabbed; /* keyboard grabbed? */ - GtkWidget* error_dialog; /* error dialog */ -}; - - -static void -ka_pwdialog_init(KaPwDialog *pwdialog) -{ - pwdialog->priv = G_TYPE_INSTANCE_GET_PRIVATE(pwdialog, - KA_TYPE_PWDIALOG, - KaPwDialogPrivate); -} - -static void -ka_pwdialog_finalize(GObject *object) -{ - KaPwDialog* pwdialog = KA_PWDIALOG (object); - GObjectClass *parent_class = G_OBJECT_CLASS (ka_pwdialog_parent_class); - - gtk_widget_destroy (pwdialog->priv->error_dialog); - pwdialog->priv->error_dialog = NULL; - - if (parent_class->finalize != NULL) - parent_class->finalize (object); -} - -static void -ka_pwdialog_class_init(KaPwDialogClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS(klass); - - object_class->finalize = ka_pwdialog_finalize; - g_type_class_add_private(klass, sizeof(KaPwDialogPrivate)); - -} - -static KaPwDialog* -ka_pwdialog_new(void) -{ - return g_object_new (KA_TYPE_PWDIALOG, NULL); -} - - -static gboolean -grab_keyboard (GtkWidget *win, GdkEvent *event, gpointer data) -{ - KaPwDialog* pwdialog = KA_PWDIALOG(data); - - GdkGrabStatus status; - if (!pwdialog->priv->grabbed) { - status = gdk_keyboard_grab (win->window, FALSE, gdk_event_get_time (event)); - if (status == GDK_GRAB_SUCCESS) - pwdialog->priv->grabbed = TRUE; - else - g_message ("could not grab keyboard: %d", (int)status); - } - return FALSE; -} - - -static gboolean -ungrab_keyboard (GtkWidget *win G_GNUC_UNUSED, - GdkEvent *event, - gpointer data) -{ - KaPwDialog* pwdialog = KA_PWDIALOG(data); - - if (pwdialog->priv->grabbed) - gdk_keyboard_ungrab (gdk_event_get_time (event)); - pwdialog->priv->grabbed = FALSE; - return FALSE; -} - - -static gboolean -window_state_changed (GtkWidget *win, GdkEventWindowState *event, gpointer data) -{ - GdkWindowState state = gdk_window_get_state (win->window); - - if (state & GDK_WINDOW_STATE_WITHDRAWN || - state & GDK_WINDOW_STATE_ICONIFIED || - state & GDK_WINDOW_STATE_FULLSCREEN || - state & GDK_WINDOW_STATE_MAXIMIZED) - ungrab_keyboard (win, (GdkEvent*)event, data); - else - grab_keyboard (win, (GdkEvent*)event, data); - - return FALSE; -} - - -gint -ka_pwdialog_run(KaPwDialog* self) -{ - GtkWidget *dialog = self->priv->dialog; - - /* cleanup old error dialog, if present (e.g. user didn't acknowledge - * the error but clicked the tray icon again) */ - if (self->priv->error_dialog) - gtk_widget_hide (self->priv->error_dialog); - - /* make sure we pop up on top */ - gtk_window_set_keep_above (GTK_WINDOW (dialog), TRUE); - - /* - * grab the keyboard so that people don't accidentally type their - * passwords in other windows. - */ - g_signal_connect (dialog, "map-event", G_CALLBACK (grab_keyboard), self); - g_signal_connect (dialog, "unmap-event", G_CALLBACK (ungrab_keyboard), self); - g_signal_connect (dialog, "window-state-event", G_CALLBACK (window_state_changed), self); - - gtk_widget_grab_focus (self->priv->pw_entry); - gtk_widget_show(dialog); - return gtk_dialog_run (GTK_DIALOG(dialog)); -} - - -void -ka_pwdialog_error(KaPwDialog* self, const char *msg) -{ - GtkWidget *dialog = self->priv->error_dialog; - - gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), - _("Couldn't acquire kerberos ticket: '%s'"), - _(msg)); - gtk_widget_show (GTK_WIDGET(dialog)); - gtk_dialog_run (GTK_DIALOG(dialog)); - gtk_widget_hide(dialog); -} - - -void -ka_pwdialog_set_persist (KaPwDialog* pwdialog, gboolean persist) -{ - pwdialog->priv->persist = persist; -} - -void -ka_pwdialog_hide (const KaPwDialog* pwdialog, gboolean force) -{ - KA_DEBUG("PW Dialog persist: %d", pwdialog->priv->persist); - if (!pwdialog->priv->persist || force) - gtk_widget_hide(pwdialog->priv->dialog); -} - -const gchar* -ka_pwdialog_get_password(KaPwDialog *pwdialog) -{ - return gtk_secure_entry_get_text (GTK_SECURE_ENTRY (pwdialog->priv->pw_entry)); -} - -gboolean -ka_pwdialog_status_update (KaPwDialog* pwdialog) -{ - gchar *expiry_text; - gchar *expiry_markup; - int minutes_left = ka_tgt_valid_seconds() / 60; - - g_return_val_if_fail (pwdialog != NULL, FALSE); - if (minutes_left > 0) { - expiry_text = g_strdup_printf (ngettext("Your credentials expire in %d minute", - "Your credentials expire in %d minutes", - minutes_left), minutes_left); - } else { - expiry_text = g_strdup_printf ("%s", - _("Your credentials have expired")); - } - expiry_markup = g_strdup_printf ("%s", expiry_text); - gtk_label_set_markup (GTK_LABEL(pwdialog->priv->status_label), expiry_markup); - g_free (expiry_text); - g_free (expiry_markup); - - return TRUE; -} - -void -ka_pwdialog_setup (KaPwDialog* pwdialog, const gchar *krb5prompt, - gboolean invalid_auth) -{ - KaPwDialogPrivate *priv = pwdialog->priv; - gchar *wrong_markup = NULL; - GtkWidget *e; - gchar *prompt; - int pw4len; - - if (krb5prompt == NULL) { - prompt = g_strdup (_("Please enter your Kerberos password:")); - } else { - /* Kerberos's prompts are a mess, and basically impossible to - * translate. There's basically no way short of doing a lot of - * string parsing to translate them. The most common prompt is - * "Password for $uid:". We special case that one at least. We - * cannot do any of the fancier strings (like challenges), - * though. */ - pw4len = strlen ("Password for "); - if (strncmp (krb5prompt, "Password for ", pw4len) == 0) { - gchar *uid = (gchar *) (krb5prompt + pw4len); - prompt = g_strdup_printf (_("Please enter the password for '%s':"), uid); - } else { - prompt = g_strdup (krb5prompt); - } - } - - e = gtk_entry_new (); - gtk_secure_entry_set_invisible_char (GTK_SECURE_ENTRY (priv->pw_entry), - gtk_entry_get_invisible_char (GTK_ENTRY (e))); - gtk_widget_destroy (e); - - /* Clear the password entry field */ - gtk_secure_entry_set_text (GTK_SECURE_ENTRY (priv->pw_entry), ""); - - /* Use the prompt label that krb5 provides us */ - gtk_label_set_text (GTK_LABEL (priv->krb_label), prompt); - - /* Add our extra message hints */ - if (invalid_auth) { - wrong_markup = g_strdup_printf ("%s", - _("The password you entered is invalid")); - gtk_label_set_markup (GTK_LABEL (priv->status_label), wrong_markup); - } else - ka_pwdialog_status_update (pwdialog); - - g_free(wrong_markup); - g_free (prompt); -} - - -static GtkWidget* -ka_error_dialog_new(void) -{ - GtkWidget *dialog = gtk_message_dialog_new ( - NULL, GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, - _("%s Error"), KA_NAME); - gtk_window_set_title(GTK_WINDOW(dialog), _(KA_NAME)); - gtk_window_set_skip_taskbar_hint(GTK_WINDOW(dialog), FALSE); - return dialog; -} - - -KaPwDialog* -ka_pwdialog_create(GtkBuilder* xml) -{ - KaPwDialog *pwdialog = ka_pwdialog_new(); - KaPwDialogPrivate *priv = pwdialog->priv; - GtkWidget *entry_hbox = NULL; - - priv->dialog = GTK_WIDGET (gtk_builder_get_object (xml, "krb5_dialog")); - priv->status_label = GTK_WIDGET (gtk_builder_get_object (xml, "krb5_status_label")); - priv->krb_label = GTK_WIDGET (gtk_builder_get_object (xml, "krb5_message_label")); - priv->pw_entry = GTK_WIDGET (gtk_secure_entry_new ()); - priv->error_dialog = ka_error_dialog_new(); - - entry_hbox = GTK_WIDGET (gtk_builder_get_object (xml, "entry_hbox")); - gtk_container_add (GTK_CONTAINER (entry_hbox), priv->pw_entry); - gtk_secure_entry_set_activates_default (GTK_SECURE_ENTRY (priv->pw_entry), TRUE); - gtk_widget_show (priv->pw_entry); - - return pwdialog; -} - diff --git a/src/krb5-auth-pwdialog.h b/src/krb5-auth-pwdialog.h deleted file mode 100644 index a02d3fb..0000000 --- a/src/krb5-auth-pwdialog.h +++ /dev/null @@ -1,65 +0,0 @@ -/* Krb5 Auth Applet -- Acquire and release kerberos tickets - * - * (C) 2009 Guido Guenther - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef KRB5_AUTH_PWDIALOG_H -#define KRB5_AUTH_PWDIALOG_H - -#include -#include - -#include "config.h" -#include "gtksecentry.h" - -G_BEGIN_DECLS - -#define KA_TYPE_PWDIALOG (ka_pwdialog_get_type ()) -#define KA_PWDIALOG(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), KA_TYPE_PWDIALOG, KaPwDialog)) -#define KA_PWDIALOG_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), KA_TYPE_PWDIALOG, KaPwDialogClass)) -#define KA_IS_PWDIALOG(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), KA_TYPE_PWDIALOG)) -#define KA_IS_PWDIALOG_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), KA_TYPE_PWDIALOG)) -#define KA_PWDIALOG_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), KA_TYPE_PWDIALOG, KaPwDialogClass)) - -typedef struct _KaPwDialog KaPwDialog; -typedef struct _KaPwDialogClass KaPwDialogClass; -typedef struct _KaPwDialogPrivate KaPwDialogPrivate; - -GType ka_pwdialog_get_type (void); - -/* public functions */ -KaPwDialog* ka_pwdialog_create(GtkBuilder *xml); -/* setup everything for the next prompting */ -void ka_pwdialog_setup (KaPwDialog* pwdialog, const gchar *krb5prompt, - gboolean invalid_auth); -gint ka_pwdialog_run(KaPwDialog *pwdialog); -void ka_pwdialog_hide(const KaPwDialog *pwdialog, gboolean force); -void ka_pwdialog_set_persist(KaPwDialog *pwdialog, gboolean persist); -void ka_pwdialog_error (KaPwDialog *pwdialog, const char *msg); -/* update the expiry information in the status entry */ -gboolean ka_pwdialog_status_update (KaPwDialog *pwdialog); -const gchar* ka_pwdialog_get_password(KaPwDialog *dialog); - -G_END_DECLS - -#endif diff --git a/src/krb5-auth-tickets.c b/src/krb5-auth-tickets.c deleted file mode 100644 index 7c177a9..0000000 --- a/src/krb5-auth-tickets.c +++ /dev/null @@ -1,116 +0,0 @@ -/* Krb5 Auth Applet -- Acquire and release kerberos tickets - * - * (C) 2009 Guido Guenther - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -#include "config.h" - -#include -#include - -#include "krb5-auth-tickets.h" -#include "krb5-auth-dialog.h" - -static GtkListStore *tickets; -static GtkWidget *tickets_dialog; - -GtkWidget* -ka_tickets_dialog_create(GtkBuilder *xml) -{ - GtkCellRenderer *text_renderer, *toggle_renderer; - GtkTreeViewColumn *column; - GtkTreeView *tickets_view; - - tickets = gtk_list_store_new (N_COLUMNS, - G_TYPE_STRING, - G_TYPE_STRING, - G_TYPE_STRING, - G_TYPE_BOOLEAN, - G_TYPE_BOOLEAN, - G_TYPE_BOOLEAN); - - tickets_dialog = GTK_WIDGET (gtk_builder_get_object (xml, "krb5_tickets_dialog")); - tickets_view = GTK_TREE_VIEW (gtk_builder_get_object (xml, "krb5_tickets_treeview")); - gtk_tree_view_set_model(GTK_TREE_VIEW(tickets_view), GTK_TREE_MODEL(tickets)); - - text_renderer = gtk_cell_renderer_text_new(); - toggle_renderer = gtk_cell_renderer_toggle_new(); - - column = gtk_tree_view_column_new_with_attributes(_("Principal"), - text_renderer, - "text", - PRINCIPAL_COLUMN, - NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW (tickets_view), column); - column = gtk_tree_view_column_new_with_attributes(_("Start Time"), - text_renderer, - "text", - START_TIME_COLUMN, - NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW (tickets_view), column); - column = gtk_tree_view_column_new_with_attributes(_("End Time"), - text_renderer, - "markup", - END_TIME_COLUMN, - NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW (tickets_view), column); - column = gtk_tree_view_column_new_with_attributes(_("Fwd"), - toggle_renderer, - "active", - FORWARDABLE_COLUMN, - NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW (tickets_view), column); - column = gtk_tree_view_column_new_with_attributes(_("Proxy"), - toggle_renderer, - "active", - PROXIABLE_COLUMN, - NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW (tickets_view), column); - column = gtk_tree_view_column_new_with_attributes(_("Renew"), - toggle_renderer, - "active", - RENEWABLE_COLUMN, - NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW (tickets_view), column); - return tickets_dialog; -} - -void -ka_tickets_dialog_run() -{ - if (ka_get_service_tickets(tickets)) { - gtk_window_present(GTK_WINDOW(tickets_dialog)); - gtk_dialog_run(GTK_DIALOG(tickets_dialog)); - gtk_widget_hide(tickets_dialog); - } else { - GtkWidget *message_dialog; - - message_dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - _("Error displaying service ticket information")); - gtk_window_set_resizable (GTK_WINDOW (message_dialog), FALSE); - - g_signal_connect (message_dialog, "response", - G_CALLBACK (gtk_widget_destroy), - NULL); - gtk_widget_show (message_dialog); - } -} - diff --git a/src/krb5-auth-tickets.h b/src/krb5-auth-tickets.h deleted file mode 100644 index 02d67b3..0000000 --- a/src/krb5-auth-tickets.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Krb5 Auth Applet -- Acquire and release kerberos tickets - * - * (C) 2009 Guido Guenther - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef KRB5_AUTH_TICKETS_H -#define KRB5_AUTH_TICKETS_H - -enum ticket_columns { - PRINCIPAL_COLUMN, - START_TIME_COLUMN, - END_TIME_COLUMN, - FORWARDABLE_COLUMN, - RENEWABLE_COLUMN, - PROXIABLE_COLUMN, - N_COLUMNS -}; - - -GtkWidget* ka_tickets_dialog_create(GtkBuilder *xml); -void ka_tickets_dialog_run(void); - - -#endif diff --git a/src/krb5-auth-tools.c b/src/krb5-auth-tools.c deleted file mode 100644 index bd72afb..0000000 --- a/src/krb5-auth-tools.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2009 Guido Guenther - * - * 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 - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#include "config.h" - -#include -#include "krb5-auth-tools.h" - -void -ka_show_help (GdkScreen* screen, const char* chapter, GtkWindow* window) -{ - GError *error = NULL; - const char *section = ""; - char *url; - - if (chapter) - section = chapter; - - url = g_strdup_printf("ghelp:krb5-auth-dialog%s", section); - - gtk_show_uri (screen, url, gtk_get_current_event_time (), &error); - - if (error) { - GtkWidget *message_dialog; - - message_dialog = gtk_message_dialog_new (GTK_WINDOW (window), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - _("There was an error displaying help:\n%s"), - error->message); - gtk_window_set_resizable (GTK_WINDOW (message_dialog), FALSE); - - g_signal_connect (message_dialog, "response", - G_CALLBACK (gtk_widget_destroy), - NULL); - - gtk_widget_show (message_dialog); - g_error_free (error); - } - g_free (url); -} - diff --git a/src/krb5-auth-tools.h b/src/krb5-auth-tools.h deleted file mode 100644 index ef777e6..0000000 --- a/src/krb5-auth-tools.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Krb5 Auth Applet -- Acquire and release kerberos tickets - * - * (C) 2009 Guido Guenther - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef KRB5_AUTH_TOOLS -#define KRB5_AUTH_TOOLS - -#include - -G_BEGIN_DECLS - -void ka_show_help (GdkScreen* screen, const char* section, GtkWindow* window); - -G_END_DECLS - -#endif - -- cgit