diff options
author | Guido Günther <agx@sigxcpu.org> | 2010-05-04 07:51:21 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2010-05-04 07:51:21 +0200 |
commit | 29320e2db78ba6e6b56af39219b0ce213b77592b (patch) | |
tree | ab74eb3246190f92d2b7a3eb82aa73c7d5a8f67b /plugins | |
parent | Imported Upstream version 0.15 (diff) | |
download | krb5-auth-dialog-29320e2db78ba6e6b56af39219b0ce213b77592b.tar.gz krb5-auth-dialog-29320e2db78ba6e6b56af39219b0ce213b77592b.tar.bz2 krb5-auth-dialog-29320e2db78ba6e6b56af39219b0ce213b77592b.zip |
Imported Upstream version 0.16~rc1
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Makefile.am | 49 | ||||
-rw-r--r-- | plugins/Makefile.in | 679 | ||||
-rw-r--r-- | plugins/ka-plugin-dummy.c | 105 | ||||
-rw-r--r-- | plugins/ka-plugin-dummy.h | 57 | ||||
-rw-r--r-- | plugins/ka-plugin-pam.c | 128 | ||||
-rw-r--r-- | plugins/ka-plugin-pam.h | 59 |
6 files changed, 1077 insertions, 0 deletions
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 <agx@sigxcpu.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * 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 <gmodule.h> + +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 <agx@sigxcpu.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * 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 <agx@sigxcpu.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * 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 <gmodule.h> + +#include <security/pam_appl.h> + +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 <agx@sigxcpu.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * 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 <ka-plugin.h> + +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 */ |