diff options
Diffstat (limited to 'src/daemon')
63 files changed, 29702 insertions, 0 deletions
diff --git a/src/daemon/Makefile.am b/src/daemon/Makefile.am new file mode 100644 index 0000000..9d45622 --- /dev/null +++ b/src/daemon/Makefile.am @@ -0,0 +1,75 @@ +SUBDIRS = db dbus plugins +NULL= + +bin_PROGRAMS = gsignond + +BUILT_SOURCES = \ + gsignond-identity-enum-types.h \ + gsignond-identity-enum-types.c \ + $(NULL) + +gsignond-identity-enum-types.h: $(top_srcdir)/src/common/gsignond-enum.h.template gsignond-identity.h + $(GLIB_MKENUMS) --template $(top_srcdir)/src/common/gsignond-enum.h.template \ + --fhead "#ifndef GSIGNOND_IDENTITY_ENUM_TYPES_H_\n#define GSIGNOND_IDENTITY_ENUM_TYPES_H_\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS" \ + --identifier-prefix gsignond \ + --ftail "\nG_END_DECLS\n\n#endif\n" \ + gsignond-identity.h > $@ + +gsignond-identity-enum-types.c: $(top_srcdir)/src/common/gsignond-enum.c.template gsignond-identity.h + $(GLIB_MKENUMS) --template $(top_srcdir)/src/common/gsignond-enum.c.template \ + --fhead "#include \"gsignond-identity-enum-types.h\"\n" \ + --identifier-prefix gsignond \ + gsignond-identity.h > $@ + +gsignond_includedir = $(includedir)/gsignond +gsignond_pubhdr = ../../include/gsignond +gsignond_include_HEADERS = \ + $(gsignond_pubhdr)/gsignond-access-control-manager.h \ + $(gsignond_pubhdr)/gsignond-config-db.h \ + $(gsignond_pubhdr)/gsignond-config-dbus.h \ + $(gsignond_pubhdr)/gsignond-config-general.h \ + $(gsignond_pubhdr)/gsignond-config.h \ + $(gsignond_pubhdr)/gsignond-credentials.h \ + $(gsignond_pubhdr)/gsignond-dictionary.h \ + $(gsignond_pubhdr)/gsignond-error.h \ + $(gsignond_pubhdr)/gsignond-extension-interface.h \ + $(gsignond_pubhdr)/gsignond-identity-info.h \ + $(gsignond_pubhdr)/gsignond-log.h \ + $(gsignond_pubhdr)/gsignond-plugin-interface.h \ + $(gsignond_pubhdr)/gsignond-secret-storage.h \ + $(gsignond_pubhdr)/gsignond-security-context.h \ + $(gsignond_pubhdr)/gsignond-session-data.h \ + $(gsignond_pubhdr)/gsignond-signonui-data.h \ + $(gsignond_pubhdr)/gsignond-signonui.h \ + $(gsignond_pubhdr)/gsignond-storage-manager.h \ + $(gsignond_pubhdr)/gsignond-utils.h + +gsignond_SOURCES = \ + main.c \ + gsignond-auth-session.c \ + gsignond-auth-session.h \ + gsignond-daemon.c \ + gsignond-daemon.h \ + gsignond-identity.c \ + gsignond-identity.h \ + gsignond-signonui-proxy.c \ + gsignond-signonui-proxy.h \ + gsignond-types.h \ + $(BUILT_SOURCES) \ + $(NULL) + +gsignond_CFLAGS = \ + -I$(top_builddir) \ + -I$(top_srcdir)/include/ \ + -I$(top_srcdir)/src/ \ + $(GSIGNOND_CFLAGS) \ + $(NULL) + +gsignond_LDADD = \ + $(top_builddir)/src/common/libgsignond-common.la \ + $(top_builddir)/src/daemon/db/libgsignond-db.la \ + $(top_builddir)/src/daemon/dbus/libgsignond-dbus.la \ + $(top_builddir)/src/daemon/plugins/libgsignond-plugins.la \ + $(GSIGNOND_LIBS) \ + $(NULL) + diff --git a/src/daemon/Makefile.in b/src/daemon/Makefile.in new file mode 100644 index 0000000..1076c86 --- /dev/null +++ b/src/daemon/Makefile.in @@ -0,0 +1,941 @@ +# Makefile.in generated by automake 1.11.3 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ +pkglibdir = $(libdir)/@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@ +bin_PROGRAMS = gsignond$(EXEEXT) +subdir = src/daemon +DIST_COMMON = $(gsignond_include_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_gnu_make.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" \ + "$(DESTDIR)$(gsignond_includedir)" +PROGRAMS = $(bin_PROGRAMS) +am__objects_1 = +am__objects_2 = gsignond-gsignond-identity-enum-types.$(OBJEXT) \ + $(am__objects_1) +am_gsignond_OBJECTS = gsignond-main.$(OBJEXT) \ + gsignond-gsignond-auth-session.$(OBJEXT) \ + gsignond-gsignond-daemon.$(OBJEXT) \ + gsignond-gsignond-identity.$(OBJEXT) \ + gsignond-gsignond-signonui-proxy.$(OBJEXT) $(am__objects_2) \ + $(am__objects_1) +gsignond_OBJECTS = $(am_gsignond_OBJECTS) +am__DEPENDENCIES_1 = +gsignond_DEPENDENCIES = \ + $(top_builddir)/src/common/libgsignond-common.la \ + $(top_builddir)/src/daemon/db/libgsignond-db.la \ + $(top_builddir)/src/daemon/dbus/libgsignond-dbus.la \ + $(top_builddir)/src/daemon/plugins/libgsignond-plugins.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +gsignond_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(gsignond_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = +depcomp = $(SHELL) $(top_srcdir)/build-aux/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_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +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_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = $(gsignond_SOURCES) +DIST_SOURCES = $(gsignond_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +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__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +HEADERS = $(gsignond_include_HEADERS) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHECK_CFLAGS = @CHECK_CFLAGS@ +CHECK_LIBS = @CHECK_LIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBUS_INTERFACES_DIR = @DBUS_INTERFACES_DIR@ +DBUS_SERVICES_DIR = @DBUS_SERVICES_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GREP = @GREP@ +GSIGNOND_CFLAGS = @GSIGNOND_CFLAGS@ +GSIGNOND_LIBS = @GSIGNOND_LIBS@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GTestDBus_CFLAGS = @GTestDBus_CFLAGS@ +GTestDBus_LIBS = @GTestDBus_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBECRYPTFS_CFLAGS = @LIBECRYPTFS_CFLAGS@ +LIBECRYPTFS_LIBS = @LIBECRYPTFS_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSMACK_CFLAGS = @LIBSMACK_CFLAGS@ +LIBSMACK_LIBS = @LIBSMACK_LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MESSAGE_BUS_TYPE = @MESSAGE_BUS_TYPE@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +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@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +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@ +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@ +ifGNUmake = @ifGNUmake@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +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@ +SUBDIRS = db dbus plugins +NULL = +BUILT_SOURCES = \ + gsignond-identity-enum-types.h \ + gsignond-identity-enum-types.c \ + $(NULL) + +gsignond_includedir = $(includedir)/gsignond +gsignond_pubhdr = ../../include/gsignond +gsignond_include_HEADERS = \ + $(gsignond_pubhdr)/gsignond-access-control-manager.h \ + $(gsignond_pubhdr)/gsignond-config-db.h \ + $(gsignond_pubhdr)/gsignond-config-dbus.h \ + $(gsignond_pubhdr)/gsignond-config-general.h \ + $(gsignond_pubhdr)/gsignond-config.h \ + $(gsignond_pubhdr)/gsignond-credentials.h \ + $(gsignond_pubhdr)/gsignond-dictionary.h \ + $(gsignond_pubhdr)/gsignond-error.h \ + $(gsignond_pubhdr)/gsignond-extension-interface.h \ + $(gsignond_pubhdr)/gsignond-identity-info.h \ + $(gsignond_pubhdr)/gsignond-log.h \ + $(gsignond_pubhdr)/gsignond-plugin-interface.h \ + $(gsignond_pubhdr)/gsignond-secret-storage.h \ + $(gsignond_pubhdr)/gsignond-security-context.h \ + $(gsignond_pubhdr)/gsignond-session-data.h \ + $(gsignond_pubhdr)/gsignond-signonui-data.h \ + $(gsignond_pubhdr)/gsignond-signonui.h \ + $(gsignond_pubhdr)/gsignond-storage-manager.h \ + $(gsignond_pubhdr)/gsignond-utils.h + +gsignond_SOURCES = \ + main.c \ + gsignond-auth-session.c \ + gsignond-auth-session.h \ + gsignond-daemon.c \ + gsignond-daemon.h \ + gsignond-identity.c \ + gsignond-identity.h \ + gsignond-signonui-proxy.c \ + gsignond-signonui-proxy.h \ + gsignond-types.h \ + $(BUILT_SOURCES) \ + $(NULL) + +gsignond_CFLAGS = \ + -I$(top_builddir) \ + -I$(top_srcdir)/include/ \ + -I$(top_srcdir)/src/ \ + $(GSIGNOND_CFLAGS) \ + $(NULL) + +gsignond_LDADD = \ + $(top_builddir)/src/common/libgsignond-common.la \ + $(top_builddir)/src/daemon/db/libgsignond-db.la \ + $(top_builddir)/src/daemon/dbus/libgsignond-dbus.la \ + $(top_builddir)/src/daemon/plugins/libgsignond-plugins.la \ + $(GSIGNOND_LIBS) \ + $(NULL) + +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(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 src/daemon/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/daemon/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: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +gsignond$(EXEEXT): $(gsignond_OBJECTS) $(gsignond_DEPENDENCIES) $(EXTRA_gsignond_DEPENDENCIES) + @rm -f gsignond$(EXEEXT) + $(AM_V_CCLD)$(gsignond_LINK) $(gsignond_OBJECTS) $(gsignond_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsignond-gsignond-auth-session.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsignond-gsignond-daemon.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsignond-gsignond-identity-enum-types.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsignond-gsignond-identity.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsignond-gsignond-signonui-proxy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsignond-main.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +gsignond-main.o: main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_CFLAGS) $(CFLAGS) -MT gsignond-main.o -MD -MP -MF $(DEPDIR)/gsignond-main.Tpo -c -o gsignond-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gsignond-main.Tpo $(DEPDIR)/gsignond-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='gsignond-main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_CFLAGS) $(CFLAGS) -c -o gsignond-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c + +gsignond-main.obj: main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_CFLAGS) $(CFLAGS) -MT gsignond-main.obj -MD -MP -MF $(DEPDIR)/gsignond-main.Tpo -c -o gsignond-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gsignond-main.Tpo $(DEPDIR)/gsignond-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='gsignond-main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_CFLAGS) $(CFLAGS) -c -o gsignond-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` + +gsignond-gsignond-auth-session.o: gsignond-auth-session.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_CFLAGS) $(CFLAGS) -MT gsignond-gsignond-auth-session.o -MD -MP -MF $(DEPDIR)/gsignond-gsignond-auth-session.Tpo -c -o gsignond-gsignond-auth-session.o `test -f 'gsignond-auth-session.c' || echo '$(srcdir)/'`gsignond-auth-session.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gsignond-gsignond-auth-session.Tpo $(DEPDIR)/gsignond-gsignond-auth-session.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-auth-session.c' object='gsignond-gsignond-auth-session.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_CFLAGS) $(CFLAGS) -c -o gsignond-gsignond-auth-session.o `test -f 'gsignond-auth-session.c' || echo '$(srcdir)/'`gsignond-auth-session.c + +gsignond-gsignond-auth-session.obj: gsignond-auth-session.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_CFLAGS) $(CFLAGS) -MT gsignond-gsignond-auth-session.obj -MD -MP -MF $(DEPDIR)/gsignond-gsignond-auth-session.Tpo -c -o gsignond-gsignond-auth-session.obj `if test -f 'gsignond-auth-session.c'; then $(CYGPATH_W) 'gsignond-auth-session.c'; else $(CYGPATH_W) '$(srcdir)/gsignond-auth-session.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gsignond-gsignond-auth-session.Tpo $(DEPDIR)/gsignond-gsignond-auth-session.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-auth-session.c' object='gsignond-gsignond-auth-session.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_CFLAGS) $(CFLAGS) -c -o gsignond-gsignond-auth-session.obj `if test -f 'gsignond-auth-session.c'; then $(CYGPATH_W) 'gsignond-auth-session.c'; else $(CYGPATH_W) '$(srcdir)/gsignond-auth-session.c'; fi` + +gsignond-gsignond-daemon.o: gsignond-daemon.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_CFLAGS) $(CFLAGS) -MT gsignond-gsignond-daemon.o -MD -MP -MF $(DEPDIR)/gsignond-gsignond-daemon.Tpo -c -o gsignond-gsignond-daemon.o `test -f 'gsignond-daemon.c' || echo '$(srcdir)/'`gsignond-daemon.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gsignond-gsignond-daemon.Tpo $(DEPDIR)/gsignond-gsignond-daemon.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-daemon.c' object='gsignond-gsignond-daemon.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_CFLAGS) $(CFLAGS) -c -o gsignond-gsignond-daemon.o `test -f 'gsignond-daemon.c' || echo '$(srcdir)/'`gsignond-daemon.c + +gsignond-gsignond-daemon.obj: gsignond-daemon.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_CFLAGS) $(CFLAGS) -MT gsignond-gsignond-daemon.obj -MD -MP -MF $(DEPDIR)/gsignond-gsignond-daemon.Tpo -c -o gsignond-gsignond-daemon.obj `if test -f 'gsignond-daemon.c'; then $(CYGPATH_W) 'gsignond-daemon.c'; else $(CYGPATH_W) '$(srcdir)/gsignond-daemon.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gsignond-gsignond-daemon.Tpo $(DEPDIR)/gsignond-gsignond-daemon.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-daemon.c' object='gsignond-gsignond-daemon.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_CFLAGS) $(CFLAGS) -c -o gsignond-gsignond-daemon.obj `if test -f 'gsignond-daemon.c'; then $(CYGPATH_W) 'gsignond-daemon.c'; else $(CYGPATH_W) '$(srcdir)/gsignond-daemon.c'; fi` + +gsignond-gsignond-identity.o: gsignond-identity.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_CFLAGS) $(CFLAGS) -MT gsignond-gsignond-identity.o -MD -MP -MF $(DEPDIR)/gsignond-gsignond-identity.Tpo -c -o gsignond-gsignond-identity.o `test -f 'gsignond-identity.c' || echo '$(srcdir)/'`gsignond-identity.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gsignond-gsignond-identity.Tpo $(DEPDIR)/gsignond-gsignond-identity.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-identity.c' object='gsignond-gsignond-identity.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_CFLAGS) $(CFLAGS) -c -o gsignond-gsignond-identity.o `test -f 'gsignond-identity.c' || echo '$(srcdir)/'`gsignond-identity.c + +gsignond-gsignond-identity.obj: gsignond-identity.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_CFLAGS) $(CFLAGS) -MT gsignond-gsignond-identity.obj -MD -MP -MF $(DEPDIR)/gsignond-gsignond-identity.Tpo -c -o gsignond-gsignond-identity.obj `if test -f 'gsignond-identity.c'; then $(CYGPATH_W) 'gsignond-identity.c'; else $(CYGPATH_W) '$(srcdir)/gsignond-identity.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gsignond-gsignond-identity.Tpo $(DEPDIR)/gsignond-gsignond-identity.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-identity.c' object='gsignond-gsignond-identity.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_CFLAGS) $(CFLAGS) -c -o gsignond-gsignond-identity.obj `if test -f 'gsignond-identity.c'; then $(CYGPATH_W) 'gsignond-identity.c'; else $(CYGPATH_W) '$(srcdir)/gsignond-identity.c'; fi` + +gsignond-gsignond-signonui-proxy.o: gsignond-signonui-proxy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_CFLAGS) $(CFLAGS) -MT gsignond-gsignond-signonui-proxy.o -MD -MP -MF $(DEPDIR)/gsignond-gsignond-signonui-proxy.Tpo -c -o gsignond-gsignond-signonui-proxy.o `test -f 'gsignond-signonui-proxy.c' || echo '$(srcdir)/'`gsignond-signonui-proxy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gsignond-gsignond-signonui-proxy.Tpo $(DEPDIR)/gsignond-gsignond-signonui-proxy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-signonui-proxy.c' object='gsignond-gsignond-signonui-proxy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_CFLAGS) $(CFLAGS) -c -o gsignond-gsignond-signonui-proxy.o `test -f 'gsignond-signonui-proxy.c' || echo '$(srcdir)/'`gsignond-signonui-proxy.c + +gsignond-gsignond-signonui-proxy.obj: gsignond-signonui-proxy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_CFLAGS) $(CFLAGS) -MT gsignond-gsignond-signonui-proxy.obj -MD -MP -MF $(DEPDIR)/gsignond-gsignond-signonui-proxy.Tpo -c -o gsignond-gsignond-signonui-proxy.obj `if test -f 'gsignond-signonui-proxy.c'; then $(CYGPATH_W) 'gsignond-signonui-proxy.c'; else $(CYGPATH_W) '$(srcdir)/gsignond-signonui-proxy.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gsignond-gsignond-signonui-proxy.Tpo $(DEPDIR)/gsignond-gsignond-signonui-proxy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-signonui-proxy.c' object='gsignond-gsignond-signonui-proxy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_CFLAGS) $(CFLAGS) -c -o gsignond-gsignond-signonui-proxy.obj `if test -f 'gsignond-signonui-proxy.c'; then $(CYGPATH_W) 'gsignond-signonui-proxy.c'; else $(CYGPATH_W) '$(srcdir)/gsignond-signonui-proxy.c'; fi` + +gsignond-gsignond-identity-enum-types.o: gsignond-identity-enum-types.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_CFLAGS) $(CFLAGS) -MT gsignond-gsignond-identity-enum-types.o -MD -MP -MF $(DEPDIR)/gsignond-gsignond-identity-enum-types.Tpo -c -o gsignond-gsignond-identity-enum-types.o `test -f 'gsignond-identity-enum-types.c' || echo '$(srcdir)/'`gsignond-identity-enum-types.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gsignond-gsignond-identity-enum-types.Tpo $(DEPDIR)/gsignond-gsignond-identity-enum-types.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-identity-enum-types.c' object='gsignond-gsignond-identity-enum-types.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_CFLAGS) $(CFLAGS) -c -o gsignond-gsignond-identity-enum-types.o `test -f 'gsignond-identity-enum-types.c' || echo '$(srcdir)/'`gsignond-identity-enum-types.c + +gsignond-gsignond-identity-enum-types.obj: gsignond-identity-enum-types.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_CFLAGS) $(CFLAGS) -MT gsignond-gsignond-identity-enum-types.obj -MD -MP -MF $(DEPDIR)/gsignond-gsignond-identity-enum-types.Tpo -c -o gsignond-gsignond-identity-enum-types.obj `if test -f 'gsignond-identity-enum-types.c'; then $(CYGPATH_W) 'gsignond-identity-enum-types.c'; else $(CYGPATH_W) '$(srcdir)/gsignond-identity-enum-types.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gsignond-gsignond-identity-enum-types.Tpo $(DEPDIR)/gsignond-gsignond-identity-enum-types.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-identity-enum-types.c' object='gsignond-gsignond-identity-enum-types.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_CFLAGS) $(CFLAGS) -c -o gsignond-gsignond-identity-enum-types.obj `if test -f 'gsignond-identity-enum-types.c'; then $(CYGPATH_W) 'gsignond-identity-enum-types.c'; else $(CYGPATH_W) '$(srcdir)/gsignond-identity-enum-types.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-gsignond_includeHEADERS: $(gsignond_include_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(gsignond_includedir)" || $(MKDIR_P) "$(DESTDIR)$(gsignond_includedir)" + @list='$(gsignond_include_HEADERS)'; test -n "$(gsignond_includedir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(gsignond_includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(gsignond_includedir)" || exit $$?; \ + done + +uninstall-gsignond_includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(gsignond_include_HEADERS)'; test -n "$(gsignond_includedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(gsignond_includedir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +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: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + 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: ctags-recursive $(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 + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-recursive +all-am: Makefile $(PROGRAMS) $(HEADERS) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(gsignond_includedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +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." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-recursive + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-gsignond_includeHEADERS + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-gsignond_includeHEADERS + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ + ctags-recursive install install-am install-strip \ + tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool ctags ctags-recursive distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-binPROGRAMS install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-gsignond_includeHEADERS install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-binPROGRAMS \ + uninstall-gsignond_includeHEADERS + + +gsignond-identity-enum-types.h: $(top_srcdir)/src/common/gsignond-enum.h.template gsignond-identity.h + $(GLIB_MKENUMS) --template $(top_srcdir)/src/common/gsignond-enum.h.template \ + --fhead "#ifndef GSIGNOND_IDENTITY_ENUM_TYPES_H_\n#define GSIGNOND_IDENTITY_ENUM_TYPES_H_\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS" \ + --identifier-prefix gsignond \ + --ftail "\nG_END_DECLS\n\n#endif\n" \ + gsignond-identity.h > $@ + +gsignond-identity-enum-types.c: $(top_srcdir)/src/common/gsignond-enum.c.template gsignond-identity.h + $(GLIB_MKENUMS) --template $(top_srcdir)/src/common/gsignond-enum.c.template \ + --fhead "#include \"gsignond-identity-enum-types.h\"\n" \ + --identifier-prefix gsignond \ + gsignond-identity.h > $@ + +# 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/src/daemon/db/Makefile.am b/src/daemon/db/Makefile.am new file mode 100644 index 0000000..3bb7fac --- /dev/null +++ b/src/daemon/db/Makefile.am @@ -0,0 +1,19 @@ +lib_LTLIBRARIES = libgsignond-db.la + +libgsignond_db_la_CPPFLAGS = \ + -I$(top_builddir) \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/include \ + $(GSIGNOND_CFLAGS) + +libgsignond_db_la_LIBADD = \ + $(top_builddir)/src/common/libgsignond-common.la \ + $(GSIGNOND_LIBS) + +libgsignond_db_la_SOURCES = \ + gsignond-db-credentials-database.h \ + gsignond-db-credentials-database.c \ + gsignond-db-metadata-database.h \ + gsignond-db-metadata-database.c + +CLEANFILES = diff --git a/src/daemon/db/Makefile.in b/src/daemon/db/Makefile.in new file mode 100644 index 0000000..b876238 --- /dev/null +++ b/src/daemon/db/Makefile.in @@ -0,0 +1,608 @@ +# Makefile.in generated by automake 1.11.3 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ +pkglibdir = $(libdir)/@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 = src/daemon/db +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_gnu_make.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +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__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libgsignond_db_la_DEPENDENCIES = \ + $(top_builddir)/src/common/libgsignond-common.la \ + $(am__DEPENDENCIES_1) +am_libgsignond_db_la_OBJECTS = \ + libgsignond_db_la-gsignond-db-credentials-database.lo \ + libgsignond_db_la-gsignond-db-metadata-database.lo +libgsignond_db_la_OBJECTS = $(am_libgsignond_db_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +DEFAULT_INCLUDES = +depcomp = $(SHELL) $(top_srcdir)/build-aux/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_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +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_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = $(libgsignond_db_la_SOURCES) +DIST_SOURCES = $(libgsignond_db_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHECK_CFLAGS = @CHECK_CFLAGS@ +CHECK_LIBS = @CHECK_LIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBUS_INTERFACES_DIR = @DBUS_INTERFACES_DIR@ +DBUS_SERVICES_DIR = @DBUS_SERVICES_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GREP = @GREP@ +GSIGNOND_CFLAGS = @GSIGNOND_CFLAGS@ +GSIGNOND_LIBS = @GSIGNOND_LIBS@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GTestDBus_CFLAGS = @GTestDBus_CFLAGS@ +GTestDBus_LIBS = @GTestDBus_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBECRYPTFS_CFLAGS = @LIBECRYPTFS_CFLAGS@ +LIBECRYPTFS_LIBS = @LIBECRYPTFS_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSMACK_CFLAGS = @LIBSMACK_CFLAGS@ +LIBSMACK_LIBS = @LIBSMACK_LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MESSAGE_BUS_TYPE = @MESSAGE_BUS_TYPE@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +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@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +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@ +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@ +ifGNUmake = @ifGNUmake@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +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@ +lib_LTLIBRARIES = libgsignond-db.la +libgsignond_db_la_CPPFLAGS = \ + -I$(top_builddir) \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/include \ + $(GSIGNOND_CFLAGS) + +libgsignond_db_la_LIBADD = \ + $(top_builddir)/src/common/libgsignond-common.la \ + $(GSIGNOND_LIBS) + +libgsignond_db_la_SOURCES = \ + gsignond-db-credentials-database.h \ + gsignond-db-credentials-database.c \ + gsignond-db-metadata-database.h \ + gsignond-db-metadata-database.c + +CLEANFILES = +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(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 src/daemon/db/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/daemon/db/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: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || 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)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_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 +libgsignond-db.la: $(libgsignond_db_la_OBJECTS) $(libgsignond_db_la_DEPENDENCIES) $(EXTRA_libgsignond_db_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) -rpath $(libdir) $(libgsignond_db_la_OBJECTS) $(libgsignond_db_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignond_db_la-gsignond-db-credentials-database.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignond_db_la-gsignond-db-metadata-database.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +libgsignond_db_la-gsignond-db-credentials-database.lo: gsignond-db-credentials-database.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_db_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgsignond_db_la-gsignond-db-credentials-database.lo -MD -MP -MF $(DEPDIR)/libgsignond_db_la-gsignond-db-credentials-database.Tpo -c -o libgsignond_db_la-gsignond-db-credentials-database.lo `test -f 'gsignond-db-credentials-database.c' || echo '$(srcdir)/'`gsignond-db-credentials-database.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgsignond_db_la-gsignond-db-credentials-database.Tpo $(DEPDIR)/libgsignond_db_la-gsignond-db-credentials-database.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-db-credentials-database.c' object='libgsignond_db_la-gsignond-db-credentials-database.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_db_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgsignond_db_la-gsignond-db-credentials-database.lo `test -f 'gsignond-db-credentials-database.c' || echo '$(srcdir)/'`gsignond-db-credentials-database.c + +libgsignond_db_la-gsignond-db-metadata-database.lo: gsignond-db-metadata-database.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_db_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgsignond_db_la-gsignond-db-metadata-database.lo -MD -MP -MF $(DEPDIR)/libgsignond_db_la-gsignond-db-metadata-database.Tpo -c -o libgsignond_db_la-gsignond-db-metadata-database.lo `test -f 'gsignond-db-metadata-database.c' || echo '$(srcdir)/'`gsignond-db-metadata-database.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgsignond_db_la-gsignond-db-metadata-database.Tpo $(DEPDIR)/libgsignond_db_la-gsignond-db-metadata-database.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-db-metadata-database.c' object='libgsignond_db_la-gsignond-db-metadata-database.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_db_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgsignond_db_la-gsignond-db-metadata-database.lo `test -f 'gsignond-db-metadata-database.c' || echo '$(srcdir)/'`gsignond-db-metadata-database.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)$(libdir)"; 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: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +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-libLTLIBRARIES clean-libtool \ + 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-libLTLIBRARIES + +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-libLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool 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-libLTLIBRARIES install-man install-pdf install-pdf-am \ + 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-libLTLIBRARIES + + +# 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/src/daemon/db/gsignond-db-credentials-database.c b/src/daemon/db/gsignond-db-credentials-database.c new file mode 100644 index 0000000..a72a629 --- /dev/null +++ b/src/daemon/db/gsignond-db-credentials-database.c @@ -0,0 +1,796 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2012 Intel Corporation. + * + * Contact: Imran Zaman <imran.zaman@linux.intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ +#include <string.h> + +#include "gsignond/gsignond-log.h" +#include "gsignond/gsignond-credentials.h" +#include "common/db/gsignond-db-error.h" +#include "gsignond-db-credentials-database.h" + +#define GSIGNOND_DB_CREDENTIALS_DATABASE_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj),\ + GSIGNOND_DB_TYPE_CREDENTIALS_DATABASE, \ + GSignondDbCredentialsDatabasePrivate)) + +G_DEFINE_TYPE (GSignondDbCredentialsDatabase, gsignond_db_credentials_database, + G_TYPE_OBJECT); + +struct _GSignondDbCredentialsDatabasePrivate +{ + GSignondDbMetadataDatabase *metadata_db; +}; + +enum +{ + PROP_0, + PROP_CONFIG, + PROP_STORAGE, + N_PROPERTIES +}; + +static GParamSpec *properties[N_PROPERTIES] = { NULL, }; + +static void +_set_property (GObject *object, guint prop_id, const GValue *value, + GParamSpec *pspec) +{ + GSignondDbCredentialsDatabase *self = + GSIGNOND_DB_CREDENTIALS_DATABASE (object); + + switch (prop_id) { + case PROP_CONFIG: + g_assert (self->config == NULL); + self->config = g_value_dup_object (value); + break; + case PROP_STORAGE: + g_assert (self->secret_storage == NULL); + self->secret_storage = g_value_dup_object (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + } +} + +static void +_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +{ + GSignondDbCredentialsDatabase *self = + GSIGNOND_DB_CREDENTIALS_DATABASE (object); + + switch (prop_id) { + case PROP_CONFIG: + g_value_set_object (value, self->config); + break; + case PROP_STORAGE: + g_value_set_object (value, self->secret_storage); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + } +} + +static void +_gsignond_db_credentials_database_dispose (GObject *gobject) +{ + g_return_if_fail (GSIGNOND_DB_IS_CREDENTIALS_DATABASE (gobject)); + GSignondDbCredentialsDatabase *self = + GSIGNOND_DB_CREDENTIALS_DATABASE (gobject); + + if (self->config) { + g_object_unref (self->config); + self->config = NULL; + } + if (self->secret_storage) { + g_object_unref (self->secret_storage); + self->secret_storage = NULL; + } + if (self->priv->metadata_db) { + g_object_unref (self->priv->metadata_db); + self->priv->metadata_db = NULL; + } + G_OBJECT_CLASS (gsignond_db_credentials_database_parent_class)->dispose ( + gobject); +} + +static void +gsignond_db_credentials_database_class_init ( + GSignondDbCredentialsDatabaseClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->set_property = _set_property; + gobject_class->get_property = _get_property; + gobject_class->dispose = _gsignond_db_credentials_database_dispose; + + properties[PROP_CONFIG] = g_param_spec_object ( + "config", + "config", + "Configuration object", + GSIGNOND_TYPE_CONFIG, + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS); + properties[PROP_STORAGE] = g_param_spec_object ( + "storage", + "storage", + "Secure Storage object", + GSIGNOND_TYPE_SECRET_STORAGE, + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS); + g_object_class_install_properties (gobject_class, N_PROPERTIES, properties); + + g_type_class_add_private (klass, + sizeof (GSignondDbCredentialsDatabasePrivate)); +} + +static void +gsignond_db_credentials_database_init ( + GSignondDbCredentialsDatabase *self) +{ + self->priv = GSIGNOND_DB_CREDENTIALS_DATABASE_GET_PRIVATE (self); + self->config = NULL; + self->secret_storage = NULL; + self->priv->metadata_db = NULL; +} + +/** + * gsignond_db_credentials_database_new: + * + * @config: (transfer none) the #GSignondConfig object + * @storage: (transfer none) the #GSignondSecretStorage object + * + * Creates new #GSignondDbCredentialsDatabase object + * + * Returns: (transfer full) the #GSignondDbCredentialsDatabase object + */ +GSignondDbCredentialsDatabase * +gsignond_db_credentials_database_new ( + GSignondConfig *config, + GSignondSecretStorage *storage) +{ + + GSignondDbCredentialsDatabase *self = NULL; + self = GSIGNOND_DB_CREDENTIALS_DATABASE ( + g_object_new (GSIGNOND_DB_TYPE_CREDENTIALS_DATABASE, + "config", + config, + "storage", + storage, + NULL)); + if (self) { + self->priv->metadata_db = gsignond_db_metadata_database_new ( + self->config); + if (self->priv->metadata_db) { + gsignond_db_metadata_database_open (self->priv->metadata_db); + } + } + return self; +} + +/** + * gsignond_db_credentials_database_open_secret_storage: + * + * @self: instance of #GSignondDbCredentialsDatabase + * + * Opens (and initializes) secret storage. + * + * Returns: TRUE if successful, FALSE otherwise. + */ +gboolean +gsignond_db_credentials_database_open_secret_storage ( + GSignondDbCredentialsDatabase *self) +{ + g_return_val_if_fail (GSIGNOND_DB_IS_CREDENTIALS_DATABASE (self), FALSE); + g_return_val_if_fail (self->secret_storage != NULL, FALSE); + + return gsignond_secret_storage_open_db (self->secret_storage); +} + +/** + * gsignond_db_credentials_database_close_secret_storage: + * + * @self: instance of #GSignondDbCredentialsDatabase + * + * Closes the secret storage. + * + * Returns: TRUE if successful, FALSE otherwise. + */ +gboolean +gsignond_db_credentials_database_close_secret_storage ( + GSignondDbCredentialsDatabase *self) +{ + g_return_val_if_fail (GSIGNOND_DB_IS_CREDENTIALS_DATABASE (self), FALSE); + g_return_val_if_fail (self->secret_storage != NULL, FALSE); + + return gsignond_secret_storage_close_db (self->secret_storage); +} + +/** + * gsignond_db_credentials_database_is_open_secret_storage: + * + * @self: instance of #GSignondDbCredentialsDatabase + * + * Checks if secret storage is open or not. + * + * Returns: TRUE if secret storage is open, FALSE otherwise. + */ +gboolean +gsignond_db_credentials_database_is_open_secret_storage ( + GSignondDbCredentialsDatabase *self) +{ + g_return_val_if_fail (GSIGNOND_DB_IS_CREDENTIALS_DATABASE (self), FALSE); + g_return_val_if_fail (self->secret_storage != NULL, FALSE); + + return gsignond_secret_storage_is_open_db (self->secret_storage); +} + +/** + * gsignond_db_credentials_database_clear: + * + * @self: instance of #GSignondDbCredentialsDatabase + * + * Clears the credentials database. + * + * Returns: TRUE if secret storage is open, FALSE otherwise. + */ +gboolean +gsignond_db_credentials_database_clear (GSignondDbCredentialsDatabase *self) +{ + g_return_val_if_fail (GSIGNOND_DB_IS_CREDENTIALS_DATABASE (self), FALSE); + g_return_val_if_fail (self->secret_storage != NULL, FALSE); + + return gsignond_secret_storage_clear_db (self->secret_storage) && + gsignond_db_sql_database_clear ( + GSIGNOND_DB_SQL_DATABASE (self->priv->metadata_db)); +} + +/** + * gsignond_db_credentials_database_load_identity: + * + * @self: instance of #GSignondDbCredentialsDatabase + * @identity_id: the id of the identity + * @query_secret: whether to query the password or not + * + * Fetches the info associated with the specified identity id. + * + * Returns: (transfer full) the info #GSignondIdentityInfo if successful, + * NULL otherwise. When done, it should be freed with + * gsignond_identity_info_unref (identity) + */ +GSignondIdentityInfo * +gsignond_db_credentials_database_load_identity ( + GSignondDbCredentialsDatabase *self, + const guint32 identity_id, + gboolean query_secret) +{ + GSignondIdentityInfo *identity = NULL; + gboolean is_un_sec = FALSE; + gboolean is_pwd_sec = FALSE; + + g_return_val_if_fail (GSIGNOND_DB_IS_CREDENTIALS_DATABASE (self), NULL); + + identity = gsignond_db_metadata_database_get_identity ( + self->priv->metadata_db, identity_id); + if (identity && query_secret && + !gsignond_identity_info_get_is_identity_new (identity) && + gsignond_db_credentials_database_is_open_secret_storage (self)) { + + is_un_sec = gsignond_identity_info_get_is_username_secret (identity); + is_pwd_sec = gsignond_identity_info_get_store_secret (identity); + if (is_un_sec || is_pwd_sec) { + GSignondCredentials * creds; + creds = gsignond_secret_storage_load_credentials ( + self->secret_storage, identity_id); + if (creds) { + if (is_un_sec) + gsignond_identity_info_set_username (identity, + gsignond_credentials_get_username (creds)); + if (is_pwd_sec) + gsignond_identity_info_set_secret (identity, + gsignond_credentials_get_password (creds)); + g_object_unref (creds); + } + } + } + + return identity; +} + +/** + * gsignond_db_credentials_database_load_identities: + * + * @self: instance of #GSignondDbCredentialsDatabase + * @filter: (transfer none) filter to apply. Currently supported filters: + * ("Owner":GSignondSecurtityContext *context) - Identities matched with this 'context' + * ("Type":guint32 type) - Identities matched with 'type' + * ("Caption":gchar *caption) - Identties matched/start with 'caption' + * + * Fetches the list of the identities. + * + * Returns: (transfer full) the list if successful, NULL otherwise. + * When done list should be freed with gsignond_identity_info_list_free (list) + */ +GSignondIdentityInfoList * +gsignond_db_credentials_database_load_identities ( + GSignondDbCredentialsDatabase *self, + GSignondDictionary *filter) +{ + g_return_val_if_fail (GSIGNOND_DB_IS_CREDENTIALS_DATABASE (self), NULL); + + return gsignond_db_metadata_database_get_identities ( + self->priv->metadata_db, filter); +} + +/** + * gsignond_db_credentials_database_update_identity: + * + * @self: instance of #GSignondDbCredentialsDatabase + * @identity: the identity info which needs to be inserted to db + * @store_secret: flag to indicate whether to store the secret or not + * + * Updates the identity info in the credentials database. + * + * Returns: the id of the updated identity, 0 otherwise. + */ +guint32 +gsignond_db_credentials_database_update_identity ( + GSignondDbCredentialsDatabase *self, + GSignondIdentityInfo* identity) +{ + guint32 id = 0; + + g_return_val_if_fail (GSIGNOND_DB_IS_CREDENTIALS_DATABASE (self), FALSE); + + id = gsignond_db_metadata_database_update_identity (self->priv->metadata_db, + identity); + + if (id != 0 && + gsignond_db_credentials_database_is_open_secret_storage (self)) { + GSignondCredentials *creds = NULL; + gboolean un_sec, pwd_sec; + + creds = gsignond_credentials_new (); + gsignond_credentials_set_id (creds, id); + + pwd_sec = gsignond_identity_info_get_store_secret (identity); + if (pwd_sec) { + gsignond_credentials_set_password (creds, + gsignond_identity_info_get_secret (identity)); + } + + un_sec = gsignond_identity_info_get_is_username_secret (identity); + if (un_sec) { + gsignond_credentials_set_username (creds, + gsignond_identity_info_get_username (identity)); + } + + if (un_sec || pwd_sec) { + DBG ("Add credentials to secret storage"); + gsignond_secret_storage_update_credentials ( + self->secret_storage, creds); + } + g_object_unref (creds); + } + + return id; +} + +/** + * gsignond_db_credentials_database_remove_identity: + * + * @self: instance of #GSignondDbCredentialsDatabase + * @identity: the identity info which needs to be removed + * + * Removes the identity info from the credentials database. + * + * Returns: TRUE if successful, FALSE otherwise. + */ +gboolean +gsignond_db_credentials_database_remove_identity ( + GSignondDbCredentialsDatabase *self, + const guint32 identity_id) +{ + g_return_val_if_fail (GSIGNOND_DB_IS_CREDENTIALS_DATABASE (self), FALSE); + + if (!gsignond_db_credentials_database_is_open_secret_storage (self)) { + DBG ("Remove failed as DB is not open"); + return FALSE; + } + return gsignond_secret_storage_remove_credentials ( + self->secret_storage, + identity_id) && + gsignond_db_metadata_database_remove_identity ( + self->priv->metadata_db, + identity_id); +} + +/** + * gsignond_db_credentials_database_check_secret: + * + * @self: instance of #GSignondDbCredentialsDatabase + * @identity_id: the id of the identity + * @username: the username of the identity + * @secret: the secret of the identity + * + * Checks the identity info from the credentials database. + * + * Returns: TRUE if successful, FALSE otherwise. + */ +gboolean +gsignond_db_credentials_database_check_secret ( + GSignondDbCredentialsDatabase *self, + const guint32 identity_id, + const gchar *username, + const gchar *secret) +{ + GSignondIdentityInfo *identity = NULL; + gboolean check = FALSE; + + g_return_val_if_fail (GSIGNOND_DB_IS_CREDENTIALS_DATABASE (self), FALSE); + + if (!gsignond_db_credentials_database_is_open_secret_storage (self)) { + DBG ("Check failed as DB is not open"); + return FALSE; + } + + identity = gsignond_db_metadata_database_get_identity ( + self->priv->metadata_db, identity_id); + if (identity) { + GSignondCredentials *creds = NULL; + + creds = gsignond_credentials_new (); + gsignond_credentials_set_id (creds, identity_id); + gsignond_credentials_set_password (creds, secret); + if (gsignond_identity_info_get_is_username_secret (identity)) { + DBG ("Check credentials from storage"); + gsignond_credentials_set_username (creds, username); + check = gsignond_secret_storage_check_credentials ( + self->secret_storage, creds); + } else { + gsignond_credentials_set_username (creds, ""); + check = g_strcmp0 (username, + gsignond_identity_info_get_username (identity)) == 0 && + gsignond_secret_storage_check_credentials ( + self->secret_storage, creds); + } + g_object_unref (creds); + gsignond_identity_info_unref (identity); + } + return check; +} + +/** + * gsignond_db_credentials_database_load_data: + * + * @self: instance of #GSignondDbCredentialsDatabase + * @identity_id: the id of the identity + * @method: the name of the method + * + * Fetches the data associated with the identity id and method. + * + * Returns: (transfer full) the data if successful, NULL otherwise. + * When done data should be freed with g_hash_table_unref (data) + */ +GHashTable* +gsignond_db_credentials_database_load_data ( + GSignondDbCredentialsDatabase *self, + const guint32 identity_id, + const gchar *method) +{ + guint32 method_id = 0; + + g_return_val_if_fail (GSIGNOND_DB_IS_CREDENTIALS_DATABASE (self), NULL); + g_return_val_if_fail (method != NULL, NULL); + + if (identity_id == 0 || + !gsignond_db_credentials_database_is_open_secret_storage (self)) { + DBG ("Load data failed - invalid id (%d)/secret storage not opened", + identity_id); + return NULL; + } + + method_id = gsignond_db_metadata_database_get_method_id ( + self->priv->metadata_db, + method); + if (method_id == 0) { + DBG ("Load data failed - invalid method id"); + return NULL; + } + return gsignond_secret_storage_load_data (self->secret_storage, + identity_id, method_id); +} + +/** + * gsignond_db_credentials_database_update_data: + * + * @self: instance of #GSignondDbCredentialsDatabase + * @identity_id: the id of the identity + * @method: the name of the method + * @data: the data to be stored + * + * Stores/updates the data associated with the identity id and method. + * + * Returns: (transfer full) the data if successful, NULL otherwise. + * When done data should be freed with g_hash_table_unref (data) + */ +gboolean +gsignond_db_credentials_database_update_data ( + GSignondDbCredentialsDatabase *self, + const guint32 identity_id, + const gchar *method, + GHashTable *data) +{ + guint32 method_id = 0; + + g_return_val_if_fail (GSIGNOND_DB_IS_CREDENTIALS_DATABASE (self), FALSE); + g_return_val_if_fail (method != NULL && data != NULL, FALSE); + + if (identity_id == 0 || + !gsignond_db_credentials_database_is_open_secret_storage (self)) { + DBG ("Update data failed - invalid id(%d)/secret storage not opened", + identity_id); + return FALSE; + } + + method_id = gsignond_db_metadata_database_get_method_id ( + self->priv->metadata_db, + method); + if (method_id == 0) { + if (!gsignond_db_metadata_database_insert_method ( + self->priv->metadata_db, + method, + &method_id)) { + DBG ("Update data failed - insertion of method to DB failed"); + return FALSE; + } + } + return gsignond_secret_storage_update_data (self->secret_storage, + identity_id, method_id, data); +} + +/** + * gsignond_db_credentials_database_remove_data: + * + * @self: instance of #GSignondDbCredentialsDatabase + * @identity_id: the id of the identity + * @method: the name of the method + * + * Fetches the data associated with the identity id and method. + * + * Returns: (transfer full) the data if successful, NULL otherwise. + * When done data should be freed with g_hash_table_unref (data) + */ +gboolean +gsignond_db_credentials_database_remove_data ( + GSignondDbCredentialsDatabase *self, + const guint32 identity_id, + const gchar *method) +{ + guint32 method_id = 0; + + g_return_val_if_fail (GSIGNOND_DB_IS_CREDENTIALS_DATABASE (self), FALSE); + + if (identity_id == 0 || + !gsignond_db_credentials_database_is_open_secret_storage (self)) { + DBG ("Remove data failed - invalid id (%d)/secret storage not opened", + identity_id); + return FALSE; + } + + if (method && strlen (method) > 0) { + method_id = gsignond_db_metadata_database_get_method_id ( + self->priv->metadata_db, + method); + if (method_id == 0) { + DBG ("Remove data failed - method not found"); + return FALSE; + } + } + return gsignond_secret_storage_remove_data (self->secret_storage, + identity_id, method_id); +} + +/** + * gsignond_db_credentials_database_get_methods: + * + * @self: instance of #GSignondDbCredentialsDatabase + * @identity_id: the id of the identity + * @sec_ctx: the security context + * + * Fetches the list of the methods associated with the specified identity id. + * + * Returns: (transfer full) the list if successful, NULL otherwise. + * When done list should be freed with g_list_free_full (list, g_free) + */ +GList * +gsignond_db_credentials_database_get_methods ( + GSignondDbCredentialsDatabase *self, + const guint32 identity_id, + GSignondSecurityContext* sec_ctx) +{ + g_return_val_if_fail (GSIGNOND_DB_IS_CREDENTIALS_DATABASE (self), NULL); + + return gsignond_db_metadata_database_get_methods (self->priv->metadata_db, + identity_id, sec_ctx); +} + +/** + * gsignond_db_credentials_database_insert_reference: + * + * @self: instance of #GSignondDbCredentialsDatabase + * @identity_id: the id of the identity + * @ref_owner: the owner security context + * @reference: reference for the given identity + * + * Insert reference into the database for the given identity id. + * + * Returns: TRUE if successful,FALSE otherwise. + */ +gboolean +gsignond_db_credentials_database_insert_reference ( + GSignondDbCredentialsDatabase *self, + const guint32 identity_id, + const GSignondSecurityContext *ref_owner, + const gchar *reference) +{ + g_return_val_if_fail (GSIGNOND_DB_IS_CREDENTIALS_DATABASE (self), FALSE); + + return gsignond_db_metadata_database_insert_reference ( + self->priv->metadata_db, identity_id, ref_owner,reference); +} + +/** + * gsignond_db_credentials_database_remove_reference: + * + * @self: instance of #GSignondDbCredentialsDatabase + * @identity_id: the id of the identity + * @ref_owner: the owner security context + * @reference: reference for the given identity + * + * Removes reference from the database for the given identity id. + * + * Returns: TRUE if successful,FALSE otherwise. + */ +gboolean +gsignond_db_credentials_database_remove_reference ( + GSignondDbCredentialsDatabase *self, + const guint32 identity_id, + const GSignondSecurityContext *ref_owner, + const gchar *reference) +{ + g_return_val_if_fail (GSIGNOND_DB_IS_CREDENTIALS_DATABASE (self), FALSE); + + return gsignond_db_metadata_database_remove_reference ( + self->priv->metadata_db, identity_id, ref_owner, reference); +} + +/** + * gsignond_db_credentials_database_get_references: + * + * @self: instance of #GSignondDbCredentialsDatabase + * @identity_id: the id of the identity + * @ref_owner: the owner security context + * + * Gets references from the database for the given identity id. + * + * Returns: (transfer full) the list #GList if successful, + * NULL otherwise. When done the list should be freed with + * g_list_free_full (list, g_free) + */ +GList * +gsignond_db_credentials_database_get_references ( + GSignondDbCredentialsDatabase *self, + const guint32 identity_id, + const GSignondSecurityContext* ref_owner) +{ + g_return_val_if_fail (GSIGNOND_DB_IS_CREDENTIALS_DATABASE (self), NULL); + + return gsignond_db_metadata_database_get_references ( + self->priv->metadata_db, identity_id, ref_owner); +} + +/** + * gsignond_db_credentials_database_get_accesscontrol_list: + * + * @self: instance of #GSignondDbCredentialsDatabase + * @identity_id: the id of the identity whose access control list is needed + * + * Gets all the access control list from the database into a list. + * + * Returns: (transfer full) the list #GSignondSecurityContextList if successful, + * NULL otherwise. When done the list should be freed with + * gsignond_identity_info_list_free + */ +GSignondSecurityContextList * +gsignond_db_credentials_database_get_accesscontrol_list( + GSignondDbCredentialsDatabase *self, + const guint32 identity_id) +{ + g_return_val_if_fail (GSIGNOND_DB_IS_CREDENTIALS_DATABASE (self), NULL); + + return gsignond_db_metadata_database_get_accesscontrol_list ( + self->priv->metadata_db, identity_id); +} + +/** + * gsignond_db_credentials_database_get_owner: + * + * @self: instance of #GSignondDbCredentialsDatabase + * @identity_id: the id of the identity whose owner list is needed + * + * Gets the onwer of the identity referred by @identity_id from the database. + * + * Returns: (transfer full) the list #GSignondSecurityContext if successful, + * NULL otherwise. When done the list should be freed with + * gsignond_identity_info_unref + */ +GSignondSecurityContext * +gsignond_db_credentials_database_get_owner( + GSignondDbCredentialsDatabase *self, + const guint32 identity_id) +{ + g_return_val_if_fail (GSIGNOND_DB_IS_CREDENTIALS_DATABASE (self), NULL); + + return gsignond_db_metadata_database_get_owner ( + self->priv->metadata_db, identity_id); +} + +/** + * gsignond_db_credentials_database_get_identity_owner: + * + * @self: instance of #GSignondDbCredentialsDatabase + * @identity_id: the id of the identity whose owner is needed + * + * Gets the owner from the database for the given identity id. + * + * Returns: (transfer full) the #GSignondSecurityContext if successful, + * NULL otherwise. When done the context, it should be freed with + * gsignond_identity_info_unref + */ +GSignondSecurityContext * +gsignond_db_credentials_database_get_identity_owner ( + GSignondDbCredentialsDatabase *self, + const guint32 identity_id) +{ + GSignondSecurityContext *ctx = NULL; + + g_return_val_if_fail (GSIGNOND_DB_IS_CREDENTIALS_DATABASE (self), NULL); + + ctx = gsignond_db_metadata_database_get_owner ( + self->priv->metadata_db, identity_id); + return ctx; +} + +const GError * +gsignond_db_credentials_database_get_last_error ( + GSignondDbCredentialsDatabase *self) +{ + g_return_val_if_fail (self && GSIGNOND_DB_IS_CREDENTIALS_DATABASE (self), NULL); + + return gsignond_db_sql_database_get_last_error ( + GSIGNOND_DB_SQL_DATABASE (self->priv->metadata_db)); +} + diff --git a/src/daemon/db/gsignond-db-credentials-database.h b/src/daemon/db/gsignond-db-credentials-database.h new file mode 100644 index 0000000..d4296d1 --- /dev/null +++ b/src/daemon/db/gsignond-db-credentials-database.h @@ -0,0 +1,198 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2012 Intel Corporation. + * + * Contact: Imran Zaman <imran.zaman@linux.intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#ifndef __GSIGNOND_DB_CREDENTIALS_DATABASE_H__ +#define __GSIGNOND_DB_CREDENTIALS_DATABASE_H__ + +#include <glib.h> +#include <glib-object.h> +#include <gsignond/gsignond-identity-info.h> +#include <gsignond/gsignond-config.h> +#include <gsignond/gsignond-secret-storage.h> + +#include "gsignond-db-metadata-database.h" + +G_BEGIN_DECLS + +/* + * Type macros. + */ +#define GSIGNOND_DB_TYPE_CREDENTIALS_DATABASE \ + (gsignond_db_credentials_database_get_type ()) +#define GSIGNOND_DB_CREDENTIALS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ + GSIGNOND_DB_TYPE_CREDENTIALS_DATABASE, \ + GSignondDbCredentialsDatabase)) +#define GSIGNOND_DB_IS_CREDENTIALS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),\ + GSIGNOND_DB_TYPE_CREDENTIALS_DATABASE)) +#define GSIGNOND_DB_CREDENTIALS_DATABASE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), \ + GSIGNOND_DB_TYPE_CREDENTIALS_DATABASE, \ + GSignondDbCredentialsDatabaseClass)) +#define GSIGNOND_DB_IS_CREDENTIALS_DATABASE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), \ + GSIGNOND_DB_TYPE_CREDENTIALS_DATABASE)) +#define GSIGNOND_DB_CREDENTIALS_DATABASE_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), \ + GSIGNOND_DB_TYPE_CREDENTIALS_DATABASE, \ + GSignondDbCredentialsDatabaseClass)) + +typedef struct _GSignondDbCredentialsDatabasePrivate + GSignondDbCredentialsDatabasePrivate; + +typedef struct +{ + GObject parent_instance; + + /*< private >*/ + GSignondConfig *config; + GSignondSecretStorage *secret_storage; + GSignondDbCredentialsDatabasePrivate *priv; +} GSignondDbCredentialsDatabase; + +typedef struct { + GObjectClass parent_class; + +} GSignondDbCredentialsDatabaseClass; + +/* used by GSIGNOND_DB_TYPE_CREDENTIALS_DATABASE */ +GType +gsignond_db_credentials_database_get_type (void); + +GSignondDbCredentialsDatabase* +gsignond_db_credentials_database_new ( + GSignondConfig *config, + GSignondSecretStorage *storage); + +gboolean +gsignond_db_credentials_database_open_secret_storage ( + GSignondDbCredentialsDatabase *self); + +gboolean +gsignond_db_credentials_database_close_secret_storage ( + GSignondDbCredentialsDatabase *self); + +gboolean +gsignond_db_credentials_database_is_open_secret_storage ( + GSignondDbCredentialsDatabase *self); + +gboolean +gsignond_db_credentials_database_clear ( + GSignondDbCredentialsDatabase *self); + +GSignondIdentityInfo * +gsignond_db_credentials_database_load_identity ( + GSignondDbCredentialsDatabase *self, + const guint32 identity_id, + gboolean query_secret); + +GSignondIdentityInfoList * +gsignond_db_credentials_database_load_identities ( + GSignondDbCredentialsDatabase *self, + GSignondDictionary *filter); + +guint32 +gsignond_db_credentials_database_update_identity ( + GSignondDbCredentialsDatabase *self, + GSignondIdentityInfo* identity); + +gboolean +gsignond_db_credentials_database_remove_identity ( + GSignondDbCredentialsDatabase *self, + const guint32 identity_id); + +gboolean +gsignond_db_credentials_database_check_secret ( + GSignondDbCredentialsDatabase *self, + const guint32 identity_id, + const gchar *username, + const gchar *secret); + +GHashTable* +gsignond_db_credentials_database_load_data ( + GSignondDbCredentialsDatabase *self, + const guint32 identity_id, + const gchar *method); + +gboolean +gsignond_db_credentials_database_update_data ( + GSignondDbCredentialsDatabase *self, + const guint32 identity_id, + const gchar *method, + GHashTable *data); + +gboolean +gsignond_db_credentials_database_remove_data ( + GSignondDbCredentialsDatabase *self, + const guint32 identity_id, + const gchar *method); + +GList * +gsignond_db_credentials_database_get_methods ( + GSignondDbCredentialsDatabase *self, + const guint32 identity_id, + GSignondSecurityContext* sec_ctx); + +gboolean +gsignond_db_credentials_database_insert_reference ( + GSignondDbCredentialsDatabase *self, + const guint32 identity_id, + const GSignondSecurityContext *ref_owner, + const gchar *reference); +gboolean +gsignond_db_credentials_database_remove_reference ( + GSignondDbCredentialsDatabase *self, + const guint32 id, + const GSignondSecurityContext *ref_owner, + const gchar *reference); + +GList * +gsignond_db_credentials_database_get_references ( + GSignondDbCredentialsDatabase *self, + const guint32 id, + const GSignondSecurityContext *ref_owner); + +GSignondSecurityContextList * +gsignond_db_credentials_database_get_accesscontrol_list( + GSignondDbCredentialsDatabase *self, + const guint32 identity_id); + +GSignondSecurityContext * +gsignond_db_credentials_database_get_owner( + GSignondDbCredentialsDatabase *self, + const guint32 identity_id); + +GSignondSecurityContext * +gsignond_db_credentials_database_get_identity_owner ( + GSignondDbCredentialsDatabase *self, + const guint32 identity_id); + +const GError * +gsignond_db_credentials_database_get_last_error ( + GSignondDbCredentialsDatabase *self); + +G_END_DECLS + +#endif /* __GSIGNOND_DB_CREDENTIALS_DATABASE_H__ */ + diff --git a/src/daemon/db/gsignond-db-metadata-database.c b/src/daemon/db/gsignond-db-metadata-database.c new file mode 100644 index 0000000..e191b4a --- /dev/null +++ b/src/daemon/db/gsignond-db-metadata-database.c @@ -0,0 +1,1711 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2012 Intel Corporation. + * + * Contact: Imran Zaman <imran.zaman@linux.intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ +#include <string.h> +#include <sys/stat.h> + +#include "gsignond/gsignond-log.h" +#include "gsignond/gsignond-config.h" +#include "common/db/gsignond-db-error.h" +#include "gsignond-db-metadata-database.h" + +#define RETURN_IF_NOT_OPEN(obj, retval) \ + if (gsignond_db_sql_database_is_open (obj) == FALSE) { \ + GError* last_error = gsignond_db_create_error( \ + GSIGNOND_DB_ERROR_NOT_OPEN,\ + "DB Not Open"); \ + DBG("MetadataDB is not available"); \ + gsignond_db_sql_database_set_last_error(obj,\ + last_error); \ + return retval; \ + } + +#define GSIGNOND_DB_METADATA_DATABASE_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj),\ + GSIGNOND_DB_TYPE_METADATA_DATABASE, \ + GSignondDbMetadataDatabasePrivate)) + +G_DEFINE_TYPE (GSignondDbMetadataDatabase, gsignond_db_metadata_database, + GSIGNOND_DB_TYPE_SQL_DATABASE); + +struct _GSignondDbMetadataDatabasePrivate +{ +}; + +enum +{ + PROP_0, + PROP_CONFIG, + N_PROPERTIES +}; + +static GParamSpec *properties[N_PROPERTIES] = { NULL, }; + +static void +_set_property (GObject *object, guint prop_id, const GValue *value, + GParamSpec *pspec) +{ + GSignondDbMetadataDatabase *self = GSIGNOND_DB_METADATA_DATABASE (object); + + switch (prop_id) { + case PROP_CONFIG: + g_assert (self->config == NULL); + self->config = g_value_dup_object (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + } +} + +static void +_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +{ + GSignondDbMetadataDatabase *self = GSIGNOND_DB_METADATA_DATABASE (object); + + switch (prop_id) { + case PROP_CONFIG: + g_value_set_object (value, self->config); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + } +} + +static gboolean +_gsignond_db_metadata_database_open ( + GSignondDbSqlDatabase *obj, + const gchar *filename, + int flags); + +static gboolean +_gsignond_db_metadata_database_create ( + GSignondDbSqlDatabase *obj); + +static gboolean +_gsignond_db_metadata_database_clear ( + GSignondDbSqlDatabase *obj); + +/*! + * @enum GSignondIdentityFlags + * Flags for the identity to be stored into db + */ +enum GSignondIdentityFlags { + GSignondIdentityFlag_Validated = 0x0001, + GSignondIdentityFlag_RememberSecret = 0x0002, + GSignondIdentityFlag_UserNameIsSecret = 0x0004, +}; + +static gint +_compare_strings ( + const gchar* a, + const gchar* b, + gpointer data) +{ + (void)data; + return g_strcmp0 (a,b); +} + +static GSequence * +_gsignond_db_metadata_database_list_to_sequence (GList *list) +{ + GSequence *seq = NULL; + if (!list) return seq; + seq = g_sequence_new ((GDestroyNotify)g_free); + list = g_list_first (list); + for ( ; list != NULL; list = g_list_next (list)) { + g_sequence_insert_sorted (seq, (gchar *) list->data, + (GCompareDataFunc)_compare_strings, NULL); + } + return seq; +} + +static gboolean +_gsignond_db_metadata_database_read_identity ( + sqlite3_stmt *stmt, + GSignondIdentityInfo *identity) +{ + gint flags = 0; + + gsignond_identity_info_set_caption (identity, + (const gchar *)sqlite3_column_text (stmt, 0)); + + flags = sqlite3_column_int (stmt, 2); + + gsignond_identity_info_set_username_secret (identity, + flags & GSignondIdentityFlag_UserNameIsSecret); + + if (flags & GSignondIdentityFlag_UserNameIsSecret) { + gsignond_identity_info_set_caption (identity, ""); + } else { + gsignond_identity_info_set_username (identity, + (const gchar *)sqlite3_column_text (stmt, 1)); + } + + gsignond_identity_info_set_store_secret (identity, + flags & GSignondIdentityFlag_RememberSecret); + + gsignond_identity_info_set_validated (identity, + flags & GSignondIdentityFlag_Validated); + + gsignond_identity_info_set_identity_type (identity, + sqlite3_column_int (stmt, 3)); + + return TRUE; +} + +static gboolean +_gsignond_db_metadata_database_exec ( + GSignondDbMetadataDatabase *self, + const gchar *query_format, + ...) +{ + gboolean ret = FALSE; + gchar *query = NULL; + va_list args; + + g_return_val_if_fail (query_format != NULL, FALSE); + + va_start (args, query_format); + query = sqlite3_vmprintf (query_format, args); + va_end (args); + + ret = gsignond_db_sql_database_exec ( + GSIGNOND_DB_SQL_DATABASE (self), + query); + sqlite3_free (query); + + return ret; +} + + +static GSequence * +_gsignond_db_metadata_database_get_sequence ( + GSignondDbMetadataDatabase *self, + const gchar *query_format, + ...) +{ + GSequence *seq = NULL; + GList *list = NULL; + gchar *query = NULL; + va_list args; + + g_return_val_if_fail (query_format != NULL, NULL); + + va_start (args, query_format); + query = sqlite3_vmprintf (query_format, args); + va_end (args); + + list = gsignond_db_sql_database_query_exec_string_list ( + GSIGNOND_DB_SQL_DATABASE (self), + query); + sqlite3_free (query); + seq = _gsignond_db_metadata_database_list_to_sequence (list); + g_list_free (list); /*list elements are owned by sequence*/ + + return seq; +} + +guint32 +_gsignond_db_metadata_database_update_credentials ( + GSignondDbMetadataDatabase *self, + GSignondIdentityInfo *identity) +{ + gchar *query = NULL; + gint flags = 0; + guint32 type; + gint64 id; + const gchar *caption= NULL, *username = NULL; + gboolean ret = FALSE; + + g_return_val_if_fail (GSIGNOND_DB_IS_METADATA_DATABASE (self), 0); + g_return_val_if_fail (identity != NULL, 0); + + if (gsignond_identity_info_get_validated (identity) ) + flags |= GSignondIdentityFlag_Validated; + if (gsignond_identity_info_get_store_secret (identity) ) + flags |= GSignondIdentityFlag_RememberSecret; + if (gsignond_identity_info_get_is_username_secret (identity) ) { + flags |= GSignondIdentityFlag_UserNameIsSecret; + } else { + username = gsignond_identity_info_get_username (identity); + } + caption = gsignond_identity_info_get_caption (identity); + + id = gsignond_identity_info_get_id (identity); + type = gsignond_identity_info_get_identity_type (identity); + if (!gsignond_identity_info_get_is_identity_new (identity)) { + query = sqlite3_mprintf ("UPDATE IDENTITY SET caption = %Q, " + "username = %Q, flags = %u, type = %u WHERE id = %u;", + caption ?caption : "",username? username : "", flags, type, id); + } else { + query = sqlite3_mprintf ("INSERT INTO IDENTITY " + "(caption, username, flags, type) " + "VALUES(%Q, %Q, %u, %u);", + caption ?caption : "",username? username : "", flags, type); + } + ret = gsignond_db_sql_database_exec ( + GSIGNOND_DB_SQL_DATABASE (self), + query); + sqlite3_free (query); + if (!ret) { + return 0; + } + + if (gsignond_identity_info_get_is_identity_new (identity)) { + id = gsignond_db_sql_database_get_last_insert_rowid ( + GSIGNOND_DB_SQL_DATABASE (self)); + } + return (guint32)id; +} + +gboolean +_gsignond_db_metadata_database_update_realms ( + GSignondDbMetadataDatabase *self, + GSignondIdentityInfo *identity, + guint32 id, + GSequence *realms) +{ + GSequenceIter *iter = NULL; + + g_return_val_if_fail (GSIGNOND_DB_IS_METADATA_DATABASE (self), FALSE); + g_return_val_if_fail (identity != NULL, FALSE); + + if (realms && g_sequence_get_length (realms) > 0) { + + if (!gsignond_identity_info_get_is_identity_new (identity)) { + /* remove realms list */ + DBG ("Remove old realms from DB as identity is not new"); + _gsignond_db_metadata_database_exec (self, + "DELETE FROM REALMS WHERE identity_id = %u;", id); + } + + /* realms insert */ + iter = g_sequence_get_begin_iter (realms); + while (!g_sequence_iter_is_end (iter)) { + if (!_gsignond_db_metadata_database_exec (self, + "INSERT OR IGNORE INTO REALMS (identity_id, realm) " + "VALUES (%u, %Q);", + id, (const gchar *)g_sequence_get (iter))) { + DBG ("Insert realms to DB failed"); + return FALSE; + } + iter = g_sequence_iter_next (iter); + } + } + return TRUE; +} + +gboolean +_gsignond_db_metadata_database_insert_methods ( + GSignondDbMetadataDatabase *self, + GSignondIdentityInfo *identity, + GHashTable *methods) +{ + GSequenceIter *mech_iter = NULL; + GHashTableIter method_iter; + const gchar *method = NULL; + GSequence *mechanisms = NULL; + + g_return_val_if_fail (GSIGNOND_DB_IS_METADATA_DATABASE (self), FALSE); + g_return_val_if_fail (identity != NULL, FALSE); + + if (!methods || g_hash_table_size (methods) <=0) { + DBG ("no authentication methods found to store identity"); + return FALSE; + } + + g_hash_table_iter_init (&method_iter, methods); + while (g_hash_table_iter_next (&method_iter, + (gpointer)&method, + (gpointer)&mechanisms)) + { + if (!_gsignond_db_metadata_database_exec ( self, + "INSERT OR IGNORE INTO METHODS (method) " + "VALUES( %Q );", + method)) { + DBG ("Insert methods to DB failed"); + return FALSE; + } + /* mechanisms insert */ + mech_iter = g_sequence_get_begin_iter (mechanisms); + while (!g_sequence_iter_is_end (mech_iter)) { + if (!_gsignond_db_metadata_database_exec (self, + "INSERT OR IGNORE INTO MECHANISMS (mechanism) " + "VALUES(%Q);", + g_sequence_get (mech_iter))) { + DBG ("Insert mechanisms to DB failed"); + return FALSE; + } + mech_iter = g_sequence_iter_next (mech_iter); + } + } + + return TRUE; +} + +gboolean +_gsignond_db_metadata_database_update_acl ( + GSignondDbMetadataDatabase *self, + GSignondIdentityInfo *identity, + GSignondSecurityContextList *acl) +{ + GSignondSecurityContextList *list = NULL; + GSignondSecurityContext *ctx = NULL; + + g_return_val_if_fail (GSIGNOND_DB_IS_METADATA_DATABASE (self), FALSE); + g_return_val_if_fail (identity != NULL, FALSE); + + if (!acl || g_list_length (acl) <= 0) { + DBG ("NULL acl or no acl to be added to DB"); + return FALSE; + } + + for (list = acl; list != NULL; list = g_list_next (list)) { + ctx = (GSignondSecurityContext *) list->data; + _gsignond_db_metadata_database_exec (self, + "INSERT OR IGNORE INTO SECCTX (sysctx, appctx) " + "VALUES (%Q, %Q);", + ctx->sys_ctx, ctx->app_ctx); + } + return TRUE; +} + +gboolean +_gsignond_db_metadata_database_update_owner ( + GSignondDbMetadataDatabase *self, + GSignondIdentityInfo *identity, + GSignondSecurityContext *owner) +{ + g_return_val_if_fail (GSIGNOND_DB_IS_METADATA_DATABASE (self), FALSE); + g_return_val_if_fail (identity != NULL, FALSE); + + if (!owner) { + DBG ("no owner to be added to DB"); + return FALSE; + } + + if (owner->sys_ctx && strlen (owner->sys_ctx) > 0) { + _gsignond_db_metadata_database_exec (self, + "INSERT OR IGNORE INTO " + "SECCTX (sysctx, appctx) " + "VALUES (%Q, %Q);", + owner->sys_ctx, owner->app_ctx); + } + + return TRUE; +} + +static void +_gsignond_db_metadata_database_dispose (GObject *gobject) +{ + g_return_if_fail (GSIGNOND_DB_IS_METADATA_DATABASE (gobject)); + GSignondDbMetadataDatabase *self = GSIGNOND_DB_METADATA_DATABASE (gobject); + + if (self->config) { + g_object_unref (self->config); + self->config = NULL; + } + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gsignond_db_metadata_database_parent_class)->dispose ( + gobject); +} + +static void +gsignond_db_metadata_database_class_init ( + GSignondDbMetadataDatabaseClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->set_property = _set_property; + gobject_class->get_property = _get_property; + gobject_class->dispose = _gsignond_db_metadata_database_dispose; + + properties[PROP_CONFIG] = g_param_spec_object ("config", + "config", + "Configuration object", + GSIGNOND_TYPE_CONFIG, + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS); + g_object_class_install_properties (gobject_class, N_PROPERTIES, properties); + + GSignondDbSqlDatabaseClass *sql_class = + GSIGNOND_DB_SQL_DATABASE_CLASS (klass); + + sql_class->create = _gsignond_db_metadata_database_create; + sql_class->clear = _gsignond_db_metadata_database_clear; + +} + +static void +gsignond_db_metadata_database_init ( + GSignondDbMetadataDatabase *self) +{ + self->config = NULL; +} + +/** + * gsignond_db_metadata_database_new: + * + * @config: (transfer none) #GSignondConfig config data + * + * Creates new #GSignondDbMetadataDatabase object + * + * Returns : (transfer full) the #GSignondDbMetadataDatabase object + */ +GSignondDbMetadataDatabase * +gsignond_db_metadata_database_new (GSignondConfig *config) +{ + return GSIGNOND_DB_METADATA_DATABASE ( + g_object_new (GSIGNOND_DB_TYPE_METADATA_DATABASE, + "config", config, NULL)); +} + +static gboolean +_gsignond_db_metadata_database_open ( + GSignondDbSqlDatabase *obj, + const gchar *filename, + int flags) +{ + const gchar *dir = NULL; + gchar *db_filename = NULL; + gboolean ret = FALSE; + gint dir_created = 0; + GSignondDbMetadataDatabase *self = NULL; + + self = GSIGNOND_DB_METADATA_DATABASE (obj); + + g_return_val_if_fail (self, FALSE); + + if (!filename || strlen (filename) <= 0) { + ERR ("Missing Metadata DB filename"); + return FALSE; + } + dir = gsignond_config_get_string (self->config, + GSIGNOND_CONFIG_GENERAL_STORAGE_PATH); + if (!dir) { + ERR ("Invalid Metadata DB directory"); + return FALSE; + } + db_filename = g_build_filename (dir, filename, NULL); + if (!db_filename) { + ERR ("Invalid Metadata DB filename"); + return FALSE; + } + + dir_created = g_mkdir_with_parents (dir, S_IRWXU); + if (dir_created != 0) { + ERR ("Metadata DB directory does not exist"); + goto _open_exit; + } + + ret = gsignond_db_sql_database_open (obj, db_filename, flags); + +_open_exit: + g_free (db_filename); + return ret; +} + +static gboolean +_gsignond_db_metadata_database_create ( + GSignondDbSqlDatabase *obj) +{ + const gchar *queries = NULL; + g_return_val_if_fail (GSIGNOND_DB_IS_METADATA_DATABASE (obj), FALSE); + RETURN_IF_NOT_OPEN (obj, FALSE); + gint fk_enabled = 0; + gint version = 0; + + queries = "PRAGMA foreign_keys = 1;"; + if (!gsignond_db_sql_database_exec (obj, queries)) { + ERR ("Metadata DB enabling foreign keys failed"); + return FALSE; + } + + gsignond_db_sql_database_query_exec_int (obj, "PRAGMA foreign_keys;", + &fk_enabled); + if (!fk_enabled) { + ERR ("Metadata DB - foreign keys not enabled"); + return FALSE; + } + + version = gsignond_db_sql_database_get_db_version(obj, + "PRAGMA user_version;"); + if (version > 0) { + DBG ("Metadata DB is already created with with version (%d) and " + "foreign keys enabled (%d)", version, fk_enabled); + return TRUE; + } + + queries = "PRAGMA user_version = 1;"; + if (!gsignond_db_sql_database_exec (obj, queries)) { + DBG ("Metadata DB setting version failed"); + return FALSE; + } + + version = gsignond_db_sql_database_get_db_version(obj, + "PRAGMA user_version;"); + DBG ("Metadata DB is to be created with version (%d) and foreign keys " + "enabled(%d)", version, fk_enabled); + + queries = "" + "CREATE TABLE IDENTITY" + "(id INTEGER PRIMARY KEY AUTOINCREMENT," + "caption TEXT," + "username TEXT," + "flags INTEGER," + "type INTEGER);" + + "CREATE TABLE METHODS" + "(id INTEGER PRIMARY KEY AUTOINCREMENT," + "method TEXT UNIQUE);" + + "CREATE TABLE MECHANISMS" + "(id INTEGER PRIMARY KEY AUTOINCREMENT," + "mechanism TEXT UNIQUE);" + + "CREATE TABLE SECCTX" + "(id INTEGER PRIMARY KEY AUTOINCREMENT," + "sysctx TEXT," + "appctx TEXT," + "CONSTRAINT tokc UNIQUE(sysctx, appctx) ON CONFLICT REPLACE);" + + "CREATE INDEX sysidx ON SECCTX(sysctx);" + "CREATE INDEX appidx ON SECCTX(appctx);" + + "CREATE TABLE REALMS" + "(identity_id INTEGER CONSTRAINT fk_identity_id " + "REFERENCES IDENTITY(id) ON DELETE CASCADE," + "realm TEXT," + "hostname TEXT," + "PRIMARY KEY (identity_id, realm, hostname));" + + "CREATE TABLE ACL" + "(rowid INTEGER PRIMARY KEY AUTOINCREMENT," + "identity_id INTEGER CONSTRAINT fk_identity_id REFERENCES " + "IDENTITY(id) ON DELETE CASCADE," + "method_id INTEGER CONSTRAINT fk_method_id REFERENCES " + "METHODS(id)," + "mechanism_id INTEGER CONSTRAINT fk_mechanism_id " + "REFERENCES MECHANISMS(id)," + "secctx_id INTEGER CONSTRAINT fk_secctx_id REFERENCES " + "SECCTX(id));" + + "CREATE TABLE REFS" + "(identity_id INTEGER CONSTRAINT fk_identity_id " + "REFERENCES IDENTITY(id) ON DELETE CASCADE," + "secctx_id INTEGER CONSTRAINT fk_secctx_id REFERENCES " + "SECCTX(id)," + "ref TEXT," + "PRIMARY KEY (identity_id, secctx_id, ref));" + + "CREATE TABLE OWNER" + "(rowid INTEGER PRIMARY KEY AUTOINCREMENT," + "identity_id INTEGER CONSTRAINT fk_identity_id " + "REFERENCES IDENTITY(id) ON DELETE CASCADE," + "secctx_id INTEGER CONSTRAINT fk_secctx_id REFERENCES SECCTX(id) " + ");" + + // Triggers for deleting orphan SECCTX entries + "CREATE TRIGGER fkdstale_ACL_secctx_id_SECCTX_id" + "BEFORE DELETE ON [ACL]" + "FOR EACH ROW BEGIN" + " DELETE FROM SECCTX WHERE SECCTX.id = OLD.secctx_id AND " + " (SELECT COUNT(*) FROM REFS WHERE " + " REFS.secctx_id = OLD.secctx_id) == 0 AND " + " (SELECT COUNT(*) FROM OWNER WHERE " + " OWNER.secctx_id = OLD.secctx_id) == 0;" + "END;" + + "CREATE TRIGGER fkdstale_REFS_secctx_id_SECCTX_id" + "BEFORE DELETE ON [REFS]" + "FOR EACH ROW BEGIN" + " DELETE FROM SECCTX WHERE SECCTX.id = OLD.secctx_id AND " + " (SELECT COUNT(*) FROM ACL WHERE " + " ACL.secctx_id = OLD.secctx_id) == 0 AND " + " (SELECT COUNT(*) FROM OWNER WHERE " + " OWNER.secctx_id = OLD.secctx_id) == 0;" + "END;" + + "CREATE TRIGGER fkdstale_OWNER_secctx_id_SECCTX_id" + "BEFORE DELETE ON [OWNER]" + "FOR EACH ROW BEGIN" + " DELETE FROM SECCTX WHERE SECCTX.id = OLD.secctx_id AND " + " (SELECT COUNT(*) FROM ACL WHERE " + " ACL.secctx_id = OLD.secctx_id) == 0 AND " + " (SELECT COUNT(*) FROM REFS WHERE " + " REFS.secctx_id = OLD.secctx_id) == 0;" + "END;" + + // Trigger for deleting orphan METHODS entries + "CREATE TRIGGER fkdstale_ACL_method_id_METHODS_id" + "BEFORE DELETE ON [ACL]" + "FOR EACH ROW BEGIN" + " DELETE FROM METHODS WHERE METHODS.id = OLD.method_id AND " + " (SELECT COUNT(*) FROM ACL WHERE " + " ACL.method_id = OLD.method_id) == 1;" + "END;" + + // Trigger for deleting orphan MECHANISMS entries + "CREATE TRIGGER fkdstale_ACL_mechanism_id_MECHANISMS_id" + "BEFORE DELETE ON [ACL]" + "FOR EACH ROW BEGIN" + " DELETE FROM MECHANISMS WHERE MECHANISMS.id = OLD.mechanism_id " + " AND (SELECT COUNT(*) FROM ACL WHERE " + " ACL.mechanism_id = OLD.mechanism_id) == 1;" + "END;" + + /* + * triggers generated with + * http://www.rcs-comp.com/site/index.php/view/Utilities- + * SQLite_foreign_key_trigger_generator + */ + /* insert triggers to force foreign keys support */ + // Foreign Key Preventing insert + "CREATE TRIGGER fki_REALMS_identity_id_IDENTITY_id" + "BEFORE INSERT ON [REALMS]" + "FOR EACH ROW BEGIN" + " SELECT RAISE(ROLLBACK, 'insert on table REALMS violates foreign " + "key constraint fki_REALMS_identity_id_IDENTITY_id')" + " WHERE NEW.identity_id IS NOT NULL AND (SELECT id FROM IDENTITY " + "WHERE id = NEW.identity_id) IS NULL;" + "END;" + + // Foreign key preventing update + "CREATE TRIGGER fku_REALMS_identity_id_IDENTITY_id" + "BEFORE UPDATE ON [REALMS]" + "FOR EACH ROW BEGIN" + " SELECT RAISE(ROLLBACK, 'update on table REALMS violates " + "foreign key constraint fku_REALMS_identity_id_IDENTITY_id')" + " WHERE NEW.identity_id IS NOT NULL AND (SELECT id FROM " + "IDENTITY WHERE id = NEW.identity_id) IS NULL;" + "END;" + + // Foreign Key Preventing insert + "CREATE TRIGGER fki_ACL_identity_id_IDENTITY_id" + "BEFORE INSERT ON [ACL]" + "FOR EACH ROW BEGIN" + " SELECT RAISE(ROLLBACK, 'insert on table ACL violates foreign " + "key constraint fki_ACL_identity_id_IDENTITY_id')" + " WHERE NEW.identity_id IS NOT NULL AND (SELECT id FROM IDENTITY " + "WHERE id = NEW.identity_id) IS NULL;" + "END;" + + // Foreign key preventing update + "CREATE TRIGGER fku_ACL_identity_id_IDENTITY_id" + "BEFORE UPDATE ON [ACL]" + "FOR EACH ROW BEGIN" + " SELECT RAISE(ROLLBACK, 'update on table ACL violates foreign " + "key constraint fku_ACL_identity_id_IDENTITY_id')" + " WHERE NEW.identity_id IS NOT NULL AND (SELECT id FROM " + "IDENTITY WHERE id = NEW.identity_id) IS NULL;" + "END;" + + // Foreign Key Preventing insert + "CREATE TRIGGER fki_ACL_method_id_METHODS_id" + "BEFORE INSERT ON [ACL]" + "FOR EACH ROW BEGIN" + " SELECT RAISE(ROLLBACK, 'insert on table ACL violates foreign " + "key constraint fki_ACL_method_id_METHODS_id')" + " WHERE NEW.method_id IS NOT NULL AND (SELECT id FROM METHODS " + "WHERE id = NEW.method_id) IS NULL;" + "END;" + + // Foreign key preventing update + "CREATE TRIGGER fku_ACL_method_id_METHODS_id" + "BEFORE UPDATE ON [ACL]" + "FOR EACH ROW BEGIN" + " SELECT RAISE(ROLLBACK, 'update on table ACL violates foreign " + "key constraint fku_ACL_method_id_METHODS_id')" + " WHERE NEW.method_id IS NOT NULL AND (SELECT id FROM METHODS " + "WHERE id = NEW.method_id) IS NULL;" + "END;" + + // Foreign Key Preventing insert + "CREATE TRIGGER fki_ACL_mechanism_id_MECHANISMS_id" + "BEFORE INSERT ON [ACL]" + "FOR EACH ROW BEGIN" + " SELECT RAISE(ROLLBACK, 'insert on table ACL violates foreign " + "key constraint fki_ACL_mechanism_id_MECHANISMS_id')" + " WHERE NEW.mechanism_id IS NOT NULL AND (SELECT id FROM " + "MECHANISMS WHERE id = NEW.mechanism_id) IS NULL;" + "END;" + + // Foreign key preventing update + "CREATE TRIGGER fku_ACL_mechanism_id_MECHANISMS_id" + "BEFORE UPDATE ON [ACL]" + "FOR EACH ROW BEGIN" + " SELECT RAISE(ROLLBACK, 'update on table ACL violates foreign " + "key constraint fku_ACL_mechanism_id_MECHANISMS_id')" + " WHERE NEW.mechanism_id IS NOT NULL AND (SELECT id FROM " + "MECHANISMS WHERE id = NEW.mechanism_id) IS NULL;" + "END;" + + // Foreign Key Preventing insert + "CREATE TRIGGER fki_ACL_secctx_id_SECCTX_id" + "BEFORE INSERT ON [ACL]" + "FOR EACH ROW BEGIN" + " SELECT RAISE(ROLLBACK, 'insert on table ACL violates foreign " + "key constraint fki_ACL_secctx_id_SECCTX_id')" + " WHERE NEW.secctx_id IS NOT NULL AND (SELECT id FROM SECCTX " + "WHERE id = NEW.secctx_id) IS NULL;" + "END;" + + // Foreign key preventing update + "CREATE TRIGGER fku_ACL_secctx_id_SECCTX_id" + "BEFORE UPDATE ON [ACL]" + "FOR EACH ROW BEGIN" + " SELECT RAISE(ROLLBACK, 'update on table ACL violates foreign " + "key constraint fku_ACL_secctx_id_SECCTX_id')" + " WHERE NEW.secctx_id IS NOT NULL AND (SELECT id FROM SECCTX " + "WHERE id = NEW.secctx_id) IS NULL;" + "END;" + + // Foreign Key Preventing insert + "CREATE TRIGGER fki_REFS_identity_id_IDENTITY_id" + "BEFORE INSERT ON [REFS]" + "FOR EACH ROW BEGIN" + " SELECT RAISE(ROLLBACK, 'insert on table REFS violates foreign " + "key constraint fki_REFS_identity_id_IDENTITY_id')" + " WHERE NEW.identity_id IS NOT NULL AND (SELECT id FROM IDENTITY " + "WHERE id = NEW.identity_id) IS NULL;" + "END;" + + // Foreign key preventing update + "CREATE TRIGGER fku_REFS_identity_id_IDENTITY_id" + "BEFORE UPDATE ON [REFS]" + "FOR EACH ROW BEGIN" + " SELECT RAISE(ROLLBACK, 'update on table REFS violates foreign " + "key constraint fku_REFS_identity_id_IDENTITY_id')" + " WHERE NEW.identity_id IS NOT NULL AND (SELECT id FROM " + "IDENTITY WHERE id = NEW.identity_id) IS NULL;" + "END;" + + // Foreign Key Preventing insert + "CREATE TRIGGER fki_REFS_secctx_id_SECCTX_id" + "BEFORE INSERT ON [REFS]" + "FOR EACH ROW BEGIN" + " SELECT RAISE(ROLLBACK, 'insert on table REFS violates foreign " + "key constraint fki_REFS_secctx_id_SECCTX_id')" + " WHERE NEW.secctx_id IS NOT NULL AND (SELECT id FROM SECCTX " + "WHERE id = NEW.secctx_id) IS NULL;" + "END;" + + // Foreign key preventing update + "CREATE TRIGGER fku_REFS_secctx_id_SECCTX_id" + "BEFORE UPDATE ON [REFS]" + "FOR EACH ROW BEGIN" + " SELECT RAISE(ROLLBACK, 'update on table REFS violates foreign " + "key constraint fku_REFS_secctx_id_SECCTX_id')" + " WHERE NEW.secctx_id IS NOT NULL AND (SELECT id FROM SECCTX " + "WHERE id = NEW.secctx_id) IS NULL;" + "END;" + + // Foreign Key Preventing insert + "CREATE TRIGGER fki_OWNER_identity_id_IDENTITY_id" + "BEFORE INSERT ON [OWNER]" + "FOR EACH ROW BEGIN" + " SELECT RAISE(ROLLBACK, 'insert on table OWNER violates " + "foreign key constraint fki_OWNER_identity_id_IDENTITY_id')" + " WHERE NEW.identity_id IS NOT NULL AND (SELECT id FROM " + "IDENTITY WHERE id = NEW.identity_id) IS NULL;" + "END;" + + // Foreign key preventing update + "CREATE TRIGGER fku_OWNER_identity_id_IDENTITY_id" + "BEFORE UPDATE ON [OWNER]" + "FOR EACH ROW BEGIN" + " SELECT RAISE(ROLLBACK, 'update on table OWNER violates " + "foreign key constraint fku_OWNER_identity_id_IDENTITY_id')" + " WHERE NEW.identity_id IS NOT NULL AND (SELECT id FROM " + "IDENTITY WHERE id = NEW.identity_id) IS NULL;" + "END;" + + // Foreign Key Preventing insert + "CREATE TRIGGER fki_OWNER_secctx_id_SECCTX_id" + "BEFORE INSERT ON [OWNER]" + "FOR EACH ROW BEGIN" + " SELECT RAISE(ROLLBACK, 'insert on table OWNER violates foreign " + "key constraint fki_OWNER_secctx_id_SECCTX_id')" + " WHERE NEW.secctx_id IS NOT NULL AND (SELECT id FROM SECCTX " + "WHERE id = NEW.secctx_id) IS NULL;" + "END;" + + // Foreign key preventing update + "CREATE TRIGGER fku_OWNER_secctx_id_SECCTX_id" + "BEFORE UPDATE ON [OWNER]" + "FOR EACH ROW BEGIN" + " SELECT RAISE(ROLLBACK, 'update on table OWNER violates " + "foreign key constraint fku_OWNER_secctx_id_SECCTX_id')" + " WHERE NEW.secctx_id IS NOT NULL AND (SELECT id FROM SECCTX " + "WHERE id = NEW.secctx_id) IS NULL;" + "END;" + ; + + return gsignond_db_sql_database_transaction_exec (obj, queries); +} + +static gboolean +_gsignond_db_metadata_database_clear ( + GSignondDbSqlDatabase *obj) +{ + const gchar *queries = NULL; + + g_return_val_if_fail (GSIGNOND_DB_IS_METADATA_DATABASE (obj), FALSE); + RETURN_IF_NOT_OPEN (obj, FALSE); + + queries = "" + "DELETE FROM IDENTITY;" + "DELETE FROM METHODS;" + "DELETE FROM MECHANISMS;" + "DELETE FROM ACL;" + "DELETE FROM REALMS;" + "DELETE FROM SECCTX;" + "DELETE FROM OWNER;"; + + return gsignond_db_sql_database_transaction_exec (obj, queries); +} + +/** + * gsignond_db_metadata_database_open: + * + * @self: instance of #GSignondDbMetadataDatabase + * + * Opens a connection to DB. + * + * Returns: TRUE if successful, FALSE otherwise. + */ +gboolean +gsignond_db_metadata_database_open (GSignondDbMetadataDatabase *self) +{ + const gchar *filename = NULL; + + g_return_val_if_fail (GSIGNOND_DB_IS_METADATA_DATABASE (self), FALSE); + + if (gsignond_db_sql_database_is_open (GSIGNOND_DB_SQL_DATABASE (self))) + return TRUE; + + filename = gsignond_config_get_string (self->config, + GSIGNOND_CONFIG_DB_METADATA_DB_FILENAME); + + return _gsignond_db_metadata_database_open ( + GSIGNOND_DB_SQL_DATABASE (self), filename, + SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE); +} + +/** + * gsignond_db_metadata_database_insert_method: + * + * @self: instance of #GSignondDbMetadataDatabase + * @method: the method to be inserted + * @method_id: (transfer none) id of the method inserted + * + * Inserts the method into the db. + * + * Returns: TRUE if successful, FALSE otherwise + */ +gboolean +gsignond_db_metadata_database_insert_method ( + GSignondDbMetadataDatabase *self, + const gchar *method, + guint32 *method_id) +{ + gchar *query = NULL; + gboolean ret = FALSE; + *method_id = 0; + + g_return_val_if_fail (GSIGNOND_DB_IS_METADATA_DATABASE (self), FALSE); + g_return_val_if_fail (method != NULL, FALSE); + RETURN_IF_NOT_OPEN (GSIGNOND_DB_SQL_DATABASE (self), FALSE); + + query = sqlite3_mprintf ("INSERT INTO METHODS (method) " + "VALUES (%Q);", + method); + ret = gsignond_db_sql_database_transaction_exec ( + GSIGNOND_DB_SQL_DATABASE (self), query); + sqlite3_free (query); + if (ret) { + DBG ("Retrieve method id for the inserted method"); + *method_id = gsignond_db_metadata_database_get_method_id (self, method); + } + return ret; +} + +/** + * gsignond_db_metadata_database_get_method_id: + * + * @self: instance of #GSignondDbMetadataDatabase + * @method: the method to be fetched + * + * Fetches the id of the specified method. + * + * Returns: the method if successful, 0 otherwise + */ +guint32 +gsignond_db_metadata_database_get_method_id ( + GSignondDbMetadataDatabase *self, + const gchar *method) +{ + gchar *query = NULL; + gint method_id = 0; + + g_return_val_if_fail (GSIGNOND_DB_IS_METADATA_DATABASE (self), FALSE); + g_return_val_if_fail (method != NULL, FALSE); + RETURN_IF_NOT_OPEN (GSIGNOND_DB_SQL_DATABASE (self), method_id); + + query = sqlite3_mprintf ("SELECT id FROM METHODS " + "WHERE method = %Q;", + method); + gsignond_db_sql_database_query_exec_int ( + GSIGNOND_DB_SQL_DATABASE (self), + query, + &method_id); + sqlite3_free (query); + + return (guint32) method_id; +} + +/** + * gsignond_db_metadata_database_get_methods: + * + * @self: instance of #GSignondDbMetadataDatabase + * @identity_id: the id of the identity + * @sec_ctx: the security context + * + * Fetches the list of the methods with the specified identity id. + * + * Returns: (transfer full) the list if successful, NULL otherwise. + * When done list should be freed with g_list_free_full (list, g_free) + */ +GList * +gsignond_db_metadata_database_get_methods ( + GSignondDbMetadataDatabase *self, + const guint32 identity_id, + GSignondSecurityContext* sec_ctx) +{ + gchar *query = NULL; + GList *methods = NULL; + + g_return_val_if_fail (GSIGNOND_DB_IS_METADATA_DATABASE (self), NULL); + g_return_val_if_fail (sec_ctx != NULL, NULL); + RETURN_IF_NOT_OPEN (GSIGNOND_DB_SQL_DATABASE (self), NULL); + + if (sec_ctx->sys_ctx && strlen (sec_ctx->sys_ctx) <= 0) { + query = sqlite3_mprintf ("SELECT DISTINCT METHODS.method FROM " + "( ACL JOIN METHODS ON ACL.method_id = METHODS.id ) " + "WHERE ACL.identity_id = %u;", + identity_id); + } else { + query = sqlite3_mprintf ("SELECT DISTINCT METHODS.method FROM " + "( ACL JOIN METHODS ON ACL.method_id = METHODS.id ) " + "WHERE ACL.identity_id = %u AND ACL.secctx_id = " + "(SELECT id FROM SECCTX " + "WHERE sysctx = %Q AND appctx = %Q);", + identity_id, sec_ctx->sys_ctx, sec_ctx->app_ctx); + } + + methods = gsignond_db_sql_database_query_exec_string_list ( + GSIGNOND_DB_SQL_DATABASE (self), + query); + sqlite3_free (query); + + return methods; +} + +/** + * gsignond_db_metadata_database_update_identity: + * + * @self: instance of #GSignondDbMetadataDatabase + * @identity: the identity #GSignondIdentityInfo object + * + * Updates the database with the data in the identity. + * + * Returns: the id of the identity if successful, 0 otherwise + */ +guint32 +gsignond_db_metadata_database_update_identity ( + GSignondDbMetadataDatabase *self, + GSignondIdentityInfo *identity) +{ + GSignondDbSqlDatabase *sql = NULL; + guint32 id = 0; + guint32 ret = 0; + GHashTable *methods = NULL; + GSequence *realms = NULL; + GSignondSecurityContextList *acl = NULL, *list = NULL; + GSignondSecurityContext *owner = NULL; + GHashTableIter method_iter; + const gchar *method = NULL; + GSequence *mechanisms = NULL; + + g_return_val_if_fail (GSIGNOND_DB_IS_METADATA_DATABASE (self), 0); + g_return_val_if_fail (identity != NULL, 0); + RETURN_IF_NOT_OPEN (GSIGNOND_DB_SQL_DATABASE (self), id); + + sql = GSIGNOND_DB_SQL_DATABASE (self); + if (!gsignond_db_sql_database_start_transaction (sql)) { + return 0; + } + + /* credentials */ + id = _gsignond_db_metadata_database_update_credentials (self, identity); + if (id == 0) { + DBG ("Update credentials failed"); + gsignond_db_sql_database_rollback_transaction (sql); + return 0; + } + + /* methods */ + methods = gsignond_identity_info_get_methods (identity); + if (!_gsignond_db_metadata_database_insert_methods (self, identity, + methods)) { + DBG ("Update methods failed"); + } + + /* realms */ + realms = gsignond_identity_info_get_realms (identity); + if (!_gsignond_db_metadata_database_update_realms (self, + identity, id, realms)) { + DBG ("Update realms failed"); + gsignond_db_sql_database_rollback_transaction (sql); + goto finished; + } + + /* acl */ + acl = gsignond_identity_info_get_access_control_list (identity); + if (!_gsignond_db_metadata_database_update_acl (self, identity, acl)) { + DBG ("Update acl failed"); + gsignond_db_sql_database_rollback_transaction (sql); + goto finished; + } + + /* owner */ + owner = gsignond_identity_info_get_owner (identity); + if (!_gsignond_db_metadata_database_update_owner (self, identity, owner)){ + DBG ("Update owner failed"); + gsignond_db_sql_database_rollback_transaction (sql); + goto finished; + } + + if (!gsignond_identity_info_get_is_identity_new (identity)) { + DBG ("Remove old acl and owner list as identity is not new"); + /* remove acl */ + _gsignond_db_metadata_database_exec (self, + "DELETE FROM ACL WHERE identity_id = %u;", id); + + /* remove owner */ + _gsignond_db_metadata_database_exec (self, + "DELETE FROM OWNER WHERE identity_id = %u;", id); + } + + /* ACL insert, this will do basically identity level ACL */ + g_hash_table_iter_init (&method_iter, methods); + while (g_hash_table_iter_next (&method_iter, (gpointer)&method, + (gpointer)&mechanisms)) { + + if (g_list_length (acl) > 0) { + for (list = acl; list != NULL; list = g_list_next (list)) { + GSequenceIter *mech_iter = NULL; + GSignondSecurityContext *ctx = NULL; + + ctx = (GSignondSecurityContext *) list->data; + mech_iter = g_sequence_get_begin_iter (mechanisms); + while (!g_sequence_iter_is_end (mech_iter)) { + _gsignond_db_metadata_database_exec (self, + "INSERT OR REPLACE INTO ACL " + "(identity_id, method_id, mechanism_id, secctx_id) " + "VALUES ( %u, " + "( SELECT id FROM METHODS WHERE method = %Q )," + "( SELECT id FROM MECHANISMS WHERE mechanism= %Q )," + " ( SELECT id FROM SECCTX WHERE sysctx = %Q " + "AND appctx = %Q));", + id, method, g_sequence_get (mech_iter), + ctx->sys_ctx, ctx->app_ctx); + mech_iter = g_sequence_iter_next (mech_iter); + } + if (g_sequence_get_length (mechanisms) <= 0) { + _gsignond_db_metadata_database_exec (self, + "INSERT OR REPLACE INTO ACL " + "(identity_id, method_id, secctx_id) " + "VALUES ( %u, " + "( SELECT id FROM METHODS WHERE method = %Q)," + "( SELECT id FROM SECCTX WHERE sysctx = %Q AND " + "appctx = %Q ));", + id, method, ctx->sys_ctx, ctx->app_ctx); + } + } + + } else { + GSequenceIter *mech_iter = NULL; + mech_iter = g_sequence_get_begin_iter (mechanisms); + while (!g_sequence_iter_is_end (mech_iter)) { + _gsignond_db_metadata_database_exec (self, + "INSERT OR REPLACE INTO ACL " + "(identity_id, method_id, mechanism_id) " + "VALUES ( %u, " + "( SELECT id FROM METHODS WHERE method = %Q )," + "( SELECT id FROM MECHANISMS WHERE mechanism= %Q ));", + id, method, g_sequence_get (mech_iter)); + mech_iter = g_sequence_iter_next (mech_iter); + } + if (g_sequence_get_length (mechanisms) <= 0) { + _gsignond_db_metadata_database_exec (self, + "INSERT OR REPLACE INTO ACL (identity_id, method_id) " + "VALUES ( %u, " + "( SELECT id FROM METHODS WHERE method = %Q ));", + id, method ); + } + } + } + /* insert acl in case where methods are missing */ + if (g_hash_table_size (methods) <= 0) { + for (list = acl; list != NULL; list = g_list_next (list)) { + GSignondSecurityContext *ctx = NULL; + + ctx = (GSignondSecurityContext *) list->data; + _gsignond_db_metadata_database_exec (self, + "INSERT OR REPLACE INTO ACL " + "(identity_id, secctx_id) " + "VALUES ( %u, " + "( SELECT id FROM SECCTX WHERE sysctx = %Q AND " + "appctx = %Q));", + id, ctx->sys_ctx, ctx->app_ctx); + } + } + + /* insert owner */ + _gsignond_db_metadata_database_exec (self, + "INSERT OR REPLACE INTO OWNER " + "(identity_id, secctx_id) " + "VALUES ( %u, " + "( SELECT id FROM SECCTX WHERE sysctx = %Q AND appctx = %Q ));", + id, owner->sys_ctx, owner->app_ctx); + + if (gsignond_db_sql_database_commit_transaction (sql)) { + DBG ("Identity updated"); + ret = id; + } + +finished: + if (methods) g_hash_table_unref (methods); + if (realms) g_sequence_free (realms); + if (acl) gsignond_security_context_list_free (acl); + if (owner) gsignond_security_context_free (owner); + + return ret; +} + +/** + * gsignond_db_metadata_database_update_identity: + * + * @self: instance of #GSignondDbMetadataDatabase + * @identity_id: the id of the identity + * + * Reads the identity data from the database based on the given id. + * + * Returns: (transfer full) the #GSignondIdentityInfo identity if successful, + * NULL otherwise. + */ +GSignondIdentityInfo * +gsignond_db_metadata_database_get_identity ( + GSignondDbMetadataDatabase *self, + const guint32 identity_id) +{ + GSignondIdentityInfo *identity = NULL; + gchar *query = NULL; + gint rows = 0; + GSequence *realms = NULL, *mechanisms = NULL; + GHashTable *methods = NULL, *tuples = NULL; + GHashTableIter iter; + gchar *method = NULL; + gint method_id = 0; + GSignondSecurityContextList *acl = NULL; + GSignondSecurityContext *owner = NULL; + + g_return_val_if_fail (GSIGNOND_DB_IS_METADATA_DATABASE (self), NULL); + RETURN_IF_NOT_OPEN (GSIGNOND_DB_SQL_DATABASE (self), NULL); + + identity = gsignond_identity_info_new (); + query = sqlite3_mprintf ("SELECT caption, username, flags, type " + "FROM IDENTITY WHERE id = %u;", + identity_id); + rows = gsignond_db_sql_database_query_exec (GSIGNOND_DB_SQL_DATABASE (self), + query, (GSignondDbSqlDatabaseQueryCallback) + _gsignond_db_metadata_database_read_identity, + identity); + sqlite3_free (query); + if (G_UNLIKELY (rows <= 0)) { + DBG ("Fetch IDENTITY failed"); + gsignond_identity_info_unref (identity); + return NULL; + } + gsignond_identity_info_set_id (identity, identity_id); + + /*realms*/ + realms = _gsignond_db_metadata_database_get_sequence (self, + "SELECT realm FROM REALMS " + "WHERE identity_id = %u;", + identity_id); + if (realms) { + gsignond_identity_info_set_realms (identity, realms); + g_sequence_free (realms); + } + + /*acl*/ + acl = gsignond_db_metadata_database_get_accesscontrol_list (self, + identity_id); + if (acl) { + gsignond_identity_info_set_access_control_list (identity, acl); + gsignond_security_context_list_free (acl); + } + + /*owner*/ + owner = gsignond_db_metadata_database_get_owner (self, + identity_id); + if (owner) { + gsignond_identity_info_set_owner (identity, owner); + gsignond_security_context_free (owner); + } + + /*methods*/ + query = sqlite3_mprintf ("SELECT DISTINCT ACL.method_id, METHODS.method " + "FROM ( ACL JOIN METHODS ON ACL.method_id = METHODS.id ) " + "WHERE ACL.identity_id = %u;", + identity_id); + tuples = gsignond_db_sql_database_query_exec_int_string_tuple ( + GSIGNOND_DB_SQL_DATABASE (self), + query); + sqlite3_free (query); + + if (tuples) { + methods = g_hash_table_new_full ((GHashFunc)g_str_hash, + (GEqualFunc)g_str_equal, + (GDestroyNotify)g_free, + (GDestroyNotify)g_sequence_free); + g_hash_table_iter_init(&iter, tuples); + while (g_hash_table_iter_next (&iter, (gpointer *)&method_id, + (gpointer *)&method)) { + /*mechanisms*/ + mechanisms = _gsignond_db_metadata_database_get_sequence (self, + "SELECT DISTINCT MECHANISMS.mechanism FROM " + "( MECHANISMS JOIN ACL ON ACL.mechanism_id = MECHANISMS.id ) " + "WHERE ACL.method_id = %u AND ACL.identity_id = %u;", + method_id, identity_id); + g_hash_table_insert(methods, g_strdup(method), mechanisms); + } + g_hash_table_destroy (tuples); + gsignond_identity_info_set_methods (identity, methods); + g_hash_table_destroy (methods); + } + + return identity; +} + +/** + * gsignond_db_metadata_database_get_identities: + * + * @self: instance of #GSignondDbMetadataDatabase + * @filter: (transfer none) filter to apply (supported filters: Owner, Type & Caption) + * + * Reads all the identities that are matched by applying @filter, + * from the database into a list. + * + * Returns: (transfer full) the list #GSignondIdentityInfoList if successful, + * NULL otherwise. When done the list should be freed with + * gsignond_identity_info_list_free + */ +GSignondIdentityInfoList * +gsignond_db_metadata_database_get_identities ( + GSignondDbMetadataDatabase *self, + GSignondDictionary *filter) +{ + GSignondIdentityInfoList *identities = NULL; + gchar *owner_query = NULL; + gchar *caption_query = NULL; + gchar *type_query = NULL; + gchar *query = NULL; + GArray *ids = NULL; + gint i; + + g_return_val_if_fail (GSIGNOND_DB_IS_METADATA_DATABASE (self), FALSE); + RETURN_IF_NOT_OPEN (GSIGNOND_DB_SQL_DATABASE (self), NULL); + + if (filter) { + GVariant *owner_var = NULL; + const gchar *caption = NULL; + gint type = 0; + gboolean append_where = TRUE; + + if ((owner_var = gsignond_dictionary_get (filter, "Owner"))) { + GSignondSecurityContext *owner_ctx = + gsignond_security_context_from_variant(owner_var); + owner_query = sqlite3_mprintf ("WHERE id IN " + "(SELECT identity_id FROM owner WHERE secctx_id = " + "(SELECT id FROM secctx WHERE sysctx=%Q AND appctx=%Q))", + gsignond_security_context_get_system_context(owner_ctx), + gsignond_security_context_get_application_context(owner_ctx)); + gsignond_security_context_free (owner_ctx); + append_where = FALSE; + } + + if ((caption = gsignond_dictionary_get_string (filter, "Caption"))) { + caption_query = sqlite3_mprintf (" %s caption like '%s%%'", + append_where ? "WHERE" : "AND", caption); + append_where = FALSE; + } + + if (gsignond_dictionary_get_int32 (filter, "Type", &type)) { + type_query = sqlite3_mprintf (" %s type = %d", + append_where ? "WHERE" : "AND", type); + append_where = FALSE; + } + } + + query = sqlite3_mprintf ("SELECT id FROM IDENTITY %s%s%s ORDER BY id", + owner_query ? owner_query : "", + caption_query ? caption_query : "", + type_query ? type_query : ""); + sqlite3_free(owner_query); + sqlite3_free(caption_query); + sqlite3_free(type_query); + + ids = gsignond_db_sql_database_query_exec_int_array ( + GSIGNOND_DB_SQL_DATABASE (self), + query); + sqlite3_free (query); + if (!ids) { + DBG ("No identity found"); + return NULL; + } + + for (i=0; i < ids->len; i++) { + GSignondIdentityInfo *identity = NULL; + identity = gsignond_db_metadata_database_get_identity (self, + g_array_index (ids, gint, i)); + if (identity) { + identities = g_list_append (identities, identity); + } + } + g_array_free (ids, TRUE); + return identities; +} + +/** + * gsignond_db_metadata_database_remove_identity: + * + * @self: instance of #GSignondDbMetadataDatabase + * @identity_id: the id of the identity + * + * Removes the identity data from the database based on the given id. + * + * Returns: TRUE if successful,FALSE otherwise. + */ +gboolean +gsignond_db_metadata_database_remove_identity ( + GSignondDbMetadataDatabase *self, + const guint32 identity_id) +{ + gchar *queries = NULL; + gboolean ret = FALSE; + + g_return_val_if_fail (GSIGNOND_DB_IS_METADATA_DATABASE (self), FALSE); + RETURN_IF_NOT_OPEN (GSIGNOND_DB_SQL_DATABASE (self), FALSE); + + /* Triggers should handle the cleanup of other tables */ + queries = sqlite3_mprintf ("DELETE FROM IDENTITY WHERE id = %u;", + identity_id); + ret = gsignond_db_sql_database_transaction_exec ( + GSIGNOND_DB_SQL_DATABASE (self), queries); + sqlite3_free (queries); + + return ret; +} + +/** + * gsignond_db_metadata_database_insert_reference: + * + * @self: instance of #GSignondDbMetadataDatabase + * @identity_id: the id of the identity + * @ref_owner: the owner security context + * @reference: reference for the given identity + * + * Insert reference into the database for the given identity id. + * + * Returns: TRUE if successful,FALSE otherwise. + */ +gboolean +gsignond_db_metadata_database_insert_reference ( + GSignondDbMetadataDatabase *self, + const guint32 identity_id, + const GSignondSecurityContext *ref_owner, + const gchar *reference) +{ + GSignondDbSqlDatabase *sql = NULL; + + g_return_val_if_fail (GSIGNOND_DB_IS_METADATA_DATABASE (self), 0); + g_return_val_if_fail (ref_owner != NULL && reference != NULL, FALSE); + RETURN_IF_NOT_OPEN (GSIGNOND_DB_SQL_DATABASE (self), FALSE); + + sql = GSIGNOND_DB_SQL_DATABASE (self); + if (!gsignond_db_sql_database_start_transaction (sql)) { + DBG ("Start transaction failed"); + return FALSE; + } + + if (!_gsignond_db_metadata_database_exec (self, + "INSERT OR IGNORE INTO SECCTX (sysctx, appctx) " + "VALUES ( %Q, %Q );", ref_owner->sys_ctx, ref_owner->app_ctx)) { + DBG ("Insertion SECCTX to DB failed"); + gsignond_db_sql_database_rollback_transaction (sql); + return FALSE; + } + if (!_gsignond_db_metadata_database_exec (self, + "INSERT OR REPLACE INTO REFS " + "(identity_id, secctx_id, ref) " + "VALUES ( %u, " + "( SELECT id FROM SECCTX " + "WHERE sysctx = %Q AND appctx = %Q), %Q );", + identity_id, ref_owner->sys_ctx, ref_owner->app_ctx, reference)) { + DBG ("Insertion to REFS failed"); + gsignond_db_sql_database_rollback_transaction (sql); + return FALSE; + } + + return gsignond_db_sql_database_commit_transaction (sql); +} + +/** + * gsignond_db_metadata_database_remove_reference: + * + * @self: instance of #GSignondDbMetadataDatabase + * @identity_id: the id of the identity + * @ref_owner: the owner security context + * @reference: reference for the given identity + * + * Removes reference from the database for the given identity id. + * + * Returns: TRUE if successful,FALSE otherwise. + */ +gboolean +gsignond_db_metadata_database_remove_reference ( + GSignondDbMetadataDatabase *self, + const guint32 identity_id, + const GSignondSecurityContext *ref_owner, + const gchar *reference) +{ + GSignondDbSqlDatabase *sql = NULL; + GList *refs = NULL; + gboolean ret = TRUE; + guint len = 0; + + g_return_val_if_fail (GSIGNOND_DB_IS_METADATA_DATABASE (self), 0); + g_return_val_if_fail (ref_owner != NULL, FALSE); + RETURN_IF_NOT_OPEN (GSIGNOND_DB_SQL_DATABASE (self), FALSE); + + sql = GSIGNOND_DB_SQL_DATABASE (self); + if (!gsignond_db_sql_database_start_transaction (sql)) { + DBG ("Start transaction failed"); + return FALSE; + } + + refs = gsignond_db_metadata_database_get_references (self, + identity_id, ref_owner); + + len = g_list_length (refs); + if (reference && !g_list_find_custom (refs, reference, + (GCompareFunc)g_strcmp0)) + ret = FALSE; + g_list_free_full (refs, (GDestroyNotify)g_free); + if (len <= 0 || !ret) { + DBG ("No ref found"); + gsignond_db_sql_database_rollback_transaction (sql); + return FALSE; + } + + if (!reference || strlen (reference) <= 0) { + ret = _gsignond_db_metadata_database_exec (self, + "DELETE FROM REFS " + "WHERE identity_id = %u AND " + "secctx_id = ( SELECT id FROM SECCTX " + "WHERE sysctx = %Q AND appctx = %Q );", + identity_id, ref_owner->sys_ctx, ref_owner->app_ctx); + } else { + ret = _gsignond_db_metadata_database_exec (self, + "DELETE FROM REFS " + "WHERE identity_id = %u AND " + "secctx_id = ( SELECT id FROM SECCTX " + "WHERE sysctx = %Q AND appctx = %Q ) " + "AND ref = :ref;", + identity_id, ref_owner->sys_ctx, ref_owner->app_ctx, reference); + } + if (!ret) { + DBG ("Delete refs from DB failed"); + gsignond_db_sql_database_rollback_transaction (sql); + return FALSE; + } + + return gsignond_db_sql_database_commit_transaction (sql); +} + +/** + * gsignond_db_metadata_database_get_references: + * + * @self: instance of #GSignondDbMetadataDatabase + * @identity_id: the id of the identity + * @ref_owner: the owner security context + * + * Gets references from the database for the given identity id. + * + * Returns: (transfer full) the list #GList if successful, + * NULL otherwise. When done the list should be freed with + * g_list_free_full (list, g_free) + */ +GList * +gsignond_db_metadata_database_get_references ( + GSignondDbMetadataDatabase *self, + const guint32 identity_id, + const GSignondSecurityContext* ref_owner) +{ + gchar *query = NULL; + GList *list = NULL; + + g_return_val_if_fail (GSIGNOND_DB_IS_METADATA_DATABASE (self), NULL); + g_return_val_if_fail (ref_owner != NULL, NULL); + RETURN_IF_NOT_OPEN (GSIGNOND_DB_SQL_DATABASE (self), NULL); + + if (!ref_owner->sys_ctx || strlen (ref_owner->sys_ctx) <= 0) { + query = sqlite3_mprintf ("SELECT ref FROM REFS " + "WHERE identity_id = %u;", + identity_id); + } else { + query = sqlite3_mprintf ("SELECT ref FROM REFS " + "WHERE identity_id = %u AND " + "secctx_id = (SELECT id FROM SECCTX " + "WHERE sysctx = %Q AND appctx = %Q );", + identity_id, ref_owner->sys_ctx, ref_owner->app_ctx ); + } + list = gsignond_db_sql_database_query_exec_string_list ( + GSIGNOND_DB_SQL_DATABASE (self), + query); + sqlite3_free (query); + return list; +} + +/** + * gsignond_db_metadata_database_get_accesscontrol_list: + * + * @self: instance of #GSignondDbMetadataDatabase + * @identity_id: the id of the identity whose access control list is needed + * + * Gets all the access control list from the database into a list. + * + * Returns: (transfer full) the list #GSignondSecurityContextList if successful, + * NULL otherwise. When done the list should be freed with + * gsignond_identity_info_list_free + */ +GSignondSecurityContextList * +gsignond_db_metadata_database_get_accesscontrol_list( + GSignondDbMetadataDatabase *self, + const guint32 identity_id) +{ + GSignondSecurityContextList *list = NULL; + GHashTable *tuples = NULL; + gchar *query = NULL; + GHashTableIter iter; + const gchar *sysctx = NULL, *appctx = NULL; + GSignondSecurityContext *ctx = NULL; + + g_return_val_if_fail (GSIGNOND_DB_IS_METADATA_DATABASE (self), FALSE); + RETURN_IF_NOT_OPEN (GSIGNOND_DB_SQL_DATABASE (self), NULL); + + query = sqlite3_mprintf ("SELECT sysctx, appctx FROM SECCTX " + "WHERE id IN " + "(SELECT secctx_id FROM ACL WHERE identity_id = %u);", + identity_id); + tuples = gsignond_db_sql_database_query_exec_string_tuple ( + GSIGNOND_DB_SQL_DATABASE (self), + query); + sqlite3_free (query); + + if (tuples) { + g_hash_table_iter_init(&iter, tuples); + while (g_hash_table_iter_next (&iter, (gpointer *)&sysctx, + (gpointer *)&appctx)) { + ctx = gsignond_security_context_new_from_values (sysctx, appctx); + list = g_list_append (list, ctx); + } + g_hash_table_unref (tuples); + } + return list; +} + +/** + * gsignond_db_metadata_database_get_owner: + * + * @self: instance of #GSignondDbMetadataDatabase + * @identity_id: the id of the identity whose owner list is needed + * + * Gets the onwer of identity referred by @identity_id from the database. + * + * Returns: (transfer full) the #GSignondSecurityContext if successful, + * NULL otherwise. When done the list should be freed with + * gsignond_identity_info_unref + */ +GSignondSecurityContext * +gsignond_db_metadata_database_get_owner( + GSignondDbMetadataDatabase *self, + const guint32 identity_id) +{ + GHashTable *tuples = NULL; + gchar *query = NULL; + GSignondSecurityContext *ctx = NULL; + + g_return_val_if_fail (GSIGNOND_DB_IS_METADATA_DATABASE (self), FALSE); + RETURN_IF_NOT_OPEN (GSIGNOND_DB_SQL_DATABASE (self), NULL); + + query = sqlite3_mprintf ("SELECT sysctx, appctx FROM SECCTX " + "WHERE id IN " + "(SELECT secctx_id FROM OWNER WHERE identity_id = %u);", + identity_id); + tuples = gsignond_db_sql_database_query_exec_string_tuple ( + GSIGNOND_DB_SQL_DATABASE (self), + query); + sqlite3_free (query); + + if (tuples) { + GHashTableIter iter; + const gchar *sysctx = NULL, *appctx = NULL; + g_hash_table_iter_init(&iter, tuples); + while (g_hash_table_iter_next (&iter, (gpointer *)&sysctx, + (gpointer *)&appctx)) { + ctx = gsignond_security_context_new_from_values (sysctx, appctx); + break; + } + g_hash_table_unref (tuples); + } + return ctx; +} + + diff --git a/src/daemon/db/gsignond-db-metadata-database.h b/src/daemon/db/gsignond-db-metadata-database.h new file mode 100644 index 0000000..0a787af --- /dev/null +++ b/src/daemon/db/gsignond-db-metadata-database.h @@ -0,0 +1,156 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2012 Intel Corporation. + * + * Contact: Imran Zaman <imran.zaman@linux.intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#ifndef __GSIGNOND_DB_METADATA_DATABASE_H__ +#define __GSIGNOND_DB_METADATA_DATABASE_H__ + +#include <glib.h> +#include <glib-object.h> +#include <gsignond/gsignond-identity-info.h> +#include <gsignond/gsignond-config.h> +#include <common/db/gsignond-db-sql-database.h> + +G_BEGIN_DECLS + +/* + * Type macros. + */ +#define GSIGNOND_DB_TYPE_METADATA_DATABASE \ + (gsignond_db_metadata_database_get_type ()) +#define GSIGNOND_DB_METADATA_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ + GSIGNOND_DB_TYPE_METADATA_DATABASE, \ + GSignondDbMetadataDatabase)) +#define GSIGNOND_DB_IS_METADATA_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),\ + GSIGNOND_DB_TYPE_METADATA_DATABASE)) +#define GSIGNOND_DB_METADATA_DATABASE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), \ + GSIGNOND_DB_TYPE_METADATA_DATABASE, \ + GSignondDbMetadataDatabaseClass)) +#define GSIGNOND_DB_IS_METADATA_DATABASE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), \ + GSIGNOND_DB_TYPE_METADATA_DATABASE)) +#define GSIGNOND_DB_METADATA_DATABASE_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), \ + GSIGNOND_DB_TYPE_METADATA_DATABASE, \ + GSignondDbMetadataDatabaseClass)) + +typedef struct _GSignondDbMetadataDatabasePrivate + GSignondDbMetadataDatabasePrivate; + +typedef struct +{ + GSignondDbSqlDatabase parent_instance; + + /*< private >*/ + GSignondConfig *config; + GSignondDbMetadataDatabasePrivate *priv; +} GSignondDbMetadataDatabase; + +typedef struct { + GSignondDbSqlDatabaseClass parent_class; + +} GSignondDbMetadataDatabaseClass; + +/* used by GSIGNOND_DB_TYPE_METADATA_DATABASE */ +GType +gsignond_db_metadata_database_get_type (void); + +GSignondDbMetadataDatabase* +gsignond_db_metadata_database_new (GSignondConfig *config); + +gboolean +gsignond_db_metadata_database_open (GSignondDbMetadataDatabase *self); + +gboolean +gsignond_db_metadata_database_insert_method ( + GSignondDbMetadataDatabase *self, + const gchar *method, + guint32 *method_id); + +guint32 +gsignond_db_metadata_database_get_method_id ( + GSignondDbMetadataDatabase *self, + const gchar *method); + +GList * +gsignond_db_metadata_database_get_methods ( + GSignondDbMetadataDatabase *self, + const guint32 identity_id, + GSignondSecurityContext* sec_ctx); + +guint32 +gsignond_db_metadata_database_update_identity ( + GSignondDbMetadataDatabase *self, + GSignondIdentityInfo *identity); + +GSignondIdentityInfo * +gsignond_db_metadata_database_get_identity ( + GSignondDbMetadataDatabase *self, + const guint32 identity_id); + +GSignondIdentityInfoList * +gsignond_db_metadata_database_get_identities ( + GSignondDbMetadataDatabase *self, + GSignondDictionary *filter); + +gboolean +gsignond_db_metadata_database_remove_identity ( + GSignondDbMetadataDatabase *self, + const guint32 identity_id); + +gboolean +gsignond_db_metadata_database_insert_reference ( + GSignondDbMetadataDatabase *self, + const guint32 identity_id, + const GSignondSecurityContext *ref_owner, + const gchar *reference); + +gboolean +gsignond_db_metadata_database_remove_reference ( + GSignondDbMetadataDatabase *self, + const guint32 identity_id, + const GSignondSecurityContext *ref_owner, + const gchar *reference); + +GList * +gsignond_db_metadata_database_get_references ( + GSignondDbMetadataDatabase *self, + const guint32 identity_id, + const GSignondSecurityContext* ref_owner); + +GSignondSecurityContextList * +gsignond_db_metadata_database_get_accesscontrol_list( + GSignondDbMetadataDatabase *self, + const guint32 identity_id); + +GSignondSecurityContext * +gsignond_db_metadata_database_get_owner( + GSignondDbMetadataDatabase *self, + const guint32 identity_id); + +G_END_DECLS + +#endif /* __GSIGNOND_DB_METADATA_DATABASE_H__ */ + diff --git a/src/daemon/dbus/Makefile.am b/src/daemon/dbus/Makefile.am new file mode 100644 index 0000000..a5f9596 --- /dev/null +++ b/src/daemon/dbus/Makefile.am @@ -0,0 +1,127 @@ +NULL= +INTERFACES_DIR = $(top_srcdir)/src/daemon/dbus/interfaces +SERVICES_DIR = $(top_builddir)/src/daemon/dbus/services +DBUS_BUILT_SOURCES = \ + gsignond-dbus-auth-service-gen.c \ + gsignond-dbus-auth-service-gen.h \ + gsignond-dbus-auth-session-gen.c \ + gsignond-dbus-auth-session-gen.h \ + gsignond-dbus-identity-gen.c \ + gsignond-dbus-identity-gen.h \ + gsignond-dbus-signonui-gen.c \ + gsignond-dbus-signonui-gen.h \ + gsignond-dbus-remote-plugin-gen.c \ + gsignond-dbus-remote-plugin-gen.h \ + $(NULL) + +DBUS_BUILT_DOCS = \ + gsignond-dbus-auth-service-doc-gen-com.google.code.AccountsSSO.gSingleSignOn.AuthService.xml \ + gsignond-dbus-auth-session-doc-gen-com.google.code.AccountsSSO.gSingleSignOn.AuthSession.xml \ + gsignond-dbus-identity-doc-gen-com.google.code.AccountsSSO.gSingleSignOn.Identity.xml \ + gsignond-dbus-signonui-doc-gen-org.tizen.SSO.singlesignonui.xml \ + gsignond-dbus-remote-plugin-doc-gen-com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin.xml \ + $(NULL) + +DBUS_INTERFACE_PREFIX="com.google.code.AccountsSSO.gSingleSignOn." +gsignond-dbus-auth-service-gen.c gsignond-dbus-auth-service-gen.h : $(INTERFACES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.AuthService.xml + gdbus-codegen \ + --interface-prefix $(DBUS_INTERFACE_PREFIX) \ + --c-namespace GSignondDbus \ + --generate-c-code gsignond-dbus-auth-service-gen \ + --generate-docbook gsignond-dbus-auth-service-doc-gen \ + $< + +gsignond-dbus-auth-session-gen.c gsignond-dbus-auth-session-gen.h : $(INTERFACES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.AuthSession.xml + gdbus-codegen \ + --interface-prefix $(DBUS_INTERFACE_PREFIX) \ + --c-namespace GSignondDbus \ + --generate-c-code gsignond-dbus-auth-session-gen \ + --generate-docbook gsignond-dbus-auth-session-doc-gen \ + $< + +gsignond-dbus-identity-gen.c gsignond-dbus-identity-gen.h : $(INTERFACES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.Identity.xml + gdbus-codegen \ + --interface-prefix $(DBUS_INTERFACE_PREFIX) \ + --c-namespace GSignondDbus \ + --generate-c-code gsignond-dbus-identity-gen \ + --generate-docbook gsignond-dbus-identity-doc-gen \ + $< + +gsignond-dbus-signonui-gen.c gsignond-dbus-signonui-gen.h : $(INTERFACES_DIR)/org.tizen.SSO.singlesignonui.xml + gdbus-codegen \ + --interface-prefix org.tizen.SSO \ + --c-namespace GSignondDbus \ + --generate-c-code gsignond-dbus-signonui-gen \ + --generate-docbook gsignond-dbus-signonui-doc-gen\ + $< + +gsignond-dbus-remote-plugin-gen.c gsignond-dbus-remote-plugin-gen.h : $(INTERFACES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin.xml + gdbus-codegen \ + --interface-prefix $(DBUS_INTERFACE_PREFIX) \ + --c-namespace GSignondDbus \ + --generate-c-code gsignond-dbus-remote-plugin-gen \ + --generate-docbook gsignond-dbus-remote-plugin-doc-gen \ + $< + +lib_LTLIBRARIES = libgsignond-dbus-glue.la + +libgsignond_dbus_glue_la_CPPFLAGS = \ + -I$(top_builddir) \ + $(GSIGNOND_CFLAGS) \ + $(NULL) + +libgsignond_dbus_glue_la_LIBADD = \ + $(GSIGNOND_LIBS) \ + $(NULL) + +libgsignond_dbus_glue_la_SOURCES = $(DBUS_BUILT_SOURCES) + +lib_LTLIBRARIES += libgsignond-dbus.la + +libgsignond_dbus_la_CPPFLAGS = \ + -I$(top_builddir) \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/src \ + -I$(top_builddir)/src/daemon/dbus \ + $(GSIGNOND_CFLAGS) \ + $(NULL) + +libgsignond_dbus_la_LIBADD = \ + libgsignond-dbus-glue.la \ + $(GSIGNOND_LIBS) \ + $(NULL) + +libgsignond_dbus_la_SOURCES = \ + $(DBUS_BUILT_SOURCES) \ + gsignond-dbus.h \ + gsignond-dbus-server.c \ + gsignond-dbus-server.h \ + gsignond-dbus-auth-service-adapter.c \ + gsignond-dbus-auth-service-adapter.h \ + gsignond-dbus-auth-session-adapter.c \ + gsignond-dbus-auth-session-adapter.h \ + gsignond-dbus-identity-adapter.c \ + gsignond-dbus-identity-adapter.h \ + gsignond-dbus-signonui-adapter.c \ + gsignond-dbus-signonui-adapter.h \ + $(NULL) + +dbusservicedir = $(DBUS_SERVICES_DIR) +dbusservice_DATA = \ + $(SERVICES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.service +nodist_dbusservice_DATA = \ + $(SERVICES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.service + +dbusinterfacesdir = $(DBUS_INTERFACES_DIR) +dbusinterfaces_DATA = \ + $(INTERFACES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.AuthService.xml \ + $(INTERFACES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.AuthSession.xml \ + $(INTERFACES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.Identity.xml \ + $(INTERFACES_DIR)/org.tizen.SSO.singlesignonui.xml \ + $(INTERFACES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin.xml + +EXTRA_DIST = interfaces + +clean-local : + rm -f *~ $(DBUS_BUILT_SOURCES) $(DBUS_BUILT_DOCS) + diff --git a/src/daemon/dbus/Makefile.in b/src/daemon/dbus/Makefile.in new file mode 100644 index 0000000..649178f --- /dev/null +++ b/src/daemon/dbus/Makefile.in @@ -0,0 +1,906 @@ +# Makefile.in generated by automake 1.11.3 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ +pkglibdir = $(libdir)/@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 = src/daemon/dbus +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_gnu_make.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +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__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" \ + "$(DESTDIR)$(dbusinterfacesdir)" "$(DESTDIR)$(dbusservicedir)" \ + "$(DESTDIR)$(dbusservicedir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libgsignond_dbus_glue_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am__objects_1 = +am__objects_2 = \ + libgsignond_dbus_glue_la-gsignond-dbus-auth-service-gen.lo \ + libgsignond_dbus_glue_la-gsignond-dbus-auth-session-gen.lo \ + libgsignond_dbus_glue_la-gsignond-dbus-identity-gen.lo \ + libgsignond_dbus_glue_la-gsignond-dbus-signonui-gen.lo \ + libgsignond_dbus_glue_la-gsignond-dbus-remote-plugin-gen.lo \ + $(am__objects_1) +am_libgsignond_dbus_glue_la_OBJECTS = $(am__objects_2) +libgsignond_dbus_glue_la_OBJECTS = \ + $(am_libgsignond_dbus_glue_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +libgsignond_dbus_la_DEPENDENCIES = libgsignond-dbus-glue.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am__objects_3 = libgsignond_dbus_la-gsignond-dbus-auth-service-gen.lo \ + libgsignond_dbus_la-gsignond-dbus-auth-session-gen.lo \ + libgsignond_dbus_la-gsignond-dbus-identity-gen.lo \ + libgsignond_dbus_la-gsignond-dbus-signonui-gen.lo \ + libgsignond_dbus_la-gsignond-dbus-remote-plugin-gen.lo \ + $(am__objects_1) +am_libgsignond_dbus_la_OBJECTS = $(am__objects_3) \ + libgsignond_dbus_la-gsignond-dbus-server.lo \ + libgsignond_dbus_la-gsignond-dbus-auth-service-adapter.lo \ + libgsignond_dbus_la-gsignond-dbus-auth-session-adapter.lo \ + libgsignond_dbus_la-gsignond-dbus-identity-adapter.lo \ + libgsignond_dbus_la-gsignond-dbus-signonui-adapter.lo \ + $(am__objects_1) +libgsignond_dbus_la_OBJECTS = $(am_libgsignond_dbus_la_OBJECTS) +DEFAULT_INCLUDES = +depcomp = $(SHELL) $(top_srcdir)/build-aux/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_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +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_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = $(libgsignond_dbus_glue_la_SOURCES) \ + $(libgsignond_dbus_la_SOURCES) +DIST_SOURCES = $(libgsignond_dbus_glue_la_SOURCES) \ + $(libgsignond_dbus_la_SOURCES) +DATA = $(dbusinterfaces_DATA) $(dbusservice_DATA) \ + $(nodist_dbusservice_DATA) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHECK_CFLAGS = @CHECK_CFLAGS@ +CHECK_LIBS = @CHECK_LIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBUS_INTERFACES_DIR = @DBUS_INTERFACES_DIR@ +DBUS_SERVICES_DIR = @DBUS_SERVICES_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GREP = @GREP@ +GSIGNOND_CFLAGS = @GSIGNOND_CFLAGS@ +GSIGNOND_LIBS = @GSIGNOND_LIBS@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GTestDBus_CFLAGS = @GTestDBus_CFLAGS@ +GTestDBus_LIBS = @GTestDBus_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBECRYPTFS_CFLAGS = @LIBECRYPTFS_CFLAGS@ +LIBECRYPTFS_LIBS = @LIBECRYPTFS_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSMACK_CFLAGS = @LIBSMACK_CFLAGS@ +LIBSMACK_LIBS = @LIBSMACK_LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MESSAGE_BUS_TYPE = @MESSAGE_BUS_TYPE@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +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@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +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@ +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@ +ifGNUmake = @ifGNUmake@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +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 = +INTERFACES_DIR = $(top_srcdir)/src/daemon/dbus/interfaces +SERVICES_DIR = $(top_builddir)/src/daemon/dbus/services +DBUS_BUILT_SOURCES = \ + gsignond-dbus-auth-service-gen.c \ + gsignond-dbus-auth-service-gen.h \ + gsignond-dbus-auth-session-gen.c \ + gsignond-dbus-auth-session-gen.h \ + gsignond-dbus-identity-gen.c \ + gsignond-dbus-identity-gen.h \ + gsignond-dbus-signonui-gen.c \ + gsignond-dbus-signonui-gen.h \ + gsignond-dbus-remote-plugin-gen.c \ + gsignond-dbus-remote-plugin-gen.h \ + $(NULL) + +DBUS_BUILT_DOCS = \ + gsignond-dbus-auth-service-doc-gen-com.google.code.AccountsSSO.gSingleSignOn.AuthService.xml \ + gsignond-dbus-auth-session-doc-gen-com.google.code.AccountsSSO.gSingleSignOn.AuthSession.xml \ + gsignond-dbus-identity-doc-gen-com.google.code.AccountsSSO.gSingleSignOn.Identity.xml \ + gsignond-dbus-signonui-doc-gen-org.tizen.SSO.singlesignonui.xml \ + gsignond-dbus-remote-plugin-doc-gen-com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin.xml \ + $(NULL) + +DBUS_INTERFACE_PREFIX = "com.google.code.AccountsSSO.gSingleSignOn." +lib_LTLIBRARIES = libgsignond-dbus-glue.la libgsignond-dbus.la +libgsignond_dbus_glue_la_CPPFLAGS = \ + -I$(top_builddir) \ + $(GSIGNOND_CFLAGS) \ + $(NULL) + +libgsignond_dbus_glue_la_LIBADD = \ + $(GSIGNOND_LIBS) \ + $(NULL) + +libgsignond_dbus_glue_la_SOURCES = $(DBUS_BUILT_SOURCES) +libgsignond_dbus_la_CPPFLAGS = \ + -I$(top_builddir) \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/src \ + -I$(top_builddir)/src/daemon/dbus \ + $(GSIGNOND_CFLAGS) \ + $(NULL) + +libgsignond_dbus_la_LIBADD = \ + libgsignond-dbus-glue.la \ + $(GSIGNOND_LIBS) \ + $(NULL) + +libgsignond_dbus_la_SOURCES = \ + $(DBUS_BUILT_SOURCES) \ + gsignond-dbus.h \ + gsignond-dbus-server.c \ + gsignond-dbus-server.h \ + gsignond-dbus-auth-service-adapter.c \ + gsignond-dbus-auth-service-adapter.h \ + gsignond-dbus-auth-session-adapter.c \ + gsignond-dbus-auth-session-adapter.h \ + gsignond-dbus-identity-adapter.c \ + gsignond-dbus-identity-adapter.h \ + gsignond-dbus-signonui-adapter.c \ + gsignond-dbus-signonui-adapter.h \ + $(NULL) + +dbusservicedir = $(DBUS_SERVICES_DIR) +dbusservice_DATA = \ + $(SERVICES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.service + +nodist_dbusservice_DATA = \ + $(SERVICES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.service + +dbusinterfacesdir = $(DBUS_INTERFACES_DIR) +dbusinterfaces_DATA = \ + $(INTERFACES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.AuthService.xml \ + $(INTERFACES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.AuthSession.xml \ + $(INTERFACES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.Identity.xml \ + $(INTERFACES_DIR)/org.tizen.SSO.singlesignonui.xml \ + $(INTERFACES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin.xml + +EXTRA_DIST = interfaces +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(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 src/daemon/dbus/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/daemon/dbus/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: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || 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)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_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 +libgsignond-dbus-glue.la: $(libgsignond_dbus_glue_la_OBJECTS) $(libgsignond_dbus_glue_la_DEPENDENCIES) $(EXTRA_libgsignond_dbus_glue_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) -rpath $(libdir) $(libgsignond_dbus_glue_la_OBJECTS) $(libgsignond_dbus_glue_la_LIBADD) $(LIBS) +libgsignond-dbus.la: $(libgsignond_dbus_la_OBJECTS) $(libgsignond_dbus_la_DEPENDENCIES) $(EXTRA_libgsignond_dbus_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) -rpath $(libdir) $(libgsignond_dbus_la_OBJECTS) $(libgsignond_dbus_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignond_dbus_glue_la-gsignond-dbus-auth-service-gen.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignond_dbus_glue_la-gsignond-dbus-auth-session-gen.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignond_dbus_glue_la-gsignond-dbus-identity-gen.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignond_dbus_glue_la-gsignond-dbus-remote-plugin-gen.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignond_dbus_glue_la-gsignond-dbus-signonui-gen.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-auth-service-adapter.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-auth-service-gen.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-auth-session-adapter.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-auth-session-gen.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-identity-adapter.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-identity-gen.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-remote-plugin-gen.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-server.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-signonui-adapter.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-signonui-gen.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +libgsignond_dbus_glue_la-gsignond-dbus-auth-service-gen.lo: gsignond-dbus-auth-service-gen.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_glue_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgsignond_dbus_glue_la-gsignond-dbus-auth-service-gen.lo -MD -MP -MF $(DEPDIR)/libgsignond_dbus_glue_la-gsignond-dbus-auth-service-gen.Tpo -c -o libgsignond_dbus_glue_la-gsignond-dbus-auth-service-gen.lo `test -f 'gsignond-dbus-auth-service-gen.c' || echo '$(srcdir)/'`gsignond-dbus-auth-service-gen.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgsignond_dbus_glue_la-gsignond-dbus-auth-service-gen.Tpo $(DEPDIR)/libgsignond_dbus_glue_la-gsignond-dbus-auth-service-gen.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-dbus-auth-service-gen.c' object='libgsignond_dbus_glue_la-gsignond-dbus-auth-service-gen.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_glue_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgsignond_dbus_glue_la-gsignond-dbus-auth-service-gen.lo `test -f 'gsignond-dbus-auth-service-gen.c' || echo '$(srcdir)/'`gsignond-dbus-auth-service-gen.c + +libgsignond_dbus_glue_la-gsignond-dbus-auth-session-gen.lo: gsignond-dbus-auth-session-gen.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_glue_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgsignond_dbus_glue_la-gsignond-dbus-auth-session-gen.lo -MD -MP -MF $(DEPDIR)/libgsignond_dbus_glue_la-gsignond-dbus-auth-session-gen.Tpo -c -o libgsignond_dbus_glue_la-gsignond-dbus-auth-session-gen.lo `test -f 'gsignond-dbus-auth-session-gen.c' || echo '$(srcdir)/'`gsignond-dbus-auth-session-gen.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgsignond_dbus_glue_la-gsignond-dbus-auth-session-gen.Tpo $(DEPDIR)/libgsignond_dbus_glue_la-gsignond-dbus-auth-session-gen.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-dbus-auth-session-gen.c' object='libgsignond_dbus_glue_la-gsignond-dbus-auth-session-gen.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_glue_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgsignond_dbus_glue_la-gsignond-dbus-auth-session-gen.lo `test -f 'gsignond-dbus-auth-session-gen.c' || echo '$(srcdir)/'`gsignond-dbus-auth-session-gen.c + +libgsignond_dbus_glue_la-gsignond-dbus-identity-gen.lo: gsignond-dbus-identity-gen.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_glue_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgsignond_dbus_glue_la-gsignond-dbus-identity-gen.lo -MD -MP -MF $(DEPDIR)/libgsignond_dbus_glue_la-gsignond-dbus-identity-gen.Tpo -c -o libgsignond_dbus_glue_la-gsignond-dbus-identity-gen.lo `test -f 'gsignond-dbus-identity-gen.c' || echo '$(srcdir)/'`gsignond-dbus-identity-gen.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgsignond_dbus_glue_la-gsignond-dbus-identity-gen.Tpo $(DEPDIR)/libgsignond_dbus_glue_la-gsignond-dbus-identity-gen.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-dbus-identity-gen.c' object='libgsignond_dbus_glue_la-gsignond-dbus-identity-gen.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_glue_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgsignond_dbus_glue_la-gsignond-dbus-identity-gen.lo `test -f 'gsignond-dbus-identity-gen.c' || echo '$(srcdir)/'`gsignond-dbus-identity-gen.c + +libgsignond_dbus_glue_la-gsignond-dbus-signonui-gen.lo: gsignond-dbus-signonui-gen.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_glue_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgsignond_dbus_glue_la-gsignond-dbus-signonui-gen.lo -MD -MP -MF $(DEPDIR)/libgsignond_dbus_glue_la-gsignond-dbus-signonui-gen.Tpo -c -o libgsignond_dbus_glue_la-gsignond-dbus-signonui-gen.lo `test -f 'gsignond-dbus-signonui-gen.c' || echo '$(srcdir)/'`gsignond-dbus-signonui-gen.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgsignond_dbus_glue_la-gsignond-dbus-signonui-gen.Tpo $(DEPDIR)/libgsignond_dbus_glue_la-gsignond-dbus-signonui-gen.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-dbus-signonui-gen.c' object='libgsignond_dbus_glue_la-gsignond-dbus-signonui-gen.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_glue_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgsignond_dbus_glue_la-gsignond-dbus-signonui-gen.lo `test -f 'gsignond-dbus-signonui-gen.c' || echo '$(srcdir)/'`gsignond-dbus-signonui-gen.c + +libgsignond_dbus_glue_la-gsignond-dbus-remote-plugin-gen.lo: gsignond-dbus-remote-plugin-gen.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_glue_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgsignond_dbus_glue_la-gsignond-dbus-remote-plugin-gen.lo -MD -MP -MF $(DEPDIR)/libgsignond_dbus_glue_la-gsignond-dbus-remote-plugin-gen.Tpo -c -o libgsignond_dbus_glue_la-gsignond-dbus-remote-plugin-gen.lo `test -f 'gsignond-dbus-remote-plugin-gen.c' || echo '$(srcdir)/'`gsignond-dbus-remote-plugin-gen.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgsignond_dbus_glue_la-gsignond-dbus-remote-plugin-gen.Tpo $(DEPDIR)/libgsignond_dbus_glue_la-gsignond-dbus-remote-plugin-gen.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-dbus-remote-plugin-gen.c' object='libgsignond_dbus_glue_la-gsignond-dbus-remote-plugin-gen.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_glue_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgsignond_dbus_glue_la-gsignond-dbus-remote-plugin-gen.lo `test -f 'gsignond-dbus-remote-plugin-gen.c' || echo '$(srcdir)/'`gsignond-dbus-remote-plugin-gen.c + +libgsignond_dbus_la-gsignond-dbus-auth-service-gen.lo: gsignond-dbus-auth-service-gen.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgsignond_dbus_la-gsignond-dbus-auth-service-gen.lo -MD -MP -MF $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-auth-service-gen.Tpo -c -o libgsignond_dbus_la-gsignond-dbus-auth-service-gen.lo `test -f 'gsignond-dbus-auth-service-gen.c' || echo '$(srcdir)/'`gsignond-dbus-auth-service-gen.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-auth-service-gen.Tpo $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-auth-service-gen.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-dbus-auth-service-gen.c' object='libgsignond_dbus_la-gsignond-dbus-auth-service-gen.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgsignond_dbus_la-gsignond-dbus-auth-service-gen.lo `test -f 'gsignond-dbus-auth-service-gen.c' || echo '$(srcdir)/'`gsignond-dbus-auth-service-gen.c + +libgsignond_dbus_la-gsignond-dbus-auth-session-gen.lo: gsignond-dbus-auth-session-gen.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgsignond_dbus_la-gsignond-dbus-auth-session-gen.lo -MD -MP -MF $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-auth-session-gen.Tpo -c -o libgsignond_dbus_la-gsignond-dbus-auth-session-gen.lo `test -f 'gsignond-dbus-auth-session-gen.c' || echo '$(srcdir)/'`gsignond-dbus-auth-session-gen.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-auth-session-gen.Tpo $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-auth-session-gen.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-dbus-auth-session-gen.c' object='libgsignond_dbus_la-gsignond-dbus-auth-session-gen.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgsignond_dbus_la-gsignond-dbus-auth-session-gen.lo `test -f 'gsignond-dbus-auth-session-gen.c' || echo '$(srcdir)/'`gsignond-dbus-auth-session-gen.c + +libgsignond_dbus_la-gsignond-dbus-identity-gen.lo: gsignond-dbus-identity-gen.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgsignond_dbus_la-gsignond-dbus-identity-gen.lo -MD -MP -MF $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-identity-gen.Tpo -c -o libgsignond_dbus_la-gsignond-dbus-identity-gen.lo `test -f 'gsignond-dbus-identity-gen.c' || echo '$(srcdir)/'`gsignond-dbus-identity-gen.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-identity-gen.Tpo $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-identity-gen.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-dbus-identity-gen.c' object='libgsignond_dbus_la-gsignond-dbus-identity-gen.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgsignond_dbus_la-gsignond-dbus-identity-gen.lo `test -f 'gsignond-dbus-identity-gen.c' || echo '$(srcdir)/'`gsignond-dbus-identity-gen.c + +libgsignond_dbus_la-gsignond-dbus-signonui-gen.lo: gsignond-dbus-signonui-gen.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgsignond_dbus_la-gsignond-dbus-signonui-gen.lo -MD -MP -MF $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-signonui-gen.Tpo -c -o libgsignond_dbus_la-gsignond-dbus-signonui-gen.lo `test -f 'gsignond-dbus-signonui-gen.c' || echo '$(srcdir)/'`gsignond-dbus-signonui-gen.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-signonui-gen.Tpo $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-signonui-gen.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-dbus-signonui-gen.c' object='libgsignond_dbus_la-gsignond-dbus-signonui-gen.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgsignond_dbus_la-gsignond-dbus-signonui-gen.lo `test -f 'gsignond-dbus-signonui-gen.c' || echo '$(srcdir)/'`gsignond-dbus-signonui-gen.c + +libgsignond_dbus_la-gsignond-dbus-remote-plugin-gen.lo: gsignond-dbus-remote-plugin-gen.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgsignond_dbus_la-gsignond-dbus-remote-plugin-gen.lo -MD -MP -MF $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-remote-plugin-gen.Tpo -c -o libgsignond_dbus_la-gsignond-dbus-remote-plugin-gen.lo `test -f 'gsignond-dbus-remote-plugin-gen.c' || echo '$(srcdir)/'`gsignond-dbus-remote-plugin-gen.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-remote-plugin-gen.Tpo $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-remote-plugin-gen.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-dbus-remote-plugin-gen.c' object='libgsignond_dbus_la-gsignond-dbus-remote-plugin-gen.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgsignond_dbus_la-gsignond-dbus-remote-plugin-gen.lo `test -f 'gsignond-dbus-remote-plugin-gen.c' || echo '$(srcdir)/'`gsignond-dbus-remote-plugin-gen.c + +libgsignond_dbus_la-gsignond-dbus-server.lo: gsignond-dbus-server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgsignond_dbus_la-gsignond-dbus-server.lo -MD -MP -MF $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-server.Tpo -c -o libgsignond_dbus_la-gsignond-dbus-server.lo `test -f 'gsignond-dbus-server.c' || echo '$(srcdir)/'`gsignond-dbus-server.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-server.Tpo $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-server.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-dbus-server.c' object='libgsignond_dbus_la-gsignond-dbus-server.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgsignond_dbus_la-gsignond-dbus-server.lo `test -f 'gsignond-dbus-server.c' || echo '$(srcdir)/'`gsignond-dbus-server.c + +libgsignond_dbus_la-gsignond-dbus-auth-service-adapter.lo: gsignond-dbus-auth-service-adapter.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgsignond_dbus_la-gsignond-dbus-auth-service-adapter.lo -MD -MP -MF $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-auth-service-adapter.Tpo -c -o libgsignond_dbus_la-gsignond-dbus-auth-service-adapter.lo `test -f 'gsignond-dbus-auth-service-adapter.c' || echo '$(srcdir)/'`gsignond-dbus-auth-service-adapter.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-auth-service-adapter.Tpo $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-auth-service-adapter.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-dbus-auth-service-adapter.c' object='libgsignond_dbus_la-gsignond-dbus-auth-service-adapter.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgsignond_dbus_la-gsignond-dbus-auth-service-adapter.lo `test -f 'gsignond-dbus-auth-service-adapter.c' || echo '$(srcdir)/'`gsignond-dbus-auth-service-adapter.c + +libgsignond_dbus_la-gsignond-dbus-auth-session-adapter.lo: gsignond-dbus-auth-session-adapter.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgsignond_dbus_la-gsignond-dbus-auth-session-adapter.lo -MD -MP -MF $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-auth-session-adapter.Tpo -c -o libgsignond_dbus_la-gsignond-dbus-auth-session-adapter.lo `test -f 'gsignond-dbus-auth-session-adapter.c' || echo '$(srcdir)/'`gsignond-dbus-auth-session-adapter.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-auth-session-adapter.Tpo $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-auth-session-adapter.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-dbus-auth-session-adapter.c' object='libgsignond_dbus_la-gsignond-dbus-auth-session-adapter.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgsignond_dbus_la-gsignond-dbus-auth-session-adapter.lo `test -f 'gsignond-dbus-auth-session-adapter.c' || echo '$(srcdir)/'`gsignond-dbus-auth-session-adapter.c + +libgsignond_dbus_la-gsignond-dbus-identity-adapter.lo: gsignond-dbus-identity-adapter.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgsignond_dbus_la-gsignond-dbus-identity-adapter.lo -MD -MP -MF $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-identity-adapter.Tpo -c -o libgsignond_dbus_la-gsignond-dbus-identity-adapter.lo `test -f 'gsignond-dbus-identity-adapter.c' || echo '$(srcdir)/'`gsignond-dbus-identity-adapter.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-identity-adapter.Tpo $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-identity-adapter.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-dbus-identity-adapter.c' object='libgsignond_dbus_la-gsignond-dbus-identity-adapter.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgsignond_dbus_la-gsignond-dbus-identity-adapter.lo `test -f 'gsignond-dbus-identity-adapter.c' || echo '$(srcdir)/'`gsignond-dbus-identity-adapter.c + +libgsignond_dbus_la-gsignond-dbus-signonui-adapter.lo: gsignond-dbus-signonui-adapter.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgsignond_dbus_la-gsignond-dbus-signonui-adapter.lo -MD -MP -MF $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-signonui-adapter.Tpo -c -o libgsignond_dbus_la-gsignond-dbus-signonui-adapter.lo `test -f 'gsignond-dbus-signonui-adapter.c' || echo '$(srcdir)/'`gsignond-dbus-signonui-adapter.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-signonui-adapter.Tpo $(DEPDIR)/libgsignond_dbus_la-gsignond-dbus-signonui-adapter.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-dbus-signonui-adapter.c' object='libgsignond_dbus_la-gsignond-dbus-signonui-adapter.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_dbus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgsignond_dbus_la-gsignond-dbus-signonui-adapter.lo `test -f 'gsignond-dbus-signonui-adapter.c' || echo '$(srcdir)/'`gsignond-dbus-signonui-adapter.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-dbusinterfacesDATA: $(dbusinterfaces_DATA) + @$(NORMAL_INSTALL) + test -z "$(dbusinterfacesdir)" || $(MKDIR_P) "$(DESTDIR)$(dbusinterfacesdir)" + @list='$(dbusinterfaces_DATA)'; test -n "$(dbusinterfacesdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dbusinterfacesdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(dbusinterfacesdir)" || exit $$?; \ + done + +uninstall-dbusinterfacesDATA: + @$(NORMAL_UNINSTALL) + @list='$(dbusinterfaces_DATA)'; test -n "$(dbusinterfacesdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(dbusinterfacesdir)'; $(am__uninstall_files_from_dir) +install-dbusserviceDATA: $(dbusservice_DATA) + @$(NORMAL_INSTALL) + test -z "$(dbusservicedir)" || $(MKDIR_P) "$(DESTDIR)$(dbusservicedir)" + @list='$(dbusservice_DATA)'; test -n "$(dbusservicedir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dbusservicedir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(dbusservicedir)" || exit $$?; \ + done + +uninstall-dbusserviceDATA: + @$(NORMAL_UNINSTALL) + @list='$(dbusservice_DATA)'; test -n "$(dbusservicedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(dbusservicedir)'; $(am__uninstall_files_from_dir) +install-nodist_dbusserviceDATA: $(nodist_dbusservice_DATA) + @$(NORMAL_INSTALL) + test -z "$(dbusservicedir)" || $(MKDIR_P) "$(DESTDIR)$(dbusservicedir)" + @list='$(nodist_dbusservice_DATA)'; test -n "$(dbusservicedir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dbusservicedir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(dbusservicedir)" || exit $$?; \ + done + +uninstall-nodist_dbusserviceDATA: + @$(NORMAL_UNINSTALL) + @list='$(nodist_dbusservice_DATA)'; test -n "$(dbusservicedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(dbusservicedir)'; $(am__uninstall_files_from_dir) + +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) $(DATA) +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(dbusinterfacesdir)" "$(DESTDIR)$(dbusservicedir)" "$(DESTDIR)$(dbusservicedir)"; 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: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +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-libLTLIBRARIES clean-libtool clean-local \ + 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-dbusinterfacesDATA install-dbusserviceDATA \ + install-nodist_dbusserviceDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +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-dbusinterfacesDATA uninstall-dbusserviceDATA \ + uninstall-libLTLIBRARIES uninstall-nodist_dbusserviceDATA + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool clean-local 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-dbusinterfacesDATA install-dbusserviceDATA install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man \ + install-nodist_dbusserviceDATA install-pdf install-pdf-am \ + 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-dbusinterfacesDATA \ + uninstall-dbusserviceDATA uninstall-libLTLIBRARIES \ + uninstall-nodist_dbusserviceDATA + +gsignond-dbus-auth-service-gen.c gsignond-dbus-auth-service-gen.h : $(INTERFACES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.AuthService.xml + gdbus-codegen \ + --interface-prefix $(DBUS_INTERFACE_PREFIX) \ + --c-namespace GSignondDbus \ + --generate-c-code gsignond-dbus-auth-service-gen \ + --generate-docbook gsignond-dbus-auth-service-doc-gen \ + $< + +gsignond-dbus-auth-session-gen.c gsignond-dbus-auth-session-gen.h : $(INTERFACES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.AuthSession.xml + gdbus-codegen \ + --interface-prefix $(DBUS_INTERFACE_PREFIX) \ + --c-namespace GSignondDbus \ + --generate-c-code gsignond-dbus-auth-session-gen \ + --generate-docbook gsignond-dbus-auth-session-doc-gen \ + $< + +gsignond-dbus-identity-gen.c gsignond-dbus-identity-gen.h : $(INTERFACES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.Identity.xml + gdbus-codegen \ + --interface-prefix $(DBUS_INTERFACE_PREFIX) \ + --c-namespace GSignondDbus \ + --generate-c-code gsignond-dbus-identity-gen \ + --generate-docbook gsignond-dbus-identity-doc-gen \ + $< + +gsignond-dbus-signonui-gen.c gsignond-dbus-signonui-gen.h : $(INTERFACES_DIR)/org.tizen.SSO.singlesignonui.xml + gdbus-codegen \ + --interface-prefix org.tizen.SSO \ + --c-namespace GSignondDbus \ + --generate-c-code gsignond-dbus-signonui-gen \ + --generate-docbook gsignond-dbus-signonui-doc-gen\ + $< + +gsignond-dbus-remote-plugin-gen.c gsignond-dbus-remote-plugin-gen.h : $(INTERFACES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin.xml + gdbus-codegen \ + --interface-prefix $(DBUS_INTERFACE_PREFIX) \ + --c-namespace GSignondDbus \ + --generate-c-code gsignond-dbus-remote-plugin-gen \ + --generate-docbook gsignond-dbus-remote-plugin-doc-gen \ + $< + +clean-local : + rm -f *~ $(DBUS_BUILT_SOURCES) $(DBUS_BUILT_DOCS) + +# 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/src/daemon/dbus/gsignond-dbus-auth-service-adapter.c b/src/daemon/dbus/gsignond-dbus-auth-service-adapter.c new file mode 100644 index 0000000..8be08f2 --- /dev/null +++ b/src/daemon/dbus/gsignond-dbus-auth-service-adapter.c @@ -0,0 +1,616 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2012 Intel Corporation. + * + * Contact: Amarnath Valluri <amarnath.valluri@linux.intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#include <config.h> +#include "gsignond-dbus-auth-service-adapter.h" +#include "gsignond-dbus-identity-adapter.h" +#include "gsignond-dbus.h" +#include "gsignond/gsignond-log.h" + +enum +{ + PROP_0, + + PROP_CONNECTION, + PROP_AUTH_SERVICE, + N_PROPERTIES +}; + +static GParamSpec *properties[N_PROPERTIES]; + +struct _GSignondDbusAuthServiceAdapterPrivate +{ + GDBusConnection *connection; + GSignondDbusAuthService *dbus_auth_service; + GSignondDaemon *auth_service; + GList *identities; +#ifndef USE_P2P + GHashTable *caller_watchers; //(dbus_caller:watcher_id) +#endif +}; + +G_DEFINE_TYPE (GSignondDbusAuthServiceAdapter, gsignond_dbus_auth_service_adapter, GSIGNOND_TYPE_DISPOSABLE) + +#define GSIGNOND_DBUS_AUTH_SERVICE_ADAPTER_GET_PRIV(obj) \ + G_TYPE_INSTANCE_GET_PRIVATE ((obj), GSIGNOND_TYPE_AUTH_SERVICE_ADAPTER, GSignondDbusAuthServiceAdapterPrivate) + +static gboolean _handle_register_new_identity (GSignondDbusAuthServiceAdapter *, GDBusMethodInvocation *, + const gchar *, gpointer); +static gboolean _handle_get_identity (GSignondDbusAuthServiceAdapter *, GDBusMethodInvocation *, guint32, + const gchar *, gpointer); +static gboolean _handle_query_methods (GSignondDbusAuthServiceAdapter *, + GDBusMethodInvocation *, + gpointer); +static gboolean _handle_query_mechanisms (GSignondDbusAuthServiceAdapter *, + GDBusMethodInvocation *, + const gchar *, gpointer); +static gboolean _handle_query_identities (GSignondDbusAuthServiceAdapter *, + GDBusMethodInvocation *, + GVariant*, + const gchar *, + gpointer); +static gboolean _handle_clear (GSignondDbusAuthServiceAdapter *, GDBusMethodInvocation *, gpointer); + +static void +_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GSignondDbusAuthServiceAdapter *self = GSIGNOND_DBUS_AUTH_SERVICE_ADAPTER (object); + + switch (property_id) { + case PROP_AUTH_SERVICE: { + GObject *auth_service = g_value_get_object (value); + if (auth_service) { + if (self->priv->auth_service) g_object_unref (self->priv->auth_service); + self->priv->auth_service = GSIGNOND_DAEMON (auth_service); + } + break; + } + case PROP_CONNECTION: + self->priv->connection = g_value_get_object(value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } +} + +static void +_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GSignondDbusAuthServiceAdapter *self = GSIGNOND_DBUS_AUTH_SERVICE_ADAPTER (object); + + switch (property_id) { + case PROP_AUTH_SERVICE: { + g_value_set_object (value, self->priv->auth_service); + break; + } + case PROP_CONNECTION: + g_value_set_object (value, self->priv->connection); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } +} + +static void +_identity_unref (gpointer data, gpointer user_data) +{ + if (data) g_object_unref (data); +} + +static void +_dispose (GObject *object) +{ + GSignondDbusAuthServiceAdapter *self = GSIGNOND_DBUS_AUTH_SERVICE_ADAPTER (object); + + DBG("- unregistering dubs auth service. %d", G_OBJECT (self->priv->auth_service)->ref_count); + + if (self->priv->identities) { + g_list_foreach (self->priv->identities, _identity_unref, NULL); + } + + if (self->priv->auth_service) { + g_object_unref (self->priv->auth_service); + self->priv->auth_service = NULL; + } + + if (self->priv->dbus_auth_service) { + g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (self->priv->dbus_auth_service)); + g_object_unref (self->priv->dbus_auth_service); + self->priv->dbus_auth_service = NULL; + } + + if (self->priv->connection) { + g_object_unref (self->priv->connection); + self->priv->connection = NULL; + } + +#ifndef USE_P2P + if (self->priv->caller_watchers) { + g_hash_table_unref (self->priv->caller_watchers); + self->priv->caller_watchers = NULL; + } +#endif + + G_OBJECT_CLASS (gsignond_dbus_auth_service_adapter_parent_class)->dispose (object); +} + +static void +_finalize (GObject *object) +{ + GSignondDbusAuthServiceAdapter *self = GSIGNOND_DBUS_AUTH_SERVICE_ADAPTER (object); + + if (self->priv->identities) { + g_list_free (self->priv->identities); + self->priv->identities = NULL; + } + + G_OBJECT_CLASS (gsignond_dbus_auth_service_adapter_parent_class)->finalize (object); +} + +static void +gsignond_dbus_auth_service_adapter_class_init (GSignondDbusAuthServiceAdapterClass *klass) +{ + GObjectClass* object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (GSignondDbusAuthServiceAdapterPrivate)); + + object_class->get_property = _get_property; + object_class->set_property = _set_property; + object_class->dispose = _dispose; + object_class->finalize = _finalize; + + properties[PROP_AUTH_SERVICE] = g_param_spec_object ("auth-service", + "Core auth service", + "AuthService core object", + GSIGNOND_TYPE_DAEMON, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); + + properties[PROP_CONNECTION] = g_param_spec_object ("connection", + "Bus connection", + "DBus connection used", + G_TYPE_DBUS_CONNECTION, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); + + g_object_class_install_properties (object_class, N_PROPERTIES, properties); +} + +static void +gsignond_dbus_auth_service_adapter_init (GSignondDbusAuthServiceAdapter *self) +{ + self->priv = GSIGNOND_DBUS_AUTH_SERVICE_ADAPTER_GET_PRIV(self); + + self->priv->connection = 0; + self->priv->auth_service = 0; + self->priv->identities = NULL; + self->priv->dbus_auth_service = gsignond_dbus_auth_service_skeleton_new (); +#ifndef USE_P2P + self->priv->caller_watchers = g_hash_table_new_full (g_str_hash, g_str_equal, + g_free, (GDestroyNotify)g_bus_unwatch_name); +#endif + + g_signal_connect_swapped (self->priv->dbus_auth_service, + "handle-register-new-identity", G_CALLBACK (_handle_register_new_identity), self); + g_signal_connect_swapped (self->priv->dbus_auth_service, + "handle-get-identity", G_CALLBACK(_handle_get_identity), self); + g_signal_connect_swapped (self->priv->dbus_auth_service, + "handle-query-methods", G_CALLBACK(_handle_query_methods), self); + g_signal_connect_swapped (self->priv->dbus_auth_service, + "handle-query-mechanisms", G_CALLBACK(_handle_query_mechanisms), self); + g_signal_connect_swapped (self->priv->dbus_auth_service, + "handle-query-identities", G_CALLBACK(_handle_query_identities), self); + g_signal_connect_swapped (self->priv->dbus_auth_service, + "handle-clear", G_CALLBACK(_handle_clear), self); +} + +#ifndef USE_P2P +static void +_clear_cache_for_name (gpointer data, gpointer user_data) +{ + g_return_if_fail (user_data); + g_return_if_fail (data && GSIGNOND_IS_DBUS_IDENTITY_ADAPTER (data)); + + const gchar *caller = (const gchar *)user_data; + GSignondDbusIdentityAdapter *dbus_identity = GSIGNOND_DBUS_IDENTITY_ADAPTER (data); + const gchar *identity_owner = g_object_get_data (G_OBJECT (dbus_identity), "dbus-client-name"); + + if (g_strcmp0 (identity_owner, caller) == 0) { + DBG ("removing dbus identity '%p' from cache", dbus_identity); + g_object_unref (dbus_identity); + } +} + +static void +_on_connnection_lost (GDBusConnection *conn, const char *peer_name, gpointer user_data) +{ + (void) conn; + g_return_if_fail (peer_name); + g_return_if_fail (user_data && GSIGNOND_IS_DBUS_AUTH_SERVICE_ADAPTER(user_data)); + + GSignondDbusAuthServiceAdapter *self = GSIGNOND_DBUS_AUTH_SERVICE_ADAPTER (user_data); + DBG ("(-)peer disappeared : %s", peer_name); + + g_list_foreach (self->priv->identities, _clear_cache_for_name, (gpointer)peer_name); + + if (g_hash_table_contains (self->priv->caller_watchers, peer_name)) { + g_hash_table_remove (self->priv->caller_watchers, (gpointer)peer_name); + } +} +#endif + +static void +_on_identity_disposed (gpointer data, GObject *object) +{ + GSignondDbusAuthServiceAdapter *self = GSIGNOND_DBUS_AUTH_SERVICE_ADAPTER (data); + + DBG ("identity object %p disposed", object); + self->priv->identities = g_list_remove (self->priv->identities, object); + + if (g_list_length (self->priv->identities) == 0) { + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), TRUE); + } +} + +static GSignondDbusIdentityAdapter * +_create_and_cache_dbus_identity (GSignondDbusAuthServiceAdapter *self, + GSignondIdentity *identity, + const gchar *app_context, + GDBusConnection *connection, + const gchar *sender) +{ + GSignondDbusIdentityAdapter *dbus_identity = NULL; + guint identity_timeout = gsignond_daemon_get_identity_timeout (self->priv->auth_service); + + dbus_identity = gsignond_dbus_identity_adapter_new_with_connection ( + g_object_ref (connection), identity, app_context, identity_timeout); + + /* keep alive till this identity object gets disposed */ + if (g_list_length (self->priv->identities) == 0) + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), FALSE); + + self->priv->identities = g_list_append (self->priv->identities, dbus_identity); + g_object_weak_ref (G_OBJECT (dbus_identity), _on_identity_disposed, self); +#ifndef USE_P2P + g_object_set_data_full (G_OBJECT(dbus_identity), "dbus-client-name", (gpointer)g_strdup(sender), g_free); + if (!g_hash_table_contains (self->priv->caller_watchers, sender)) { + guint watcher_id = g_bus_watch_name_on_connection (connection, sender, G_BUS_NAME_WATCHER_FLAGS_NONE, + NULL, _on_connnection_lost, self, NULL); + g_hash_table_insert (self->priv->caller_watchers, + (gpointer)g_strdup (sender), + GUINT_TO_POINTER(watcher_id)); + } +#endif + + return dbus_identity; +} + +static gboolean +_handle_register_new_identity (GSignondDbusAuthServiceAdapter *self, + GDBusMethodInvocation *invocation, + const gchar *app_context, + gpointer user_data) +{ + GSignondIdentity *identity = NULL; + GError *error = NULL; + GDBusConnection *connection = NULL; + const gchar *sender = NULL; + int fd = -1; + GSignondSecurityContext *sec_context = gsignond_security_context_new (); + + g_return_val_if_fail (self && GSIGNOND_IS_DBUS_AUTH_SERVICE_ADAPTER(self), FALSE); + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), FALSE); + + connection = g_dbus_method_invocation_get_connection (invocation); +#ifdef USE_P2P + fd = g_socket_get_fd (g_socket_connection_get_socket (G_SOCKET_CONNECTION (g_dbus_connection_get_stream(connection)))); +#else + sender = g_dbus_method_invocation_get_sender (invocation); +#endif + + gsignond_access_control_manager_security_context_of_peer( + gsignond_daemon_get_access_control_manager (self->priv->auth_service), + sec_context, + fd, + sender, + app_context); + + identity = gsignond_daemon_register_new_identity (self->priv->auth_service, sec_context, &error); + + if (identity) { + GSignondDbusIdentityAdapter *dbus_identity = _create_and_cache_dbus_identity (self, identity, app_context, connection, sender); + + gsignond_dbus_auth_service_complete_register_new_identity (self->priv->dbus_auth_service, + invocation, gsignond_dbus_identity_adapter_get_object_path (dbus_identity)); + } + else { + g_dbus_method_invocation_return_gerror (invocation, error); + g_error_free (error); + } + gsignond_security_context_free (sec_context); + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), TRUE); + + return TRUE; +} + +static gboolean +_handle_get_identity (GSignondDbusAuthServiceAdapter *self, + GDBusMethodInvocation *invocation, + guint32 id, + const gchar *app_context, + gpointer user_data) +{ + GSignondIdentity *identity = NULL; + GError *error = NULL; + GDBusConnection *connection = NULL; + const gchar *sender = NULL; + int fd = -1; + GSignondSecurityContext *sec_context = gsignond_security_context_new (); + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), FALSE); + + connection = g_dbus_method_invocation_get_connection (invocation); +#ifdef USE_P2P + fd = g_socket_get_fd (g_socket_connection_get_socket (G_SOCKET_CONNECTION (g_dbus_connection_get_stream(connection)))); +#else + sender = g_dbus_method_invocation_get_sender (invocation); +#endif + gsignond_access_control_manager_security_context_of_peer( + gsignond_daemon_get_access_control_manager (self->priv->auth_service), + sec_context, + fd, + sender, + app_context); + + identity = gsignond_daemon_get_identity (self->priv->auth_service, id, sec_context, &error); + + if (identity) { + GSignondIdentityInfo *info = NULL; + GSignondDbusIdentityAdapter *dbus_identity = _create_and_cache_dbus_identity (self, identity, app_context, connection, sender); + + info = gsignond_identity_get_identity_info (identity); + gsignond_dbus_auth_service_complete_get_identity (self->priv->dbus_auth_service, + invocation, gsignond_dbus_identity_adapter_get_object_path (dbus_identity), + gsignond_dictionary_to_variant (info)); + } + else { + g_dbus_method_invocation_return_gerror (invocation, error); + g_error_free (error); + } + gsignond_security_context_free (sec_context); + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), TRUE); + + return TRUE; +} + +static gboolean +_handle_query_methods (GSignondDbusAuthServiceAdapter *self, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + const gchar **methods = NULL; + GError *error = NULL; + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), FALSE); + + methods = gsignond_daemon_query_methods (self->priv->auth_service, &error); + + if (error) { + g_dbus_method_invocation_return_gerror (invocation, error); + g_error_free (error); + } else { + const gchar *const empty_methods[] = { NULL }; + gsignond_dbus_auth_service_complete_query_methods ( + self->priv->dbus_auth_service, invocation, + methods ? (const gchar * const*)methods : empty_methods); + } + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), TRUE); + + return TRUE; +} + +static gboolean +_handle_query_mechanisms (GSignondDbusAuthServiceAdapter *self, + GDBusMethodInvocation *invocation, + const gchar *method, + gpointer user_data) +{ + const gchar **mechanisms = 0; + GError *error = NULL; + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), FALSE); + + mechanisms = gsignond_daemon_query_mechanisms (self->priv->auth_service, method, &error); + + if (mechanisms) + gsignond_dbus_auth_service_complete_query_mechanisms ( + self->priv->dbus_auth_service, invocation, (const gchar* const*)mechanisms); + else { + g_dbus_method_invocation_return_gerror (invocation, error); + g_error_free (error); + } + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), TRUE); + + return TRUE; +} + +static void +_append_identity_info (gpointer data, gpointer user_data) +{ + GVariantBuilder *builder = (GVariantBuilder *)user_data; + + g_variant_builder_add (builder, "@a{sv}", gsignond_dictionary_to_variant ((GSignondIdentityInfo*)data)); +} + +static gboolean +_handle_query_identities (GSignondDbusAuthServiceAdapter *self, + GDBusMethodInvocation *invocation, + GVariant *filter, + const gchar *app_context, + gpointer user_data) +{ + GSignondIdentityInfoList *identities = NULL; + GError *error = NULL; + GSignondSecurityContext *sec_context; + const gchar *sender = NULL; + int fd = -1; + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), FALSE); + +#ifdef USE_P2P + GDBusConnection *connection = NULL; + connection = g_dbus_method_invocation_get_connection (invocation); + fd = g_socket_get_fd (g_socket_connection_get_socket (G_SOCKET_CONNECTION (g_dbus_connection_get_stream(connection)))); +#else + sender = g_dbus_method_invocation_get_sender (invocation); +#endif + sec_context = gsignond_security_context_new (); + gsignond_access_control_manager_security_context_of_peer( + gsignond_daemon_get_access_control_manager (self->priv->auth_service), + sec_context, + fd, + sender, app_context); + + identities = gsignond_daemon_query_identities (self->priv->auth_service, + filter, + sec_context, + &error); + + gsignond_security_context_free (sec_context); + + if (identities) { + GVariantBuilder builder; + + g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY); + + g_list_foreach(identities, _append_identity_info, &builder); + + gsignond_identity_info_list_free (identities); + + gsignond_dbus_auth_service_complete_query_identities ( + self->priv->dbus_auth_service, invocation, + g_variant_builder_end(&builder)); + + g_variant_builder_clear (&builder); + } + else { + g_dbus_method_invocation_return_gerror (invocation, error); + g_error_free (error); + } + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), TRUE); + + return TRUE; +} + +static gboolean +_handle_clear (GSignondDbusAuthServiceAdapter *self, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + gboolean res ; + GError *error = NULL; + GSignondSecurityContext *sec_context; + const gchar *sender = NULL; + int fd = -1; + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), FALSE); +#ifdef USE_P2P + GDBusConnection *connection = NULL; + connection = g_dbus_method_invocation_get_connection (invocation); + fd = g_socket_get_fd (g_socket_connection_get_socket (G_SOCKET_CONNECTION (g_dbus_connection_get_stream(connection)))); +#else + sender = g_dbus_method_invocation_get_sender (invocation); +#endif + sec_context = gsignond_security_context_new (); + gsignond_access_control_manager_security_context_of_peer( + gsignond_daemon_get_access_control_manager (self->priv->auth_service), + sec_context, + fd, + sender, ""); + + res = gsignond_daemon_clear (self->priv->auth_service, + sec_context, + &error); + + gsignond_security_context_free (sec_context); + + if (!error) + gsignond_dbus_auth_service_complete_clear (self->priv->dbus_auth_service, invocation, res); + else { + g_dbus_method_invocation_return_gerror (invocation, error); + g_error_free (error); + } + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), TRUE); + + return TRUE; +} + +GSignondDbusAuthServiceAdapter * +gsignond_dbus_auth_service_adapter_new_with_connection (GDBusConnection *bus_connection, GSignondDaemon *daemon) +{ + GError *err = NULL; + guint timeout = 0; + GSignondDbusAuthServiceAdapter *adapter = GSIGNOND_DBUS_AUTH_SERVICE_ADAPTER ( + g_object_new (GSIGNOND_TYPE_AUTH_SERVICE_ADAPTER, + "auth-service", daemon, + "connection", bus_connection, + NULL)); + + if (!g_dbus_interface_skeleton_export ( + G_DBUS_INTERFACE_SKELETON(adapter->priv->dbus_auth_service), + adapter->priv->connection, GSIGNOND_DAEMON_OBJECTPATH, &err)) { + ERR ("failed to register object: %s", err->message); + g_error_free (err); + g_object_unref (adapter); + return NULL; + } + DBG("(+) started auth service '%p' at path '%s' on connection '%p'", adapter, GSIGNOND_DAEMON_OBJECTPATH, bus_connection); + + timeout = gsignond_daemon_get_timeout (adapter->priv->auth_service); + if (timeout) { + gsignond_disposable_set_timeout (GSIGNOND_DISPOSABLE (adapter), timeout); + } + return adapter; +} +#ifndef USE_P2P +GSignondDbusAuthServiceAdapter * gsignond_dbus_auth_service_adapter_new (GSignondDaemon *daemon) +{ + GError *error = NULL; + GDBusConnection *connection = g_bus_get_sync (GSIGNOND_BUS_TYPE, NULL, &error); + + if (error) { + ERR("failed to connect to session bus : %s", error->message); + g_error_free (error); + return NULL; + } + + return gsignond_dbus_auth_service_adapter_new_with_connection (connection, daemon); +} +#endif diff --git a/src/daemon/dbus/gsignond-dbus-auth-service-adapter.h b/src/daemon/dbus/gsignond-dbus-auth-service-adapter.h new file mode 100644 index 0000000..adf956b --- /dev/null +++ b/src/daemon/dbus/gsignond-dbus-auth-service-adapter.h @@ -0,0 +1,74 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2012 Intel Corporation. + * + * Contact: Amarnath Valluri <amarnath.valluri@linux.intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#ifndef __GSIGNOND_DBUS_AUTH_SERVICE_ADAPTER_H_ +#define __GSIGNOND_DBUS_AUTH_SERVICE_ADAPTER_H_ + +#include <config.h> +#include <glib.h> +#include <daemon/gsignond-daemon.h> +#include "common/gsignond-disposable.h" +#include "gsignond-dbus-auth-service-gen.h" + +G_BEGIN_DECLS + +#define GSIGNOND_TYPE_AUTH_SERVICE_ADAPTER (gsignond_dbus_auth_service_adapter_get_type()) +#define GSIGNOND_DBUS_AUTH_SERVICE_ADAPTER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GSIGNOND_TYPE_AUTH_SERVICE_ADAPTER, GSignondDbusAuthServiceAdapter)) +#define GSIGNOND_DBUS_AUTH_SERVICE_ADAPTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GSIGNOND_TYPE_AUTH_SERVICE_ADAPTER, GSignondDbusAuthServiceAdapterClass)) +#define GSIGNOND_IS_DBUS_AUTH_SERVICE_ADAPTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GSIGNOND_TYPE_AUTH_SERVICE_ADAPTER)) +#define GSIGNOND_IS_DBUS_AUTH_SERVICE_ADAPTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GSIGNOND_TYPE_AUTH_SERVICE_ADAPTER)) +#define GSIGNOND_DBUS_AUTH_SERVICE_ADAPTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GSIGNOND_TYPE_AUTH_SERVICE_ADAPTER, GSignondDbusAuthServiceAdapterClass)) + +typedef struct _GSignondDbusAuthServiceAdapter GSignondDbusAuthServiceAdapter; +typedef struct _GSignondDbusAuthServiceAdapterClass GSignondDbusAuthServiceAdapterClass; +typedef struct _GSignondDbusAuthServiceAdapterPrivate GSignondDbusAuthServiceAdapterPrivate; + +struct _GSignondDbusAuthServiceAdapter +{ + GSignondDisposable parent; + + /* priv */ + GSignondDbusAuthServiceAdapterPrivate *priv; +}; + +struct _GSignondDbusAuthServiceAdapterClass +{ + GSignondDisposableClass parent_class; +}; + +GType gsignond_dbus_auth_service_adapter_get_type (void) G_GNUC_CONST; + +GSignondDbusAuthServiceAdapter * +gsignond_dbus_auth_service_adapter_new_with_connection (GDBusConnection *connection, + GSignondDaemon *daemon); + +#ifndef USE_P2P +GSignondDbusAuthServiceAdapter * +gsignond_dbus_auth_service_adapter_new (GSignondDaemon *daemon); +#endif + +G_END_DECLS + +#endif /* __GSIGNOND_DBUS_AUTH_SERVICE_ADAPTER_H_ */ diff --git a/src/daemon/dbus/gsignond-dbus-auth-service-gen.c b/src/daemon/dbus/gsignond-dbus-auth-service-gen.c new file mode 100644 index 0000000..79b1adc --- /dev/null +++ b/src/daemon/dbus/gsignond-dbus-auth-service-gen.c @@ -0,0 +1,2717 @@ +/* + * Generated by gdbus-codegen 2.32.3. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "gsignond-dbus-auth-service-gen.h" + +#ifdef G_OS_UNIX +# include <gio/gunixfdlist.h> +#endif + +typedef struct +{ + GDBusArgInfo parent_struct; + gboolean use_gvariant; +} _ExtendedGDBusArgInfo; + +typedef struct +{ + GDBusMethodInfo parent_struct; + const gchar *signal_name; + gboolean pass_fdlist; +} _ExtendedGDBusMethodInfo; + +typedef struct +{ + GDBusSignalInfo parent_struct; + const gchar *signal_name; +} _ExtendedGDBusSignalInfo; + +typedef struct +{ + GDBusPropertyInfo parent_struct; + const gchar *hyphen_name; + gboolean use_gvariant; +} _ExtendedGDBusPropertyInfo; + +typedef struct +{ + GDBusInterfaceInfo parent_struct; + const gchar *hyphen_name; +} _ExtendedGDBusInterfaceInfo; + +typedef struct +{ + const _ExtendedGDBusPropertyInfo *info; + guint prop_id; + GValue orig_value; /* the value before the change */ +} ChangedProperty; + +static void +_changed_property_free (ChangedProperty *data) +{ + g_value_unset (&data->orig_value); + g_free (data); +} + +static gboolean +_g_strv_equal0 (gchar **a, gchar **b) +{ + gboolean ret = FALSE; + guint n; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + if (g_strv_length (a) != g_strv_length (b)) + goto out; + for (n = 0; a[n] != NULL; n++) + if (g_strcmp0 (a[n], b[n]) != 0) + goto out; + ret = TRUE; +out: + return ret; +} + +static gboolean +_g_variant_equal0 (GVariant *a, GVariant *b) +{ + gboolean ret = FALSE; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + ret = g_variant_equal (a, b); +out: + return ret; +} + +G_GNUC_UNUSED static gboolean +_g_value_equal (const GValue *a, const GValue *b) +{ + gboolean ret = FALSE; + g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b)); + switch (G_VALUE_TYPE (a)) + { + case G_TYPE_BOOLEAN: + ret = (g_value_get_boolean (a) == g_value_get_boolean (b)); + break; + case G_TYPE_UCHAR: + ret = (g_value_get_uchar (a) == g_value_get_uchar (b)); + break; + case G_TYPE_INT: + ret = (g_value_get_int (a) == g_value_get_int (b)); + break; + case G_TYPE_UINT: + ret = (g_value_get_uint (a) == g_value_get_uint (b)); + break; + case G_TYPE_INT64: + ret = (g_value_get_int64 (a) == g_value_get_int64 (b)); + break; + case G_TYPE_UINT64: + ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b)); + break; + case G_TYPE_DOUBLE: + ret = (g_value_get_double (a) == g_value_get_double (b)); + break; + case G_TYPE_STRING: + ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0); + break; + case G_TYPE_VARIANT: + ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b)); + break; + default: + if (G_VALUE_TYPE (a) == G_TYPE_STRV) + ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b)); + else + g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a))); + break; + } + return ret; +} + +/* ------------------------------------------------------------------------ + * Code for interface com.google.code.AccountsSSO.gSingleSignOn.AuthService + * ------------------------------------------------------------------------ + */ + +/** + * SECTION:GSignondDbusAuthService + * @title: GSignondDbusAuthService + * @short_description: Generated C code for the com.google.code.AccountsSSO.gSingleSignOn.AuthService D-Bus interface + * + * This section contains code for working with the <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-AuthService.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.AuthService</link> D-Bus interface in C. + */ + +/* ---- Introspection data for com.google.code.AccountsSSO.gSingleSignOn.AuthService ---- */ + +static const _ExtendedGDBusArgInfo _gsignond_dbus_auth_service_method_info_register_new_identity_IN_ARG_applicationContext = +{ + { + -1, + "applicationContext", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_auth_service_method_info_register_new_identity_IN_ARG_pointers[] = +{ + &_gsignond_dbus_auth_service_method_info_register_new_identity_IN_ARG_applicationContext, + NULL +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_auth_service_method_info_register_new_identity_OUT_ARG_objectPath = +{ + { + -1, + "objectPath", + "o", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_auth_service_method_info_register_new_identity_OUT_ARG_pointers[] = +{ + &_gsignond_dbus_auth_service_method_info_register_new_identity_OUT_ARG_objectPath, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_auth_service_method_info_register_new_identity = +{ + { + -1, + "registerNewIdentity", + (GDBusArgInfo **) &_gsignond_dbus_auth_service_method_info_register_new_identity_IN_ARG_pointers, + (GDBusArgInfo **) &_gsignond_dbus_auth_service_method_info_register_new_identity_OUT_ARG_pointers, + NULL + }, + "handle-register-new-identity", + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_auth_service_method_info_get_identity_IN_ARG_id = +{ + { + -1, + "id", + "u", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_auth_service_method_info_get_identity_IN_ARG_applicationContext = +{ + { + -1, + "applicationContext", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_auth_service_method_info_get_identity_IN_ARG_pointers[] = +{ + &_gsignond_dbus_auth_service_method_info_get_identity_IN_ARG_id, + &_gsignond_dbus_auth_service_method_info_get_identity_IN_ARG_applicationContext, + NULL +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_auth_service_method_info_get_identity_OUT_ARG_objectPath = +{ + { + -1, + "objectPath", + "o", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_auth_service_method_info_get_identity_OUT_ARG_identityData = +{ + { + -1, + "identityData", + "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_auth_service_method_info_get_identity_OUT_ARG_pointers[] = +{ + &_gsignond_dbus_auth_service_method_info_get_identity_OUT_ARG_objectPath, + &_gsignond_dbus_auth_service_method_info_get_identity_OUT_ARG_identityData, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_auth_service_method_info_get_identity = +{ + { + -1, + "getIdentity", + (GDBusArgInfo **) &_gsignond_dbus_auth_service_method_info_get_identity_IN_ARG_pointers, + (GDBusArgInfo **) &_gsignond_dbus_auth_service_method_info_get_identity_OUT_ARG_pointers, + NULL + }, + "handle-get-identity", + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_auth_service_method_info_query_methods_OUT_ARG_authMethods = +{ + { + -1, + "authMethods", + "as", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_auth_service_method_info_query_methods_OUT_ARG_pointers[] = +{ + &_gsignond_dbus_auth_service_method_info_query_methods_OUT_ARG_authMethods, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_auth_service_method_info_query_methods = +{ + { + -1, + "queryMethods", + NULL, + (GDBusArgInfo **) &_gsignond_dbus_auth_service_method_info_query_methods_OUT_ARG_pointers, + NULL + }, + "handle-query-methods", + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_auth_service_method_info_query_mechanisms_IN_ARG_method = +{ + { + -1, + "method", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_auth_service_method_info_query_mechanisms_IN_ARG_pointers[] = +{ + &_gsignond_dbus_auth_service_method_info_query_mechanisms_IN_ARG_method, + NULL +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_auth_service_method_info_query_mechanisms_OUT_ARG_mechanisms = +{ + { + -1, + "mechanisms", + "as", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_auth_service_method_info_query_mechanisms_OUT_ARG_pointers[] = +{ + &_gsignond_dbus_auth_service_method_info_query_mechanisms_OUT_ARG_mechanisms, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_auth_service_method_info_query_mechanisms = +{ + { + -1, + "queryMechanisms", + (GDBusArgInfo **) &_gsignond_dbus_auth_service_method_info_query_mechanisms_IN_ARG_pointers, + (GDBusArgInfo **) &_gsignond_dbus_auth_service_method_info_query_mechanisms_OUT_ARG_pointers, + NULL + }, + "handle-query-mechanisms", + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_auth_service_method_info_query_identities_IN_ARG_filter = +{ + { + -1, + "filter", + "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_auth_service_method_info_query_identities_IN_ARG_applicationContext = +{ + { + -1, + "applicationContext", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_auth_service_method_info_query_identities_IN_ARG_pointers[] = +{ + &_gsignond_dbus_auth_service_method_info_query_identities_IN_ARG_filter, + &_gsignond_dbus_auth_service_method_info_query_identities_IN_ARG_applicationContext, + NULL +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_auth_service_method_info_query_identities_OUT_ARG_identities = +{ + { + -1, + "identities", + "aa{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_auth_service_method_info_query_identities_OUT_ARG_pointers[] = +{ + &_gsignond_dbus_auth_service_method_info_query_identities_OUT_ARG_identities, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_auth_service_method_info_query_identities = +{ + { + -1, + "queryIdentities", + (GDBusArgInfo **) &_gsignond_dbus_auth_service_method_info_query_identities_IN_ARG_pointers, + (GDBusArgInfo **) &_gsignond_dbus_auth_service_method_info_query_identities_OUT_ARG_pointers, + NULL + }, + "handle-query-identities", + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_auth_service_method_info_clear_OUT_ARG_unnamed_arg0 = +{ + { + -1, + "unnamed_arg0", + "b", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_auth_service_method_info_clear_OUT_ARG_pointers[] = +{ + &_gsignond_dbus_auth_service_method_info_clear_OUT_ARG_unnamed_arg0, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_auth_service_method_info_clear = +{ + { + -1, + "clear", + NULL, + (GDBusArgInfo **) &_gsignond_dbus_auth_service_method_info_clear_OUT_ARG_pointers, + NULL + }, + "handle-clear", + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_auth_service_method_info_backup_starts_OUT_ARG_unnamed_arg0 = +{ + { + -1, + "unnamed_arg0", + "y", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_auth_service_method_info_backup_starts_OUT_ARG_pointers[] = +{ + &_gsignond_dbus_auth_service_method_info_backup_starts_OUT_ARG_unnamed_arg0, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_auth_service_method_info_backup_starts = +{ + { + -1, + "backupStarts", + NULL, + (GDBusArgInfo **) &_gsignond_dbus_auth_service_method_info_backup_starts_OUT_ARG_pointers, + NULL + }, + "handle-backup-starts", + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_auth_service_method_info_backup_finished_OUT_ARG_unnamed_arg0 = +{ + { + -1, + "unnamed_arg0", + "y", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_auth_service_method_info_backup_finished_OUT_ARG_pointers[] = +{ + &_gsignond_dbus_auth_service_method_info_backup_finished_OUT_ARG_unnamed_arg0, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_auth_service_method_info_backup_finished = +{ + { + -1, + "backupFinished", + NULL, + (GDBusArgInfo **) &_gsignond_dbus_auth_service_method_info_backup_finished_OUT_ARG_pointers, + NULL + }, + "handle-backup-finished", + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_auth_service_method_info_restore_starts_OUT_ARG_unnamed_arg0 = +{ + { + -1, + "unnamed_arg0", + "y", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_auth_service_method_info_restore_starts_OUT_ARG_pointers[] = +{ + &_gsignond_dbus_auth_service_method_info_restore_starts_OUT_ARG_unnamed_arg0, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_auth_service_method_info_restore_starts = +{ + { + -1, + "restoreStarts", + NULL, + (GDBusArgInfo **) &_gsignond_dbus_auth_service_method_info_restore_starts_OUT_ARG_pointers, + NULL + }, + "handle-restore-starts", + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_auth_service_method_info_restore_finished_OUT_ARG_unnamed_arg0 = +{ + { + -1, + "unnamed_arg0", + "y", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_auth_service_method_info_restore_finished_OUT_ARG_pointers[] = +{ + &_gsignond_dbus_auth_service_method_info_restore_finished_OUT_ARG_unnamed_arg0, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_auth_service_method_info_restore_finished = +{ + { + -1, + "restoreFinished", + NULL, + (GDBusArgInfo **) &_gsignond_dbus_auth_service_method_info_restore_finished_OUT_ARG_pointers, + NULL + }, + "handle-restore-finished", + FALSE +}; + +static const _ExtendedGDBusMethodInfo * const _gsignond_dbus_auth_service_method_info_pointers[] = +{ + &_gsignond_dbus_auth_service_method_info_register_new_identity, + &_gsignond_dbus_auth_service_method_info_get_identity, + &_gsignond_dbus_auth_service_method_info_query_methods, + &_gsignond_dbus_auth_service_method_info_query_mechanisms, + &_gsignond_dbus_auth_service_method_info_query_identities, + &_gsignond_dbus_auth_service_method_info_clear, + &_gsignond_dbus_auth_service_method_info_backup_starts, + &_gsignond_dbus_auth_service_method_info_backup_finished, + &_gsignond_dbus_auth_service_method_info_restore_starts, + &_gsignond_dbus_auth_service_method_info_restore_finished, + NULL +}; + +static const _ExtendedGDBusInterfaceInfo _gsignond_dbus_auth_service_interface_info = +{ + { + -1, + "com.google.code.AccountsSSO.gSingleSignOn.AuthService", + (GDBusMethodInfo **) &_gsignond_dbus_auth_service_method_info_pointers, + NULL, + NULL, + NULL + }, + "auth-service", +}; + + +/** + * gsignond_dbus_auth_service_interface_info: + * + * Gets a machine-readable description of the <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-AuthService.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.AuthService</link> D-Bus interface. + * + * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. + */ +GDBusInterfaceInfo * +gsignond_dbus_auth_service_interface_info (void) +{ + return (GDBusInterfaceInfo *) &_gsignond_dbus_auth_service_interface_info; +} + +/** + * gsignond_dbus_auth_service_override_properties: + * @klass: The class structure for a #GObject<!-- -->-derived class. + * @property_id_begin: The property id to assign to the first overridden property. + * + * Overrides all #GObject properties in the #GSignondDbusAuthService interface for a concrete class. + * The properties are overridden in the order they are defined. + * + * Returns: The last property id. + */ +guint +gsignond_dbus_auth_service_override_properties (GObjectClass *klass, guint property_id_begin) +{ + return property_id_begin - 1; +} + + + +/** + * GSignondDbusAuthService: + * + * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-AuthService.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.AuthService</link>. + */ + +/** + * GSignondDbusAuthServiceIface: + * @parent_iface: The parent interface. + * @handle_backup_finished: Handler for the #GSignondDbusAuthService::handle-backup-finished signal. + * @handle_backup_starts: Handler for the #GSignondDbusAuthService::handle-backup-starts signal. + * @handle_clear: Handler for the #GSignondDbusAuthService::handle-clear signal. + * @handle_get_identity: Handler for the #GSignondDbusAuthService::handle-get-identity signal. + * @handle_query_identities: Handler for the #GSignondDbusAuthService::handle-query-identities signal. + * @handle_query_mechanisms: Handler for the #GSignondDbusAuthService::handle-query-mechanisms signal. + * @handle_query_methods: Handler for the #GSignondDbusAuthService::handle-query-methods signal. + * @handle_register_new_identity: Handler for the #GSignondDbusAuthService::handle-register-new-identity signal. + * @handle_restore_finished: Handler for the #GSignondDbusAuthService::handle-restore-finished signal. + * @handle_restore_starts: Handler for the #GSignondDbusAuthService::handle-restore-starts signal. + * + * Virtual table for the D-Bus interface <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-AuthService.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.AuthService</link>. + */ + +static void +gsignond_dbus_auth_service_default_init (GSignondDbusAuthServiceIface *iface) +{ + /* GObject signals for incoming D-Bus method calls: */ + /** + * GSignondDbusAuthService::handle-register-new-identity: + * @object: A #GSignondDbusAuthService. + * @invocation: A #GDBusMethodInvocation. + * @arg_applicationContext: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.registerNewIdentity">registerNewIdentity()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_auth_service_complete_register_new_identity() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-register-new-identity", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusAuthServiceIface, handle_register_new_identity), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); + + /** + * GSignondDbusAuthService::handle-get-identity: + * @object: A #GSignondDbusAuthService. + * @invocation: A #GDBusMethodInvocation. + * @arg_id: Argument passed by remote caller. + * @arg_applicationContext: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.getIdentity">getIdentity()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_auth_service_complete_get_identity() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-get-identity", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusAuthServiceIface, handle_get_identity), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT, G_TYPE_STRING); + + /** + * GSignondDbusAuthService::handle-query-methods: + * @object: A #GSignondDbusAuthService. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.queryMethods">queryMethods()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_auth_service_complete_query_methods() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-query-methods", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusAuthServiceIface, handle_query_methods), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * GSignondDbusAuthService::handle-query-mechanisms: + * @object: A #GSignondDbusAuthService. + * @invocation: A #GDBusMethodInvocation. + * @arg_method: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.queryMechanisms">queryMechanisms()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_auth_service_complete_query_mechanisms() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-query-mechanisms", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusAuthServiceIface, handle_query_mechanisms), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); + + /** + * GSignondDbusAuthService::handle-query-identities: + * @object: A #GSignondDbusAuthService. + * @invocation: A #GDBusMethodInvocation. + * @arg_filter: Argument passed by remote caller. + * @arg_applicationContext: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.queryIdentities">queryIdentities()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_auth_service_complete_query_identities() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-query-identities", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusAuthServiceIface, handle_query_identities), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_STRING); + + /** + * GSignondDbusAuthService::handle-clear: + * @object: A #GSignondDbusAuthService. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.clear">clear()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_auth_service_complete_clear() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-clear", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusAuthServiceIface, handle_clear), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * GSignondDbusAuthService::handle-backup-starts: + * @object: A #GSignondDbusAuthService. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.backupStarts">backupStarts()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_auth_service_complete_backup_starts() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-backup-starts", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusAuthServiceIface, handle_backup_starts), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * GSignondDbusAuthService::handle-backup-finished: + * @object: A #GSignondDbusAuthService. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.backupFinished">backupFinished()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_auth_service_complete_backup_finished() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-backup-finished", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusAuthServiceIface, handle_backup_finished), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * GSignondDbusAuthService::handle-restore-starts: + * @object: A #GSignondDbusAuthService. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.restoreStarts">restoreStarts()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_auth_service_complete_restore_starts() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-restore-starts", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusAuthServiceIface, handle_restore_starts), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * GSignondDbusAuthService::handle-restore-finished: + * @object: A #GSignondDbusAuthService. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.restoreFinished">restoreFinished()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_auth_service_complete_restore_finished() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-restore-finished", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusAuthServiceIface, handle_restore_finished), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + +} + +typedef GSignondDbusAuthServiceIface GSignondDbusAuthServiceInterface; +G_DEFINE_INTERFACE (GSignondDbusAuthService, gsignond_dbus_auth_service, G_TYPE_OBJECT); + +/** + * gsignond_dbus_auth_service_call_register_new_identity: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @arg_applicationContext: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.registerNewIdentity">registerNewIdentity()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_auth_service_call_register_new_identity_finish() to get the result of the operation. + * + * See gsignond_dbus_auth_service_call_register_new_identity_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_auth_service_call_register_new_identity ( + GSignondDbusAuthService *proxy, + const gchar *arg_applicationContext, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "registerNewIdentity", + g_variant_new ("(s)", + arg_applicationContext), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_auth_service_call_register_new_identity_finish: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @out_objectPath: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_auth_service_call_register_new_identity(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_auth_service_call_register_new_identity(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_auth_service_call_register_new_identity_finish ( + GSignondDbusAuthService *proxy, + gchar **out_objectPath, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(o)", + out_objectPath); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_auth_service_call_register_new_identity_sync: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @arg_applicationContext: Argument to pass with the method invocation. + * @out_objectPath: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.registerNewIdentity">registerNewIdentity()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_auth_service_call_register_new_identity() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_auth_service_call_register_new_identity_sync ( + GSignondDbusAuthService *proxy, + const gchar *arg_applicationContext, + gchar **out_objectPath, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "registerNewIdentity", + g_variant_new ("(s)", + arg_applicationContext), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(o)", + out_objectPath); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_auth_service_call_get_identity: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @arg_id: Argument to pass with the method invocation. + * @arg_applicationContext: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.getIdentity">getIdentity()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_auth_service_call_get_identity_finish() to get the result of the operation. + * + * See gsignond_dbus_auth_service_call_get_identity_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_auth_service_call_get_identity ( + GSignondDbusAuthService *proxy, + guint arg_id, + const gchar *arg_applicationContext, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "getIdentity", + g_variant_new ("(us)", + arg_id, + arg_applicationContext), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_auth_service_call_get_identity_finish: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @out_objectPath: (out): Return location for return parameter or %NULL to ignore. + * @out_identityData: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_auth_service_call_get_identity(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_auth_service_call_get_identity(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_auth_service_call_get_identity_finish ( + GSignondDbusAuthService *proxy, + gchar **out_objectPath, + GVariant **out_identityData, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(o@a{sv})", + out_objectPath, + out_identityData); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_auth_service_call_get_identity_sync: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @arg_id: Argument to pass with the method invocation. + * @arg_applicationContext: Argument to pass with the method invocation. + * @out_objectPath: (out): Return location for return parameter or %NULL to ignore. + * @out_identityData: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.getIdentity">getIdentity()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_auth_service_call_get_identity() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_auth_service_call_get_identity_sync ( + GSignondDbusAuthService *proxy, + guint arg_id, + const gchar *arg_applicationContext, + gchar **out_objectPath, + GVariant **out_identityData, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "getIdentity", + g_variant_new ("(us)", + arg_id, + arg_applicationContext), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(o@a{sv})", + out_objectPath, + out_identityData); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_auth_service_call_query_methods: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.queryMethods">queryMethods()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_auth_service_call_query_methods_finish() to get the result of the operation. + * + * See gsignond_dbus_auth_service_call_query_methods_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_auth_service_call_query_methods ( + GSignondDbusAuthService *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "queryMethods", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_auth_service_call_query_methods_finish: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @out_authMethods: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_auth_service_call_query_methods(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_auth_service_call_query_methods(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_auth_service_call_query_methods_finish ( + GSignondDbusAuthService *proxy, + gchar ***out_authMethods, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(^as)", + out_authMethods); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_auth_service_call_query_methods_sync: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @out_authMethods: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.queryMethods">queryMethods()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_auth_service_call_query_methods() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_auth_service_call_query_methods_sync ( + GSignondDbusAuthService *proxy, + gchar ***out_authMethods, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "queryMethods", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(^as)", + out_authMethods); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_auth_service_call_query_mechanisms: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @arg_method: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.queryMechanisms">queryMechanisms()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_auth_service_call_query_mechanisms_finish() to get the result of the operation. + * + * See gsignond_dbus_auth_service_call_query_mechanisms_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_auth_service_call_query_mechanisms ( + GSignondDbusAuthService *proxy, + const gchar *arg_method, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "queryMechanisms", + g_variant_new ("(s)", + arg_method), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_auth_service_call_query_mechanisms_finish: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @out_mechanisms: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_auth_service_call_query_mechanisms(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_auth_service_call_query_mechanisms(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_auth_service_call_query_mechanisms_finish ( + GSignondDbusAuthService *proxy, + gchar ***out_mechanisms, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(^as)", + out_mechanisms); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_auth_service_call_query_mechanisms_sync: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @arg_method: Argument to pass with the method invocation. + * @out_mechanisms: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.queryMechanisms">queryMechanisms()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_auth_service_call_query_mechanisms() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_auth_service_call_query_mechanisms_sync ( + GSignondDbusAuthService *proxy, + const gchar *arg_method, + gchar ***out_mechanisms, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "queryMechanisms", + g_variant_new ("(s)", + arg_method), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(^as)", + out_mechanisms); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_auth_service_call_query_identities: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @arg_filter: Argument to pass with the method invocation. + * @arg_applicationContext: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.queryIdentities">queryIdentities()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_auth_service_call_query_identities_finish() to get the result of the operation. + * + * See gsignond_dbus_auth_service_call_query_identities_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_auth_service_call_query_identities ( + GSignondDbusAuthService *proxy, + GVariant *arg_filter, + const gchar *arg_applicationContext, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "queryIdentities", + g_variant_new ("(@a{sv}s)", + arg_filter, + arg_applicationContext), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_auth_service_call_query_identities_finish: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @out_identities: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_auth_service_call_query_identities(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_auth_service_call_query_identities(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_auth_service_call_query_identities_finish ( + GSignondDbusAuthService *proxy, + GVariant **out_identities, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@aa{sv})", + out_identities); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_auth_service_call_query_identities_sync: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @arg_filter: Argument to pass with the method invocation. + * @arg_applicationContext: Argument to pass with the method invocation. + * @out_identities: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.queryIdentities">queryIdentities()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_auth_service_call_query_identities() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_auth_service_call_query_identities_sync ( + GSignondDbusAuthService *proxy, + GVariant *arg_filter, + const gchar *arg_applicationContext, + GVariant **out_identities, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "queryIdentities", + g_variant_new ("(@a{sv}s)", + arg_filter, + arg_applicationContext), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@aa{sv})", + out_identities); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_auth_service_call_clear: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.clear">clear()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_auth_service_call_clear_finish() to get the result of the operation. + * + * See gsignond_dbus_auth_service_call_clear_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_auth_service_call_clear ( + GSignondDbusAuthService *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "clear", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_auth_service_call_clear_finish: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @out_unnamed_arg0: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_auth_service_call_clear(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_auth_service_call_clear(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_auth_service_call_clear_finish ( + GSignondDbusAuthService *proxy, + gboolean *out_unnamed_arg0, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(b)", + out_unnamed_arg0); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_auth_service_call_clear_sync: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @out_unnamed_arg0: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.clear">clear()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_auth_service_call_clear() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_auth_service_call_clear_sync ( + GSignondDbusAuthService *proxy, + gboolean *out_unnamed_arg0, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "clear", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(b)", + out_unnamed_arg0); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_auth_service_call_backup_starts: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.backupStarts">backupStarts()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_auth_service_call_backup_starts_finish() to get the result of the operation. + * + * See gsignond_dbus_auth_service_call_backup_starts_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_auth_service_call_backup_starts ( + GSignondDbusAuthService *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "backupStarts", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_auth_service_call_backup_starts_finish: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @out_unnamed_arg0: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_auth_service_call_backup_starts(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_auth_service_call_backup_starts(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_auth_service_call_backup_starts_finish ( + GSignondDbusAuthService *proxy, + guchar *out_unnamed_arg0, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(y)", + out_unnamed_arg0); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_auth_service_call_backup_starts_sync: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @out_unnamed_arg0: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.backupStarts">backupStarts()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_auth_service_call_backup_starts() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_auth_service_call_backup_starts_sync ( + GSignondDbusAuthService *proxy, + guchar *out_unnamed_arg0, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "backupStarts", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(y)", + out_unnamed_arg0); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_auth_service_call_backup_finished: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.backupFinished">backupFinished()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_auth_service_call_backup_finished_finish() to get the result of the operation. + * + * See gsignond_dbus_auth_service_call_backup_finished_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_auth_service_call_backup_finished ( + GSignondDbusAuthService *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "backupFinished", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_auth_service_call_backup_finished_finish: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @out_unnamed_arg0: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_auth_service_call_backup_finished(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_auth_service_call_backup_finished(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_auth_service_call_backup_finished_finish ( + GSignondDbusAuthService *proxy, + guchar *out_unnamed_arg0, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(y)", + out_unnamed_arg0); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_auth_service_call_backup_finished_sync: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @out_unnamed_arg0: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.backupFinished">backupFinished()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_auth_service_call_backup_finished() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_auth_service_call_backup_finished_sync ( + GSignondDbusAuthService *proxy, + guchar *out_unnamed_arg0, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "backupFinished", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(y)", + out_unnamed_arg0); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_auth_service_call_restore_starts: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.restoreStarts">restoreStarts()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_auth_service_call_restore_starts_finish() to get the result of the operation. + * + * See gsignond_dbus_auth_service_call_restore_starts_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_auth_service_call_restore_starts ( + GSignondDbusAuthService *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "restoreStarts", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_auth_service_call_restore_starts_finish: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @out_unnamed_arg0: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_auth_service_call_restore_starts(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_auth_service_call_restore_starts(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_auth_service_call_restore_starts_finish ( + GSignondDbusAuthService *proxy, + guchar *out_unnamed_arg0, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(y)", + out_unnamed_arg0); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_auth_service_call_restore_starts_sync: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @out_unnamed_arg0: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.restoreStarts">restoreStarts()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_auth_service_call_restore_starts() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_auth_service_call_restore_starts_sync ( + GSignondDbusAuthService *proxy, + guchar *out_unnamed_arg0, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "restoreStarts", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(y)", + out_unnamed_arg0); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_auth_service_call_restore_finished: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.restoreFinished">restoreFinished()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_auth_service_call_restore_finished_finish() to get the result of the operation. + * + * See gsignond_dbus_auth_service_call_restore_finished_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_auth_service_call_restore_finished ( + GSignondDbusAuthService *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "restoreFinished", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_auth_service_call_restore_finished_finish: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @out_unnamed_arg0: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_auth_service_call_restore_finished(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_auth_service_call_restore_finished(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_auth_service_call_restore_finished_finish ( + GSignondDbusAuthService *proxy, + guchar *out_unnamed_arg0, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(y)", + out_unnamed_arg0); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_auth_service_call_restore_finished_sync: + * @proxy: A #GSignondDbusAuthServiceProxy. + * @out_unnamed_arg0: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.restoreFinished">restoreFinished()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_auth_service_call_restore_finished() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_auth_service_call_restore_finished_sync ( + GSignondDbusAuthService *proxy, + guchar *out_unnamed_arg0, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "restoreFinished", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(y)", + out_unnamed_arg0); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_auth_service_complete_register_new_identity: + * @object: A #GSignondDbusAuthService. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @objectPath: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.registerNewIdentity">registerNewIdentity()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_auth_service_complete_register_new_identity ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation, + const gchar *objectPath) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(o)", + objectPath)); +} + +/** + * gsignond_dbus_auth_service_complete_get_identity: + * @object: A #GSignondDbusAuthService. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @objectPath: Parameter to return. + * @identityData: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.getIdentity">getIdentity()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_auth_service_complete_get_identity ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation, + const gchar *objectPath, + GVariant *identityData) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(o@a{sv})", + objectPath, + identityData)); +} + +/** + * gsignond_dbus_auth_service_complete_query_methods: + * @object: A #GSignondDbusAuthService. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @authMethods: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.queryMethods">queryMethods()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_auth_service_complete_query_methods ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation, + const gchar *const *authMethods) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(^as)", + authMethods)); +} + +/** + * gsignond_dbus_auth_service_complete_query_mechanisms: + * @object: A #GSignondDbusAuthService. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @mechanisms: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.queryMechanisms">queryMechanisms()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_auth_service_complete_query_mechanisms ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation, + const gchar *const *mechanisms) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(^as)", + mechanisms)); +} + +/** + * gsignond_dbus_auth_service_complete_query_identities: + * @object: A #GSignondDbusAuthService. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @identities: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.queryIdentities">queryIdentities()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_auth_service_complete_query_identities ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation, + GVariant *identities) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(@aa{sv})", + identities)); +} + +/** + * gsignond_dbus_auth_service_complete_clear: + * @object: A #GSignondDbusAuthService. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg0: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.clear">clear()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_auth_service_complete_clear ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation, + gboolean unnamed_arg0) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(b)", + unnamed_arg0)); +} + +/** + * gsignond_dbus_auth_service_complete_backup_starts: + * @object: A #GSignondDbusAuthService. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg0: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.backupStarts">backupStarts()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_auth_service_complete_backup_starts ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation, + guchar unnamed_arg0) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(y)", + unnamed_arg0)); +} + +/** + * gsignond_dbus_auth_service_complete_backup_finished: + * @object: A #GSignondDbusAuthService. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg0: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.backupFinished">backupFinished()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_auth_service_complete_backup_finished ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation, + guchar unnamed_arg0) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(y)", + unnamed_arg0)); +} + +/** + * gsignond_dbus_auth_service_complete_restore_starts: + * @object: A #GSignondDbusAuthService. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg0: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.restoreStarts">restoreStarts()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_auth_service_complete_restore_starts ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation, + guchar unnamed_arg0) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(y)", + unnamed_arg0)); +} + +/** + * gsignond_dbus_auth_service_complete_restore_finished: + * @object: A #GSignondDbusAuthService. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg0: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthService.restoreFinished">restoreFinished()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_auth_service_complete_restore_finished ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation, + guchar unnamed_arg0) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(y)", + unnamed_arg0)); +} + +/* ------------------------------------------------------------------------ */ + +/** + * GSignondDbusAuthServiceProxy: + * + * The #GSignondDbusAuthServiceProxy structure contains only private data and should only be accessed using the provided API. + */ + +/** + * GSignondDbusAuthServiceProxyClass: + * @parent_class: The parent class. + * + * Class structure for #GSignondDbusAuthServiceProxy. + */ + +struct _GSignondDbusAuthServiceProxyPrivate +{ + GData *qdata; +}; + +static void gsignond_dbus_auth_service_proxy_iface_init (GSignondDbusAuthServiceIface *iface); + +G_DEFINE_TYPE_WITH_CODE (GSignondDbusAuthServiceProxy, gsignond_dbus_auth_service_proxy, G_TYPE_DBUS_PROXY, + G_IMPLEMENT_INTERFACE (GSIGNOND_DBUS_TYPE_AUTH_SERVICE, gsignond_dbus_auth_service_proxy_iface_init)); + +static void +gsignond_dbus_auth_service_proxy_finalize (GObject *object) +{ + GSignondDbusAuthServiceProxy *proxy = GSIGNOND_DBUS_AUTH_SERVICE_PROXY (object); + g_datalist_clear (&proxy->priv->qdata); + G_OBJECT_CLASS (gsignond_dbus_auth_service_proxy_parent_class)->finalize (object); +} + +static void +gsignond_dbus_auth_service_proxy_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ +} + +static void +gsignond_dbus_auth_service_proxy_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ +} + +static void +gsignond_dbus_auth_service_proxy_g_signal (GDBusProxy *proxy, + const gchar *sender_name, + const gchar *signal_name, + GVariant *parameters) +{ + _ExtendedGDBusSignalInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint n; + guint signal_id; + info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_gsignond_dbus_auth_service_interface_info, signal_name); + if (info == NULL) + return; + num_params = g_variant_n_children (parameters); + paramv = g_new0 (GValue, num_params + 1); + g_value_init (¶mv[0], GSIGNOND_DBUS_TYPE_AUTH_SERVICE); + g_value_set_object (¶mv[0], proxy); + g_variant_iter_init (&iter, parameters); + n = 1; + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, GSIGNOND_DBUS_TYPE_AUTH_SERVICE); + g_signal_emitv (paramv, signal_id, 0, NULL); + for (n = 0; n < num_params + 1; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static void +gsignond_dbus_auth_service_proxy_g_properties_changed (GDBusProxy *_proxy, + GVariant *changed_properties, + const gchar *const *invalidated_properties) +{ + GSignondDbusAuthServiceProxy *proxy = GSIGNOND_DBUS_AUTH_SERVICE_PROXY (_proxy); + guint n; + const gchar *key; + GVariantIter *iter; + _ExtendedGDBusPropertyInfo *info; + g_variant_get (changed_properties, "a{sv}", &iter); + while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsignond_dbus_auth_service_interface_info, key); + g_datalist_remove_data (&proxy->priv->qdata, key); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } + g_variant_iter_free (iter); + for (n = 0; invalidated_properties[n] != NULL; n++) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsignond_dbus_auth_service_interface_info, invalidated_properties[n]); + g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } +} + +static void +gsignond_dbus_auth_service_proxy_init (GSignondDbusAuthServiceProxy *proxy) +{ + proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GSIGNOND_DBUS_TYPE_AUTH_SERVICE_PROXY, GSignondDbusAuthServiceProxyPrivate); + g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), gsignond_dbus_auth_service_interface_info ()); +} + +static void +gsignond_dbus_auth_service_proxy_class_init (GSignondDbusAuthServiceProxyClass *klass) +{ + GObjectClass *gobject_class; + GDBusProxyClass *proxy_class; + + g_type_class_add_private (klass, sizeof (GSignondDbusAuthServiceProxyPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = gsignond_dbus_auth_service_proxy_finalize; + gobject_class->get_property = gsignond_dbus_auth_service_proxy_get_property; + gobject_class->set_property = gsignond_dbus_auth_service_proxy_set_property; + + proxy_class = G_DBUS_PROXY_CLASS (klass); + proxy_class->g_signal = gsignond_dbus_auth_service_proxy_g_signal; + proxy_class->g_properties_changed = gsignond_dbus_auth_service_proxy_g_properties_changed; + +} + +static void +gsignond_dbus_auth_service_proxy_iface_init (GSignondDbusAuthServiceIface *iface) +{ +} + +/** + * gsignond_dbus_auth_service_proxy_new: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-AuthService.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.AuthService</link>. See g_dbus_proxy_new() for more details. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_auth_service_proxy_new_finish() to get the result of the operation. + * + * See gsignond_dbus_auth_service_proxy_new_sync() for the synchronous, blocking version of this constructor. + */ +void +gsignond_dbus_auth_service_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (GSIGNOND_DBUS_TYPE_AUTH_SERVICE_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.AuthService", NULL); +} + +/** + * gsignond_dbus_auth_service_proxy_new_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_auth_service_proxy_new(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with gsignond_dbus_auth_service_proxy_new(). + * + * Returns: (transfer full) (type GSignondDbusAuthServiceProxy): The constructed proxy object or %NULL if @error is set. + */ +GSignondDbusAuthService * +gsignond_dbus_auth_service_proxy_new_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return GSIGNOND_DBUS_AUTH_SERVICE (ret); + else + return NULL; +} + +/** + * gsignond_dbus_auth_service_proxy_new_sync: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-AuthService.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.AuthService</link>. See g_dbus_proxy_new_sync() for more details. + * + * The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_auth_service_proxy_new() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type GSignondDbusAuthServiceProxy): The constructed proxy object or %NULL if @error is set. + */ +GSignondDbusAuthService * +gsignond_dbus_auth_service_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (GSIGNOND_DBUS_TYPE_AUTH_SERVICE_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.AuthService", NULL); + if (ret != NULL) + return GSIGNOND_DBUS_AUTH_SERVICE (ret); + else + return NULL; +} + + +/** + * gsignond_dbus_auth_service_proxy_new_for_bus: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Like gsignond_dbus_auth_service_proxy_new() but takes a #GBusType instead of a #GDBusConnection. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_auth_service_proxy_new_for_bus_finish() to get the result of the operation. + * + * See gsignond_dbus_auth_service_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. + */ +void +gsignond_dbus_auth_service_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (GSIGNOND_DBUS_TYPE_AUTH_SERVICE_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.AuthService", NULL); +} + +/** + * gsignond_dbus_auth_service_proxy_new_for_bus_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_auth_service_proxy_new_for_bus(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with gsignond_dbus_auth_service_proxy_new_for_bus(). + * + * Returns: (transfer full) (type GSignondDbusAuthServiceProxy): The constructed proxy object or %NULL if @error is set. + */ +GSignondDbusAuthService * +gsignond_dbus_auth_service_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return GSIGNOND_DBUS_AUTH_SERVICE (ret); + else + return NULL; +} + +/** + * gsignond_dbus_auth_service_proxy_new_for_bus_sync: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Like gsignond_dbus_auth_service_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. + * + * The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_auth_service_proxy_new_for_bus() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type GSignondDbusAuthServiceProxy): The constructed proxy object or %NULL if @error is set. + */ +GSignondDbusAuthService * +gsignond_dbus_auth_service_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (GSIGNOND_DBUS_TYPE_AUTH_SERVICE_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.AuthService", NULL); + if (ret != NULL) + return GSIGNOND_DBUS_AUTH_SERVICE (ret); + else + return NULL; +} + + +/* ------------------------------------------------------------------------ */ + +/** + * GSignondDbusAuthServiceSkeleton: + * + * The #GSignondDbusAuthServiceSkeleton structure contains only private data and should only be accessed using the provided API. + */ + +/** + * GSignondDbusAuthServiceSkeletonClass: + * @parent_class: The parent class. + * + * Class structure for #GSignondDbusAuthServiceSkeleton. + */ + +struct _GSignondDbusAuthServiceSkeletonPrivate +{ + GValue *properties; + GList *changed_properties; + GSource *changed_properties_idle_source; + GMainContext *context; + GMutex lock; +}; + +static void +_gsignond_dbus_auth_service_skeleton_handle_method_call ( + GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + GSignondDbusAuthServiceSkeleton *skeleton = GSIGNOND_DBUS_AUTH_SERVICE_SKELETON (user_data); + _ExtendedGDBusMethodInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint num_extra; + guint n; + guint signal_id; + GValue return_value = G_VALUE_INIT; + info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); + g_assert (info != NULL); + num_params = g_variant_n_children (parameters); + num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); + n = 0; + g_value_init (¶mv[n], GSIGNOND_DBUS_TYPE_AUTH_SERVICE); + g_value_set_object (¶mv[n++], skeleton); + g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); + g_value_set_object (¶mv[n++], invocation); + if (info->pass_fdlist) + { +#ifdef G_OS_UNIX + g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); + g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); +#else + g_assert_not_reached (); +#endif + } + g_variant_iter_init (&iter, parameters); + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, GSIGNOND_DBUS_TYPE_AUTH_SERVICE); + g_value_init (&return_value, G_TYPE_BOOLEAN); + g_signal_emitv (paramv, signal_id, 0, &return_value); + if (!g_value_get_boolean (&return_value)) + g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); + g_value_unset (&return_value); + for (n = 0; n < num_params + num_extra; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static GVariant * +_gsignond_dbus_auth_service_skeleton_handle_get_property ( + GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GError **error, + gpointer user_data) +{ + GSignondDbusAuthServiceSkeleton *skeleton = GSIGNOND_DBUS_AUTH_SERVICE_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + GVariant *ret; + ret = NULL; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsignond_dbus_auth_service_interface_info, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + g_value_init (&value, pspec->value_type); + g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); + ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); + g_value_unset (&value); + } + return ret; +} + +static gboolean +_gsignond_dbus_auth_service_skeleton_handle_set_property ( + GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GVariant *variant, + GError **error, + gpointer user_data) +{ + GSignondDbusAuthServiceSkeleton *skeleton = GSIGNOND_DBUS_AUTH_SERVICE_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + gboolean ret; + ret = FALSE; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsignond_dbus_auth_service_interface_info, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + if (info->use_gvariant) + g_value_set_variant (&value, variant); + else + g_dbus_gvariant_to_gvalue (variant, &value); + g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); + g_value_unset (&value); + ret = TRUE; + } + return ret; +} + +static const GDBusInterfaceVTable _gsignond_dbus_auth_service_skeleton_vtable = +{ + _gsignond_dbus_auth_service_skeleton_handle_method_call, + _gsignond_dbus_auth_service_skeleton_handle_get_property, + _gsignond_dbus_auth_service_skeleton_handle_set_property +}; + +static GDBusInterfaceInfo * +gsignond_dbus_auth_service_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton) +{ + return gsignond_dbus_auth_service_interface_info (); +} + +static GDBusInterfaceVTable * +gsignond_dbus_auth_service_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton) +{ + return (GDBusInterfaceVTable *) &_gsignond_dbus_auth_service_skeleton_vtable; +} + +static GVariant * +gsignond_dbus_auth_service_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) +{ + GSignondDbusAuthServiceSkeleton *skeleton = GSIGNOND_DBUS_AUTH_SERVICE_SKELETON (_skeleton); + + GVariantBuilder builder; + guint n; + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + if (_gsignond_dbus_auth_service_interface_info.parent_struct.properties == NULL) + goto out; + for (n = 0; _gsignond_dbus_auth_service_interface_info.parent_struct.properties[n] != NULL; n++) + { + GDBusPropertyInfo *info = _gsignond_dbus_auth_service_interface_info.parent_struct.properties[n]; + if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) + { + GVariant *value; + value = _gsignond_dbus_auth_service_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.google.code.AccountsSSO.gSingleSignOn.AuthService", info->name, NULL, skeleton); + if (value != NULL) + { + g_variant_take_ref (value); + g_variant_builder_add (&builder, "{sv}", info->name, value); + g_variant_unref (value); + } + } + } +out: + return g_variant_builder_end (&builder); +} + +static void +gsignond_dbus_auth_service_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) +{ +} + +static void gsignond_dbus_auth_service_skeleton_iface_init (GSignondDbusAuthServiceIface *iface); +G_DEFINE_TYPE_WITH_CODE (GSignondDbusAuthServiceSkeleton, gsignond_dbus_auth_service_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_IMPLEMENT_INTERFACE (GSIGNOND_DBUS_TYPE_AUTH_SERVICE, gsignond_dbus_auth_service_skeleton_iface_init)); + +static void +gsignond_dbus_auth_service_skeleton_finalize (GObject *object) +{ + GSignondDbusAuthServiceSkeleton *skeleton = GSIGNOND_DBUS_AUTH_SERVICE_SKELETON (object); + g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); + if (skeleton->priv->changed_properties_idle_source != NULL) + g_source_destroy (skeleton->priv->changed_properties_idle_source); + g_main_context_unref (skeleton->priv->context); + g_mutex_clear (&skeleton->priv->lock); + G_OBJECT_CLASS (gsignond_dbus_auth_service_skeleton_parent_class)->finalize (object); +} + +static void +gsignond_dbus_auth_service_skeleton_init (GSignondDbusAuthServiceSkeleton *skeleton) +{ + skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GSIGNOND_DBUS_TYPE_AUTH_SERVICE_SKELETON, GSignondDbusAuthServiceSkeletonPrivate); + g_mutex_init (&skeleton->priv->lock); + skeleton->priv->context = g_main_context_ref_thread_default (); +} + +static void +gsignond_dbus_auth_service_skeleton_class_init (GSignondDbusAuthServiceSkeletonClass *klass) +{ + GObjectClass *gobject_class; + GDBusInterfaceSkeletonClass *skeleton_class; + + g_type_class_add_private (klass, sizeof (GSignondDbusAuthServiceSkeletonPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = gsignond_dbus_auth_service_skeleton_finalize; + + skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); + skeleton_class->get_info = gsignond_dbus_auth_service_skeleton_dbus_interface_get_info; + skeleton_class->get_properties = gsignond_dbus_auth_service_skeleton_dbus_interface_get_properties; + skeleton_class->flush = gsignond_dbus_auth_service_skeleton_dbus_interface_flush; + skeleton_class->get_vtable = gsignond_dbus_auth_service_skeleton_dbus_interface_get_vtable; +} + +static void +gsignond_dbus_auth_service_skeleton_iface_init (GSignondDbusAuthServiceIface *iface) +{ +} + +/** + * gsignond_dbus_auth_service_skeleton_new: + * + * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-AuthService.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.AuthService</link>. + * + * Returns: (transfer full) (type GSignondDbusAuthServiceSkeleton): The skeleton object. + */ +GSignondDbusAuthService * +gsignond_dbus_auth_service_skeleton_new (void) +{ + return GSIGNOND_DBUS_AUTH_SERVICE (g_object_new (GSIGNOND_DBUS_TYPE_AUTH_SERVICE_SKELETON, NULL)); +} + diff --git a/src/daemon/dbus/gsignond-dbus-auth-service-gen.h b/src/daemon/dbus/gsignond-dbus-auth-service-gen.h new file mode 100644 index 0000000..2d5eb2d --- /dev/null +++ b/src/daemon/dbus/gsignond-dbus-auth-service-gen.h @@ -0,0 +1,434 @@ +/* + * Generated by gdbus-codegen 2.32.3. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifndef __GSIGNOND_DBUS_AUTH_SERVICE_GEN_H__ +#define __GSIGNOND_DBUS_AUTH_SERVICE_GEN_H__ + +#include <gio/gio.h> + +G_BEGIN_DECLS + + +/* ------------------------------------------------------------------------ */ +/* Declarations for com.google.code.AccountsSSO.gSingleSignOn.AuthService */ + +#define GSIGNOND_DBUS_TYPE_AUTH_SERVICE (gsignond_dbus_auth_service_get_type ()) +#define GSIGNOND_DBUS_AUTH_SERVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSIGNOND_DBUS_TYPE_AUTH_SERVICE, GSignondDbusAuthService)) +#define GSIGNOND_DBUS_IS_AUTH_SERVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSIGNOND_DBUS_TYPE_AUTH_SERVICE)) +#define GSIGNOND_DBUS_AUTH_SERVICE_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GSIGNOND_DBUS_TYPE_AUTH_SERVICE, GSignondDbusAuthServiceIface)) + +struct _GSignondDbusAuthService; +typedef struct _GSignondDbusAuthService GSignondDbusAuthService; +typedef struct _GSignondDbusAuthServiceIface GSignondDbusAuthServiceIface; + +struct _GSignondDbusAuthServiceIface +{ + GTypeInterface parent_iface; + + gboolean (*handle_backup_finished) ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_backup_starts) ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_clear) ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_get_identity) ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation, + guint arg_id, + const gchar *arg_applicationContext); + + gboolean (*handle_query_identities) ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation, + GVariant *arg_filter, + const gchar *arg_applicationContext); + + gboolean (*handle_query_mechanisms) ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation, + const gchar *arg_method); + + gboolean (*handle_query_methods) ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_register_new_identity) ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation, + const gchar *arg_applicationContext); + + gboolean (*handle_restore_finished) ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_restore_starts) ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation); + +}; + +GType gsignond_dbus_auth_service_get_type (void) G_GNUC_CONST; + +GDBusInterfaceInfo *gsignond_dbus_auth_service_interface_info (void); +guint gsignond_dbus_auth_service_override_properties (GObjectClass *klass, guint property_id_begin); + + +/* D-Bus method call completion functions: */ +void gsignond_dbus_auth_service_complete_register_new_identity ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation, + const gchar *objectPath); + +void gsignond_dbus_auth_service_complete_get_identity ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation, + const gchar *objectPath, + GVariant *identityData); + +void gsignond_dbus_auth_service_complete_query_methods ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation, + const gchar *const *authMethods); + +void gsignond_dbus_auth_service_complete_query_mechanisms ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation, + const gchar *const *mechanisms); + +void gsignond_dbus_auth_service_complete_query_identities ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation, + GVariant *identities); + +void gsignond_dbus_auth_service_complete_clear ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation, + gboolean unnamed_arg0); + +void gsignond_dbus_auth_service_complete_backup_starts ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation, + guchar unnamed_arg0); + +void gsignond_dbus_auth_service_complete_backup_finished ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation, + guchar unnamed_arg0); + +void gsignond_dbus_auth_service_complete_restore_starts ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation, + guchar unnamed_arg0); + +void gsignond_dbus_auth_service_complete_restore_finished ( + GSignondDbusAuthService *object, + GDBusMethodInvocation *invocation, + guchar unnamed_arg0); + + + +/* D-Bus method calls: */ +void gsignond_dbus_auth_service_call_register_new_identity ( + GSignondDbusAuthService *proxy, + const gchar *arg_applicationContext, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_auth_service_call_register_new_identity_finish ( + GSignondDbusAuthService *proxy, + gchar **out_objectPath, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_auth_service_call_register_new_identity_sync ( + GSignondDbusAuthService *proxy, + const gchar *arg_applicationContext, + gchar **out_objectPath, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_auth_service_call_get_identity ( + GSignondDbusAuthService *proxy, + guint arg_id, + const gchar *arg_applicationContext, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_auth_service_call_get_identity_finish ( + GSignondDbusAuthService *proxy, + gchar **out_objectPath, + GVariant **out_identityData, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_auth_service_call_get_identity_sync ( + GSignondDbusAuthService *proxy, + guint arg_id, + const gchar *arg_applicationContext, + gchar **out_objectPath, + GVariant **out_identityData, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_auth_service_call_query_methods ( + GSignondDbusAuthService *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_auth_service_call_query_methods_finish ( + GSignondDbusAuthService *proxy, + gchar ***out_authMethods, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_auth_service_call_query_methods_sync ( + GSignondDbusAuthService *proxy, + gchar ***out_authMethods, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_auth_service_call_query_mechanisms ( + GSignondDbusAuthService *proxy, + const gchar *arg_method, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_auth_service_call_query_mechanisms_finish ( + GSignondDbusAuthService *proxy, + gchar ***out_mechanisms, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_auth_service_call_query_mechanisms_sync ( + GSignondDbusAuthService *proxy, + const gchar *arg_method, + gchar ***out_mechanisms, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_auth_service_call_query_identities ( + GSignondDbusAuthService *proxy, + GVariant *arg_filter, + const gchar *arg_applicationContext, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_auth_service_call_query_identities_finish ( + GSignondDbusAuthService *proxy, + GVariant **out_identities, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_auth_service_call_query_identities_sync ( + GSignondDbusAuthService *proxy, + GVariant *arg_filter, + const gchar *arg_applicationContext, + GVariant **out_identities, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_auth_service_call_clear ( + GSignondDbusAuthService *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_auth_service_call_clear_finish ( + GSignondDbusAuthService *proxy, + gboolean *out_unnamed_arg0, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_auth_service_call_clear_sync ( + GSignondDbusAuthService *proxy, + gboolean *out_unnamed_arg0, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_auth_service_call_backup_starts ( + GSignondDbusAuthService *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_auth_service_call_backup_starts_finish ( + GSignondDbusAuthService *proxy, + guchar *out_unnamed_arg0, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_auth_service_call_backup_starts_sync ( + GSignondDbusAuthService *proxy, + guchar *out_unnamed_arg0, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_auth_service_call_backup_finished ( + GSignondDbusAuthService *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_auth_service_call_backup_finished_finish ( + GSignondDbusAuthService *proxy, + guchar *out_unnamed_arg0, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_auth_service_call_backup_finished_sync ( + GSignondDbusAuthService *proxy, + guchar *out_unnamed_arg0, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_auth_service_call_restore_starts ( + GSignondDbusAuthService *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_auth_service_call_restore_starts_finish ( + GSignondDbusAuthService *proxy, + guchar *out_unnamed_arg0, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_auth_service_call_restore_starts_sync ( + GSignondDbusAuthService *proxy, + guchar *out_unnamed_arg0, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_auth_service_call_restore_finished ( + GSignondDbusAuthService *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_auth_service_call_restore_finished_finish ( + GSignondDbusAuthService *proxy, + guchar *out_unnamed_arg0, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_auth_service_call_restore_finished_sync ( + GSignondDbusAuthService *proxy, + guchar *out_unnamed_arg0, + GCancellable *cancellable, + GError **error); + + + +/* ---- */ + +#define GSIGNOND_DBUS_TYPE_AUTH_SERVICE_PROXY (gsignond_dbus_auth_service_proxy_get_type ()) +#define GSIGNOND_DBUS_AUTH_SERVICE_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSIGNOND_DBUS_TYPE_AUTH_SERVICE_PROXY, GSignondDbusAuthServiceProxy)) +#define GSIGNOND_DBUS_AUTH_SERVICE_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GSIGNOND_DBUS_TYPE_AUTH_SERVICE_PROXY, GSignondDbusAuthServiceProxyClass)) +#define GSIGNOND_DBUS_AUTH_SERVICE_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSIGNOND_DBUS_TYPE_AUTH_SERVICE_PROXY, GSignondDbusAuthServiceProxyClass)) +#define GSIGNOND_DBUS_IS_AUTH_SERVICE_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSIGNOND_DBUS_TYPE_AUTH_SERVICE_PROXY)) +#define GSIGNOND_DBUS_IS_AUTH_SERVICE_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSIGNOND_DBUS_TYPE_AUTH_SERVICE_PROXY)) + +typedef struct _GSignondDbusAuthServiceProxy GSignondDbusAuthServiceProxy; +typedef struct _GSignondDbusAuthServiceProxyClass GSignondDbusAuthServiceProxyClass; +typedef struct _GSignondDbusAuthServiceProxyPrivate GSignondDbusAuthServiceProxyPrivate; + +struct _GSignondDbusAuthServiceProxy +{ + /*< private >*/ + GDBusProxy parent_instance; + GSignondDbusAuthServiceProxyPrivate *priv; +}; + +struct _GSignondDbusAuthServiceProxyClass +{ + GDBusProxyClass parent_class; +}; + +GType gsignond_dbus_auth_service_proxy_get_type (void) G_GNUC_CONST; + +void gsignond_dbus_auth_service_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +GSignondDbusAuthService *gsignond_dbus_auth_service_proxy_new_finish ( + GAsyncResult *res, + GError **error); +GSignondDbusAuthService *gsignond_dbus_auth_service_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_auth_service_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +GSignondDbusAuthService *gsignond_dbus_auth_service_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error); +GSignondDbusAuthService *gsignond_dbus_auth_service_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + + +/* ---- */ + +#define GSIGNOND_DBUS_TYPE_AUTH_SERVICE_SKELETON (gsignond_dbus_auth_service_skeleton_get_type ()) +#define GSIGNOND_DBUS_AUTH_SERVICE_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSIGNOND_DBUS_TYPE_AUTH_SERVICE_SKELETON, GSignondDbusAuthServiceSkeleton)) +#define GSIGNOND_DBUS_AUTH_SERVICE_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GSIGNOND_DBUS_TYPE_AUTH_SERVICE_SKELETON, GSignondDbusAuthServiceSkeletonClass)) +#define GSIGNOND_DBUS_AUTH_SERVICE_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSIGNOND_DBUS_TYPE_AUTH_SERVICE_SKELETON, GSignondDbusAuthServiceSkeletonClass)) +#define GSIGNOND_DBUS_IS_AUTH_SERVICE_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSIGNOND_DBUS_TYPE_AUTH_SERVICE_SKELETON)) +#define GSIGNOND_DBUS_IS_AUTH_SERVICE_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSIGNOND_DBUS_TYPE_AUTH_SERVICE_SKELETON)) + +typedef struct _GSignondDbusAuthServiceSkeleton GSignondDbusAuthServiceSkeleton; +typedef struct _GSignondDbusAuthServiceSkeletonClass GSignondDbusAuthServiceSkeletonClass; +typedef struct _GSignondDbusAuthServiceSkeletonPrivate GSignondDbusAuthServiceSkeletonPrivate; + +struct _GSignondDbusAuthServiceSkeleton +{ + /*< private >*/ + GDBusInterfaceSkeleton parent_instance; + GSignondDbusAuthServiceSkeletonPrivate *priv; +}; + +struct _GSignondDbusAuthServiceSkeletonClass +{ + GDBusInterfaceSkeletonClass parent_class; +}; + +GType gsignond_dbus_auth_service_skeleton_get_type (void) G_GNUC_CONST; + +GSignondDbusAuthService *gsignond_dbus_auth_service_skeleton_new (void); + + +G_END_DECLS + +#endif /* __GSIGNOND_DBUS_AUTH_SERVICE_GEN_H__ */ diff --git a/src/daemon/dbus/gsignond-dbus-auth-session-adapter.c b/src/daemon/dbus/gsignond-dbus-auth-session-adapter.c new file mode 100644 index 0000000..c537118 --- /dev/null +++ b/src/daemon/dbus/gsignond-dbus-auth-session-adapter.c @@ -0,0 +1,455 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2012 Intel Corporation. + * + * Contact: Amarnath Valluri <amarnath.valluri@linux.intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#include <config.h> +#include "gsignond-dbus-auth-session-adapter.h" +#include "gsignond/gsignond-log.h" +#include "gsignond-dbus.h" + +enum +{ + PROP_0, + PROP_SESSION, + PROP_CONNECTION, + PROP_APP_CONTEXT, + N_PROPERTIES +}; + +static GParamSpec *properties[N_PROPERTIES]; + +struct _GSignondDbusAuthSessionAdapterPrivate +{ + GDBusConnection *connection; + GSignondDbusAuthSession *dbus_auth_session; + GSignondAuthSession *session; + gchar *app_context; + gboolean is_process_active; + GSignondSecurityContext *ctx; +}; + +G_DEFINE_TYPE (GSignondDbusAuthSessionAdapter, gsignond_dbus_auth_session_adapter, GSIGNOND_TYPE_DISPOSABLE) + + +#define GSIGNOND_DBUS_AUTH_SESSION_ADAPTER_GET_PRIV(obj) G_TYPE_INSTANCE_GET_PRIVATE ((obj), GSIGNOND_TYPE_DBUS_AUTH_SESSION_ADAPTER, GSignondDbusAuthSessionAdapterPrivate) + +#define PREPARE_SECURITY_CONTEXT(dbus_object, invocation) \ +{ \ + GSignondDbusAuthSessionAdapterPrivate *priv = dbus_object->priv; \ + GSignondAccessControlManager *acm = gsignond_auth_session_get_acm (priv->session); \ + const gchar *sender = NULL; \ + int fd = -1; \ + sender = g_dbus_method_invocation_get_sender (invocation); \ + if (!sender) {\ + GDBusConnection *connection = g_dbus_method_invocation_get_connection (invocation);\ + fd = g_socket_get_fd(g_socket_connection_get_socket(G_SOCKET_CONNECTION(g_dbus_connection_get_stream (connection))));\ + }\ + gsignond_access_control_manager_security_context_of_peer( \ + acm, \ + priv->ctx, \ + fd, \ + sender, \ + priv->app_context); \ +} + +static gboolean _handle_query_available_mechanisms (GSignondDbusAuthSessionAdapter *, GDBusMethodInvocation *, const gchar **, gpointer); +static gboolean _handle_process (GSignondDbusAuthSessionAdapter *, GDBusMethodInvocation *, const GVariant *, const gchar *, gpointer); +static gboolean _handle_cancel (GSignondDbusAuthSessionAdapter *, GDBusMethodInvocation *, gpointer); + +static void +gsignond_dbus_auth_session_adapter_set_property (GObject *object, + guint property_id, + const GValue *value, GParamSpec *pspec) +{ + GSignondDbusAuthSessionAdapter *self = GSIGNOND_DBUS_AUTH_SESSION_ADAPTER (object); + + switch (property_id) { + case PROP_SESSION: { + gpointer object = g_value_get_object (value); + self->priv->session = GSIGNOND_AUTH_SESSION ((object)); + break; + } + case PROP_CONNECTION: { + if (self->priv->connection) g_object_unref (self->priv->connection); + self->priv->connection = G_DBUS_CONNECTION (g_value_get_object (value)); + break; + } + case PROP_APP_CONTEXT: { + if (self->priv->app_context) g_free (self->priv->app_context); + self->priv->app_context = g_strdup (g_value_get_string (value)); + break; + } + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } +} + +static void +gsignond_dbus_auth_session_adapter_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + GSignondDbusAuthSessionAdapter *self = GSIGNOND_DBUS_AUTH_SESSION_ADAPTER (object); + + switch (property_id) { + case PROP_SESSION: { + g_value_set_object (value, self->priv->session); + break; + } + case PROP_CONNECTION: + g_value_set_object (value, self->priv->connection); + break; + case PROP_APP_CONTEXT: + g_value_set_string (value, self->priv->app_context); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } +} + +static void +gsignond_dbus_auth_session_adapter_dispose (GObject *object) +{ + GSignondDbusAuthSessionAdapter *self = GSIGNOND_DBUS_AUTH_SESSION_ADAPTER (object); + + if (self->priv->session) { + if (self->priv->is_process_active) { + gsignond_auth_session_abort_process (self->priv->session); + self->priv->is_process_active = FALSE; + } + + g_object_unref (self->priv->session); + self->priv->session = NULL; + } + + if (self->priv->dbus_auth_session) { + gsignond_dbus_auth_session_emit_unregistered (self->priv->dbus_auth_session); + DBG("(-)'%s' object unexported", g_dbus_interface_skeleton_get_object_path ( + G_DBUS_INTERFACE_SKELETON(self->priv->dbus_auth_session))); + g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON(self->priv->dbus_auth_session)); + g_object_unref (self->priv->dbus_auth_session); + self->priv->dbus_auth_session = NULL; + } + + if (self->priv->connection) { + g_object_unref (self->priv->connection); + self->priv->connection = NULL; + } + + G_OBJECT_CLASS(gsignond_dbus_auth_session_adapter_parent_class)->dispose (object); +} + +static void +gsignond_dbus_auth_session_adapter_finalize (GObject *object) +{ + GSignondDbusAuthSessionAdapter *self = GSIGNOND_DBUS_AUTH_SESSION_ADAPTER (object); + + if (self->priv->ctx) { + gsignond_security_context_free (self->priv->ctx); + self->priv->ctx = NULL; + } + + if (self->priv->app_context) { + g_free (self->priv->app_context); + self->priv->app_context = NULL; + } + + G_OBJECT_CLASS (gsignond_dbus_auth_session_adapter_parent_class)->finalize (object); +} + +static void +gsignond_dbus_auth_session_adapter_class_init (GSignondDbusAuthSessionAdapterClass *klass) +{ + GObjectClass* object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (GSignondDbusAuthSessionAdapterPrivate)); + + object_class->get_property = gsignond_dbus_auth_session_adapter_get_property; + object_class->set_property = gsignond_dbus_auth_session_adapter_set_property; + object_class->dispose = gsignond_dbus_auth_session_adapter_dispose; + object_class->finalize = gsignond_dbus_auth_session_adapter_finalize; + + properties[PROP_SESSION] = g_param_spec_object ("auth-session", + "Core auth session object", + "Core AuthSession Object", + GSIGNOND_TYPE_AUTH_SESSION, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS); + + properties[PROP_CONNECTION] = g_param_spec_object ("connection", + "Dbus connection used", + "Dbus connection used", + G_TYPE_DBUS_CONNECTION, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS); + properties[PROP_APP_CONTEXT] = g_param_spec_string ( + "app-context", + "application security context", + "Application security context of the identity object creater", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); + + g_object_class_install_properties (object_class, N_PROPERTIES, properties); +} + +static void +gsignond_dbus_auth_session_adapter_init (GSignondDbusAuthSessionAdapter *self) +{ + self->priv = GSIGNOND_DBUS_AUTH_SESSION_ADAPTER_GET_PRIV(self); + + self->priv->connection = 0; + self->priv->session = 0; + self->priv->app_context = 0; + self->priv->is_process_active = FALSE; + self->priv->dbus_auth_session = gsignond_dbus_auth_session_skeleton_new (); + self->priv->ctx = gsignond_security_context_new (); + + g_signal_connect_swapped (self->priv->dbus_auth_session, + "handle-query-available-mechanisms", + G_CALLBACK (_handle_query_available_mechanisms), self); + g_signal_connect_swapped (self->priv->dbus_auth_session, "handle-process", G_CALLBACK(_handle_process), self); + g_signal_connect_swapped (self->priv->dbus_auth_session, "handle-cancel", G_CALLBACK(_handle_cancel), self); +} + +static gboolean +_handle_query_available_mechanisms (GSignondDbusAuthSessionAdapter *self, + GDBusMethodInvocation *invocation, + const gchar **wanted_mechanisms, + gpointer user_data) +{ + gchar **mechanisms = NULL; + GError *error = NULL; + + g_return_val_if_fail (self && GSIGNOND_IS_DBUS_AUTH_SESSION_ADAPTER (self), FALSE); + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), FALSE); + + PREPARE_SECURITY_CONTEXT (self, invocation); + + mechanisms = gsignond_auth_session_query_available_mechanisms ( + self->priv->session, wanted_mechanisms, self->priv->ctx, &error); + + if (mechanisms) { + gsignond_dbus_auth_session_complete_query_available_mechanisms ( + self->priv->dbus_auth_session, invocation, (const gchar * const *)mechanisms); + g_free (mechanisms); + } + else { + g_dbus_method_invocation_return_gerror (invocation, error); + g_error_free (error); + } + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), TRUE); + + return TRUE; +} + +typedef struct { + GSignondDbusAuthSessionAdapter *adapter; + GDBusMethodInvocation *invocation; +} _AuthSessionDbusInfo; + +static _AuthSessionDbusInfo* +_auth_session_dbus_info_new (GSignondDbusAuthSessionAdapter *self, GDBusMethodInvocation *invocation) +{ + _AuthSessionDbusInfo *info = g_slice_new0(_AuthSessionDbusInfo); + + info->adapter = g_object_ref (self); + info->invocation = g_object_ref (invocation); + + return info; +} + +static void +_auth_session_dbus_info_free (_AuthSessionDbusInfo *info) +{ + if (!info) return; + + g_object_unref (info->adapter); + g_object_unref (info->invocation); + + g_slice_free (_AuthSessionDbusInfo, info); +} + +static void +_emit_state_changed (gint state, const gchar *message, gpointer user_data) +{ + GSignondDbusAuthSessionAdapter *self = NULL; + _AuthSessionDbusInfo *info = (_AuthSessionDbusInfo*) user_data; + + if (!info) return ; + + self = info->adapter; + gsignond_dbus_auth_session_emit_state_changed ( + self->priv->dbus_auth_session, state, message); +} + +static void +_on_process_done (GSignondSessionData *reply, const GError *error, gpointer user_data) +{ + GSignondDbusAuthSessionAdapter *self = NULL; + _AuthSessionDbusInfo *info = (_AuthSessionDbusInfo*) user_data; + + if (!info) return ; + + self = info->adapter; + self->priv->is_process_active = FALSE; + + if (error) + g_dbus_method_invocation_return_gerror (info->invocation, error); + else { + GVariant *result = gsignond_dictionary_to_variant ((GSignondDictionary *)reply); + gsignond_dbus_auth_session_complete_process ( + self->priv->dbus_auth_session, info->invocation, result); + } + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), TRUE); + + _auth_session_dbus_info_free (info); +} + +static gboolean +_handle_process (GSignondDbusAuthSessionAdapter *self, + GDBusMethodInvocation *invocation, + const GVariant *session_data, + const gchar *mechanisms, + gpointer user_data) +{ + _AuthSessionDbusInfo *info = 0; + GError *error = NULL; + GSignondSessionData *data = NULL; + + g_return_val_if_fail (self && GSIGNOND_IS_DBUS_AUTH_SESSION_ADAPTER (self), FALSE); + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), FALSE); + + PREPARE_SECURITY_CONTEXT (self, invocation); + + data = (GSignondSessionData *)gsignond_dictionary_new_from_variant ((GVariant *)session_data); + info = _auth_session_dbus_info_new (self, invocation); + self->priv->is_process_active = TRUE; + if (!gsignond_auth_session_process (self->priv->session, data, mechanisms, + self->priv->ctx, _on_process_done, + _emit_state_changed, info, &error)) { + g_dbus_method_invocation_return_gerror (invocation, error); + g_error_free (error); + + _auth_session_dbus_info_free (info); + + self->priv->is_process_active = FALSE; + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), TRUE); + } + + gsignond_dictionary_unref (data); + + return TRUE; +} + +static gboolean +_handle_cancel (GSignondDbusAuthSessionAdapter *self, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + GError *error = NULL; + + g_return_val_if_fail (self && GSIGNOND_IS_DBUS_AUTH_SESSION_ADAPTER (self), FALSE); + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), FALSE); + + PREPARE_SECURITY_CONTEXT (self, invocation); + + if (gsignond_auth_session_cancel (self->priv->session, self->priv->ctx, &error)) + gsignond_dbus_auth_session_complete_cancel (self->priv->dbus_auth_session, invocation); + else { + g_dbus_method_invocation_return_gerror (invocation, error); + g_error_free (error); + } + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), TRUE); + + return TRUE; +} + +const gchar * +gsignond_dbus_auth_session_adapter_get_object_path (GSignondDbusAuthSessionAdapter *self) +{ + g_return_val_if_fail (self && GSIGNOND_IS_DBUS_AUTH_SESSION_ADAPTER(self), NULL); + + return g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON(self->priv->dbus_auth_session)); +} + +GSignondDbusAuthSessionAdapter * +gsignond_dbus_auth_session_adapter_new_with_connection (GDBusConnection *connection, + GSignondAuthSession *session, + const gchar *app_context, + guint timeout) +{ + static guint32 object_counter; + gchar *object_path = NULL; + GSignondDbusAuthSessionAdapter *adapter = NULL; + GError *error = NULL; + + adapter = GSIGNOND_DBUS_AUTH_SESSION_ADAPTER ( + g_object_new (GSIGNOND_TYPE_DBUS_AUTH_SESSION_ADAPTER, + "connection", connection, "auth-session", session, "app-context", app_context, NULL)); + + if (!adapter) return NULL; + + object_path = g_strdup_printf ("%s/AuthSession_%d", GSIGNOND_DAEMON_OBJECTPATH, object_counter++); + if (!g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (adapter->priv->dbus_auth_session), + adapter->priv->connection, + object_path, + &error)) { + ERR ("failed to register object: %s", error->message); + g_error_free (error); + g_free (object_path); + g_object_unref (adapter); + return NULL; + } + DBG("(+) '%s' object exported", object_path); + g_free (object_path); + + gsignond_disposable_set_timeout (GSIGNOND_DISPOSABLE(adapter), timeout); + + return adapter; +} + +#ifndef USE_P2P +GSignondDbusAuthSessionAdapter * +gsignond_dbus_auth_session_adapter_new (GSignondAuthSession *session, const gchar *app_context, guint timeout) +{ + GError *error = NULL; + GDBusConnection *connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error); + if (error) { + ERR ("Error getting session bus :%s", error->message); + g_error_free (error); + return NULL; + } + + return gsignond_dbus_auth_session_adapter_new_with_connection (connection, session, app_context, timeout); +} +#endif diff --git a/src/daemon/dbus/gsignond-dbus-auth-session-adapter.h b/src/daemon/dbus/gsignond-dbus-auth-session-adapter.h new file mode 100644 index 0000000..9405a4b --- /dev/null +++ b/src/daemon/dbus/gsignond-dbus-auth-session-adapter.h @@ -0,0 +1,82 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2012 Intel Corporation. + * + * Contact: Amarnath Valluri <amarnath.valluri@linux.intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#ifndef __GSIGNOND_DBUS_AUTH_SESSION_ADAPTER_H_ +#define __GSIGNOND_DBUS_AUTH_SESSION_ADAPTER_H_ + +#include <config.h> +#include <glib.h> +#include <daemon/gsignond-auth-session.h> +#include "common/gsignond-disposable.h" +#include "gsignond-dbus-auth-session-gen.h" + +G_BEGIN_DECLS + +#define GSIGNOND_TYPE_DBUS_AUTH_SESSION_ADAPTER (gsignond_dbus_auth_session_adapter_get_type()) +#define GSIGNOND_DBUS_AUTH_SESSION_ADAPTER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GSIGNOND_TYPE_DBUS_AUTH_SESSION_ADAPTER, GSignondDbusAuthSessionAdapter)) +#define GSIGNOND_DBUS_AUTH_SESSION_ADAPTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GSIGNOND_TYPE_DBUS_AUTH_SESSION_ADAPTER, GSignondDbusAuthSessionAdapterClass)) +#define GSIGNOND_IS_DBUS_AUTH_SESSION_ADAPTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GSIGNOND_TYPE_DBUS_AUTH_SESSION_ADAPTER)) +#define GSIGNOND_IS_DBUS_AUTH_SESSION_ADAPTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GSIGNOND_TYPE_DBUS_AUTH_SESSION_ADAPTER)) +#define GSIGNOND_DBUS_AUTH_SESSION_ADAPTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GSIGNOND_TYPE_DBUS_AUTH_SESSION_ADAPTER, GSignondDbusAuthSessionAdapterClass)) + +typedef struct _GSignondDbusAuthSessionAdapter GSignondDbusAuthSessionAdapter; +typedef struct _GSignondDbusAuthSessionAdapterClass GSignondDbusAuthSessionAdapterClass; +typedef struct _GSignondDbusAuthSessionAdapterPrivate GSignondDbusAuthSessionAdapterPrivate; + +struct _GSignondDbusAuthSessionAdapter +{ + GSignondDisposable parent; + + /* priv */ + GSignondDbusAuthSessionAdapterPrivate *priv; +}; + +struct _GSignondDbusAuthSessionAdapterClass +{ + GSignondDisposableClass parent_class; +}; + +GType gsignond_dbus_auth_session_adapter_get_type (void) G_GNUC_CONST; + +GSignondDbusAuthSessionAdapter * +gsignond_dbus_auth_session_adapter_new_with_connection (GDBusConnection *connection, + GSignondAuthSession *session, + const gchar *app_context, + guint timeout); + +#ifndef USE_P2P +GSignondDbusAuthSessionAdapter * +gsignond_dbus_auth_session_adapter_new (GSignondAuthSession *session, + const gchar *app_context, + guint timeout); +#endif + +const gchar * +gsignond_dbus_auth_session_adapter_get_object_path ( + GSignondDbusAuthSessionAdapter *dbus_session) G_GNUC_CONST; + +G_END_DECLS + +#endif /* __GSIGNOND_DBUS_AUTH_SESSION_ADAPTER_H_ */ diff --git a/src/daemon/dbus/gsignond-dbus-auth-session-gen.c b/src/daemon/dbus/gsignond-dbus-auth-session-gen.c new file mode 100644 index 0000000..eaea53d --- /dev/null +++ b/src/daemon/dbus/gsignond-dbus-auth-session-gen.c @@ -0,0 +1,1585 @@ +/* + * Generated by gdbus-codegen 2.32.3. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "gsignond-dbus-auth-session-gen.h" + +#ifdef G_OS_UNIX +# include <gio/gunixfdlist.h> +#endif + +typedef struct +{ + GDBusArgInfo parent_struct; + gboolean use_gvariant; +} _ExtendedGDBusArgInfo; + +typedef struct +{ + GDBusMethodInfo parent_struct; + const gchar *signal_name; + gboolean pass_fdlist; +} _ExtendedGDBusMethodInfo; + +typedef struct +{ + GDBusSignalInfo parent_struct; + const gchar *signal_name; +} _ExtendedGDBusSignalInfo; + +typedef struct +{ + GDBusPropertyInfo parent_struct; + const gchar *hyphen_name; + gboolean use_gvariant; +} _ExtendedGDBusPropertyInfo; + +typedef struct +{ + GDBusInterfaceInfo parent_struct; + const gchar *hyphen_name; +} _ExtendedGDBusInterfaceInfo; + +typedef struct +{ + const _ExtendedGDBusPropertyInfo *info; + guint prop_id; + GValue orig_value; /* the value before the change */ +} ChangedProperty; + +static void +_changed_property_free (ChangedProperty *data) +{ + g_value_unset (&data->orig_value); + g_free (data); +} + +static gboolean +_g_strv_equal0 (gchar **a, gchar **b) +{ + gboolean ret = FALSE; + guint n; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + if (g_strv_length (a) != g_strv_length (b)) + goto out; + for (n = 0; a[n] != NULL; n++) + if (g_strcmp0 (a[n], b[n]) != 0) + goto out; + ret = TRUE; +out: + return ret; +} + +static gboolean +_g_variant_equal0 (GVariant *a, GVariant *b) +{ + gboolean ret = FALSE; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + ret = g_variant_equal (a, b); +out: + return ret; +} + +G_GNUC_UNUSED static gboolean +_g_value_equal (const GValue *a, const GValue *b) +{ + gboolean ret = FALSE; + g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b)); + switch (G_VALUE_TYPE (a)) + { + case G_TYPE_BOOLEAN: + ret = (g_value_get_boolean (a) == g_value_get_boolean (b)); + break; + case G_TYPE_UCHAR: + ret = (g_value_get_uchar (a) == g_value_get_uchar (b)); + break; + case G_TYPE_INT: + ret = (g_value_get_int (a) == g_value_get_int (b)); + break; + case G_TYPE_UINT: + ret = (g_value_get_uint (a) == g_value_get_uint (b)); + break; + case G_TYPE_INT64: + ret = (g_value_get_int64 (a) == g_value_get_int64 (b)); + break; + case G_TYPE_UINT64: + ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b)); + break; + case G_TYPE_DOUBLE: + ret = (g_value_get_double (a) == g_value_get_double (b)); + break; + case G_TYPE_STRING: + ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0); + break; + case G_TYPE_VARIANT: + ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b)); + break; + default: + if (G_VALUE_TYPE (a) == G_TYPE_STRV) + ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b)); + else + g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a))); + break; + } + return ret; +} + +/* ------------------------------------------------------------------------ + * Code for interface com.google.code.AccountsSSO.gSingleSignOn.AuthSession + * ------------------------------------------------------------------------ + */ + +/** + * SECTION:GSignondDbusAuthSession + * @title: GSignondDbusAuthSession + * @short_description: Generated C code for the com.google.code.AccountsSSO.gSingleSignOn.AuthSession D-Bus interface + * + * This section contains code for working with the <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-AuthSession.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.AuthSession</link> D-Bus interface in C. + */ + +/* ---- Introspection data for com.google.code.AccountsSSO.gSingleSignOn.AuthSession ---- */ + +static const _ExtendedGDBusArgInfo _gsignond_dbus_auth_session_method_info_query_available_mechanisms_IN_ARG_wantedMechanisms = +{ + { + -1, + "wantedMechanisms", + "as", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_auth_session_method_info_query_available_mechanisms_IN_ARG_pointers[] = +{ + &_gsignond_dbus_auth_session_method_info_query_available_mechanisms_IN_ARG_wantedMechanisms, + NULL +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_auth_session_method_info_query_available_mechanisms_OUT_ARG_unnamed_arg1 = +{ + { + -1, + "unnamed_arg1", + "as", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_auth_session_method_info_query_available_mechanisms_OUT_ARG_pointers[] = +{ + &_gsignond_dbus_auth_session_method_info_query_available_mechanisms_OUT_ARG_unnamed_arg1, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_auth_session_method_info_query_available_mechanisms = +{ + { + -1, + "queryAvailableMechanisms", + (GDBusArgInfo **) &_gsignond_dbus_auth_session_method_info_query_available_mechanisms_IN_ARG_pointers, + (GDBusArgInfo **) &_gsignond_dbus_auth_session_method_info_query_available_mechanisms_OUT_ARG_pointers, + NULL + }, + "handle-query-available-mechanisms", + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_auth_session_method_info_process_IN_ARG_sessionDataVa = +{ + { + -1, + "sessionDataVa", + "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_auth_session_method_info_process_IN_ARG_mechanism = +{ + { + -1, + "mechanism", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_auth_session_method_info_process_IN_ARG_pointers[] = +{ + &_gsignond_dbus_auth_session_method_info_process_IN_ARG_sessionDataVa, + &_gsignond_dbus_auth_session_method_info_process_IN_ARG_mechanism, + NULL +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_auth_session_method_info_process_OUT_ARG_unnamed_arg2 = +{ + { + -1, + "unnamed_arg2", + "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_auth_session_method_info_process_OUT_ARG_pointers[] = +{ + &_gsignond_dbus_auth_session_method_info_process_OUT_ARG_unnamed_arg2, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_auth_session_method_info_process = +{ + { + -1, + "process", + (GDBusArgInfo **) &_gsignond_dbus_auth_session_method_info_process_IN_ARG_pointers, + (GDBusArgInfo **) &_gsignond_dbus_auth_session_method_info_process_OUT_ARG_pointers, + NULL + }, + "handle-process", + FALSE +}; + +static const GDBusAnnotationInfo _gsignond_dbus_auth_session_method_cancel_annotation_info_0 = +{ + -1, + "org.freedesktop.DBus.Method.NoReply", + "true", + NULL +}; + +static const GDBusAnnotationInfo * const _gsignond_dbus_auth_session_method_cancel_annotation_info_pointers[] = +{ + &_gsignond_dbus_auth_session_method_cancel_annotation_info_0, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_auth_session_method_info_cancel = +{ + { + -1, + "cancel", + NULL, + NULL, + (GDBusAnnotationInfo **) &_gsignond_dbus_auth_session_method_cancel_annotation_info_pointers + }, + "handle-cancel", + FALSE +}; + +static const _ExtendedGDBusMethodInfo * const _gsignond_dbus_auth_session_method_info_pointers[] = +{ + &_gsignond_dbus_auth_session_method_info_query_available_mechanisms, + &_gsignond_dbus_auth_session_method_info_process, + &_gsignond_dbus_auth_session_method_info_cancel, + NULL +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_auth_session_signal_info_state_changed_ARG_state = +{ + { + -1, + "state", + "i", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_auth_session_signal_info_state_changed_ARG_message = +{ + { + -1, + "message", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_auth_session_signal_info_state_changed_ARG_pointers[] = +{ + &_gsignond_dbus_auth_session_signal_info_state_changed_ARG_state, + &_gsignond_dbus_auth_session_signal_info_state_changed_ARG_message, + NULL +}; + +static const _ExtendedGDBusSignalInfo _gsignond_dbus_auth_session_signal_info_state_changed = +{ + { + -1, + "stateChanged", + (GDBusArgInfo **) &_gsignond_dbus_auth_session_signal_info_state_changed_ARG_pointers, + NULL + }, + "state-changed" +}; + +static const _ExtendedGDBusSignalInfo _gsignond_dbus_auth_session_signal_info_unregistered = +{ + { + -1, + "unregistered", + NULL, + NULL + }, + "unregistered" +}; + +static const _ExtendedGDBusSignalInfo * const _gsignond_dbus_auth_session_signal_info_pointers[] = +{ + &_gsignond_dbus_auth_session_signal_info_state_changed, + &_gsignond_dbus_auth_session_signal_info_unregistered, + NULL +}; + +static const _ExtendedGDBusInterfaceInfo _gsignond_dbus_auth_session_interface_info = +{ + { + -1, + "com.google.code.AccountsSSO.gSingleSignOn.AuthSession", + (GDBusMethodInfo **) &_gsignond_dbus_auth_session_method_info_pointers, + (GDBusSignalInfo **) &_gsignond_dbus_auth_session_signal_info_pointers, + NULL, + NULL + }, + "auth-session", +}; + + +/** + * gsignond_dbus_auth_session_interface_info: + * + * Gets a machine-readable description of the <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-AuthSession.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.AuthSession</link> D-Bus interface. + * + * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. + */ +GDBusInterfaceInfo * +gsignond_dbus_auth_session_interface_info (void) +{ + return (GDBusInterfaceInfo *) &_gsignond_dbus_auth_session_interface_info; +} + +/** + * gsignond_dbus_auth_session_override_properties: + * @klass: The class structure for a #GObject<!-- -->-derived class. + * @property_id_begin: The property id to assign to the first overridden property. + * + * Overrides all #GObject properties in the #GSignondDbusAuthSession interface for a concrete class. + * The properties are overridden in the order they are defined. + * + * Returns: The last property id. + */ +guint +gsignond_dbus_auth_session_override_properties (GObjectClass *klass, guint property_id_begin) +{ + return property_id_begin - 1; +} + + + +/** + * GSignondDbusAuthSession: + * + * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-AuthSession.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.AuthSession</link>. + */ + +/** + * GSignondDbusAuthSessionIface: + * @parent_iface: The parent interface. + * @handle_cancel: Handler for the #GSignondDbusAuthSession::handle-cancel signal. + * @handle_process: Handler for the #GSignondDbusAuthSession::handle-process signal. + * @handle_query_available_mechanisms: Handler for the #GSignondDbusAuthSession::handle-query-available-mechanisms signal. + * @state_changed: Handler for the #GSignondDbusAuthSession::state-changed signal. + * @unregistered: Handler for the #GSignondDbusAuthSession::unregistered signal. + * + * Virtual table for the D-Bus interface <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-AuthSession.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.AuthSession</link>. + */ + +static void +gsignond_dbus_auth_session_default_init (GSignondDbusAuthSessionIface *iface) +{ + /* GObject signals for incoming D-Bus method calls: */ + /** + * GSignondDbusAuthSession::handle-query-available-mechanisms: + * @object: A #GSignondDbusAuthSession. + * @invocation: A #GDBusMethodInvocation. + * @arg_wantedMechanisms: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthSession.queryAvailableMechanisms">queryAvailableMechanisms()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_auth_session_complete_query_available_mechanisms() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-query-available-mechanisms", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusAuthSessionIface, handle_query_available_mechanisms), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRV); + + /** + * GSignondDbusAuthSession::handle-process: + * @object: A #GSignondDbusAuthSession. + * @invocation: A #GDBusMethodInvocation. + * @arg_sessionDataVa: Argument passed by remote caller. + * @arg_mechanism: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthSession.process">process()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_auth_session_complete_process() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-process", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusAuthSessionIface, handle_process), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_STRING); + + /** + * GSignondDbusAuthSession::handle-cancel: + * @object: A #GSignondDbusAuthSession. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthSession.cancel">cancel()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_auth_session_complete_cancel() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-cancel", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusAuthSessionIface, handle_cancel), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /* GObject signals for received D-Bus signals: */ + /** + * GSignondDbusAuthSession::state-changed: + * @object: A #GSignondDbusAuthSession. + * @arg_state: Argument. + * @arg_message: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-com-google-code-AccountsSSO-gSingleSignOn-AuthSession.stateChanged">"stateChanged"</link> is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("state-changed", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusAuthSessionIface, state_changed), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 2, G_TYPE_INT, G_TYPE_STRING); + + /** + * GSignondDbusAuthSession::unregistered: + * @object: A #GSignondDbusAuthSession. + * + * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-com-google-code-AccountsSSO-gSingleSignOn-AuthSession.unregistered">"unregistered"</link> is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("unregistered", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusAuthSessionIface, unregistered), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 0); + +} + +typedef GSignondDbusAuthSessionIface GSignondDbusAuthSessionInterface; +G_DEFINE_INTERFACE (GSignondDbusAuthSession, gsignond_dbus_auth_session, G_TYPE_OBJECT); + +/** + * gsignond_dbus_auth_session_emit_state_changed: + * @object: A #GSignondDbusAuthSession. + * @arg_state: Argument to pass with the signal. + * @arg_message: Argument to pass with the signal. + * + * Emits the <link linkend="gdbus-signal-com-google-code-AccountsSSO-gSingleSignOn-AuthSession.stateChanged">"stateChanged"</link> D-Bus signal. + */ +void +gsignond_dbus_auth_session_emit_state_changed ( + GSignondDbusAuthSession *object, + gint arg_state, + const gchar *arg_message) +{ + g_signal_emit_by_name (object, "state-changed", arg_state, arg_message); +} + +/** + * gsignond_dbus_auth_session_emit_unregistered: + * @object: A #GSignondDbusAuthSession. + * + * Emits the <link linkend="gdbus-signal-com-google-code-AccountsSSO-gSingleSignOn-AuthSession.unregistered">"unregistered"</link> D-Bus signal. + */ +void +gsignond_dbus_auth_session_emit_unregistered ( + GSignondDbusAuthSession *object) +{ + g_signal_emit_by_name (object, "unregistered"); +} + +/** + * gsignond_dbus_auth_session_call_query_available_mechanisms: + * @proxy: A #GSignondDbusAuthSessionProxy. + * @arg_wantedMechanisms: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthSession.queryAvailableMechanisms">queryAvailableMechanisms()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_auth_session_call_query_available_mechanisms_finish() to get the result of the operation. + * + * See gsignond_dbus_auth_session_call_query_available_mechanisms_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_auth_session_call_query_available_mechanisms ( + GSignondDbusAuthSession *proxy, + const gchar *const *arg_wantedMechanisms, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "queryAvailableMechanisms", + g_variant_new ("(^as)", + arg_wantedMechanisms), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_auth_session_call_query_available_mechanisms_finish: + * @proxy: A #GSignondDbusAuthSessionProxy. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_auth_session_call_query_available_mechanisms(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_auth_session_call_query_available_mechanisms(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_auth_session_call_query_available_mechanisms_finish ( + GSignondDbusAuthSession *proxy, + gchar ***out_unnamed_arg1, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(^as)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_auth_session_call_query_available_mechanisms_sync: + * @proxy: A #GSignondDbusAuthSessionProxy. + * @arg_wantedMechanisms: Argument to pass with the method invocation. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthSession.queryAvailableMechanisms">queryAvailableMechanisms()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_auth_session_call_query_available_mechanisms() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_auth_session_call_query_available_mechanisms_sync ( + GSignondDbusAuthSession *proxy, + const gchar *const *arg_wantedMechanisms, + gchar ***out_unnamed_arg1, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "queryAvailableMechanisms", + g_variant_new ("(^as)", + arg_wantedMechanisms), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(^as)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_auth_session_call_process: + * @proxy: A #GSignondDbusAuthSessionProxy. + * @arg_sessionDataVa: Argument to pass with the method invocation. + * @arg_mechanism: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthSession.process">process()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_auth_session_call_process_finish() to get the result of the operation. + * + * See gsignond_dbus_auth_session_call_process_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_auth_session_call_process ( + GSignondDbusAuthSession *proxy, + GVariant *arg_sessionDataVa, + const gchar *arg_mechanism, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "process", + g_variant_new ("(@a{sv}s)", + arg_sessionDataVa, + arg_mechanism), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_auth_session_call_process_finish: + * @proxy: A #GSignondDbusAuthSessionProxy. + * @out_unnamed_arg2: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_auth_session_call_process(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_auth_session_call_process(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_auth_session_call_process_finish ( + GSignondDbusAuthSession *proxy, + GVariant **out_unnamed_arg2, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@a{sv})", + out_unnamed_arg2); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_auth_session_call_process_sync: + * @proxy: A #GSignondDbusAuthSessionProxy. + * @arg_sessionDataVa: Argument to pass with the method invocation. + * @arg_mechanism: Argument to pass with the method invocation. + * @out_unnamed_arg2: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthSession.process">process()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_auth_session_call_process() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_auth_session_call_process_sync ( + GSignondDbusAuthSession *proxy, + GVariant *arg_sessionDataVa, + const gchar *arg_mechanism, + GVariant **out_unnamed_arg2, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "process", + g_variant_new ("(@a{sv}s)", + arg_sessionDataVa, + arg_mechanism), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@a{sv})", + out_unnamed_arg2); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_auth_session_call_cancel: + * @proxy: A #GSignondDbusAuthSessionProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthSession.cancel">cancel()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_auth_session_call_cancel_finish() to get the result of the operation. + * + * See gsignond_dbus_auth_session_call_cancel_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_auth_session_call_cancel ( + GSignondDbusAuthSession *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "cancel", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_auth_session_call_cancel_finish: + * @proxy: A #GSignondDbusAuthSessionProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_auth_session_call_cancel(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_auth_session_call_cancel(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_auth_session_call_cancel_finish ( + GSignondDbusAuthSession *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_auth_session_call_cancel_sync: + * @proxy: A #GSignondDbusAuthSessionProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthSession.cancel">cancel()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_auth_session_call_cancel() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_auth_session_call_cancel_sync ( + GSignondDbusAuthSession *proxy, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "cancel", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_auth_session_complete_query_available_mechanisms: + * @object: A #GSignondDbusAuthSession. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg1: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthSession.queryAvailableMechanisms">queryAvailableMechanisms()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_auth_session_complete_query_available_mechanisms ( + GSignondDbusAuthSession *object, + GDBusMethodInvocation *invocation, + const gchar *const *unnamed_arg1) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(^as)", + unnamed_arg1)); +} + +/** + * gsignond_dbus_auth_session_complete_process: + * @object: A #GSignondDbusAuthSession. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg2: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthSession.process">process()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_auth_session_complete_process ( + GSignondDbusAuthSession *object, + GDBusMethodInvocation *invocation, + GVariant *unnamed_arg2) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(@a{sv})", + unnamed_arg2)); +} + +/** + * gsignond_dbus_auth_session_complete_cancel: + * @object: A #GSignondDbusAuthSession. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-AuthSession.cancel">cancel()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_auth_session_complete_cancel ( + GSignondDbusAuthSession *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/* ------------------------------------------------------------------------ */ + +/** + * GSignondDbusAuthSessionProxy: + * + * The #GSignondDbusAuthSessionProxy structure contains only private data and should only be accessed using the provided API. + */ + +/** + * GSignondDbusAuthSessionProxyClass: + * @parent_class: The parent class. + * + * Class structure for #GSignondDbusAuthSessionProxy. + */ + +struct _GSignondDbusAuthSessionProxyPrivate +{ + GData *qdata; +}; + +static void gsignond_dbus_auth_session_proxy_iface_init (GSignondDbusAuthSessionIface *iface); + +G_DEFINE_TYPE_WITH_CODE (GSignondDbusAuthSessionProxy, gsignond_dbus_auth_session_proxy, G_TYPE_DBUS_PROXY, + G_IMPLEMENT_INTERFACE (GSIGNOND_DBUS_TYPE_AUTH_SESSION, gsignond_dbus_auth_session_proxy_iface_init)); + +static void +gsignond_dbus_auth_session_proxy_finalize (GObject *object) +{ + GSignondDbusAuthSessionProxy *proxy = GSIGNOND_DBUS_AUTH_SESSION_PROXY (object); + g_datalist_clear (&proxy->priv->qdata); + G_OBJECT_CLASS (gsignond_dbus_auth_session_proxy_parent_class)->finalize (object); +} + +static void +gsignond_dbus_auth_session_proxy_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ +} + +static void +gsignond_dbus_auth_session_proxy_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ +} + +static void +gsignond_dbus_auth_session_proxy_g_signal (GDBusProxy *proxy, + const gchar *sender_name, + const gchar *signal_name, + GVariant *parameters) +{ + _ExtendedGDBusSignalInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint n; + guint signal_id; + info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_gsignond_dbus_auth_session_interface_info, signal_name); + if (info == NULL) + return; + num_params = g_variant_n_children (parameters); + paramv = g_new0 (GValue, num_params + 1); + g_value_init (¶mv[0], GSIGNOND_DBUS_TYPE_AUTH_SESSION); + g_value_set_object (¶mv[0], proxy); + g_variant_iter_init (&iter, parameters); + n = 1; + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, GSIGNOND_DBUS_TYPE_AUTH_SESSION); + g_signal_emitv (paramv, signal_id, 0, NULL); + for (n = 0; n < num_params + 1; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static void +gsignond_dbus_auth_session_proxy_g_properties_changed (GDBusProxy *_proxy, + GVariant *changed_properties, + const gchar *const *invalidated_properties) +{ + GSignondDbusAuthSessionProxy *proxy = GSIGNOND_DBUS_AUTH_SESSION_PROXY (_proxy); + guint n; + const gchar *key; + GVariantIter *iter; + _ExtendedGDBusPropertyInfo *info; + g_variant_get (changed_properties, "a{sv}", &iter); + while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsignond_dbus_auth_session_interface_info, key); + g_datalist_remove_data (&proxy->priv->qdata, key); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } + g_variant_iter_free (iter); + for (n = 0; invalidated_properties[n] != NULL; n++) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsignond_dbus_auth_session_interface_info, invalidated_properties[n]); + g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } +} + +static void +gsignond_dbus_auth_session_proxy_init (GSignondDbusAuthSessionProxy *proxy) +{ + proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GSIGNOND_DBUS_TYPE_AUTH_SESSION_PROXY, GSignondDbusAuthSessionProxyPrivate); + g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), gsignond_dbus_auth_session_interface_info ()); +} + +static void +gsignond_dbus_auth_session_proxy_class_init (GSignondDbusAuthSessionProxyClass *klass) +{ + GObjectClass *gobject_class; + GDBusProxyClass *proxy_class; + + g_type_class_add_private (klass, sizeof (GSignondDbusAuthSessionProxyPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = gsignond_dbus_auth_session_proxy_finalize; + gobject_class->get_property = gsignond_dbus_auth_session_proxy_get_property; + gobject_class->set_property = gsignond_dbus_auth_session_proxy_set_property; + + proxy_class = G_DBUS_PROXY_CLASS (klass); + proxy_class->g_signal = gsignond_dbus_auth_session_proxy_g_signal; + proxy_class->g_properties_changed = gsignond_dbus_auth_session_proxy_g_properties_changed; + +} + +static void +gsignond_dbus_auth_session_proxy_iface_init (GSignondDbusAuthSessionIface *iface) +{ +} + +/** + * gsignond_dbus_auth_session_proxy_new: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-AuthSession.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.AuthSession</link>. See g_dbus_proxy_new() for more details. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_auth_session_proxy_new_finish() to get the result of the operation. + * + * See gsignond_dbus_auth_session_proxy_new_sync() for the synchronous, blocking version of this constructor. + */ +void +gsignond_dbus_auth_session_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (GSIGNOND_DBUS_TYPE_AUTH_SESSION_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.AuthSession", NULL); +} + +/** + * gsignond_dbus_auth_session_proxy_new_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_auth_session_proxy_new(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with gsignond_dbus_auth_session_proxy_new(). + * + * Returns: (transfer full) (type GSignondDbusAuthSessionProxy): The constructed proxy object or %NULL if @error is set. + */ +GSignondDbusAuthSession * +gsignond_dbus_auth_session_proxy_new_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return GSIGNOND_DBUS_AUTH_SESSION (ret); + else + return NULL; +} + +/** + * gsignond_dbus_auth_session_proxy_new_sync: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-AuthSession.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.AuthSession</link>. See g_dbus_proxy_new_sync() for more details. + * + * The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_auth_session_proxy_new() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type GSignondDbusAuthSessionProxy): The constructed proxy object or %NULL if @error is set. + */ +GSignondDbusAuthSession * +gsignond_dbus_auth_session_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (GSIGNOND_DBUS_TYPE_AUTH_SESSION_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.AuthSession", NULL); + if (ret != NULL) + return GSIGNOND_DBUS_AUTH_SESSION (ret); + else + return NULL; +} + + +/** + * gsignond_dbus_auth_session_proxy_new_for_bus: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Like gsignond_dbus_auth_session_proxy_new() but takes a #GBusType instead of a #GDBusConnection. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_auth_session_proxy_new_for_bus_finish() to get the result of the operation. + * + * See gsignond_dbus_auth_session_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. + */ +void +gsignond_dbus_auth_session_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (GSIGNOND_DBUS_TYPE_AUTH_SESSION_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.AuthSession", NULL); +} + +/** + * gsignond_dbus_auth_session_proxy_new_for_bus_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_auth_session_proxy_new_for_bus(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with gsignond_dbus_auth_session_proxy_new_for_bus(). + * + * Returns: (transfer full) (type GSignondDbusAuthSessionProxy): The constructed proxy object or %NULL if @error is set. + */ +GSignondDbusAuthSession * +gsignond_dbus_auth_session_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return GSIGNOND_DBUS_AUTH_SESSION (ret); + else + return NULL; +} + +/** + * gsignond_dbus_auth_session_proxy_new_for_bus_sync: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Like gsignond_dbus_auth_session_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. + * + * The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_auth_session_proxy_new_for_bus() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type GSignondDbusAuthSessionProxy): The constructed proxy object or %NULL if @error is set. + */ +GSignondDbusAuthSession * +gsignond_dbus_auth_session_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (GSIGNOND_DBUS_TYPE_AUTH_SESSION_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.AuthSession", NULL); + if (ret != NULL) + return GSIGNOND_DBUS_AUTH_SESSION (ret); + else + return NULL; +} + + +/* ------------------------------------------------------------------------ */ + +/** + * GSignondDbusAuthSessionSkeleton: + * + * The #GSignondDbusAuthSessionSkeleton structure contains only private data and should only be accessed using the provided API. + */ + +/** + * GSignondDbusAuthSessionSkeletonClass: + * @parent_class: The parent class. + * + * Class structure for #GSignondDbusAuthSessionSkeleton. + */ + +struct _GSignondDbusAuthSessionSkeletonPrivate +{ + GValue *properties; + GList *changed_properties; + GSource *changed_properties_idle_source; + GMainContext *context; + GMutex lock; +}; + +static void +_gsignond_dbus_auth_session_skeleton_handle_method_call ( + GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + GSignondDbusAuthSessionSkeleton *skeleton = GSIGNOND_DBUS_AUTH_SESSION_SKELETON (user_data); + _ExtendedGDBusMethodInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint num_extra; + guint n; + guint signal_id; + GValue return_value = G_VALUE_INIT; + info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); + g_assert (info != NULL); + num_params = g_variant_n_children (parameters); + num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); + n = 0; + g_value_init (¶mv[n], GSIGNOND_DBUS_TYPE_AUTH_SESSION); + g_value_set_object (¶mv[n++], skeleton); + g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); + g_value_set_object (¶mv[n++], invocation); + if (info->pass_fdlist) + { +#ifdef G_OS_UNIX + g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); + g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); +#else + g_assert_not_reached (); +#endif + } + g_variant_iter_init (&iter, parameters); + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, GSIGNOND_DBUS_TYPE_AUTH_SESSION); + g_value_init (&return_value, G_TYPE_BOOLEAN); + g_signal_emitv (paramv, signal_id, 0, &return_value); + if (!g_value_get_boolean (&return_value)) + g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); + g_value_unset (&return_value); + for (n = 0; n < num_params + num_extra; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static GVariant * +_gsignond_dbus_auth_session_skeleton_handle_get_property ( + GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GError **error, + gpointer user_data) +{ + GSignondDbusAuthSessionSkeleton *skeleton = GSIGNOND_DBUS_AUTH_SESSION_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + GVariant *ret; + ret = NULL; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsignond_dbus_auth_session_interface_info, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + g_value_init (&value, pspec->value_type); + g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); + ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); + g_value_unset (&value); + } + return ret; +} + +static gboolean +_gsignond_dbus_auth_session_skeleton_handle_set_property ( + GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GVariant *variant, + GError **error, + gpointer user_data) +{ + GSignondDbusAuthSessionSkeleton *skeleton = GSIGNOND_DBUS_AUTH_SESSION_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + gboolean ret; + ret = FALSE; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsignond_dbus_auth_session_interface_info, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + if (info->use_gvariant) + g_value_set_variant (&value, variant); + else + g_dbus_gvariant_to_gvalue (variant, &value); + g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); + g_value_unset (&value); + ret = TRUE; + } + return ret; +} + +static const GDBusInterfaceVTable _gsignond_dbus_auth_session_skeleton_vtable = +{ + _gsignond_dbus_auth_session_skeleton_handle_method_call, + _gsignond_dbus_auth_session_skeleton_handle_get_property, + _gsignond_dbus_auth_session_skeleton_handle_set_property +}; + +static GDBusInterfaceInfo * +gsignond_dbus_auth_session_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton) +{ + return gsignond_dbus_auth_session_interface_info (); +} + +static GDBusInterfaceVTable * +gsignond_dbus_auth_session_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton) +{ + return (GDBusInterfaceVTable *) &_gsignond_dbus_auth_session_skeleton_vtable; +} + +static GVariant * +gsignond_dbus_auth_session_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) +{ + GSignondDbusAuthSessionSkeleton *skeleton = GSIGNOND_DBUS_AUTH_SESSION_SKELETON (_skeleton); + + GVariantBuilder builder; + guint n; + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + if (_gsignond_dbus_auth_session_interface_info.parent_struct.properties == NULL) + goto out; + for (n = 0; _gsignond_dbus_auth_session_interface_info.parent_struct.properties[n] != NULL; n++) + { + GDBusPropertyInfo *info = _gsignond_dbus_auth_session_interface_info.parent_struct.properties[n]; + if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) + { + GVariant *value; + value = _gsignond_dbus_auth_session_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.google.code.AccountsSSO.gSingleSignOn.AuthSession", info->name, NULL, skeleton); + if (value != NULL) + { + g_variant_take_ref (value); + g_variant_builder_add (&builder, "{sv}", info->name, value); + g_variant_unref (value); + } + } + } +out: + return g_variant_builder_end (&builder); +} + +static void +gsignond_dbus_auth_session_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) +{ +} + +static void +_gsignond_dbus_auth_session_on_signal_state_changed ( + GSignondDbusAuthSession *object, + gint arg_state, + const gchar *arg_message) +{ + GSignondDbusAuthSessionSkeleton *skeleton = GSIGNOND_DBUS_AUTH_SESSION_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("(is)", + arg_state, + arg_message)); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.google.code.AccountsSSO.gSingleSignOn.AuthSession", "stateChanged", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void +_gsignond_dbus_auth_session_on_signal_unregistered ( + GSignondDbusAuthSession *object) +{ + GSignondDbusAuthSessionSkeleton *skeleton = GSIGNOND_DBUS_AUTH_SESSION_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("()")); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.google.code.AccountsSSO.gSingleSignOn.AuthSession", "unregistered", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void gsignond_dbus_auth_session_skeleton_iface_init (GSignondDbusAuthSessionIface *iface); +G_DEFINE_TYPE_WITH_CODE (GSignondDbusAuthSessionSkeleton, gsignond_dbus_auth_session_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_IMPLEMENT_INTERFACE (GSIGNOND_DBUS_TYPE_AUTH_SESSION, gsignond_dbus_auth_session_skeleton_iface_init)); + +static void +gsignond_dbus_auth_session_skeleton_finalize (GObject *object) +{ + GSignondDbusAuthSessionSkeleton *skeleton = GSIGNOND_DBUS_AUTH_SESSION_SKELETON (object); + g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); + if (skeleton->priv->changed_properties_idle_source != NULL) + g_source_destroy (skeleton->priv->changed_properties_idle_source); + g_main_context_unref (skeleton->priv->context); + g_mutex_clear (&skeleton->priv->lock); + G_OBJECT_CLASS (gsignond_dbus_auth_session_skeleton_parent_class)->finalize (object); +} + +static void +gsignond_dbus_auth_session_skeleton_init (GSignondDbusAuthSessionSkeleton *skeleton) +{ + skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GSIGNOND_DBUS_TYPE_AUTH_SESSION_SKELETON, GSignondDbusAuthSessionSkeletonPrivate); + g_mutex_init (&skeleton->priv->lock); + skeleton->priv->context = g_main_context_ref_thread_default (); +} + +static void +gsignond_dbus_auth_session_skeleton_class_init (GSignondDbusAuthSessionSkeletonClass *klass) +{ + GObjectClass *gobject_class; + GDBusInterfaceSkeletonClass *skeleton_class; + + g_type_class_add_private (klass, sizeof (GSignondDbusAuthSessionSkeletonPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = gsignond_dbus_auth_session_skeleton_finalize; + + skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); + skeleton_class->get_info = gsignond_dbus_auth_session_skeleton_dbus_interface_get_info; + skeleton_class->get_properties = gsignond_dbus_auth_session_skeleton_dbus_interface_get_properties; + skeleton_class->flush = gsignond_dbus_auth_session_skeleton_dbus_interface_flush; + skeleton_class->get_vtable = gsignond_dbus_auth_session_skeleton_dbus_interface_get_vtable; +} + +static void +gsignond_dbus_auth_session_skeleton_iface_init (GSignondDbusAuthSessionIface *iface) +{ + iface->state_changed = _gsignond_dbus_auth_session_on_signal_state_changed; + iface->unregistered = _gsignond_dbus_auth_session_on_signal_unregistered; +} + +/** + * gsignond_dbus_auth_session_skeleton_new: + * + * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-AuthSession.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.AuthSession</link>. + * + * Returns: (transfer full) (type GSignondDbusAuthSessionSkeleton): The skeleton object. + */ +GSignondDbusAuthSession * +gsignond_dbus_auth_session_skeleton_new (void) +{ + return GSIGNOND_DBUS_AUTH_SESSION (g_object_new (GSIGNOND_DBUS_TYPE_AUTH_SESSION_SKELETON, NULL)); +} + diff --git a/src/daemon/dbus/gsignond-dbus-auth-session-gen.h b/src/daemon/dbus/gsignond-dbus-auth-session-gen.h new file mode 100644 index 0000000..5059507 --- /dev/null +++ b/src/daemon/dbus/gsignond-dbus-auth-session-gen.h @@ -0,0 +1,250 @@ +/* + * Generated by gdbus-codegen 2.32.3. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifndef __GSIGNOND_DBUS_AUTH_SESSION_GEN_H__ +#define __GSIGNOND_DBUS_AUTH_SESSION_GEN_H__ + +#include <gio/gio.h> + +G_BEGIN_DECLS + + +/* ------------------------------------------------------------------------ */ +/* Declarations for com.google.code.AccountsSSO.gSingleSignOn.AuthSession */ + +#define GSIGNOND_DBUS_TYPE_AUTH_SESSION (gsignond_dbus_auth_session_get_type ()) +#define GSIGNOND_DBUS_AUTH_SESSION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSIGNOND_DBUS_TYPE_AUTH_SESSION, GSignondDbusAuthSession)) +#define GSIGNOND_DBUS_IS_AUTH_SESSION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSIGNOND_DBUS_TYPE_AUTH_SESSION)) +#define GSIGNOND_DBUS_AUTH_SESSION_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GSIGNOND_DBUS_TYPE_AUTH_SESSION, GSignondDbusAuthSessionIface)) + +struct _GSignondDbusAuthSession; +typedef struct _GSignondDbusAuthSession GSignondDbusAuthSession; +typedef struct _GSignondDbusAuthSessionIface GSignondDbusAuthSessionIface; + +struct _GSignondDbusAuthSessionIface +{ + GTypeInterface parent_iface; + + + gboolean (*handle_cancel) ( + GSignondDbusAuthSession *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_process) ( + GSignondDbusAuthSession *object, + GDBusMethodInvocation *invocation, + GVariant *arg_sessionDataVa, + const gchar *arg_mechanism); + + gboolean (*handle_query_available_mechanisms) ( + GSignondDbusAuthSession *object, + GDBusMethodInvocation *invocation, + const gchar *const *arg_wantedMechanisms); + + void (*state_changed) ( + GSignondDbusAuthSession *object, + gint arg_state, + const gchar *arg_message); + + void (*unregistered) ( + GSignondDbusAuthSession *object); + +}; + +GType gsignond_dbus_auth_session_get_type (void) G_GNUC_CONST; + +GDBusInterfaceInfo *gsignond_dbus_auth_session_interface_info (void); +guint gsignond_dbus_auth_session_override_properties (GObjectClass *klass, guint property_id_begin); + + +/* D-Bus method call completion functions: */ +void gsignond_dbus_auth_session_complete_query_available_mechanisms ( + GSignondDbusAuthSession *object, + GDBusMethodInvocation *invocation, + const gchar *const *unnamed_arg1); + +void gsignond_dbus_auth_session_complete_process ( + GSignondDbusAuthSession *object, + GDBusMethodInvocation *invocation, + GVariant *unnamed_arg2); + +void gsignond_dbus_auth_session_complete_cancel ( + GSignondDbusAuthSession *object, + GDBusMethodInvocation *invocation); + + + +/* D-Bus signal emissions functions: */ +void gsignond_dbus_auth_session_emit_state_changed ( + GSignondDbusAuthSession *object, + gint arg_state, + const gchar *arg_message); + +void gsignond_dbus_auth_session_emit_unregistered ( + GSignondDbusAuthSession *object); + + + +/* D-Bus method calls: */ +void gsignond_dbus_auth_session_call_query_available_mechanisms ( + GSignondDbusAuthSession *proxy, + const gchar *const *arg_wantedMechanisms, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_auth_session_call_query_available_mechanisms_finish ( + GSignondDbusAuthSession *proxy, + gchar ***out_unnamed_arg1, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_auth_session_call_query_available_mechanisms_sync ( + GSignondDbusAuthSession *proxy, + const gchar *const *arg_wantedMechanisms, + gchar ***out_unnamed_arg1, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_auth_session_call_process ( + GSignondDbusAuthSession *proxy, + GVariant *arg_sessionDataVa, + const gchar *arg_mechanism, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_auth_session_call_process_finish ( + GSignondDbusAuthSession *proxy, + GVariant **out_unnamed_arg2, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_auth_session_call_process_sync ( + GSignondDbusAuthSession *proxy, + GVariant *arg_sessionDataVa, + const gchar *arg_mechanism, + GVariant **out_unnamed_arg2, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_auth_session_call_cancel ( + GSignondDbusAuthSession *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_auth_session_call_cancel_finish ( + GSignondDbusAuthSession *proxy, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_auth_session_call_cancel_sync ( + GSignondDbusAuthSession *proxy, + GCancellable *cancellable, + GError **error); + + + +/* ---- */ + +#define GSIGNOND_DBUS_TYPE_AUTH_SESSION_PROXY (gsignond_dbus_auth_session_proxy_get_type ()) +#define GSIGNOND_DBUS_AUTH_SESSION_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSIGNOND_DBUS_TYPE_AUTH_SESSION_PROXY, GSignondDbusAuthSessionProxy)) +#define GSIGNOND_DBUS_AUTH_SESSION_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GSIGNOND_DBUS_TYPE_AUTH_SESSION_PROXY, GSignondDbusAuthSessionProxyClass)) +#define GSIGNOND_DBUS_AUTH_SESSION_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSIGNOND_DBUS_TYPE_AUTH_SESSION_PROXY, GSignondDbusAuthSessionProxyClass)) +#define GSIGNOND_DBUS_IS_AUTH_SESSION_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSIGNOND_DBUS_TYPE_AUTH_SESSION_PROXY)) +#define GSIGNOND_DBUS_IS_AUTH_SESSION_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSIGNOND_DBUS_TYPE_AUTH_SESSION_PROXY)) + +typedef struct _GSignondDbusAuthSessionProxy GSignondDbusAuthSessionProxy; +typedef struct _GSignondDbusAuthSessionProxyClass GSignondDbusAuthSessionProxyClass; +typedef struct _GSignondDbusAuthSessionProxyPrivate GSignondDbusAuthSessionProxyPrivate; + +struct _GSignondDbusAuthSessionProxy +{ + /*< private >*/ + GDBusProxy parent_instance; + GSignondDbusAuthSessionProxyPrivate *priv; +}; + +struct _GSignondDbusAuthSessionProxyClass +{ + GDBusProxyClass parent_class; +}; + +GType gsignond_dbus_auth_session_proxy_get_type (void) G_GNUC_CONST; + +void gsignond_dbus_auth_session_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +GSignondDbusAuthSession *gsignond_dbus_auth_session_proxy_new_finish ( + GAsyncResult *res, + GError **error); +GSignondDbusAuthSession *gsignond_dbus_auth_session_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_auth_session_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +GSignondDbusAuthSession *gsignond_dbus_auth_session_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error); +GSignondDbusAuthSession *gsignond_dbus_auth_session_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + + +/* ---- */ + +#define GSIGNOND_DBUS_TYPE_AUTH_SESSION_SKELETON (gsignond_dbus_auth_session_skeleton_get_type ()) +#define GSIGNOND_DBUS_AUTH_SESSION_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSIGNOND_DBUS_TYPE_AUTH_SESSION_SKELETON, GSignondDbusAuthSessionSkeleton)) +#define GSIGNOND_DBUS_AUTH_SESSION_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GSIGNOND_DBUS_TYPE_AUTH_SESSION_SKELETON, GSignondDbusAuthSessionSkeletonClass)) +#define GSIGNOND_DBUS_AUTH_SESSION_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSIGNOND_DBUS_TYPE_AUTH_SESSION_SKELETON, GSignondDbusAuthSessionSkeletonClass)) +#define GSIGNOND_DBUS_IS_AUTH_SESSION_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSIGNOND_DBUS_TYPE_AUTH_SESSION_SKELETON)) +#define GSIGNOND_DBUS_IS_AUTH_SESSION_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSIGNOND_DBUS_TYPE_AUTH_SESSION_SKELETON)) + +typedef struct _GSignondDbusAuthSessionSkeleton GSignondDbusAuthSessionSkeleton; +typedef struct _GSignondDbusAuthSessionSkeletonClass GSignondDbusAuthSessionSkeletonClass; +typedef struct _GSignondDbusAuthSessionSkeletonPrivate GSignondDbusAuthSessionSkeletonPrivate; + +struct _GSignondDbusAuthSessionSkeleton +{ + /*< private >*/ + GDBusInterfaceSkeleton parent_instance; + GSignondDbusAuthSessionSkeletonPrivate *priv; +}; + +struct _GSignondDbusAuthSessionSkeletonClass +{ + GDBusInterfaceSkeletonClass parent_class; +}; + +GType gsignond_dbus_auth_session_skeleton_get_type (void) G_GNUC_CONST; + +GSignondDbusAuthSession *gsignond_dbus_auth_session_skeleton_new (void); + + +G_END_DECLS + +#endif /* __GSIGNOND_DBUS_AUTH_SESSION_GEN_H__ */ diff --git a/src/daemon/dbus/gsignond-dbus-identity-adapter.c b/src/daemon/dbus/gsignond-dbus-identity-adapter.c new file mode 100644 index 0000000..9e236aa --- /dev/null +++ b/src/daemon/dbus/gsignond-dbus-identity-adapter.c @@ -0,0 +1,838 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2012 Intel Corporation. + * + * Contact: Amarnath Valluri <amarnath.valluri@linux.intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#include <config.h> +#include "gsignond/gsignond-log.h" +#include "gsignond-dbus-identity-adapter.h" +#include "gsignond-dbus-auth-session-adapter.h" +#include "gsignond-dbus.h" + +enum +{ + PROP_0, + + PROP_CONNECTION, + PROP_IDENTITY, + PROP_APP_CONTEXT, + N_PROPERTIES +}; + +static GParamSpec *properties[N_PROPERTIES]; + +typedef struct { + GSignondDbusIdentityAdapter *adapter; + GDBusMethodInvocation *invocation; + gpointer user_data; +} _IdentityDbusInfo; + +static _IdentityDbusInfo* +_identity_dbus_info_new (GSignondDbusIdentityAdapter *self, GDBusMethodInvocation *invocation, gpointer userdata) +{ + _IdentityDbusInfo *info = g_new0(_IdentityDbusInfo, 1); + + info->adapter = g_object_ref (self); + info->invocation = g_object_ref (invocation); + info->user_data = userdata; + + return info; +} + +static void +_identity_dbus_info_free (_IdentityDbusInfo *info) +{ + if (!info) return ; + + if (info->adapter) g_object_unref (info->adapter); + if (info->invocation) g_object_unref (info->invocation); + + g_free (info); +} + +struct _GSignondDbusIdentityAdapterPrivate +{ + GDBusConnection *connection; + GSignondDbusIdentity *dbus_identity; + GSignondIdentity *identity; + gchar *app_context; + GSignondSecurityContext *sec_context; + GList *sessions; + /* signal handler ids */ + gulong info_updated_handler_id; + gulong verify_user_handler_id; + gulong verify_secret_handler_id; + gulong credentials_update_handler_id; +}; + +G_DEFINE_TYPE (GSignondDbusIdentityAdapter, gsignond_dbus_identity_adapter, GSIGNOND_TYPE_DISPOSABLE) + +#define GSIGNOND_DBUS_IDENTITY_ADAPTER_GET_PRIV(obj) \ + G_TYPE_INSTANCE_GET_PRIVATE ((obj), GSIGNOND_TYPE_DBUS_IDENTITY_ADAPTER, GSignondDbusIdentityAdapterPrivate) + +#define PREPARE_SECURITY_CONTEXT(dbus_object, invocation) \ +{ \ + GSignondDbusIdentityAdapterPrivate *priv = dbus_object->priv;\ + GSignondAccessControlManager *acm = gsignond_identity_get_acm (priv->identity);\ + if (acm) { \ + const gchar *sender = NULL; \ + int fd = -1; \ + sender = g_dbus_method_invocation_get_sender (invocation);\ + if (!sender) {\ + GDBusConnection *connection = g_dbus_method_invocation_get_connection (invocation);\ + fd = g_socket_get_fd (g_socket_connection_get_socket (G_SOCKET_CONNECTION (g_dbus_connection_get_stream(connection))));\ + }\ + gsignond_access_control_manager_security_context_of_peer( \ + acm, \ + priv->sec_context, \ + fd, \ + sender, \ + priv->app_context); \ + }\ +} + +static gboolean _handle_request_credentials_update (GSignondDbusIdentityAdapter *, GDBusMethodInvocation *, const gchar*, gpointer); +static gboolean _handle_get_info (GSignondDbusIdentityAdapter *, GDBusMethodInvocation *, gpointer); +static gboolean _handle_get_auth_session (GSignondDbusIdentityAdapter *self, GDBusMethodInvocation *invocation, const gchar *method, gpointer user_data); +static gboolean _handle_verify_user (GSignondDbusIdentityAdapter *, GDBusMethodInvocation *, GVariant *, gpointer); +static gboolean _handle_verify_secret (GSignondDbusIdentityAdapter *, GDBusMethodInvocation *, const gchar *, gpointer); +static gboolean _handle_remove (GSignondDbusIdentityAdapter *, GDBusMethodInvocation *, gpointer); +static gboolean _handle_sign_out (GSignondDbusIdentityAdapter *, GDBusMethodInvocation *, gpointer); +static gboolean _handle_store (GSignondDbusIdentityAdapter *, GDBusMethodInvocation *, const GVariant *, gpointer); +static gboolean _handle_add_reference (GSignondDbusIdentityAdapter *, GDBusMethodInvocation *, const gchar *, gpointer); +static gboolean _handle_remove_reference (GSignondDbusIdentityAdapter *, GDBusMethodInvocation *, const gchar *, gpointer); +static void _emit_info_updated (GSignondIdentity *identity, GSignondIdentityChangeType change, gpointer userdata); + +static void +gsignond_dbus_identity_adapter_set_property (GObject *object, + guint property_id, + const GValue *value, GParamSpec *pspec) +{ + GSignondDbusIdentityAdapter *self = GSIGNOND_DBUS_IDENTITY_ADAPTER (object); + + switch (property_id) { + case PROP_CONNECTION: { + self->priv->connection = g_value_get_object (value); + break; + } + case PROP_IDENTITY: { + gpointer identity = g_value_get_object (value); + if (identity) { + if (self->priv->identity) { + if (self->priv->info_updated_handler_id) { + g_signal_handler_disconnect (self->priv->identity, self->priv->info_updated_handler_id); + self->priv->info_updated_handler_id = 0; + } + if (self->priv->verify_user_handler_id) { + g_signal_handler_disconnect (self->priv->identity, self->priv->verify_user_handler_id); + self->priv->verify_user_handler_id = 0; + } + if (self->priv->verify_secret_handler_id) { + g_signal_handler_disconnect (self->priv->identity, self->priv->verify_secret_handler_id); + self->priv->verify_secret_handler_id = 0; + } + if (self->priv->credentials_update_handler_id) { + g_signal_handler_disconnect (self->priv->identity, self->priv->credentials_update_handler_id); + self->priv->credentials_update_handler_id = 0; + } + g_object_unref (self->priv->identity); + self->priv->identity = NULL; + } + self->priv->identity = GSIGNOND_IDENTITY(identity); + self->priv->info_updated_handler_id = g_signal_connect ( + self->priv->identity, "info-updated", G_CALLBACK (_emit_info_updated), self); + } + break; + } + case PROP_APP_CONTEXT: { + if (self->priv->app_context) g_free (self->priv->app_context); + self->priv->app_context = g_strdup (g_value_get_string (value)); + break; + } + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } +} + +static void +gsignond_dbus_identity_adapter_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + GSignondDbusIdentityAdapter *self = GSIGNOND_DBUS_IDENTITY_ADAPTER (object); + + switch (property_id) { + case PROP_IDENTITY:{ + g_value_set_object (value, self->priv->identity); + break; + } + case PROP_CONNECTION: { + g_value_set_object (value, self->priv->connection); + break; + } + case PROP_APP_CONTEXT:{ + g_value_set_string (value, self->priv->app_context); + break; + } + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } +} + +static void +_destroy_session (gpointer data, gpointer user_data) +{ + (void)user_data; + if (data) g_object_unref (G_OBJECT(data)); +} + +static void +gsignond_dbus_identity_adapter_dispose (GObject *object) +{ + GSignondDbusIdentityAdapter *self = GSIGNOND_DBUS_IDENTITY_ADAPTER (object); + + if (self->priv->identity) { + if (self->priv->info_updated_handler_id) { + g_signal_handler_disconnect (self->priv->identity, self->priv->info_updated_handler_id); + self->priv->info_updated_handler_id = 0; + } + if (self->priv->verify_user_handler_id) { + g_signal_handler_disconnect (self->priv->identity, self->priv->verify_user_handler_id); + self->priv->verify_user_handler_id = 0; + } + if (self->priv->verify_secret_handler_id) { + g_signal_handler_disconnect (self->priv->identity, self->priv->verify_secret_handler_id); + self->priv->verify_secret_handler_id = 0; + } + + if (self->priv->credentials_update_handler_id) { + g_signal_handler_disconnect (self->priv->identity, self->priv->credentials_update_handler_id); + self->priv->credentials_update_handler_id = 0; + } + + g_object_unref (self->priv->identity); + self->priv->identity = NULL; + } + + if (self->priv->sessions) { + g_list_foreach (self->priv->sessions, _destroy_session, NULL); + } + + if (self->priv->dbus_identity) { + GDBusInterfaceSkeleton *iface = G_DBUS_INTERFACE_SKELETON(self->priv->dbus_identity); + gsignond_dbus_identity_emit_unregistered (self->priv->dbus_identity); + DBG("(-)'%s' object unexported", g_dbus_interface_skeleton_get_object_path (iface)); + g_dbus_interface_skeleton_unexport (iface); + g_object_unref (self->priv->dbus_identity); + self->priv->dbus_identity = NULL; + } + + if (self->priv->connection) { + g_object_unref (self->priv->connection); + self->priv->connection = NULL; + } + + G_OBJECT_CLASS (gsignond_dbus_identity_adapter_parent_class)->dispose (object); +} + +static void +gsignond_dbus_identity_adapter_finalize (GObject *object) +{ + GSignondDbusIdentityAdapter *self = GSIGNOND_DBUS_IDENTITY_ADAPTER (object); + + if (self->priv->sec_context) { + gsignond_security_context_free (self->priv->sec_context); + self->priv->sec_context = NULL; + } + + if (self->priv->sessions) { + g_list_free (self->priv->sessions); + self->priv->sessions = NULL; + } + + if (self->priv->app_context) { + g_free (self->priv->app_context); + self->priv->app_context = NULL; + } + + G_OBJECT_CLASS (gsignond_dbus_identity_adapter_parent_class)->finalize (object); +} + +static void +gsignond_dbus_identity_adapter_class_init (GSignondDbusIdentityAdapterClass *klass) +{ + GObjectClass* object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (GSignondDbusIdentityAdapterPrivate)); + + object_class->get_property = gsignond_dbus_identity_adapter_get_property; + object_class->set_property = gsignond_dbus_identity_adapter_set_property; + object_class->dispose = gsignond_dbus_identity_adapter_dispose; + object_class->finalize = gsignond_dbus_identity_adapter_finalize; + + properties[PROP_IDENTITY] = g_param_spec_object ("identity", + "Core identity object", + "Core Identity Object", + GSIGNOND_TYPE_IDENTITY, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS); + properties[PROP_CONNECTION] = g_param_spec_object ("connection", + "bus connection used", + "Bus connection", + G_TYPE_DBUS_CONNECTION, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS); + properties[PROP_APP_CONTEXT] = g_param_spec_string ( + "app-context", + "application security context", + "Application security context of the identity object creater", + NULL, + G_PARAM_READWRITE |G_PARAM_STATIC_STRINGS); + + g_object_class_install_properties (object_class, N_PROPERTIES, properties); +} + +static void +gsignond_dbus_identity_adapter_init (GSignondDbusIdentityAdapter *self) +{ + self->priv = GSIGNOND_DBUS_IDENTITY_ADAPTER_GET_PRIV(self); + + self->priv->connection = 0; + self->priv->identity = 0; + self->priv->app_context = 0; + self->priv->dbus_identity = gsignond_dbus_identity_skeleton_new(); + self->priv->sec_context = gsignond_security_context_new (); + + g_signal_connect_swapped (self->priv->dbus_identity, + "handle-request-credentials-update", G_CALLBACK (_handle_request_credentials_update), self); + g_signal_connect_swapped (self->priv->dbus_identity, + "handle-get-info", G_CALLBACK(_handle_get_info), self); + g_signal_connect_swapped (self->priv->dbus_identity, + "handle-get-auth-session", G_CALLBACK(_handle_get_auth_session), self); + g_signal_connect_swapped (self->priv->dbus_identity, + "handle-verify-user", G_CALLBACK(_handle_verify_user), self); + g_signal_connect_swapped (self->priv->dbus_identity, + "handle-verify-secret", G_CALLBACK(_handle_verify_secret), self); + g_signal_connect_swapped (self->priv->dbus_identity, + "handle-remove", G_CALLBACK(_handle_remove), self); + g_signal_connect_swapped (self->priv->dbus_identity, + "handle-sign-out", G_CALLBACK(_handle_sign_out), self); + g_signal_connect_swapped (self->priv->dbus_identity, + "handle-store", G_CALLBACK(_handle_store), self); + g_signal_connect_swapped (self->priv->dbus_identity, + "handle-add-reference", G_CALLBACK(_handle_add_reference), self); + g_signal_connect_swapped (self->priv->dbus_identity, + "handle-remove-reference", G_CALLBACK(_handle_remove_reference), self); +} + +static void +_on_credentials_updated (_IdentityDbusInfo *info, guint32 updated_id, GError *error, gpointer userdata) +{ + g_assert (info); + + GSignondDbusIdentityAdapter *self = info->adapter; + GDBusMethodInvocation *invocation = info->invocation; + + g_signal_handler_disconnect (userdata, self->priv->credentials_update_handler_id); + self->priv->credentials_update_handler_id = 0; + if (error) { + g_dbus_method_invocation_return_gerror (invocation, error); + g_error_free (error); + } + else + { + gsignond_dbus_identity_complete_request_credentials_update ( + self->priv->dbus_identity, invocation, updated_id); + } + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), TRUE); + + _identity_dbus_info_free (info); +} + +static gboolean +_handle_request_credentials_update (GSignondDbusIdentityAdapter *self, + GDBusMethodInvocation *invocation, + const gchar *message, + gpointer user_data) +{ + GError *error = NULL; + + g_return_val_if_fail (self && GSIGNOND_IS_DBUS_IDENTITY_ADAPTER (self), FALSE); + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), FALSE); + + PREPARE_SECURITY_CONTEXT (self, invocation); + + gsignond_identity_request_credentials_update (self->priv->identity, message, self->priv->sec_context, &error); + if (error) { + g_dbus_method_invocation_return_gerror (invocation, error); + g_error_free (error); + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), TRUE); + } + else { + self->priv->credentials_update_handler_id = g_signal_connect_swapped (self->priv->identity, + "credentials-updated", G_CALLBACK (_on_credentials_updated), self); + } + + return TRUE; +} + +static gboolean +_handle_get_info (GSignondDbusIdentityAdapter *self, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + GVariant *identity_data = 0; + GError *error = NULL; + + g_return_val_if_fail (self && GSIGNOND_IS_DBUS_IDENTITY_ADAPTER (self), FALSE); + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), FALSE); + + PREPARE_SECURITY_CONTEXT (self, invocation); + + identity_data = gsignond_identity_get_info (self->priv->identity, + self->priv->sec_context, &error); + + if (identity_data) { + gsignond_dbus_identity_complete_get_info ( + self->priv->dbus_identity, invocation, identity_data); + } + else { + g_dbus_method_invocation_return_gerror (invocation, error); + g_error_free (error); + } + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), TRUE); + + return TRUE; +} + +static void +_on_session_disposed (gpointer data, GObject *session) +{ + GSignondDbusIdentityAdapter *self = GSIGNOND_DBUS_IDENTITY_ADAPTER (data); + + if (!self) return; + + self->priv->sessions = g_list_remove (self->priv->sessions, session); + + if (g_list_length (self->priv->sessions) == 0){ + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE(self), TRUE); + } +} + +static gboolean +_handle_get_auth_session (GSignondDbusIdentityAdapter *self, + GDBusMethodInvocation *invocation, + const gchar *method, + gpointer user_data) +{ + GSignondAuthSession *session = NULL; + GError *error = NULL; + + g_return_val_if_fail (self && GSIGNOND_IS_DBUS_IDENTITY_ADAPTER (self), FALSE); + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), FALSE); + + PREPARE_SECURITY_CONTEXT (self, invocation); + + session = gsignond_identity_get_auth_session (self->priv->identity, method, self->priv->sec_context, &error); + + if (session) { + guint timeout =gsignond_identity_get_auth_session_timeout (self->priv->identity); + GSignondDbusAuthSessionAdapter *dbus_session = gsignond_dbus_auth_session_adapter_new_with_connection ( + g_object_ref (self->priv->connection), session, self->priv->app_context, timeout); + + if (g_list_length (self->priv->sessions) == 0) + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), FALSE); + + self->priv->sessions = g_list_append (self->priv->sessions, dbus_session); + + g_object_weak_ref (G_OBJECT (dbus_session), _on_session_disposed, self); + + gsignond_dbus_identity_complete_get_auth_session ( + self->priv->dbus_identity, invocation, + gsignond_dbus_auth_session_adapter_get_object_path (dbus_session)); + } + else { + g_dbus_method_invocation_return_gerror (invocation, error); + g_error_free (error); + } + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE(self), TRUE); + + return TRUE; +} + +static void +_on_user_verfied (_IdentityDbusInfo *info, gboolean res, const GError *error, gpointer user_data) +{ + if (!info) { + WARN ("assertion G_UNLIKELY (info) failed"); + return ; + } + + GSignondDbusIdentityAdapter *self = info->adapter; + GDBusMethodInvocation *invocation = info->invocation; + + g_signal_handler_disconnect (user_data, self->priv->verify_user_handler_id); + self->priv->verify_user_handler_id = 0; + + if (error) { + g_dbus_method_invocation_return_gerror (invocation, error); + } + else { + gsignond_dbus_identity_complete_verify_user ( + self->priv->dbus_identity, invocation, res); + } + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), TRUE); + + _identity_dbus_info_free (info); +} + +static gboolean +_handle_verify_user (GSignondDbusIdentityAdapter *self, + GDBusMethodInvocation *invocation, + GVariant *params, + gpointer user_data) +{ + GError *error = NULL; + + g_return_val_if_fail (self && GSIGNOND_IS_DBUS_IDENTITY_ADAPTER (self), FALSE); + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), FALSE); + + PREPARE_SECURITY_CONTEXT (self, invocation); + + gsignond_identity_verify_user (self->priv->identity, params, self->priv->sec_context, &error); + + if (error) { + g_dbus_method_invocation_return_gerror (invocation, error); + g_error_free (error); + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), TRUE); + } + else { + _IdentityDbusInfo *info = _identity_dbus_info_new (self, invocation, NULL); + + /* FIXME: Do we allow multiple calls at a given point of time */ + self->priv->verify_user_handler_id = g_signal_connect_swapped (self->priv->identity, + "user-verified", G_CALLBACK (_on_user_verfied), (gpointer)info); + } + + return TRUE; +} + +static void +_on_secret_verfied (_IdentityDbusInfo *info, gboolean res, const GError *error, gpointer user_data) +{ + g_assert (info); + + GSignondDbusIdentityAdapter *self = info->adapter; + GDBusMethodInvocation *invocation = info->invocation; + + g_signal_handler_disconnect (user_data, self->priv->verify_secret_handler_id); + self->priv->verify_secret_handler_id = 0; + + if (error) { + g_dbus_method_invocation_return_gerror (info->invocation, error); + } + else { + gsignond_dbus_identity_complete_verify_secret ( + self->priv->dbus_identity, invocation, res); + } + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE(self), TRUE); + + _identity_dbus_info_free (info); +} + +static gboolean +_handle_verify_secret (GSignondDbusIdentityAdapter *self, + GDBusMethodInvocation *invocation, + const gchar *secret, + gpointer user_data) +{ + GError *error = NULL; + + g_return_val_if_fail (self && GSIGNOND_IS_DBUS_IDENTITY_ADAPTER (self), FALSE); + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), FALSE); + + PREPARE_SECURITY_CONTEXT (self, invocation); + + gsignond_identity_verify_secret (self->priv->identity, secret, self->priv->sec_context, &error); + + if (error) { + g_dbus_method_invocation_return_gerror (invocation, error); + g_error_free (error); + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), TRUE); + } + else { + _IdentityDbusInfo *info = _identity_dbus_info_new (self, invocation, NULL); + + self->priv->verify_secret_handler_id = g_signal_connect_swapped (self->priv->identity, + "secret-verified", G_CALLBACK (_on_secret_verfied), (gpointer)info); + } + + return TRUE; +} + +static gboolean +_handle_remove (GSignondDbusIdentityAdapter *self, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + GError *error = NULL; + + g_return_val_if_fail (self && GSIGNOND_IS_DBUS_IDENTITY_ADAPTER (self), FALSE); + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), FALSE); + + PREPARE_SECURITY_CONTEXT (self, invocation); + + if (!gsignond_identity_remove (self->priv->identity, self->priv->sec_context, &error)) { + g_dbus_method_invocation_return_gerror (invocation, error); + g_error_free (error); + } + else { + gsignond_dbus_identity_complete_remove (self->priv->dbus_identity, invocation); + } + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), TRUE); + + return TRUE; +} + +static gboolean +_handle_sign_out (GSignondDbusIdentityAdapter *self, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + GError *error = NULL; + gboolean res; + + g_return_val_if_fail (self && GSIGNOND_IS_DBUS_IDENTITY_ADAPTER (self), FALSE); + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), FALSE); + + PREPARE_SECURITY_CONTEXT (self, invocation); + + res = gsignond_identity_sign_out (self->priv->identity, self->priv->sec_context, &error); + + if (!error) { + gsignond_dbus_identity_complete_sign_out (self->priv->dbus_identity, invocation, res); + } + else { + g_dbus_method_invocation_return_gerror (invocation, error); + g_error_free (error); + } + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), TRUE); + + return TRUE; +} + +static gboolean +_handle_store (GSignondDbusIdentityAdapter *self, + GDBusMethodInvocation *invocation, + const GVariant *info, + gpointer user_data) +{ + guint id = 0; + GError *error = NULL; + + g_return_val_if_fail (self && GSIGNOND_IS_DBUS_IDENTITY_ADAPTER (self), FALSE); + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), FALSE); + + PREPARE_SECURITY_CONTEXT (self, invocation); + + id = gsignond_identity_store (self->priv->identity, info, self->priv->sec_context, &error); + + if (id) { + gsignond_dbus_identity_complete_store (self->priv->dbus_identity, invocation, id); + } else { + g_dbus_method_invocation_return_gerror (invocation, error); + g_error_free (error); + } + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), TRUE); + + return TRUE; +} + +static gboolean +_handle_add_reference (GSignondDbusIdentityAdapter *self, + GDBusMethodInvocation *invocation, + const gchar *reference, + gpointer user_data) +{ + guint32 id = 0; + GError *error = NULL; + + g_return_val_if_fail (self && GSIGNOND_IS_DBUS_IDENTITY_ADAPTER (self), FALSE); + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), FALSE); + + PREPARE_SECURITY_CONTEXT (self, invocation); + + id = gsignond_identity_add_reference (self->priv->identity, reference, self->priv->sec_context, &error); + + if (id) { + gsignond_dbus_identity_complete_add_reference (self->priv->dbus_identity, invocation, id); + } + else { + g_dbus_method_invocation_return_gerror (invocation, error); + g_error_free (error); + } + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), TRUE); + + return TRUE; +} + +static gboolean +_handle_remove_reference (GSignondDbusIdentityAdapter *self, + GDBusMethodInvocation *invocation, + const gchar *reference, + gpointer user_data) +{ + guint32 id = 0; + GError *error = NULL; + + g_return_val_if_fail (self && GSIGNOND_IS_DBUS_IDENTITY_ADAPTER (self), FALSE); + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), FALSE); + + PREPARE_SECURITY_CONTEXT (self, invocation); + + id = gsignond_identity_remove_reference (self->priv->identity, reference, self->priv->sec_context, &error); + + if (id) { + gsignond_dbus_identity_complete_remove_reference (self->priv->dbus_identity, invocation, id); + } else { + g_dbus_method_invocation_return_gerror (invocation, error); + g_error_free (error); + } + + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (self), TRUE); + + return TRUE; +} + +static void +_emit_info_updated (GSignondIdentity *identity, + GSignondIdentityChangeType change, + gpointer userdata) +{ + GSignondDbusIdentityAdapter *self = GSIGNOND_DBUS_IDENTITY_ADAPTER (userdata); + + gsignond_dbus_identity_emit_info_updated (self->priv->dbus_identity, change); + + if (change == GSIGNOND_IDENTITY_REMOVED) + gsignond_disposable_delete_later (GSIGNOND_DISPOSABLE (self)); + else if (change == GSIGNOND_IDENTITY_SIGNED_OUT && self->priv->sessions) { + /* destroy all sessions on this identity as it's signed out */ + g_list_foreach (self->priv->sessions, _destroy_session, NULL); + g_list_free (self->priv->sessions); + self->priv->sessions = NULL; + } +} + +const gchar * +gsignond_dbus_identity_adapter_get_object_path(GSignondDbusIdentityAdapter *self) +{ + g_return_val_if_fail (self && GSIGNOND_IS_DBUS_IDENTITY_ADAPTER (self), NULL); + + return g_dbus_interface_skeleton_get_object_path ( + G_DBUS_INTERFACE_SKELETON (self->priv->dbus_identity)); +} + +GSignondDbusIdentityAdapter * +gsignond_dbus_identity_adapter_new_with_connection (GDBusConnection *connection, + GSignondIdentity *identity, + const gchar *app_context, + guint timeout) +{ + static guint32 object_counter; + gchar *object_path = NULL; + GError *err = NULL; + GSignondDbusIdentityAdapter *adapter = GSIGNOND_DBUS_IDENTITY_ADAPTER ( + g_object_new (GSIGNOND_TYPE_DBUS_IDENTITY_ADAPTER, + "identity", identity, "connection", connection, "app-context", app_context, NULL)); + + if (!adapter) return NULL; + + object_path = g_strdup_printf ("%s/Identity_%d", GSIGNOND_DAEMON_OBJECTPATH, object_counter++); + if (!g_dbus_interface_skeleton_export ( + G_DBUS_INTERFACE_SKELETON (adapter->priv->dbus_identity), + adapter->priv->connection, object_path, &err)) { + ERR ("failed to register object: %s", err->message); + g_error_free (err); + g_free (object_path); + g_object_unref (adapter); + + return NULL; + } + DBG("(+)'%s' object exported(%p)", object_path, adapter); + g_free (object_path); + + gsignond_disposable_set_timeout (GSIGNOND_DISPOSABLE (adapter), timeout); + + return adapter; +} + +#ifndef USE_P2P +/** + * gsignond_dbus_identity_adapter_new: + * @impl: Instance of #GSignondDbusIdentityAdapter + * + * Creates new instance of #GSignondDbusIdentityAdapter + * + * Retrurns: (transfer full) new instance of #GSignondDbusIdentityAdapter + */ +GSignondDbusIdentityAdapter * +gsignond_dbus_identity_adapter_new (GSignondIdentity *identity, const gchar *app_context, guint timeout) +{ + GError *error = NULL; + GDBusConnection *connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error); + + if (error) { + ERR("failed to connect to session bus : %s", error->message); + g_error_free (error); + return NULL; + } + + return gsignond_dbus_identity_adapter_new_with_connection (connection, identity, app_context, timeout); +} + +#endif +#undef PREPARE_SECURITY_CONTEXT diff --git a/src/daemon/dbus/gsignond-dbus-identity-adapter.h b/src/daemon/dbus/gsignond-dbus-identity-adapter.h new file mode 100644 index 0000000..d900c21 --- /dev/null +++ b/src/daemon/dbus/gsignond-dbus-identity-adapter.h @@ -0,0 +1,81 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2012 Intel Corporation. + * + * Contact: Amarnath Valluri <amarnath.valluri@linux.intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#ifndef __GSIGNOND_IDENTITY_ADAPTER_H_ +#define __GSIGNOND_IDENTITY_ADAPTER_H_ + +#include <config.h> +#include <glib.h> +#include <daemon/gsignond-identity.h> +#include "common/gsignond-disposable.h" +#include "gsignond-dbus-identity-gen.h" + +G_BEGIN_DECLS + +#define GSIGNOND_TYPE_DBUS_IDENTITY_ADAPTER (gsignond_dbus_identity_adapter_get_type()) +#define GSIGNOND_DBUS_IDENTITY_ADAPTER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GSIGNOND_TYPE_DBUS_IDENTITY_ADAPTER, GSignondDbusIdentityAdapter)) +#define GSIGNOND_DBUS_IDENTITY_ADAPTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GSIGNOND_TYPE_DBUS_IDENTITY_ADAPTER, GSignondDbusIdentityAdapterClass)) +#define GSIGNOND_IS_DBUS_IDENTITY_ADAPTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GSIGNOND_TYPE_DBUS_IDENTITY_ADAPTER)) +#define GSIGNOND_IS_DBUS_IDENTITY_ADAPTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GSIGNOND_TYPE_DBUS_IDENTITY_ADAPTER)) +#define GSIGNOND_DBUS_IDENTITY_ADAPTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GSIGNOND_TYPE_DBUS_IDENTITY_ADAPTER, GSignondDbusIdentityAdapterClass)) + +typedef struct _GSignondDbusIdentityAdapter GSignondDbusIdentityAdapter; +typedef struct _GSignondDbusIdentityAdapterClass GSignondDbusIdentityAdapterClass; +typedef struct _GSignondDbusIdentityAdapterPrivate GSignondDbusIdentityAdapterPrivate; + +struct _GSignondDbusIdentityAdapter +{ + GSignondDisposable parent; + + /* priv */ + GSignondDbusIdentityAdapterPrivate *priv; +}; + +struct _GSignondDbusIdentityAdapterClass +{ + GSignondDisposableClass parent_class; +}; + +GType gsignond_dbus_identity_adapter_get_type (void) G_GNUC_CONST; + +GSignondDbusIdentityAdapter * +gsignond_dbus_identity_adapter_new_with_connection (GDBusConnection *connection, + GSignondIdentity *identity, + const gchar *app_context, + guint timeout); + +#ifndef USE_P2P +GSignondDbusIdentityAdapter * +gsignond_dbus_identity_adapter_new (GSignondIdentity *identity, + const gchar *app_context, + guint timeout); +#endif + +const gchar* +gsignond_dbus_identity_adapter_get_object_path (GSignondDbusIdentityAdapter *self) G_GNUC_CONST; + +G_END_DECLS + +#endif /* __GSIGNOND_IDENTITY_ADAPTER_H_ */ diff --git a/src/daemon/dbus/gsignond-dbus-identity-gen.c b/src/daemon/dbus/gsignond-dbus-identity-gen.c new file mode 100644 index 0000000..2f8b74b --- /dev/null +++ b/src/daemon/dbus/gsignond-dbus-identity-gen.c @@ -0,0 +1,2866 @@ +/* + * Generated by gdbus-codegen 2.32.3. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "gsignond-dbus-identity-gen.h" + +#ifdef G_OS_UNIX +# include <gio/gunixfdlist.h> +#endif + +typedef struct +{ + GDBusArgInfo parent_struct; + gboolean use_gvariant; +} _ExtendedGDBusArgInfo; + +typedef struct +{ + GDBusMethodInfo parent_struct; + const gchar *signal_name; + gboolean pass_fdlist; +} _ExtendedGDBusMethodInfo; + +typedef struct +{ + GDBusSignalInfo parent_struct; + const gchar *signal_name; +} _ExtendedGDBusSignalInfo; + +typedef struct +{ + GDBusPropertyInfo parent_struct; + const gchar *hyphen_name; + gboolean use_gvariant; +} _ExtendedGDBusPropertyInfo; + +typedef struct +{ + GDBusInterfaceInfo parent_struct; + const gchar *hyphen_name; +} _ExtendedGDBusInterfaceInfo; + +typedef struct +{ + const _ExtendedGDBusPropertyInfo *info; + guint prop_id; + GValue orig_value; /* the value before the change */ +} ChangedProperty; + +static void +_changed_property_free (ChangedProperty *data) +{ + g_value_unset (&data->orig_value); + g_free (data); +} + +static gboolean +_g_strv_equal0 (gchar **a, gchar **b) +{ + gboolean ret = FALSE; + guint n; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + if (g_strv_length (a) != g_strv_length (b)) + goto out; + for (n = 0; a[n] != NULL; n++) + if (g_strcmp0 (a[n], b[n]) != 0) + goto out; + ret = TRUE; +out: + return ret; +} + +static gboolean +_g_variant_equal0 (GVariant *a, GVariant *b) +{ + gboolean ret = FALSE; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + ret = g_variant_equal (a, b); +out: + return ret; +} + +G_GNUC_UNUSED static gboolean +_g_value_equal (const GValue *a, const GValue *b) +{ + gboolean ret = FALSE; + g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b)); + switch (G_VALUE_TYPE (a)) + { + case G_TYPE_BOOLEAN: + ret = (g_value_get_boolean (a) == g_value_get_boolean (b)); + break; + case G_TYPE_UCHAR: + ret = (g_value_get_uchar (a) == g_value_get_uchar (b)); + break; + case G_TYPE_INT: + ret = (g_value_get_int (a) == g_value_get_int (b)); + break; + case G_TYPE_UINT: + ret = (g_value_get_uint (a) == g_value_get_uint (b)); + break; + case G_TYPE_INT64: + ret = (g_value_get_int64 (a) == g_value_get_int64 (b)); + break; + case G_TYPE_UINT64: + ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b)); + break; + case G_TYPE_DOUBLE: + ret = (g_value_get_double (a) == g_value_get_double (b)); + break; + case G_TYPE_STRING: + ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0); + break; + case G_TYPE_VARIANT: + ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b)); + break; + default: + if (G_VALUE_TYPE (a) == G_TYPE_STRV) + ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b)); + else + g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a))); + break; + } + return ret; +} + +/* ------------------------------------------------------------------------ + * Code for interface com.google.code.AccountsSSO.gSingleSignOn.Identity + * ------------------------------------------------------------------------ + */ + +/** + * SECTION:GSignondDbusIdentity + * @title: GSignondDbusIdentity + * @short_description: Generated C code for the com.google.code.AccountsSSO.gSingleSignOn.Identity D-Bus interface + * + * This section contains code for working with the <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-Identity.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.Identity</link> D-Bus interface in C. + */ + +/* ---- Introspection data for com.google.code.AccountsSSO.gSingleSignOn.Identity ---- */ + +static const _ExtendedGDBusArgInfo _gsignond_dbus_identity_method_info_request_credentials_update_IN_ARG_message = +{ + { + -1, + "message", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_identity_method_info_request_credentials_update_IN_ARG_pointers[] = +{ + &_gsignond_dbus_identity_method_info_request_credentials_update_IN_ARG_message, + NULL +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_identity_method_info_request_credentials_update_OUT_ARG_unnamed_arg1 = +{ + { + -1, + "unnamed_arg1", + "u", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_identity_method_info_request_credentials_update_OUT_ARG_pointers[] = +{ + &_gsignond_dbus_identity_method_info_request_credentials_update_OUT_ARG_unnamed_arg1, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_identity_method_info_request_credentials_update = +{ + { + -1, + "requestCredentialsUpdate", + (GDBusArgInfo **) &_gsignond_dbus_identity_method_info_request_credentials_update_IN_ARG_pointers, + (GDBusArgInfo **) &_gsignond_dbus_identity_method_info_request_credentials_update_OUT_ARG_pointers, + NULL + }, + "handle-request-credentials-update", + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_identity_method_info_get_info_OUT_ARG_identityInfo = +{ + { + -1, + "identityInfo", + "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_identity_method_info_get_info_OUT_ARG_pointers[] = +{ + &_gsignond_dbus_identity_method_info_get_info_OUT_ARG_identityInfo, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_identity_method_info_get_info = +{ + { + -1, + "getInfo", + NULL, + (GDBusArgInfo **) &_gsignond_dbus_identity_method_info_get_info_OUT_ARG_pointers, + NULL + }, + "handle-get-info", + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_identity_method_info_get_auth_session_IN_ARG_method = +{ + { + -1, + "method", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_identity_method_info_get_auth_session_IN_ARG_pointers[] = +{ + &_gsignond_dbus_identity_method_info_get_auth_session_IN_ARG_method, + NULL +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_identity_method_info_get_auth_session_OUT_ARG_objectPath = +{ + { + -1, + "objectPath", + "o", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_identity_method_info_get_auth_session_OUT_ARG_pointers[] = +{ + &_gsignond_dbus_identity_method_info_get_auth_session_OUT_ARG_objectPath, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_identity_method_info_get_auth_session = +{ + { + -1, + "getAuthSession", + (GDBusArgInfo **) &_gsignond_dbus_identity_method_info_get_auth_session_IN_ARG_pointers, + (GDBusArgInfo **) &_gsignond_dbus_identity_method_info_get_auth_session_OUT_ARG_pointers, + NULL + }, + "handle-get-auth-session", + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_identity_method_info_verify_user_IN_ARG_params = +{ + { + -1, + "params", + "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_identity_method_info_verify_user_IN_ARG_pointers[] = +{ + &_gsignond_dbus_identity_method_info_verify_user_IN_ARG_params, + NULL +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_identity_method_info_verify_user_OUT_ARG_unnamed_arg1 = +{ + { + -1, + "unnamed_arg1", + "b", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_identity_method_info_verify_user_OUT_ARG_pointers[] = +{ + &_gsignond_dbus_identity_method_info_verify_user_OUT_ARG_unnamed_arg1, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_identity_method_info_verify_user = +{ + { + -1, + "verifyUser", + (GDBusArgInfo **) &_gsignond_dbus_identity_method_info_verify_user_IN_ARG_pointers, + (GDBusArgInfo **) &_gsignond_dbus_identity_method_info_verify_user_OUT_ARG_pointers, + NULL + }, + "handle-verify-user", + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_identity_method_info_verify_secret_IN_ARG_secret = +{ + { + -1, + "secret", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_identity_method_info_verify_secret_IN_ARG_pointers[] = +{ + &_gsignond_dbus_identity_method_info_verify_secret_IN_ARG_secret, + NULL +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_identity_method_info_verify_secret_OUT_ARG_unnamed_arg1 = +{ + { + -1, + "unnamed_arg1", + "b", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_identity_method_info_verify_secret_OUT_ARG_pointers[] = +{ + &_gsignond_dbus_identity_method_info_verify_secret_OUT_ARG_unnamed_arg1, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_identity_method_info_verify_secret = +{ + { + -1, + "verifySecret", + (GDBusArgInfo **) &_gsignond_dbus_identity_method_info_verify_secret_IN_ARG_pointers, + (GDBusArgInfo **) &_gsignond_dbus_identity_method_info_verify_secret_OUT_ARG_pointers, + NULL + }, + "handle-verify-secret", + FALSE +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_identity_method_info_remove = +{ + { + -1, + "remove", + NULL, + NULL, + NULL + }, + "handle-remove", + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_identity_method_info_sign_out_OUT_ARG_unnamed_arg0 = +{ + { + -1, + "unnamed_arg0", + "b", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_identity_method_info_sign_out_OUT_ARG_pointers[] = +{ + &_gsignond_dbus_identity_method_info_sign_out_OUT_ARG_unnamed_arg0, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_identity_method_info_sign_out = +{ + { + -1, + "signOut", + NULL, + (GDBusArgInfo **) &_gsignond_dbus_identity_method_info_sign_out_OUT_ARG_pointers, + NULL + }, + "handle-sign-out", + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_identity_method_info_store_IN_ARG_unnamed_arg0 = +{ + { + -1, + "unnamed_arg0", + "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_identity_method_info_store_IN_ARG_pointers[] = +{ + &_gsignond_dbus_identity_method_info_store_IN_ARG_unnamed_arg0, + NULL +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_identity_method_info_store_OUT_ARG_unnamed_arg1 = +{ + { + -1, + "unnamed_arg1", + "u", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_identity_method_info_store_OUT_ARG_pointers[] = +{ + &_gsignond_dbus_identity_method_info_store_OUT_ARG_unnamed_arg1, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_identity_method_info_store = +{ + { + -1, + "store", + (GDBusArgInfo **) &_gsignond_dbus_identity_method_info_store_IN_ARG_pointers, + (GDBusArgInfo **) &_gsignond_dbus_identity_method_info_store_OUT_ARG_pointers, + NULL + }, + "handle-store", + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_identity_method_info_add_reference_IN_ARG_reference = +{ + { + -1, + "reference", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_identity_method_info_add_reference_IN_ARG_pointers[] = +{ + &_gsignond_dbus_identity_method_info_add_reference_IN_ARG_reference, + NULL +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_identity_method_info_add_reference_OUT_ARG_unnamed_arg1 = +{ + { + -1, + "unnamed_arg1", + "i", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_identity_method_info_add_reference_OUT_ARG_pointers[] = +{ + &_gsignond_dbus_identity_method_info_add_reference_OUT_ARG_unnamed_arg1, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_identity_method_info_add_reference = +{ + { + -1, + "addReference", + (GDBusArgInfo **) &_gsignond_dbus_identity_method_info_add_reference_IN_ARG_pointers, + (GDBusArgInfo **) &_gsignond_dbus_identity_method_info_add_reference_OUT_ARG_pointers, + NULL + }, + "handle-add-reference", + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_identity_method_info_remove_reference_IN_ARG_reference = +{ + { + -1, + "reference", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_identity_method_info_remove_reference_IN_ARG_pointers[] = +{ + &_gsignond_dbus_identity_method_info_remove_reference_IN_ARG_reference, + NULL +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_identity_method_info_remove_reference_OUT_ARG_unnamed_arg1 = +{ + { + -1, + "unnamed_arg1", + "i", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_identity_method_info_remove_reference_OUT_ARG_pointers[] = +{ + &_gsignond_dbus_identity_method_info_remove_reference_OUT_ARG_unnamed_arg1, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_identity_method_info_remove_reference = +{ + { + -1, + "removeReference", + (GDBusArgInfo **) &_gsignond_dbus_identity_method_info_remove_reference_IN_ARG_pointers, + (GDBusArgInfo **) &_gsignond_dbus_identity_method_info_remove_reference_OUT_ARG_pointers, + NULL + }, + "handle-remove-reference", + FALSE +}; + +static const _ExtendedGDBusMethodInfo * const _gsignond_dbus_identity_method_info_pointers[] = +{ + &_gsignond_dbus_identity_method_info_request_credentials_update, + &_gsignond_dbus_identity_method_info_get_info, + &_gsignond_dbus_identity_method_info_get_auth_session, + &_gsignond_dbus_identity_method_info_verify_user, + &_gsignond_dbus_identity_method_info_verify_secret, + &_gsignond_dbus_identity_method_info_remove, + &_gsignond_dbus_identity_method_info_sign_out, + &_gsignond_dbus_identity_method_info_store, + &_gsignond_dbus_identity_method_info_add_reference, + &_gsignond_dbus_identity_method_info_remove_reference, + NULL +}; + +static const _ExtendedGDBusSignalInfo _gsignond_dbus_identity_signal_info_unregistered = +{ + { + -1, + "unregistered", + NULL, + NULL + }, + "unregistered" +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_identity_signal_info_info_updated_ARG_unnamed_arg0 = +{ + { + -1, + "unnamed_arg0", + "i", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_identity_signal_info_info_updated_ARG_pointers[] = +{ + &_gsignond_dbus_identity_signal_info_info_updated_ARG_unnamed_arg0, + NULL +}; + +static const _ExtendedGDBusSignalInfo _gsignond_dbus_identity_signal_info_info_updated = +{ + { + -1, + "infoUpdated", + (GDBusArgInfo **) &_gsignond_dbus_identity_signal_info_info_updated_ARG_pointers, + NULL + }, + "info-updated" +}; + +static const _ExtendedGDBusSignalInfo * const _gsignond_dbus_identity_signal_info_pointers[] = +{ + &_gsignond_dbus_identity_signal_info_unregistered, + &_gsignond_dbus_identity_signal_info_info_updated, + NULL +}; + +static const _ExtendedGDBusInterfaceInfo _gsignond_dbus_identity_interface_info = +{ + { + -1, + "com.google.code.AccountsSSO.gSingleSignOn.Identity", + (GDBusMethodInfo **) &_gsignond_dbus_identity_method_info_pointers, + (GDBusSignalInfo **) &_gsignond_dbus_identity_signal_info_pointers, + NULL, + NULL + }, + "identity", +}; + + +/** + * gsignond_dbus_identity_interface_info: + * + * Gets a machine-readable description of the <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-Identity.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.Identity</link> D-Bus interface. + * + * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. + */ +GDBusInterfaceInfo * +gsignond_dbus_identity_interface_info (void) +{ + return (GDBusInterfaceInfo *) &_gsignond_dbus_identity_interface_info; +} + +/** + * gsignond_dbus_identity_override_properties: + * @klass: The class structure for a #GObject<!-- -->-derived class. + * @property_id_begin: The property id to assign to the first overridden property. + * + * Overrides all #GObject properties in the #GSignondDbusIdentity interface for a concrete class. + * The properties are overridden in the order they are defined. + * + * Returns: The last property id. + */ +guint +gsignond_dbus_identity_override_properties (GObjectClass *klass, guint property_id_begin) +{ + return property_id_begin - 1; +} + + + +/** + * GSignondDbusIdentity: + * + * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-Identity.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.Identity</link>. + */ + +/** + * GSignondDbusIdentityIface: + * @parent_iface: The parent interface. + * @handle_add_reference: Handler for the #GSignondDbusIdentity::handle-add-reference signal. + * @handle_get_auth_session: Handler for the #GSignondDbusIdentity::handle-get-auth-session signal. + * @handle_get_info: Handler for the #GSignondDbusIdentity::handle-get-info signal. + * @handle_remove: Handler for the #GSignondDbusIdentity::handle-remove signal. + * @handle_remove_reference: Handler for the #GSignondDbusIdentity::handle-remove-reference signal. + * @handle_request_credentials_update: Handler for the #GSignondDbusIdentity::handle-request-credentials-update signal. + * @handle_sign_out: Handler for the #GSignondDbusIdentity::handle-sign-out signal. + * @handle_store: Handler for the #GSignondDbusIdentity::handle-store signal. + * @handle_verify_secret: Handler for the #GSignondDbusIdentity::handle-verify-secret signal. + * @handle_verify_user: Handler for the #GSignondDbusIdentity::handle-verify-user signal. + * @info_updated: Handler for the #GSignondDbusIdentity::info-updated signal. + * @unregistered: Handler for the #GSignondDbusIdentity::unregistered signal. + * + * Virtual table for the D-Bus interface <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-Identity.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.Identity</link>. + */ + +static void +gsignond_dbus_identity_default_init (GSignondDbusIdentityIface *iface) +{ + /* GObject signals for incoming D-Bus method calls: */ + /** + * GSignondDbusIdentity::handle-request-credentials-update: + * @object: A #GSignondDbusIdentity. + * @invocation: A #GDBusMethodInvocation. + * @arg_message: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.requestCredentialsUpdate">requestCredentialsUpdate()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_identity_complete_request_credentials_update() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-request-credentials-update", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusIdentityIface, handle_request_credentials_update), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); + + /** + * GSignondDbusIdentity::handle-get-info: + * @object: A #GSignondDbusIdentity. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.getInfo">getInfo()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_identity_complete_get_info() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-get-info", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusIdentityIface, handle_get_info), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * GSignondDbusIdentity::handle-get-auth-session: + * @object: A #GSignondDbusIdentity. + * @invocation: A #GDBusMethodInvocation. + * @arg_method: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.getAuthSession">getAuthSession()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_identity_complete_get_auth_session() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-get-auth-session", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusIdentityIface, handle_get_auth_session), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); + + /** + * GSignondDbusIdentity::handle-verify-user: + * @object: A #GSignondDbusIdentity. + * @invocation: A #GDBusMethodInvocation. + * @arg_params: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.verifyUser">verifyUser()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_identity_complete_verify_user() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-verify-user", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusIdentityIface, handle_verify_user), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT); + + /** + * GSignondDbusIdentity::handle-verify-secret: + * @object: A #GSignondDbusIdentity. + * @invocation: A #GDBusMethodInvocation. + * @arg_secret: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.verifySecret">verifySecret()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_identity_complete_verify_secret() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-verify-secret", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusIdentityIface, handle_verify_secret), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); + + /** + * GSignondDbusIdentity::handle-remove: + * @object: A #GSignondDbusIdentity. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.remove">remove()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_identity_complete_remove() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-remove", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusIdentityIface, handle_remove), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * GSignondDbusIdentity::handle-sign-out: + * @object: A #GSignondDbusIdentity. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.signOut">signOut()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_identity_complete_sign_out() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-sign-out", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusIdentityIface, handle_sign_out), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * GSignondDbusIdentity::handle-store: + * @object: A #GSignondDbusIdentity. + * @invocation: A #GDBusMethodInvocation. + * @arg_unnamed_arg0: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.store">store()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_identity_complete_store() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-store", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusIdentityIface, handle_store), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT); + + /** + * GSignondDbusIdentity::handle-add-reference: + * @object: A #GSignondDbusIdentity. + * @invocation: A #GDBusMethodInvocation. + * @arg_reference: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.addReference">addReference()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_identity_complete_add_reference() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-add-reference", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusIdentityIface, handle_add_reference), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); + + /** + * GSignondDbusIdentity::handle-remove-reference: + * @object: A #GSignondDbusIdentity. + * @invocation: A #GDBusMethodInvocation. + * @arg_reference: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.removeReference">removeReference()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_identity_complete_remove_reference() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-remove-reference", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusIdentityIface, handle_remove_reference), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); + + /* GObject signals for received D-Bus signals: */ + /** + * GSignondDbusIdentity::unregistered: + * @object: A #GSignondDbusIdentity. + * + * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-com-google-code-AccountsSSO-gSingleSignOn-Identity.unregistered">"unregistered"</link> is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("unregistered", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusIdentityIface, unregistered), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 0); + + /** + * GSignondDbusIdentity::info-updated: + * @object: A #GSignondDbusIdentity. + * @arg_unnamed_arg0: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-com-google-code-AccountsSSO-gSingleSignOn-Identity.infoUpdated">"infoUpdated"</link> is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("info-updated", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusIdentityIface, info_updated), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 1, G_TYPE_INT); + +} + +typedef GSignondDbusIdentityIface GSignondDbusIdentityInterface; +G_DEFINE_INTERFACE (GSignondDbusIdentity, gsignond_dbus_identity, G_TYPE_OBJECT); + +/** + * gsignond_dbus_identity_emit_unregistered: + * @object: A #GSignondDbusIdentity. + * + * Emits the <link linkend="gdbus-signal-com-google-code-AccountsSSO-gSingleSignOn-Identity.unregistered">"unregistered"</link> D-Bus signal. + */ +void +gsignond_dbus_identity_emit_unregistered ( + GSignondDbusIdentity *object) +{ + g_signal_emit_by_name (object, "unregistered"); +} + +/** + * gsignond_dbus_identity_emit_info_updated: + * @object: A #GSignondDbusIdentity. + * @arg_unnamed_arg0: Argument to pass with the signal. + * + * Emits the <link linkend="gdbus-signal-com-google-code-AccountsSSO-gSingleSignOn-Identity.infoUpdated">"infoUpdated"</link> D-Bus signal. + */ +void +gsignond_dbus_identity_emit_info_updated ( + GSignondDbusIdentity *object, + gint arg_unnamed_arg0) +{ + g_signal_emit_by_name (object, "info-updated", arg_unnamed_arg0); +} + +/** + * gsignond_dbus_identity_call_request_credentials_update: + * @proxy: A #GSignondDbusIdentityProxy. + * @arg_message: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.requestCredentialsUpdate">requestCredentialsUpdate()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_identity_call_request_credentials_update_finish() to get the result of the operation. + * + * See gsignond_dbus_identity_call_request_credentials_update_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_identity_call_request_credentials_update ( + GSignondDbusIdentity *proxy, + const gchar *arg_message, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "requestCredentialsUpdate", + g_variant_new ("(s)", + arg_message), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_identity_call_request_credentials_update_finish: + * @proxy: A #GSignondDbusIdentityProxy. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_identity_call_request_credentials_update(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_identity_call_request_credentials_update(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_identity_call_request_credentials_update_finish ( + GSignondDbusIdentity *proxy, + guint *out_unnamed_arg1, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(u)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_identity_call_request_credentials_update_sync: + * @proxy: A #GSignondDbusIdentityProxy. + * @arg_message: Argument to pass with the method invocation. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.requestCredentialsUpdate">requestCredentialsUpdate()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_identity_call_request_credentials_update() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_identity_call_request_credentials_update_sync ( + GSignondDbusIdentity *proxy, + const gchar *arg_message, + guint *out_unnamed_arg1, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "requestCredentialsUpdate", + g_variant_new ("(s)", + arg_message), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(u)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_identity_call_get_info: + * @proxy: A #GSignondDbusIdentityProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.getInfo">getInfo()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_identity_call_get_info_finish() to get the result of the operation. + * + * See gsignond_dbus_identity_call_get_info_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_identity_call_get_info ( + GSignondDbusIdentity *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "getInfo", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_identity_call_get_info_finish: + * @proxy: A #GSignondDbusIdentityProxy. + * @out_identityInfo: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_identity_call_get_info(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_identity_call_get_info(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_identity_call_get_info_finish ( + GSignondDbusIdentity *proxy, + GVariant **out_identityInfo, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@a{sv})", + out_identityInfo); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_identity_call_get_info_sync: + * @proxy: A #GSignondDbusIdentityProxy. + * @out_identityInfo: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.getInfo">getInfo()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_identity_call_get_info() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_identity_call_get_info_sync ( + GSignondDbusIdentity *proxy, + GVariant **out_identityInfo, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "getInfo", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@a{sv})", + out_identityInfo); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_identity_call_get_auth_session: + * @proxy: A #GSignondDbusIdentityProxy. + * @arg_method: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.getAuthSession">getAuthSession()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_identity_call_get_auth_session_finish() to get the result of the operation. + * + * See gsignond_dbus_identity_call_get_auth_session_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_identity_call_get_auth_session ( + GSignondDbusIdentity *proxy, + const gchar *arg_method, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "getAuthSession", + g_variant_new ("(s)", + arg_method), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_identity_call_get_auth_session_finish: + * @proxy: A #GSignondDbusIdentityProxy. + * @out_objectPath: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_identity_call_get_auth_session(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_identity_call_get_auth_session(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_identity_call_get_auth_session_finish ( + GSignondDbusIdentity *proxy, + gchar **out_objectPath, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(o)", + out_objectPath); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_identity_call_get_auth_session_sync: + * @proxy: A #GSignondDbusIdentityProxy. + * @arg_method: Argument to pass with the method invocation. + * @out_objectPath: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.getAuthSession">getAuthSession()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_identity_call_get_auth_session() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_identity_call_get_auth_session_sync ( + GSignondDbusIdentity *proxy, + const gchar *arg_method, + gchar **out_objectPath, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "getAuthSession", + g_variant_new ("(s)", + arg_method), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(o)", + out_objectPath); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_identity_call_verify_user: + * @proxy: A #GSignondDbusIdentityProxy. + * @arg_params: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.verifyUser">verifyUser()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_identity_call_verify_user_finish() to get the result of the operation. + * + * See gsignond_dbus_identity_call_verify_user_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_identity_call_verify_user ( + GSignondDbusIdentity *proxy, + GVariant *arg_params, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "verifyUser", + g_variant_new ("(@a{sv})", + arg_params), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_identity_call_verify_user_finish: + * @proxy: A #GSignondDbusIdentityProxy. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_identity_call_verify_user(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_identity_call_verify_user(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_identity_call_verify_user_finish ( + GSignondDbusIdentity *proxy, + gboolean *out_unnamed_arg1, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(b)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_identity_call_verify_user_sync: + * @proxy: A #GSignondDbusIdentityProxy. + * @arg_params: Argument to pass with the method invocation. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.verifyUser">verifyUser()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_identity_call_verify_user() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_identity_call_verify_user_sync ( + GSignondDbusIdentity *proxy, + GVariant *arg_params, + gboolean *out_unnamed_arg1, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "verifyUser", + g_variant_new ("(@a{sv})", + arg_params), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(b)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_identity_call_verify_secret: + * @proxy: A #GSignondDbusIdentityProxy. + * @arg_secret: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.verifySecret">verifySecret()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_identity_call_verify_secret_finish() to get the result of the operation. + * + * See gsignond_dbus_identity_call_verify_secret_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_identity_call_verify_secret ( + GSignondDbusIdentity *proxy, + const gchar *arg_secret, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "verifySecret", + g_variant_new ("(s)", + arg_secret), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_identity_call_verify_secret_finish: + * @proxy: A #GSignondDbusIdentityProxy. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_identity_call_verify_secret(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_identity_call_verify_secret(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_identity_call_verify_secret_finish ( + GSignondDbusIdentity *proxy, + gboolean *out_unnamed_arg1, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(b)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_identity_call_verify_secret_sync: + * @proxy: A #GSignondDbusIdentityProxy. + * @arg_secret: Argument to pass with the method invocation. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.verifySecret">verifySecret()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_identity_call_verify_secret() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_identity_call_verify_secret_sync ( + GSignondDbusIdentity *proxy, + const gchar *arg_secret, + gboolean *out_unnamed_arg1, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "verifySecret", + g_variant_new ("(s)", + arg_secret), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(b)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_identity_call_remove: + * @proxy: A #GSignondDbusIdentityProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.remove">remove()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_identity_call_remove_finish() to get the result of the operation. + * + * See gsignond_dbus_identity_call_remove_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_identity_call_remove ( + GSignondDbusIdentity *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "remove", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_identity_call_remove_finish: + * @proxy: A #GSignondDbusIdentityProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_identity_call_remove(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_identity_call_remove(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_identity_call_remove_finish ( + GSignondDbusIdentity *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_identity_call_remove_sync: + * @proxy: A #GSignondDbusIdentityProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.remove">remove()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_identity_call_remove() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_identity_call_remove_sync ( + GSignondDbusIdentity *proxy, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "remove", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_identity_call_sign_out: + * @proxy: A #GSignondDbusIdentityProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.signOut">signOut()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_identity_call_sign_out_finish() to get the result of the operation. + * + * See gsignond_dbus_identity_call_sign_out_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_identity_call_sign_out ( + GSignondDbusIdentity *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "signOut", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_identity_call_sign_out_finish: + * @proxy: A #GSignondDbusIdentityProxy. + * @out_unnamed_arg0: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_identity_call_sign_out(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_identity_call_sign_out(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_identity_call_sign_out_finish ( + GSignondDbusIdentity *proxy, + gboolean *out_unnamed_arg0, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(b)", + out_unnamed_arg0); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_identity_call_sign_out_sync: + * @proxy: A #GSignondDbusIdentityProxy. + * @out_unnamed_arg0: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.signOut">signOut()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_identity_call_sign_out() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_identity_call_sign_out_sync ( + GSignondDbusIdentity *proxy, + gboolean *out_unnamed_arg0, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "signOut", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(b)", + out_unnamed_arg0); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_identity_call_store: + * @proxy: A #GSignondDbusIdentityProxy. + * @arg_unnamed_arg0: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.store">store()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_identity_call_store_finish() to get the result of the operation. + * + * See gsignond_dbus_identity_call_store_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_identity_call_store ( + GSignondDbusIdentity *proxy, + GVariant *arg_unnamed_arg0, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "store", + g_variant_new ("(@a{sv})", + arg_unnamed_arg0), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_identity_call_store_finish: + * @proxy: A #GSignondDbusIdentityProxy. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_identity_call_store(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_identity_call_store(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_identity_call_store_finish ( + GSignondDbusIdentity *proxy, + guint *out_unnamed_arg1, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(u)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_identity_call_store_sync: + * @proxy: A #GSignondDbusIdentityProxy. + * @arg_unnamed_arg0: Argument to pass with the method invocation. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.store">store()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_identity_call_store() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_identity_call_store_sync ( + GSignondDbusIdentity *proxy, + GVariant *arg_unnamed_arg0, + guint *out_unnamed_arg1, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "store", + g_variant_new ("(@a{sv})", + arg_unnamed_arg0), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(u)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_identity_call_add_reference: + * @proxy: A #GSignondDbusIdentityProxy. + * @arg_reference: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.addReference">addReference()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_identity_call_add_reference_finish() to get the result of the operation. + * + * See gsignond_dbus_identity_call_add_reference_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_identity_call_add_reference ( + GSignondDbusIdentity *proxy, + const gchar *arg_reference, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "addReference", + g_variant_new ("(s)", + arg_reference), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_identity_call_add_reference_finish: + * @proxy: A #GSignondDbusIdentityProxy. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_identity_call_add_reference(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_identity_call_add_reference(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_identity_call_add_reference_finish ( + GSignondDbusIdentity *proxy, + gint *out_unnamed_arg1, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(i)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_identity_call_add_reference_sync: + * @proxy: A #GSignondDbusIdentityProxy. + * @arg_reference: Argument to pass with the method invocation. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.addReference">addReference()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_identity_call_add_reference() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_identity_call_add_reference_sync ( + GSignondDbusIdentity *proxy, + const gchar *arg_reference, + gint *out_unnamed_arg1, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "addReference", + g_variant_new ("(s)", + arg_reference), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(i)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_identity_call_remove_reference: + * @proxy: A #GSignondDbusIdentityProxy. + * @arg_reference: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.removeReference">removeReference()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_identity_call_remove_reference_finish() to get the result of the operation. + * + * See gsignond_dbus_identity_call_remove_reference_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_identity_call_remove_reference ( + GSignondDbusIdentity *proxy, + const gchar *arg_reference, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "removeReference", + g_variant_new ("(s)", + arg_reference), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_identity_call_remove_reference_finish: + * @proxy: A #GSignondDbusIdentityProxy. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_identity_call_remove_reference(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_identity_call_remove_reference(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_identity_call_remove_reference_finish ( + GSignondDbusIdentity *proxy, + gint *out_unnamed_arg1, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(i)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_identity_call_remove_reference_sync: + * @proxy: A #GSignondDbusIdentityProxy. + * @arg_reference: Argument to pass with the method invocation. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.removeReference">removeReference()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_identity_call_remove_reference() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_identity_call_remove_reference_sync ( + GSignondDbusIdentity *proxy, + const gchar *arg_reference, + gint *out_unnamed_arg1, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "removeReference", + g_variant_new ("(s)", + arg_reference), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(i)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_identity_complete_request_credentials_update: + * @object: A #GSignondDbusIdentity. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg1: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.requestCredentialsUpdate">requestCredentialsUpdate()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_identity_complete_request_credentials_update ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation, + guint unnamed_arg1) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(u)", + unnamed_arg1)); +} + +/** + * gsignond_dbus_identity_complete_get_info: + * @object: A #GSignondDbusIdentity. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @identityInfo: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.getInfo">getInfo()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_identity_complete_get_info ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation, + GVariant *identityInfo) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(@a{sv})", + identityInfo)); +} + +/** + * gsignond_dbus_identity_complete_get_auth_session: + * @object: A #GSignondDbusIdentity. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @objectPath: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.getAuthSession">getAuthSession()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_identity_complete_get_auth_session ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation, + const gchar *objectPath) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(o)", + objectPath)); +} + +/** + * gsignond_dbus_identity_complete_verify_user: + * @object: A #GSignondDbusIdentity. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg1: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.verifyUser">verifyUser()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_identity_complete_verify_user ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation, + gboolean unnamed_arg1) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(b)", + unnamed_arg1)); +} + +/** + * gsignond_dbus_identity_complete_verify_secret: + * @object: A #GSignondDbusIdentity. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg1: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.verifySecret">verifySecret()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_identity_complete_verify_secret ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation, + gboolean unnamed_arg1) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(b)", + unnamed_arg1)); +} + +/** + * gsignond_dbus_identity_complete_remove: + * @object: A #GSignondDbusIdentity. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.remove">remove()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_identity_complete_remove ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * gsignond_dbus_identity_complete_sign_out: + * @object: A #GSignondDbusIdentity. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg0: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.signOut">signOut()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_identity_complete_sign_out ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation, + gboolean unnamed_arg0) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(b)", + unnamed_arg0)); +} + +/** + * gsignond_dbus_identity_complete_store: + * @object: A #GSignondDbusIdentity. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg1: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.store">store()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_identity_complete_store ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation, + guint unnamed_arg1) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(u)", + unnamed_arg1)); +} + +/** + * gsignond_dbus_identity_complete_add_reference: + * @object: A #GSignondDbusIdentity. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg1: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.addReference">addReference()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_identity_complete_add_reference ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation, + gint unnamed_arg1) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(i)", + unnamed_arg1)); +} + +/** + * gsignond_dbus_identity_complete_remove_reference: + * @object: A #GSignondDbusIdentity. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg1: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-Identity.removeReference">removeReference()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_identity_complete_remove_reference ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation, + gint unnamed_arg1) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(i)", + unnamed_arg1)); +} + +/* ------------------------------------------------------------------------ */ + +/** + * GSignondDbusIdentityProxy: + * + * The #GSignondDbusIdentityProxy structure contains only private data and should only be accessed using the provided API. + */ + +/** + * GSignondDbusIdentityProxyClass: + * @parent_class: The parent class. + * + * Class structure for #GSignondDbusIdentityProxy. + */ + +struct _GSignondDbusIdentityProxyPrivate +{ + GData *qdata; +}; + +static void gsignond_dbus_identity_proxy_iface_init (GSignondDbusIdentityIface *iface); + +G_DEFINE_TYPE_WITH_CODE (GSignondDbusIdentityProxy, gsignond_dbus_identity_proxy, G_TYPE_DBUS_PROXY, + G_IMPLEMENT_INTERFACE (GSIGNOND_DBUS_TYPE_IDENTITY, gsignond_dbus_identity_proxy_iface_init)); + +static void +gsignond_dbus_identity_proxy_finalize (GObject *object) +{ + GSignondDbusIdentityProxy *proxy = GSIGNOND_DBUS_IDENTITY_PROXY (object); + g_datalist_clear (&proxy->priv->qdata); + G_OBJECT_CLASS (gsignond_dbus_identity_proxy_parent_class)->finalize (object); +} + +static void +gsignond_dbus_identity_proxy_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ +} + +static void +gsignond_dbus_identity_proxy_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ +} + +static void +gsignond_dbus_identity_proxy_g_signal (GDBusProxy *proxy, + const gchar *sender_name, + const gchar *signal_name, + GVariant *parameters) +{ + _ExtendedGDBusSignalInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint n; + guint signal_id; + info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_gsignond_dbus_identity_interface_info, signal_name); + if (info == NULL) + return; + num_params = g_variant_n_children (parameters); + paramv = g_new0 (GValue, num_params + 1); + g_value_init (¶mv[0], GSIGNOND_DBUS_TYPE_IDENTITY); + g_value_set_object (¶mv[0], proxy); + g_variant_iter_init (&iter, parameters); + n = 1; + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, GSIGNOND_DBUS_TYPE_IDENTITY); + g_signal_emitv (paramv, signal_id, 0, NULL); + for (n = 0; n < num_params + 1; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static void +gsignond_dbus_identity_proxy_g_properties_changed (GDBusProxy *_proxy, + GVariant *changed_properties, + const gchar *const *invalidated_properties) +{ + GSignondDbusIdentityProxy *proxy = GSIGNOND_DBUS_IDENTITY_PROXY (_proxy); + guint n; + const gchar *key; + GVariantIter *iter; + _ExtendedGDBusPropertyInfo *info; + g_variant_get (changed_properties, "a{sv}", &iter); + while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsignond_dbus_identity_interface_info, key); + g_datalist_remove_data (&proxy->priv->qdata, key); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } + g_variant_iter_free (iter); + for (n = 0; invalidated_properties[n] != NULL; n++) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsignond_dbus_identity_interface_info, invalidated_properties[n]); + g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } +} + +static void +gsignond_dbus_identity_proxy_init (GSignondDbusIdentityProxy *proxy) +{ + proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GSIGNOND_DBUS_TYPE_IDENTITY_PROXY, GSignondDbusIdentityProxyPrivate); + g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), gsignond_dbus_identity_interface_info ()); +} + +static void +gsignond_dbus_identity_proxy_class_init (GSignondDbusIdentityProxyClass *klass) +{ + GObjectClass *gobject_class; + GDBusProxyClass *proxy_class; + + g_type_class_add_private (klass, sizeof (GSignondDbusIdentityProxyPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = gsignond_dbus_identity_proxy_finalize; + gobject_class->get_property = gsignond_dbus_identity_proxy_get_property; + gobject_class->set_property = gsignond_dbus_identity_proxy_set_property; + + proxy_class = G_DBUS_PROXY_CLASS (klass); + proxy_class->g_signal = gsignond_dbus_identity_proxy_g_signal; + proxy_class->g_properties_changed = gsignond_dbus_identity_proxy_g_properties_changed; + +} + +static void +gsignond_dbus_identity_proxy_iface_init (GSignondDbusIdentityIface *iface) +{ +} + +/** + * gsignond_dbus_identity_proxy_new: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-Identity.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.Identity</link>. See g_dbus_proxy_new() for more details. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_identity_proxy_new_finish() to get the result of the operation. + * + * See gsignond_dbus_identity_proxy_new_sync() for the synchronous, blocking version of this constructor. + */ +void +gsignond_dbus_identity_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (GSIGNOND_DBUS_TYPE_IDENTITY_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.Identity", NULL); +} + +/** + * gsignond_dbus_identity_proxy_new_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_identity_proxy_new(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with gsignond_dbus_identity_proxy_new(). + * + * Returns: (transfer full) (type GSignondDbusIdentityProxy): The constructed proxy object or %NULL if @error is set. + */ +GSignondDbusIdentity * +gsignond_dbus_identity_proxy_new_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return GSIGNOND_DBUS_IDENTITY (ret); + else + return NULL; +} + +/** + * gsignond_dbus_identity_proxy_new_sync: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-Identity.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.Identity</link>. See g_dbus_proxy_new_sync() for more details. + * + * The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_identity_proxy_new() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type GSignondDbusIdentityProxy): The constructed proxy object or %NULL if @error is set. + */ +GSignondDbusIdentity * +gsignond_dbus_identity_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (GSIGNOND_DBUS_TYPE_IDENTITY_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.Identity", NULL); + if (ret != NULL) + return GSIGNOND_DBUS_IDENTITY (ret); + else + return NULL; +} + + +/** + * gsignond_dbus_identity_proxy_new_for_bus: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Like gsignond_dbus_identity_proxy_new() but takes a #GBusType instead of a #GDBusConnection. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_identity_proxy_new_for_bus_finish() to get the result of the operation. + * + * See gsignond_dbus_identity_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. + */ +void +gsignond_dbus_identity_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (GSIGNOND_DBUS_TYPE_IDENTITY_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.Identity", NULL); +} + +/** + * gsignond_dbus_identity_proxy_new_for_bus_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_identity_proxy_new_for_bus(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with gsignond_dbus_identity_proxy_new_for_bus(). + * + * Returns: (transfer full) (type GSignondDbusIdentityProxy): The constructed proxy object or %NULL if @error is set. + */ +GSignondDbusIdentity * +gsignond_dbus_identity_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return GSIGNOND_DBUS_IDENTITY (ret); + else + return NULL; +} + +/** + * gsignond_dbus_identity_proxy_new_for_bus_sync: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Like gsignond_dbus_identity_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. + * + * The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_identity_proxy_new_for_bus() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type GSignondDbusIdentityProxy): The constructed proxy object or %NULL if @error is set. + */ +GSignondDbusIdentity * +gsignond_dbus_identity_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (GSIGNOND_DBUS_TYPE_IDENTITY_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.Identity", NULL); + if (ret != NULL) + return GSIGNOND_DBUS_IDENTITY (ret); + else + return NULL; +} + + +/* ------------------------------------------------------------------------ */ + +/** + * GSignondDbusIdentitySkeleton: + * + * The #GSignondDbusIdentitySkeleton structure contains only private data and should only be accessed using the provided API. + */ + +/** + * GSignondDbusIdentitySkeletonClass: + * @parent_class: The parent class. + * + * Class structure for #GSignondDbusIdentitySkeleton. + */ + +struct _GSignondDbusIdentitySkeletonPrivate +{ + GValue *properties; + GList *changed_properties; + GSource *changed_properties_idle_source; + GMainContext *context; + GMutex lock; +}; + +static void +_gsignond_dbus_identity_skeleton_handle_method_call ( + GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + GSignondDbusIdentitySkeleton *skeleton = GSIGNOND_DBUS_IDENTITY_SKELETON (user_data); + _ExtendedGDBusMethodInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint num_extra; + guint n; + guint signal_id; + GValue return_value = G_VALUE_INIT; + info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); + g_assert (info != NULL); + num_params = g_variant_n_children (parameters); + num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); + n = 0; + g_value_init (¶mv[n], GSIGNOND_DBUS_TYPE_IDENTITY); + g_value_set_object (¶mv[n++], skeleton); + g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); + g_value_set_object (¶mv[n++], invocation); + if (info->pass_fdlist) + { +#ifdef G_OS_UNIX + g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); + g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); +#else + g_assert_not_reached (); +#endif + } + g_variant_iter_init (&iter, parameters); + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, GSIGNOND_DBUS_TYPE_IDENTITY); + g_value_init (&return_value, G_TYPE_BOOLEAN); + g_signal_emitv (paramv, signal_id, 0, &return_value); + if (!g_value_get_boolean (&return_value)) + g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); + g_value_unset (&return_value); + for (n = 0; n < num_params + num_extra; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static GVariant * +_gsignond_dbus_identity_skeleton_handle_get_property ( + GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GError **error, + gpointer user_data) +{ + GSignondDbusIdentitySkeleton *skeleton = GSIGNOND_DBUS_IDENTITY_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + GVariant *ret; + ret = NULL; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsignond_dbus_identity_interface_info, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + g_value_init (&value, pspec->value_type); + g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); + ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); + g_value_unset (&value); + } + return ret; +} + +static gboolean +_gsignond_dbus_identity_skeleton_handle_set_property ( + GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GVariant *variant, + GError **error, + gpointer user_data) +{ + GSignondDbusIdentitySkeleton *skeleton = GSIGNOND_DBUS_IDENTITY_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + gboolean ret; + ret = FALSE; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsignond_dbus_identity_interface_info, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + if (info->use_gvariant) + g_value_set_variant (&value, variant); + else + g_dbus_gvariant_to_gvalue (variant, &value); + g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); + g_value_unset (&value); + ret = TRUE; + } + return ret; +} + +static const GDBusInterfaceVTable _gsignond_dbus_identity_skeleton_vtable = +{ + _gsignond_dbus_identity_skeleton_handle_method_call, + _gsignond_dbus_identity_skeleton_handle_get_property, + _gsignond_dbus_identity_skeleton_handle_set_property +}; + +static GDBusInterfaceInfo * +gsignond_dbus_identity_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton) +{ + return gsignond_dbus_identity_interface_info (); +} + +static GDBusInterfaceVTable * +gsignond_dbus_identity_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton) +{ + return (GDBusInterfaceVTable *) &_gsignond_dbus_identity_skeleton_vtable; +} + +static GVariant * +gsignond_dbus_identity_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) +{ + GSignondDbusIdentitySkeleton *skeleton = GSIGNOND_DBUS_IDENTITY_SKELETON (_skeleton); + + GVariantBuilder builder; + guint n; + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + if (_gsignond_dbus_identity_interface_info.parent_struct.properties == NULL) + goto out; + for (n = 0; _gsignond_dbus_identity_interface_info.parent_struct.properties[n] != NULL; n++) + { + GDBusPropertyInfo *info = _gsignond_dbus_identity_interface_info.parent_struct.properties[n]; + if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) + { + GVariant *value; + value = _gsignond_dbus_identity_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.google.code.AccountsSSO.gSingleSignOn.Identity", info->name, NULL, skeleton); + if (value != NULL) + { + g_variant_take_ref (value); + g_variant_builder_add (&builder, "{sv}", info->name, value); + g_variant_unref (value); + } + } + } +out: + return g_variant_builder_end (&builder); +} + +static void +gsignond_dbus_identity_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) +{ +} + +static void +_gsignond_dbus_identity_on_signal_unregistered ( + GSignondDbusIdentity *object) +{ + GSignondDbusIdentitySkeleton *skeleton = GSIGNOND_DBUS_IDENTITY_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("()")); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.google.code.AccountsSSO.gSingleSignOn.Identity", "unregistered", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void +_gsignond_dbus_identity_on_signal_info_updated ( + GSignondDbusIdentity *object, + gint arg_unnamed_arg0) +{ + GSignondDbusIdentitySkeleton *skeleton = GSIGNOND_DBUS_IDENTITY_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("(i)", + arg_unnamed_arg0)); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.google.code.AccountsSSO.gSingleSignOn.Identity", "infoUpdated", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void gsignond_dbus_identity_skeleton_iface_init (GSignondDbusIdentityIface *iface); +G_DEFINE_TYPE_WITH_CODE (GSignondDbusIdentitySkeleton, gsignond_dbus_identity_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_IMPLEMENT_INTERFACE (GSIGNOND_DBUS_TYPE_IDENTITY, gsignond_dbus_identity_skeleton_iface_init)); + +static void +gsignond_dbus_identity_skeleton_finalize (GObject *object) +{ + GSignondDbusIdentitySkeleton *skeleton = GSIGNOND_DBUS_IDENTITY_SKELETON (object); + g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); + if (skeleton->priv->changed_properties_idle_source != NULL) + g_source_destroy (skeleton->priv->changed_properties_idle_source); + g_main_context_unref (skeleton->priv->context); + g_mutex_clear (&skeleton->priv->lock); + G_OBJECT_CLASS (gsignond_dbus_identity_skeleton_parent_class)->finalize (object); +} + +static void +gsignond_dbus_identity_skeleton_init (GSignondDbusIdentitySkeleton *skeleton) +{ + skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GSIGNOND_DBUS_TYPE_IDENTITY_SKELETON, GSignondDbusIdentitySkeletonPrivate); + g_mutex_init (&skeleton->priv->lock); + skeleton->priv->context = g_main_context_ref_thread_default (); +} + +static void +gsignond_dbus_identity_skeleton_class_init (GSignondDbusIdentitySkeletonClass *klass) +{ + GObjectClass *gobject_class; + GDBusInterfaceSkeletonClass *skeleton_class; + + g_type_class_add_private (klass, sizeof (GSignondDbusIdentitySkeletonPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = gsignond_dbus_identity_skeleton_finalize; + + skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); + skeleton_class->get_info = gsignond_dbus_identity_skeleton_dbus_interface_get_info; + skeleton_class->get_properties = gsignond_dbus_identity_skeleton_dbus_interface_get_properties; + skeleton_class->flush = gsignond_dbus_identity_skeleton_dbus_interface_flush; + skeleton_class->get_vtable = gsignond_dbus_identity_skeleton_dbus_interface_get_vtable; +} + +static void +gsignond_dbus_identity_skeleton_iface_init (GSignondDbusIdentityIface *iface) +{ + iface->unregistered = _gsignond_dbus_identity_on_signal_unregistered; + iface->info_updated = _gsignond_dbus_identity_on_signal_info_updated; +} + +/** + * gsignond_dbus_identity_skeleton_new: + * + * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-Identity.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.Identity</link>. + * + * Returns: (transfer full) (type GSignondDbusIdentitySkeleton): The skeleton object. + */ +GSignondDbusIdentity * +gsignond_dbus_identity_skeleton_new (void) +{ + return GSIGNOND_DBUS_IDENTITY (g_object_new (GSIGNOND_DBUS_TYPE_IDENTITY_SKELETON, NULL)); +} + diff --git a/src/daemon/dbus/gsignond-dbus-identity-gen.h b/src/daemon/dbus/gsignond-dbus-identity-gen.h new file mode 100644 index 0000000..752a70c --- /dev/null +++ b/src/daemon/dbus/gsignond-dbus-identity-gen.h @@ -0,0 +1,449 @@ +/* + * Generated by gdbus-codegen 2.32.3. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifndef __GSIGNOND_DBUS_IDENTITY_GEN_H__ +#define __GSIGNOND_DBUS_IDENTITY_GEN_H__ + +#include <gio/gio.h> + +G_BEGIN_DECLS + + +/* ------------------------------------------------------------------------ */ +/* Declarations for com.google.code.AccountsSSO.gSingleSignOn.Identity */ + +#define GSIGNOND_DBUS_TYPE_IDENTITY (gsignond_dbus_identity_get_type ()) +#define GSIGNOND_DBUS_IDENTITY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSIGNOND_DBUS_TYPE_IDENTITY, GSignondDbusIdentity)) +#define GSIGNOND_DBUS_IS_IDENTITY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSIGNOND_DBUS_TYPE_IDENTITY)) +#define GSIGNOND_DBUS_IDENTITY_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GSIGNOND_DBUS_TYPE_IDENTITY, GSignondDbusIdentityIface)) + +struct _GSignondDbusIdentity; +typedef struct _GSignondDbusIdentity GSignondDbusIdentity; +typedef struct _GSignondDbusIdentityIface GSignondDbusIdentityIface; + +struct _GSignondDbusIdentityIface +{ + GTypeInterface parent_iface; + + + gboolean (*handle_add_reference) ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation, + const gchar *arg_reference); + + gboolean (*handle_get_auth_session) ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation, + const gchar *arg_method); + + gboolean (*handle_get_info) ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_remove) ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_remove_reference) ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation, + const gchar *arg_reference); + + gboolean (*handle_request_credentials_update) ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation, + const gchar *arg_message); + + gboolean (*handle_sign_out) ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_store) ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation, + GVariant *arg_unnamed_arg0); + + gboolean (*handle_verify_secret) ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation, + const gchar *arg_secret); + + gboolean (*handle_verify_user) ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation, + GVariant *arg_params); + + void (*info_updated) ( + GSignondDbusIdentity *object, + gint arg_unnamed_arg0); + + void (*unregistered) ( + GSignondDbusIdentity *object); + +}; + +GType gsignond_dbus_identity_get_type (void) G_GNUC_CONST; + +GDBusInterfaceInfo *gsignond_dbus_identity_interface_info (void); +guint gsignond_dbus_identity_override_properties (GObjectClass *klass, guint property_id_begin); + + +/* D-Bus method call completion functions: */ +void gsignond_dbus_identity_complete_request_credentials_update ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation, + guint unnamed_arg1); + +void gsignond_dbus_identity_complete_get_info ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation, + GVariant *identityInfo); + +void gsignond_dbus_identity_complete_get_auth_session ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation, + const gchar *objectPath); + +void gsignond_dbus_identity_complete_verify_user ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation, + gboolean unnamed_arg1); + +void gsignond_dbus_identity_complete_verify_secret ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation, + gboolean unnamed_arg1); + +void gsignond_dbus_identity_complete_remove ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation); + +void gsignond_dbus_identity_complete_sign_out ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation, + gboolean unnamed_arg0); + +void gsignond_dbus_identity_complete_store ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation, + guint unnamed_arg1); + +void gsignond_dbus_identity_complete_add_reference ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation, + gint unnamed_arg1); + +void gsignond_dbus_identity_complete_remove_reference ( + GSignondDbusIdentity *object, + GDBusMethodInvocation *invocation, + gint unnamed_arg1); + + + +/* D-Bus signal emissions functions: */ +void gsignond_dbus_identity_emit_unregistered ( + GSignondDbusIdentity *object); + +void gsignond_dbus_identity_emit_info_updated ( + GSignondDbusIdentity *object, + gint arg_unnamed_arg0); + + + +/* D-Bus method calls: */ +void gsignond_dbus_identity_call_request_credentials_update ( + GSignondDbusIdentity *proxy, + const gchar *arg_message, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_identity_call_request_credentials_update_finish ( + GSignondDbusIdentity *proxy, + guint *out_unnamed_arg1, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_identity_call_request_credentials_update_sync ( + GSignondDbusIdentity *proxy, + const gchar *arg_message, + guint *out_unnamed_arg1, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_identity_call_get_info ( + GSignondDbusIdentity *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_identity_call_get_info_finish ( + GSignondDbusIdentity *proxy, + GVariant **out_identityInfo, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_identity_call_get_info_sync ( + GSignondDbusIdentity *proxy, + GVariant **out_identityInfo, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_identity_call_get_auth_session ( + GSignondDbusIdentity *proxy, + const gchar *arg_method, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_identity_call_get_auth_session_finish ( + GSignondDbusIdentity *proxy, + gchar **out_objectPath, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_identity_call_get_auth_session_sync ( + GSignondDbusIdentity *proxy, + const gchar *arg_method, + gchar **out_objectPath, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_identity_call_verify_user ( + GSignondDbusIdentity *proxy, + GVariant *arg_params, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_identity_call_verify_user_finish ( + GSignondDbusIdentity *proxy, + gboolean *out_unnamed_arg1, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_identity_call_verify_user_sync ( + GSignondDbusIdentity *proxy, + GVariant *arg_params, + gboolean *out_unnamed_arg1, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_identity_call_verify_secret ( + GSignondDbusIdentity *proxy, + const gchar *arg_secret, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_identity_call_verify_secret_finish ( + GSignondDbusIdentity *proxy, + gboolean *out_unnamed_arg1, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_identity_call_verify_secret_sync ( + GSignondDbusIdentity *proxy, + const gchar *arg_secret, + gboolean *out_unnamed_arg1, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_identity_call_remove ( + GSignondDbusIdentity *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_identity_call_remove_finish ( + GSignondDbusIdentity *proxy, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_identity_call_remove_sync ( + GSignondDbusIdentity *proxy, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_identity_call_sign_out ( + GSignondDbusIdentity *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_identity_call_sign_out_finish ( + GSignondDbusIdentity *proxy, + gboolean *out_unnamed_arg0, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_identity_call_sign_out_sync ( + GSignondDbusIdentity *proxy, + gboolean *out_unnamed_arg0, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_identity_call_store ( + GSignondDbusIdentity *proxy, + GVariant *arg_unnamed_arg0, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_identity_call_store_finish ( + GSignondDbusIdentity *proxy, + guint *out_unnamed_arg1, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_identity_call_store_sync ( + GSignondDbusIdentity *proxy, + GVariant *arg_unnamed_arg0, + guint *out_unnamed_arg1, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_identity_call_add_reference ( + GSignondDbusIdentity *proxy, + const gchar *arg_reference, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_identity_call_add_reference_finish ( + GSignondDbusIdentity *proxy, + gint *out_unnamed_arg1, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_identity_call_add_reference_sync ( + GSignondDbusIdentity *proxy, + const gchar *arg_reference, + gint *out_unnamed_arg1, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_identity_call_remove_reference ( + GSignondDbusIdentity *proxy, + const gchar *arg_reference, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_identity_call_remove_reference_finish ( + GSignondDbusIdentity *proxy, + gint *out_unnamed_arg1, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_identity_call_remove_reference_sync ( + GSignondDbusIdentity *proxy, + const gchar *arg_reference, + gint *out_unnamed_arg1, + GCancellable *cancellable, + GError **error); + + + +/* ---- */ + +#define GSIGNOND_DBUS_TYPE_IDENTITY_PROXY (gsignond_dbus_identity_proxy_get_type ()) +#define GSIGNOND_DBUS_IDENTITY_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSIGNOND_DBUS_TYPE_IDENTITY_PROXY, GSignondDbusIdentityProxy)) +#define GSIGNOND_DBUS_IDENTITY_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GSIGNOND_DBUS_TYPE_IDENTITY_PROXY, GSignondDbusIdentityProxyClass)) +#define GSIGNOND_DBUS_IDENTITY_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSIGNOND_DBUS_TYPE_IDENTITY_PROXY, GSignondDbusIdentityProxyClass)) +#define GSIGNOND_DBUS_IS_IDENTITY_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSIGNOND_DBUS_TYPE_IDENTITY_PROXY)) +#define GSIGNOND_DBUS_IS_IDENTITY_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSIGNOND_DBUS_TYPE_IDENTITY_PROXY)) + +typedef struct _GSignondDbusIdentityProxy GSignondDbusIdentityProxy; +typedef struct _GSignondDbusIdentityProxyClass GSignondDbusIdentityProxyClass; +typedef struct _GSignondDbusIdentityProxyPrivate GSignondDbusIdentityProxyPrivate; + +struct _GSignondDbusIdentityProxy +{ + /*< private >*/ + GDBusProxy parent_instance; + GSignondDbusIdentityProxyPrivate *priv; +}; + +struct _GSignondDbusIdentityProxyClass +{ + GDBusProxyClass parent_class; +}; + +GType gsignond_dbus_identity_proxy_get_type (void) G_GNUC_CONST; + +void gsignond_dbus_identity_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +GSignondDbusIdentity *gsignond_dbus_identity_proxy_new_finish ( + GAsyncResult *res, + GError **error); +GSignondDbusIdentity *gsignond_dbus_identity_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_identity_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +GSignondDbusIdentity *gsignond_dbus_identity_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error); +GSignondDbusIdentity *gsignond_dbus_identity_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + + +/* ---- */ + +#define GSIGNOND_DBUS_TYPE_IDENTITY_SKELETON (gsignond_dbus_identity_skeleton_get_type ()) +#define GSIGNOND_DBUS_IDENTITY_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSIGNOND_DBUS_TYPE_IDENTITY_SKELETON, GSignondDbusIdentitySkeleton)) +#define GSIGNOND_DBUS_IDENTITY_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GSIGNOND_DBUS_TYPE_IDENTITY_SKELETON, GSignondDbusIdentitySkeletonClass)) +#define GSIGNOND_DBUS_IDENTITY_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSIGNOND_DBUS_TYPE_IDENTITY_SKELETON, GSignondDbusIdentitySkeletonClass)) +#define GSIGNOND_DBUS_IS_IDENTITY_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSIGNOND_DBUS_TYPE_IDENTITY_SKELETON)) +#define GSIGNOND_DBUS_IS_IDENTITY_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSIGNOND_DBUS_TYPE_IDENTITY_SKELETON)) + +typedef struct _GSignondDbusIdentitySkeleton GSignondDbusIdentitySkeleton; +typedef struct _GSignondDbusIdentitySkeletonClass GSignondDbusIdentitySkeletonClass; +typedef struct _GSignondDbusIdentitySkeletonPrivate GSignondDbusIdentitySkeletonPrivate; + +struct _GSignondDbusIdentitySkeleton +{ + /*< private >*/ + GDBusInterfaceSkeleton parent_instance; + GSignondDbusIdentitySkeletonPrivate *priv; +}; + +struct _GSignondDbusIdentitySkeletonClass +{ + GDBusInterfaceSkeletonClass parent_class; +}; + +GType gsignond_dbus_identity_skeleton_get_type (void) G_GNUC_CONST; + +GSignondDbusIdentity *gsignond_dbus_identity_skeleton_new (void); + + +G_END_DECLS + +#endif /* __GSIGNOND_DBUS_IDENTITY_GEN_H__ */ diff --git a/src/daemon/dbus/gsignond-dbus-remote-plugin-gen.c b/src/daemon/dbus/gsignond-dbus-remote-plugin-gen.c new file mode 100644 index 0000000..b8cb666 --- /dev/null +++ b/src/daemon/dbus/gsignond-dbus-remote-plugin-gen.c @@ -0,0 +1,2522 @@ +/* + * Generated by gdbus-codegen 2.32.3. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "gsignond-dbus-remote-plugin-gen.h" + +#ifdef G_OS_UNIX +# include <gio/gunixfdlist.h> +#endif + +typedef struct +{ + GDBusArgInfo parent_struct; + gboolean use_gvariant; +} _ExtendedGDBusArgInfo; + +typedef struct +{ + GDBusMethodInfo parent_struct; + const gchar *signal_name; + gboolean pass_fdlist; +} _ExtendedGDBusMethodInfo; + +typedef struct +{ + GDBusSignalInfo parent_struct; + const gchar *signal_name; +} _ExtendedGDBusSignalInfo; + +typedef struct +{ + GDBusPropertyInfo parent_struct; + const gchar *hyphen_name; + gboolean use_gvariant; +} _ExtendedGDBusPropertyInfo; + +typedef struct +{ + GDBusInterfaceInfo parent_struct; + const gchar *hyphen_name; +} _ExtendedGDBusInterfaceInfo; + +typedef struct +{ + const _ExtendedGDBusPropertyInfo *info; + guint prop_id; + GValue orig_value; /* the value before the change */ +} ChangedProperty; + +static void +_changed_property_free (ChangedProperty *data) +{ + g_value_unset (&data->orig_value); + g_free (data); +} + +static gboolean +_g_strv_equal0 (gchar **a, gchar **b) +{ + gboolean ret = FALSE; + guint n; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + if (g_strv_length (a) != g_strv_length (b)) + goto out; + for (n = 0; a[n] != NULL; n++) + if (g_strcmp0 (a[n], b[n]) != 0) + goto out; + ret = TRUE; +out: + return ret; +} + +static gboolean +_g_variant_equal0 (GVariant *a, GVariant *b) +{ + gboolean ret = FALSE; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + ret = g_variant_equal (a, b); +out: + return ret; +} + +G_GNUC_UNUSED static gboolean +_g_value_equal (const GValue *a, const GValue *b) +{ + gboolean ret = FALSE; + g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b)); + switch (G_VALUE_TYPE (a)) + { + case G_TYPE_BOOLEAN: + ret = (g_value_get_boolean (a) == g_value_get_boolean (b)); + break; + case G_TYPE_UCHAR: + ret = (g_value_get_uchar (a) == g_value_get_uchar (b)); + break; + case G_TYPE_INT: + ret = (g_value_get_int (a) == g_value_get_int (b)); + break; + case G_TYPE_UINT: + ret = (g_value_get_uint (a) == g_value_get_uint (b)); + break; + case G_TYPE_INT64: + ret = (g_value_get_int64 (a) == g_value_get_int64 (b)); + break; + case G_TYPE_UINT64: + ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b)); + break; + case G_TYPE_DOUBLE: + ret = (g_value_get_double (a) == g_value_get_double (b)); + break; + case G_TYPE_STRING: + ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0); + break; + case G_TYPE_VARIANT: + ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b)); + break; + default: + if (G_VALUE_TYPE (a) == G_TYPE_STRV) + ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b)); + else + g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a))); + break; + } + return ret; +} + +/* ------------------------------------------------------------------------ + * Code for interface com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin + * ------------------------------------------------------------------------ + */ + +/** + * SECTION:GSignondDbusRemotePlugin + * @title: GSignondDbusRemotePlugin + * @short_description: Generated C code for the com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin D-Bus interface + * + * This section contains code for working with the <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin</link> D-Bus interface in C. + */ + +/* ---- Introspection data for com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin ---- */ + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_remote_plugin_method_info_cancel = +{ + { + -1, + "cancel", + NULL, + NULL, + NULL + }, + "handle-cancel", + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_remote_plugin_method_info_request_initial_IN_ARG_sessionData = +{ + { + -1, + "sessionData", + "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_remote_plugin_method_info_request_initial_IN_ARG_mechanism = +{ + { + -1, + "mechanism", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_remote_plugin_method_info_request_initial_IN_ARG_pointers[] = +{ + &_gsignond_dbus_remote_plugin_method_info_request_initial_IN_ARG_sessionData, + &_gsignond_dbus_remote_plugin_method_info_request_initial_IN_ARG_mechanism, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_remote_plugin_method_info_request_initial = +{ + { + -1, + "requestInitial", + (GDBusArgInfo **) &_gsignond_dbus_remote_plugin_method_info_request_initial_IN_ARG_pointers, + NULL, + NULL + }, + "handle-request-initial", + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_remote_plugin_method_info_request_IN_ARG_sessionData = +{ + { + -1, + "sessionData", + "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_remote_plugin_method_info_request_IN_ARG_pointers[] = +{ + &_gsignond_dbus_remote_plugin_method_info_request_IN_ARG_sessionData, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_remote_plugin_method_info_request = +{ + { + -1, + "request", + (GDBusArgInfo **) &_gsignond_dbus_remote_plugin_method_info_request_IN_ARG_pointers, + NULL, + NULL + }, + "handle-request", + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_remote_plugin_method_info_user_action_finished_IN_ARG_uiData = +{ + { + -1, + "uiData", + "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_remote_plugin_method_info_user_action_finished_IN_ARG_pointers[] = +{ + &_gsignond_dbus_remote_plugin_method_info_user_action_finished_IN_ARG_uiData, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_remote_plugin_method_info_user_action_finished = +{ + { + -1, + "userActionFinished", + (GDBusArgInfo **) &_gsignond_dbus_remote_plugin_method_info_user_action_finished_IN_ARG_pointers, + NULL, + NULL + }, + "handle-user-action-finished", + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_remote_plugin_method_info_refresh_IN_ARG_uiData = +{ + { + -1, + "uiData", + "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_remote_plugin_method_info_refresh_IN_ARG_pointers[] = +{ + &_gsignond_dbus_remote_plugin_method_info_refresh_IN_ARG_uiData, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_remote_plugin_method_info_refresh = +{ + { + -1, + "refresh", + (GDBusArgInfo **) &_gsignond_dbus_remote_plugin_method_info_refresh_IN_ARG_pointers, + NULL, + NULL + }, + "handle-refresh", + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_remote_plugin_method_info_get_info_OUT_ARG_type = +{ + { + -1, + "type", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_remote_plugin_method_info_get_info_OUT_ARG_mechanisms = +{ + { + -1, + "mechanisms", + "as", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_remote_plugin_method_info_get_info_OUT_ARG_pointers[] = +{ + &_gsignond_dbus_remote_plugin_method_info_get_info_OUT_ARG_type, + &_gsignond_dbus_remote_plugin_method_info_get_info_OUT_ARG_mechanisms, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_remote_plugin_method_info_get_info = +{ + { + -1, + "getInfo", + NULL, + (GDBusArgInfo **) &_gsignond_dbus_remote_plugin_method_info_get_info_OUT_ARG_pointers, + NULL + }, + "handle-get-info", + FALSE +}; + +static const _ExtendedGDBusMethodInfo * const _gsignond_dbus_remote_plugin_method_info_pointers[] = +{ + &_gsignond_dbus_remote_plugin_method_info_cancel, + &_gsignond_dbus_remote_plugin_method_info_request_initial, + &_gsignond_dbus_remote_plugin_method_info_request, + &_gsignond_dbus_remote_plugin_method_info_user_action_finished, + &_gsignond_dbus_remote_plugin_method_info_refresh, + &_gsignond_dbus_remote_plugin_method_info_get_info, + NULL +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_remote_plugin_signal_info_response_ARG_sessionData = +{ + { + -1, + "sessionData", + "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_remote_plugin_signal_info_response_ARG_pointers[] = +{ + &_gsignond_dbus_remote_plugin_signal_info_response_ARG_sessionData, + NULL +}; + +static const _ExtendedGDBusSignalInfo _gsignond_dbus_remote_plugin_signal_info_response = +{ + { + -1, + "response", + (GDBusArgInfo **) &_gsignond_dbus_remote_plugin_signal_info_response_ARG_pointers, + NULL + }, + "response" +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_remote_plugin_signal_info_response_final_ARG_sessionData = +{ + { + -1, + "sessionData", + "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_remote_plugin_signal_info_response_final_ARG_pointers[] = +{ + &_gsignond_dbus_remote_plugin_signal_info_response_final_ARG_sessionData, + NULL +}; + +static const _ExtendedGDBusSignalInfo _gsignond_dbus_remote_plugin_signal_info_response_final = +{ + { + -1, + "responseFinal", + (GDBusArgInfo **) &_gsignond_dbus_remote_plugin_signal_info_response_final_ARG_pointers, + NULL + }, + "response-final" +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_remote_plugin_signal_info_store_ARG_sessionData = +{ + { + -1, + "sessionData", + "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_remote_plugin_signal_info_store_ARG_pointers[] = +{ + &_gsignond_dbus_remote_plugin_signal_info_store_ARG_sessionData, + NULL +}; + +static const _ExtendedGDBusSignalInfo _gsignond_dbus_remote_plugin_signal_info_store = +{ + { + -1, + "store", + (GDBusArgInfo **) &_gsignond_dbus_remote_plugin_signal_info_store_ARG_pointers, + NULL + }, + "store" +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_remote_plugin_signal_info_error_ARG_error = +{ + { + -1, + "error", + "(uis)", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_remote_plugin_signal_info_error_ARG_pointers[] = +{ + &_gsignond_dbus_remote_plugin_signal_info_error_ARG_error, + NULL +}; + +static const _ExtendedGDBusSignalInfo _gsignond_dbus_remote_plugin_signal_info_error = +{ + { + -1, + "error", + (GDBusArgInfo **) &_gsignond_dbus_remote_plugin_signal_info_error_ARG_pointers, + NULL + }, + "error" +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_remote_plugin_signal_info_user_action_required_ARG_uiData = +{ + { + -1, + "uiData", + "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_remote_plugin_signal_info_user_action_required_ARG_pointers[] = +{ + &_gsignond_dbus_remote_plugin_signal_info_user_action_required_ARG_uiData, + NULL +}; + +static const _ExtendedGDBusSignalInfo _gsignond_dbus_remote_plugin_signal_info_user_action_required = +{ + { + -1, + "userActionRequired", + (GDBusArgInfo **) &_gsignond_dbus_remote_plugin_signal_info_user_action_required_ARG_pointers, + NULL + }, + "user-action-required" +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_remote_plugin_signal_info_refreshed_ARG_uiData = +{ + { + -1, + "uiData", + "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_remote_plugin_signal_info_refreshed_ARG_pointers[] = +{ + &_gsignond_dbus_remote_plugin_signal_info_refreshed_ARG_uiData, + NULL +}; + +static const _ExtendedGDBusSignalInfo _gsignond_dbus_remote_plugin_signal_info_refreshed = +{ + { + -1, + "refreshed", + (GDBusArgInfo **) &_gsignond_dbus_remote_plugin_signal_info_refreshed_ARG_pointers, + NULL + }, + "refreshed" +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_remote_plugin_signal_info_status_changed_ARG_state = +{ + { + -1, + "state", + "i", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_remote_plugin_signal_info_status_changed_ARG_message = +{ + { + -1, + "message", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_remote_plugin_signal_info_status_changed_ARG_pointers[] = +{ + &_gsignond_dbus_remote_plugin_signal_info_status_changed_ARG_state, + &_gsignond_dbus_remote_plugin_signal_info_status_changed_ARG_message, + NULL +}; + +static const _ExtendedGDBusSignalInfo _gsignond_dbus_remote_plugin_signal_info_status_changed = +{ + { + -1, + "statusChanged", + (GDBusArgInfo **) &_gsignond_dbus_remote_plugin_signal_info_status_changed_ARG_pointers, + NULL + }, + "status-changed" +}; + +static const _ExtendedGDBusSignalInfo * const _gsignond_dbus_remote_plugin_signal_info_pointers[] = +{ + &_gsignond_dbus_remote_plugin_signal_info_response, + &_gsignond_dbus_remote_plugin_signal_info_response_final, + &_gsignond_dbus_remote_plugin_signal_info_store, + &_gsignond_dbus_remote_plugin_signal_info_error, + &_gsignond_dbus_remote_plugin_signal_info_user_action_required, + &_gsignond_dbus_remote_plugin_signal_info_refreshed, + &_gsignond_dbus_remote_plugin_signal_info_status_changed, + NULL +}; + +static const _ExtendedGDBusInterfaceInfo _gsignond_dbus_remote_plugin_interface_info = +{ + { + -1, + "com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin", + (GDBusMethodInfo **) &_gsignond_dbus_remote_plugin_method_info_pointers, + (GDBusSignalInfo **) &_gsignond_dbus_remote_plugin_signal_info_pointers, + NULL, + NULL + }, + "remote-plugin", +}; + + +/** + * gsignond_dbus_remote_plugin_interface_info: + * + * Gets a machine-readable description of the <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin</link> D-Bus interface. + * + * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. + */ +GDBusInterfaceInfo * +gsignond_dbus_remote_plugin_interface_info (void) +{ + return (GDBusInterfaceInfo *) &_gsignond_dbus_remote_plugin_interface_info; +} + +/** + * gsignond_dbus_remote_plugin_override_properties: + * @klass: The class structure for a #GObject<!-- -->-derived class. + * @property_id_begin: The property id to assign to the first overridden property. + * + * Overrides all #GObject properties in the #GSignondDbusRemotePlugin interface for a concrete class. + * The properties are overridden in the order they are defined. + * + * Returns: The last property id. + */ +guint +gsignond_dbus_remote_plugin_override_properties (GObjectClass *klass, guint property_id_begin) +{ + return property_id_begin - 1; +} + + + +/** + * GSignondDbusRemotePlugin: + * + * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin</link>. + */ + +/** + * GSignondDbusRemotePluginIface: + * @parent_iface: The parent interface. + * @handle_cancel: Handler for the #GSignondDbusRemotePlugin::handle-cancel signal. + * @handle_get_info: Handler for the #GSignondDbusRemotePlugin::handle-get-info signal. + * @handle_refresh: Handler for the #GSignondDbusRemotePlugin::handle-refresh signal. + * @handle_request: Handler for the #GSignondDbusRemotePlugin::handle-request signal. + * @handle_request_initial: Handler for the #GSignondDbusRemotePlugin::handle-request-initial signal. + * @handle_user_action_finished: Handler for the #GSignondDbusRemotePlugin::handle-user-action-finished signal. + * @error: Handler for the #GSignondDbusRemotePlugin::error signal. + * @refreshed: Handler for the #GSignondDbusRemotePlugin::refreshed signal. + * @response: Handler for the #GSignondDbusRemotePlugin::response signal. + * @response_final: Handler for the #GSignondDbusRemotePlugin::response-final signal. + * @status_changed: Handler for the #GSignondDbusRemotePlugin::status-changed signal. + * @store: Handler for the #GSignondDbusRemotePlugin::store signal. + * @user_action_required: Handler for the #GSignondDbusRemotePlugin::user-action-required signal. + * + * Virtual table for the D-Bus interface <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin</link>. + */ + +static void +gsignond_dbus_remote_plugin_default_init (GSignondDbusRemotePluginIface *iface) +{ + /* GObject signals for incoming D-Bus method calls: */ + /** + * GSignondDbusRemotePlugin::handle-cancel: + * @object: A #GSignondDbusRemotePlugin. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.cancel">cancel()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_remote_plugin_complete_cancel() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-cancel", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusRemotePluginIface, handle_cancel), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * GSignondDbusRemotePlugin::handle-request-initial: + * @object: A #GSignondDbusRemotePlugin. + * @invocation: A #GDBusMethodInvocation. + * @arg_sessionData: Argument passed by remote caller. + * @arg_mechanism: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.requestInitial">requestInitial()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_remote_plugin_complete_request_initial() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-request-initial", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusRemotePluginIface, handle_request_initial), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_STRING); + + /** + * GSignondDbusRemotePlugin::handle-request: + * @object: A #GSignondDbusRemotePlugin. + * @invocation: A #GDBusMethodInvocation. + * @arg_sessionData: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.request">request()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_remote_plugin_complete_request() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-request", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusRemotePluginIface, handle_request), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT); + + /** + * GSignondDbusRemotePlugin::handle-user-action-finished: + * @object: A #GSignondDbusRemotePlugin. + * @invocation: A #GDBusMethodInvocation. + * @arg_uiData: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.userActionFinished">userActionFinished()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_remote_plugin_complete_user_action_finished() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-user-action-finished", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusRemotePluginIface, handle_user_action_finished), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT); + + /** + * GSignondDbusRemotePlugin::handle-refresh: + * @object: A #GSignondDbusRemotePlugin. + * @invocation: A #GDBusMethodInvocation. + * @arg_uiData: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.refresh">refresh()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_remote_plugin_complete_refresh() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-refresh", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusRemotePluginIface, handle_refresh), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT); + + /** + * GSignondDbusRemotePlugin::handle-get-info: + * @object: A #GSignondDbusRemotePlugin. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.getInfo">getInfo()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_remote_plugin_complete_get_info() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-get-info", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusRemotePluginIface, handle_get_info), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /* GObject signals for received D-Bus signals: */ + /** + * GSignondDbusRemotePlugin::response: + * @object: A #GSignondDbusRemotePlugin. + * @arg_sessionData: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.response">"response"</link> is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("response", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusRemotePluginIface, response), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 1, G_TYPE_VARIANT); + + /** + * GSignondDbusRemotePlugin::response-final: + * @object: A #GSignondDbusRemotePlugin. + * @arg_sessionData: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.responseFinal">"responseFinal"</link> is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("response-final", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusRemotePluginIface, response_final), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 1, G_TYPE_VARIANT); + + /** + * GSignondDbusRemotePlugin::store: + * @object: A #GSignondDbusRemotePlugin. + * @arg_sessionData: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.store">"store"</link> is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("store", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusRemotePluginIface, store), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 1, G_TYPE_VARIANT); + + /** + * GSignondDbusRemotePlugin::error: + * @object: A #GSignondDbusRemotePlugin. + * @arg_error: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.error">"error"</link> is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("error", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusRemotePluginIface, error), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 1, G_TYPE_VARIANT); + + /** + * GSignondDbusRemotePlugin::user-action-required: + * @object: A #GSignondDbusRemotePlugin. + * @arg_uiData: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.userActionRequired">"userActionRequired"</link> is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("user-action-required", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusRemotePluginIface, user_action_required), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 1, G_TYPE_VARIANT); + + /** + * GSignondDbusRemotePlugin::refreshed: + * @object: A #GSignondDbusRemotePlugin. + * @arg_uiData: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.refreshed">"refreshed"</link> is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("refreshed", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusRemotePluginIface, refreshed), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 1, G_TYPE_VARIANT); + + /** + * GSignondDbusRemotePlugin::status-changed: + * @object: A #GSignondDbusRemotePlugin. + * @arg_state: Argument. + * @arg_message: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.statusChanged">"statusChanged"</link> is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("status-changed", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusRemotePluginIface, status_changed), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 2, G_TYPE_INT, G_TYPE_STRING); + +} + +typedef GSignondDbusRemotePluginIface GSignondDbusRemotePluginInterface; +G_DEFINE_INTERFACE (GSignondDbusRemotePlugin, gsignond_dbus_remote_plugin, G_TYPE_OBJECT); + +/** + * gsignond_dbus_remote_plugin_emit_response: + * @object: A #GSignondDbusRemotePlugin. + * @arg_sessionData: Argument to pass with the signal. + * + * Emits the <link linkend="gdbus-signal-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.response">"response"</link> D-Bus signal. + */ +void +gsignond_dbus_remote_plugin_emit_response ( + GSignondDbusRemotePlugin *object, + GVariant *arg_sessionData) +{ + g_signal_emit_by_name (object, "response", arg_sessionData); +} + +/** + * gsignond_dbus_remote_plugin_emit_response_final: + * @object: A #GSignondDbusRemotePlugin. + * @arg_sessionData: Argument to pass with the signal. + * + * Emits the <link linkend="gdbus-signal-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.responseFinal">"responseFinal"</link> D-Bus signal. + */ +void +gsignond_dbus_remote_plugin_emit_response_final ( + GSignondDbusRemotePlugin *object, + GVariant *arg_sessionData) +{ + g_signal_emit_by_name (object, "response-final", arg_sessionData); +} + +/** + * gsignond_dbus_remote_plugin_emit_store: + * @object: A #GSignondDbusRemotePlugin. + * @arg_sessionData: Argument to pass with the signal. + * + * Emits the <link linkend="gdbus-signal-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.store">"store"</link> D-Bus signal. + */ +void +gsignond_dbus_remote_plugin_emit_store ( + GSignondDbusRemotePlugin *object, + GVariant *arg_sessionData) +{ + g_signal_emit_by_name (object, "store", arg_sessionData); +} + +/** + * gsignond_dbus_remote_plugin_emit_error: + * @object: A #GSignondDbusRemotePlugin. + * @arg_error: Argument to pass with the signal. + * + * Emits the <link linkend="gdbus-signal-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.error">"error"</link> D-Bus signal. + */ +void +gsignond_dbus_remote_plugin_emit_error ( + GSignondDbusRemotePlugin *object, + GVariant *arg_error) +{ + g_signal_emit_by_name (object, "error", arg_error); +} + +/** + * gsignond_dbus_remote_plugin_emit_user_action_required: + * @object: A #GSignondDbusRemotePlugin. + * @arg_uiData: Argument to pass with the signal. + * + * Emits the <link linkend="gdbus-signal-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.userActionRequired">"userActionRequired"</link> D-Bus signal. + */ +void +gsignond_dbus_remote_plugin_emit_user_action_required ( + GSignondDbusRemotePlugin *object, + GVariant *arg_uiData) +{ + g_signal_emit_by_name (object, "user-action-required", arg_uiData); +} + +/** + * gsignond_dbus_remote_plugin_emit_refreshed: + * @object: A #GSignondDbusRemotePlugin. + * @arg_uiData: Argument to pass with the signal. + * + * Emits the <link linkend="gdbus-signal-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.refreshed">"refreshed"</link> D-Bus signal. + */ +void +gsignond_dbus_remote_plugin_emit_refreshed ( + GSignondDbusRemotePlugin *object, + GVariant *arg_uiData) +{ + g_signal_emit_by_name (object, "refreshed", arg_uiData); +} + +/** + * gsignond_dbus_remote_plugin_emit_status_changed: + * @object: A #GSignondDbusRemotePlugin. + * @arg_state: Argument to pass with the signal. + * @arg_message: Argument to pass with the signal. + * + * Emits the <link linkend="gdbus-signal-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.statusChanged">"statusChanged"</link> D-Bus signal. + */ +void +gsignond_dbus_remote_plugin_emit_status_changed ( + GSignondDbusRemotePlugin *object, + gint arg_state, + const gchar *arg_message) +{ + g_signal_emit_by_name (object, "status-changed", arg_state, arg_message); +} + +/** + * gsignond_dbus_remote_plugin_call_cancel: + * @proxy: A #GSignondDbusRemotePluginProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.cancel">cancel()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_remote_plugin_call_cancel_finish() to get the result of the operation. + * + * See gsignond_dbus_remote_plugin_call_cancel_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_remote_plugin_call_cancel ( + GSignondDbusRemotePlugin *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "cancel", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_remote_plugin_call_cancel_finish: + * @proxy: A #GSignondDbusRemotePluginProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_remote_plugin_call_cancel(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_remote_plugin_call_cancel(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_remote_plugin_call_cancel_finish ( + GSignondDbusRemotePlugin *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_remote_plugin_call_cancel_sync: + * @proxy: A #GSignondDbusRemotePluginProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.cancel">cancel()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_remote_plugin_call_cancel() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_remote_plugin_call_cancel_sync ( + GSignondDbusRemotePlugin *proxy, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "cancel", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_remote_plugin_call_request_initial: + * @proxy: A #GSignondDbusRemotePluginProxy. + * @arg_sessionData: Argument to pass with the method invocation. + * @arg_mechanism: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.requestInitial">requestInitial()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_remote_plugin_call_request_initial_finish() to get the result of the operation. + * + * See gsignond_dbus_remote_plugin_call_request_initial_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_remote_plugin_call_request_initial ( + GSignondDbusRemotePlugin *proxy, + GVariant *arg_sessionData, + const gchar *arg_mechanism, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "requestInitial", + g_variant_new ("(@a{sv}s)", + arg_sessionData, + arg_mechanism), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_remote_plugin_call_request_initial_finish: + * @proxy: A #GSignondDbusRemotePluginProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_remote_plugin_call_request_initial(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_remote_plugin_call_request_initial(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_remote_plugin_call_request_initial_finish ( + GSignondDbusRemotePlugin *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_remote_plugin_call_request_initial_sync: + * @proxy: A #GSignondDbusRemotePluginProxy. + * @arg_sessionData: Argument to pass with the method invocation. + * @arg_mechanism: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.requestInitial">requestInitial()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_remote_plugin_call_request_initial() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_remote_plugin_call_request_initial_sync ( + GSignondDbusRemotePlugin *proxy, + GVariant *arg_sessionData, + const gchar *arg_mechanism, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "requestInitial", + g_variant_new ("(@a{sv}s)", + arg_sessionData, + arg_mechanism), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_remote_plugin_call_request: + * @proxy: A #GSignondDbusRemotePluginProxy. + * @arg_sessionData: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.request">request()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_remote_plugin_call_request_finish() to get the result of the operation. + * + * See gsignond_dbus_remote_plugin_call_request_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_remote_plugin_call_request ( + GSignondDbusRemotePlugin *proxy, + GVariant *arg_sessionData, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "request", + g_variant_new ("(@a{sv})", + arg_sessionData), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_remote_plugin_call_request_finish: + * @proxy: A #GSignondDbusRemotePluginProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_remote_plugin_call_request(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_remote_plugin_call_request(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_remote_plugin_call_request_finish ( + GSignondDbusRemotePlugin *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_remote_plugin_call_request_sync: + * @proxy: A #GSignondDbusRemotePluginProxy. + * @arg_sessionData: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.request">request()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_remote_plugin_call_request() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_remote_plugin_call_request_sync ( + GSignondDbusRemotePlugin *proxy, + GVariant *arg_sessionData, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "request", + g_variant_new ("(@a{sv})", + arg_sessionData), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_remote_plugin_call_user_action_finished: + * @proxy: A #GSignondDbusRemotePluginProxy. + * @arg_uiData: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.userActionFinished">userActionFinished()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_remote_plugin_call_user_action_finished_finish() to get the result of the operation. + * + * See gsignond_dbus_remote_plugin_call_user_action_finished_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_remote_plugin_call_user_action_finished ( + GSignondDbusRemotePlugin *proxy, + GVariant *arg_uiData, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "userActionFinished", + g_variant_new ("(@a{sv})", + arg_uiData), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_remote_plugin_call_user_action_finished_finish: + * @proxy: A #GSignondDbusRemotePluginProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_remote_plugin_call_user_action_finished(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_remote_plugin_call_user_action_finished(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_remote_plugin_call_user_action_finished_finish ( + GSignondDbusRemotePlugin *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_remote_plugin_call_user_action_finished_sync: + * @proxy: A #GSignondDbusRemotePluginProxy. + * @arg_uiData: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.userActionFinished">userActionFinished()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_remote_plugin_call_user_action_finished() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_remote_plugin_call_user_action_finished_sync ( + GSignondDbusRemotePlugin *proxy, + GVariant *arg_uiData, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "userActionFinished", + g_variant_new ("(@a{sv})", + arg_uiData), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_remote_plugin_call_refresh: + * @proxy: A #GSignondDbusRemotePluginProxy. + * @arg_uiData: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.refresh">refresh()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_remote_plugin_call_refresh_finish() to get the result of the operation. + * + * See gsignond_dbus_remote_plugin_call_refresh_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_remote_plugin_call_refresh ( + GSignondDbusRemotePlugin *proxy, + GVariant *arg_uiData, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "refresh", + g_variant_new ("(@a{sv})", + arg_uiData), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_remote_plugin_call_refresh_finish: + * @proxy: A #GSignondDbusRemotePluginProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_remote_plugin_call_refresh(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_remote_plugin_call_refresh(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_remote_plugin_call_refresh_finish ( + GSignondDbusRemotePlugin *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_remote_plugin_call_refresh_sync: + * @proxy: A #GSignondDbusRemotePluginProxy. + * @arg_uiData: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.refresh">refresh()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_remote_plugin_call_refresh() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_remote_plugin_call_refresh_sync ( + GSignondDbusRemotePlugin *proxy, + GVariant *arg_uiData, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "refresh", + g_variant_new ("(@a{sv})", + arg_uiData), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_remote_plugin_call_get_info: + * @proxy: A #GSignondDbusRemotePluginProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.getInfo">getInfo()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_remote_plugin_call_get_info_finish() to get the result of the operation. + * + * See gsignond_dbus_remote_plugin_call_get_info_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_remote_plugin_call_get_info ( + GSignondDbusRemotePlugin *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "getInfo", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_remote_plugin_call_get_info_finish: + * @proxy: A #GSignondDbusRemotePluginProxy. + * @out_type: (out): Return location for return parameter or %NULL to ignore. + * @out_mechanisms: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_remote_plugin_call_get_info(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_remote_plugin_call_get_info(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_remote_plugin_call_get_info_finish ( + GSignondDbusRemotePlugin *proxy, + gchar **out_type, + gchar ***out_mechanisms, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(s^as)", + out_type, + out_mechanisms); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_remote_plugin_call_get_info_sync: + * @proxy: A #GSignondDbusRemotePluginProxy. + * @out_type: (out): Return location for return parameter or %NULL to ignore. + * @out_mechanisms: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.getInfo">getInfo()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_remote_plugin_call_get_info() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_remote_plugin_call_get_info_sync ( + GSignondDbusRemotePlugin *proxy, + gchar **out_type, + gchar ***out_mechanisms, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "getInfo", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(s^as)", + out_type, + out_mechanisms); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_remote_plugin_complete_cancel: + * @object: A #GSignondDbusRemotePlugin. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.cancel">cancel()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_remote_plugin_complete_cancel ( + GSignondDbusRemotePlugin *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * gsignond_dbus_remote_plugin_complete_request_initial: + * @object: A #GSignondDbusRemotePlugin. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.requestInitial">requestInitial()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_remote_plugin_complete_request_initial ( + GSignondDbusRemotePlugin *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * gsignond_dbus_remote_plugin_complete_request: + * @object: A #GSignondDbusRemotePlugin. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.request">request()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_remote_plugin_complete_request ( + GSignondDbusRemotePlugin *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * gsignond_dbus_remote_plugin_complete_user_action_finished: + * @object: A #GSignondDbusRemotePlugin. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.userActionFinished">userActionFinished()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_remote_plugin_complete_user_action_finished ( + GSignondDbusRemotePlugin *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * gsignond_dbus_remote_plugin_complete_refresh: + * @object: A #GSignondDbusRemotePlugin. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.refresh">refresh()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_remote_plugin_complete_refresh ( + GSignondDbusRemotePlugin *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * gsignond_dbus_remote_plugin_complete_get_info: + * @object: A #GSignondDbusRemotePlugin. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @type: Parameter to return. + * @mechanisms: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.getInfo">getInfo()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_remote_plugin_complete_get_info ( + GSignondDbusRemotePlugin *object, + GDBusMethodInvocation *invocation, + const gchar *type, + const gchar *const *mechanisms) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(s^as)", + type, + mechanisms)); +} + +/* ------------------------------------------------------------------------ */ + +/** + * GSignondDbusRemotePluginProxy: + * + * The #GSignondDbusRemotePluginProxy structure contains only private data and should only be accessed using the provided API. + */ + +/** + * GSignondDbusRemotePluginProxyClass: + * @parent_class: The parent class. + * + * Class structure for #GSignondDbusRemotePluginProxy. + */ + +struct _GSignondDbusRemotePluginProxyPrivate +{ + GData *qdata; +}; + +static void gsignond_dbus_remote_plugin_proxy_iface_init (GSignondDbusRemotePluginIface *iface); + +G_DEFINE_TYPE_WITH_CODE (GSignondDbusRemotePluginProxy, gsignond_dbus_remote_plugin_proxy, G_TYPE_DBUS_PROXY, + G_IMPLEMENT_INTERFACE (GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN, gsignond_dbus_remote_plugin_proxy_iface_init)); + +static void +gsignond_dbus_remote_plugin_proxy_finalize (GObject *object) +{ + GSignondDbusRemotePluginProxy *proxy = GSIGNOND_DBUS_REMOTE_PLUGIN_PROXY (object); + g_datalist_clear (&proxy->priv->qdata); + G_OBJECT_CLASS (gsignond_dbus_remote_plugin_proxy_parent_class)->finalize (object); +} + +static void +gsignond_dbus_remote_plugin_proxy_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ +} + +static void +gsignond_dbus_remote_plugin_proxy_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ +} + +static void +gsignond_dbus_remote_plugin_proxy_g_signal (GDBusProxy *proxy, + const gchar *sender_name, + const gchar *signal_name, + GVariant *parameters) +{ + _ExtendedGDBusSignalInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint n; + guint signal_id; + info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_gsignond_dbus_remote_plugin_interface_info, signal_name); + if (info == NULL) + return; + num_params = g_variant_n_children (parameters); + paramv = g_new0 (GValue, num_params + 1); + g_value_init (¶mv[0], GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN); + g_value_set_object (¶mv[0], proxy); + g_variant_iter_init (&iter, parameters); + n = 1; + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN); + g_signal_emitv (paramv, signal_id, 0, NULL); + for (n = 0; n < num_params + 1; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static void +gsignond_dbus_remote_plugin_proxy_g_properties_changed (GDBusProxy *_proxy, + GVariant *changed_properties, + const gchar *const *invalidated_properties) +{ + GSignondDbusRemotePluginProxy *proxy = GSIGNOND_DBUS_REMOTE_PLUGIN_PROXY (_proxy); + guint n; + const gchar *key; + GVariantIter *iter; + _ExtendedGDBusPropertyInfo *info; + g_variant_get (changed_properties, "a{sv}", &iter); + while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsignond_dbus_remote_plugin_interface_info, key); + g_datalist_remove_data (&proxy->priv->qdata, key); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } + g_variant_iter_free (iter); + for (n = 0; invalidated_properties[n] != NULL; n++) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsignond_dbus_remote_plugin_interface_info, invalidated_properties[n]); + g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } +} + +static void +gsignond_dbus_remote_plugin_proxy_init (GSignondDbusRemotePluginProxy *proxy) +{ + proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN_PROXY, GSignondDbusRemotePluginProxyPrivate); + g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), gsignond_dbus_remote_plugin_interface_info ()); +} + +static void +gsignond_dbus_remote_plugin_proxy_class_init (GSignondDbusRemotePluginProxyClass *klass) +{ + GObjectClass *gobject_class; + GDBusProxyClass *proxy_class; + + g_type_class_add_private (klass, sizeof (GSignondDbusRemotePluginProxyPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = gsignond_dbus_remote_plugin_proxy_finalize; + gobject_class->get_property = gsignond_dbus_remote_plugin_proxy_get_property; + gobject_class->set_property = gsignond_dbus_remote_plugin_proxy_set_property; + + proxy_class = G_DBUS_PROXY_CLASS (klass); + proxy_class->g_signal = gsignond_dbus_remote_plugin_proxy_g_signal; + proxy_class->g_properties_changed = gsignond_dbus_remote_plugin_proxy_g_properties_changed; + +} + +static void +gsignond_dbus_remote_plugin_proxy_iface_init (GSignondDbusRemotePluginIface *iface) +{ +} + +/** + * gsignond_dbus_remote_plugin_proxy_new: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin</link>. See g_dbus_proxy_new() for more details. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_remote_plugin_proxy_new_finish() to get the result of the operation. + * + * See gsignond_dbus_remote_plugin_proxy_new_sync() for the synchronous, blocking version of this constructor. + */ +void +gsignond_dbus_remote_plugin_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin", NULL); +} + +/** + * gsignond_dbus_remote_plugin_proxy_new_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_remote_plugin_proxy_new(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with gsignond_dbus_remote_plugin_proxy_new(). + * + * Returns: (transfer full) (type GSignondDbusRemotePluginProxy): The constructed proxy object or %NULL if @error is set. + */ +GSignondDbusRemotePlugin * +gsignond_dbus_remote_plugin_proxy_new_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return GSIGNOND_DBUS_REMOTE_PLUGIN (ret); + else + return NULL; +} + +/** + * gsignond_dbus_remote_plugin_proxy_new_sync: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin</link>. See g_dbus_proxy_new_sync() for more details. + * + * The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_remote_plugin_proxy_new() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type GSignondDbusRemotePluginProxy): The constructed proxy object or %NULL if @error is set. + */ +GSignondDbusRemotePlugin * +gsignond_dbus_remote_plugin_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin", NULL); + if (ret != NULL) + return GSIGNOND_DBUS_REMOTE_PLUGIN (ret); + else + return NULL; +} + + +/** + * gsignond_dbus_remote_plugin_proxy_new_for_bus: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Like gsignond_dbus_remote_plugin_proxy_new() but takes a #GBusType instead of a #GDBusConnection. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_remote_plugin_proxy_new_for_bus_finish() to get the result of the operation. + * + * See gsignond_dbus_remote_plugin_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. + */ +void +gsignond_dbus_remote_plugin_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin", NULL); +} + +/** + * gsignond_dbus_remote_plugin_proxy_new_for_bus_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_remote_plugin_proxy_new_for_bus(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with gsignond_dbus_remote_plugin_proxy_new_for_bus(). + * + * Returns: (transfer full) (type GSignondDbusRemotePluginProxy): The constructed proxy object or %NULL if @error is set. + */ +GSignondDbusRemotePlugin * +gsignond_dbus_remote_plugin_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return GSIGNOND_DBUS_REMOTE_PLUGIN (ret); + else + return NULL; +} + +/** + * gsignond_dbus_remote_plugin_proxy_new_for_bus_sync: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Like gsignond_dbus_remote_plugin_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. + * + * The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_remote_plugin_proxy_new_for_bus() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type GSignondDbusRemotePluginProxy): The constructed proxy object or %NULL if @error is set. + */ +GSignondDbusRemotePlugin * +gsignond_dbus_remote_plugin_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin", NULL); + if (ret != NULL) + return GSIGNOND_DBUS_REMOTE_PLUGIN (ret); + else + return NULL; +} + + +/* ------------------------------------------------------------------------ */ + +/** + * GSignondDbusRemotePluginSkeleton: + * + * The #GSignondDbusRemotePluginSkeleton structure contains only private data and should only be accessed using the provided API. + */ + +/** + * GSignondDbusRemotePluginSkeletonClass: + * @parent_class: The parent class. + * + * Class structure for #GSignondDbusRemotePluginSkeleton. + */ + +struct _GSignondDbusRemotePluginSkeletonPrivate +{ + GValue *properties; + GList *changed_properties; + GSource *changed_properties_idle_source; + GMainContext *context; + GMutex lock; +}; + +static void +_gsignond_dbus_remote_plugin_skeleton_handle_method_call ( + GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + GSignondDbusRemotePluginSkeleton *skeleton = GSIGNOND_DBUS_REMOTE_PLUGIN_SKELETON (user_data); + _ExtendedGDBusMethodInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint num_extra; + guint n; + guint signal_id; + GValue return_value = G_VALUE_INIT; + info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); + g_assert (info != NULL); + num_params = g_variant_n_children (parameters); + num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); + n = 0; + g_value_init (¶mv[n], GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN); + g_value_set_object (¶mv[n++], skeleton); + g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); + g_value_set_object (¶mv[n++], invocation); + if (info->pass_fdlist) + { +#ifdef G_OS_UNIX + g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); + g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); +#else + g_assert_not_reached (); +#endif + } + g_variant_iter_init (&iter, parameters); + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN); + g_value_init (&return_value, G_TYPE_BOOLEAN); + g_signal_emitv (paramv, signal_id, 0, &return_value); + if (!g_value_get_boolean (&return_value)) + g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); + g_value_unset (&return_value); + for (n = 0; n < num_params + num_extra; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static GVariant * +_gsignond_dbus_remote_plugin_skeleton_handle_get_property ( + GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GError **error, + gpointer user_data) +{ + GSignondDbusRemotePluginSkeleton *skeleton = GSIGNOND_DBUS_REMOTE_PLUGIN_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + GVariant *ret; + ret = NULL; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsignond_dbus_remote_plugin_interface_info, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + g_value_init (&value, pspec->value_type); + g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); + ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); + g_value_unset (&value); + } + return ret; +} + +static gboolean +_gsignond_dbus_remote_plugin_skeleton_handle_set_property ( + GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GVariant *variant, + GError **error, + gpointer user_data) +{ + GSignondDbusRemotePluginSkeleton *skeleton = GSIGNOND_DBUS_REMOTE_PLUGIN_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + gboolean ret; + ret = FALSE; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsignond_dbus_remote_plugin_interface_info, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + if (info->use_gvariant) + g_value_set_variant (&value, variant); + else + g_dbus_gvariant_to_gvalue (variant, &value); + g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); + g_value_unset (&value); + ret = TRUE; + } + return ret; +} + +static const GDBusInterfaceVTable _gsignond_dbus_remote_plugin_skeleton_vtable = +{ + _gsignond_dbus_remote_plugin_skeleton_handle_method_call, + _gsignond_dbus_remote_plugin_skeleton_handle_get_property, + _gsignond_dbus_remote_plugin_skeleton_handle_set_property +}; + +static GDBusInterfaceInfo * +gsignond_dbus_remote_plugin_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton) +{ + return gsignond_dbus_remote_plugin_interface_info (); +} + +static GDBusInterfaceVTable * +gsignond_dbus_remote_plugin_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton) +{ + return (GDBusInterfaceVTable *) &_gsignond_dbus_remote_plugin_skeleton_vtable; +} + +static GVariant * +gsignond_dbus_remote_plugin_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) +{ + GSignondDbusRemotePluginSkeleton *skeleton = GSIGNOND_DBUS_REMOTE_PLUGIN_SKELETON (_skeleton); + + GVariantBuilder builder; + guint n; + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + if (_gsignond_dbus_remote_plugin_interface_info.parent_struct.properties == NULL) + goto out; + for (n = 0; _gsignond_dbus_remote_plugin_interface_info.parent_struct.properties[n] != NULL; n++) + { + GDBusPropertyInfo *info = _gsignond_dbus_remote_plugin_interface_info.parent_struct.properties[n]; + if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) + { + GVariant *value; + value = _gsignond_dbus_remote_plugin_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin", info->name, NULL, skeleton); + if (value != NULL) + { + g_variant_take_ref (value); + g_variant_builder_add (&builder, "{sv}", info->name, value); + g_variant_unref (value); + } + } + } +out: + return g_variant_builder_end (&builder); +} + +static void +gsignond_dbus_remote_plugin_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) +{ +} + +static void +_gsignond_dbus_remote_plugin_on_signal_response ( + GSignondDbusRemotePlugin *object, + GVariant *arg_sessionData) +{ + GSignondDbusRemotePluginSkeleton *skeleton = GSIGNOND_DBUS_REMOTE_PLUGIN_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("(@a{sv})", + arg_sessionData)); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin", "response", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void +_gsignond_dbus_remote_plugin_on_signal_response_final ( + GSignondDbusRemotePlugin *object, + GVariant *arg_sessionData) +{ + GSignondDbusRemotePluginSkeleton *skeleton = GSIGNOND_DBUS_REMOTE_PLUGIN_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("(@a{sv})", + arg_sessionData)); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin", "responseFinal", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void +_gsignond_dbus_remote_plugin_on_signal_store ( + GSignondDbusRemotePlugin *object, + GVariant *arg_sessionData) +{ + GSignondDbusRemotePluginSkeleton *skeleton = GSIGNOND_DBUS_REMOTE_PLUGIN_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("(@a{sv})", + arg_sessionData)); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin", "store", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void +_gsignond_dbus_remote_plugin_on_signal_error ( + GSignondDbusRemotePlugin *object, + GVariant *arg_error) +{ + GSignondDbusRemotePluginSkeleton *skeleton = GSIGNOND_DBUS_REMOTE_PLUGIN_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("(@(uis))", + arg_error)); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin", "error", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void +_gsignond_dbus_remote_plugin_on_signal_user_action_required ( + GSignondDbusRemotePlugin *object, + GVariant *arg_uiData) +{ + GSignondDbusRemotePluginSkeleton *skeleton = GSIGNOND_DBUS_REMOTE_PLUGIN_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("(@a{sv})", + arg_uiData)); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin", "userActionRequired", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void +_gsignond_dbus_remote_plugin_on_signal_refreshed ( + GSignondDbusRemotePlugin *object, + GVariant *arg_uiData) +{ + GSignondDbusRemotePluginSkeleton *skeleton = GSIGNOND_DBUS_REMOTE_PLUGIN_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("(@a{sv})", + arg_uiData)); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin", "refreshed", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void +_gsignond_dbus_remote_plugin_on_signal_status_changed ( + GSignondDbusRemotePlugin *object, + gint arg_state, + const gchar *arg_message) +{ + GSignondDbusRemotePluginSkeleton *skeleton = GSIGNOND_DBUS_REMOTE_PLUGIN_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("(is)", + arg_state, + arg_message)); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin", "statusChanged", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void gsignond_dbus_remote_plugin_skeleton_iface_init (GSignondDbusRemotePluginIface *iface); +G_DEFINE_TYPE_WITH_CODE (GSignondDbusRemotePluginSkeleton, gsignond_dbus_remote_plugin_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_IMPLEMENT_INTERFACE (GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN, gsignond_dbus_remote_plugin_skeleton_iface_init)); + +static void +gsignond_dbus_remote_plugin_skeleton_finalize (GObject *object) +{ + GSignondDbusRemotePluginSkeleton *skeleton = GSIGNOND_DBUS_REMOTE_PLUGIN_SKELETON (object); + g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); + if (skeleton->priv->changed_properties_idle_source != NULL) + g_source_destroy (skeleton->priv->changed_properties_idle_source); + g_main_context_unref (skeleton->priv->context); + g_mutex_clear (&skeleton->priv->lock); + G_OBJECT_CLASS (gsignond_dbus_remote_plugin_skeleton_parent_class)->finalize (object); +} + +static void +gsignond_dbus_remote_plugin_skeleton_init (GSignondDbusRemotePluginSkeleton *skeleton) +{ + skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN_SKELETON, GSignondDbusRemotePluginSkeletonPrivate); + g_mutex_init (&skeleton->priv->lock); + skeleton->priv->context = g_main_context_ref_thread_default (); +} + +static void +gsignond_dbus_remote_plugin_skeleton_class_init (GSignondDbusRemotePluginSkeletonClass *klass) +{ + GObjectClass *gobject_class; + GDBusInterfaceSkeletonClass *skeleton_class; + + g_type_class_add_private (klass, sizeof (GSignondDbusRemotePluginSkeletonPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = gsignond_dbus_remote_plugin_skeleton_finalize; + + skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); + skeleton_class->get_info = gsignond_dbus_remote_plugin_skeleton_dbus_interface_get_info; + skeleton_class->get_properties = gsignond_dbus_remote_plugin_skeleton_dbus_interface_get_properties; + skeleton_class->flush = gsignond_dbus_remote_plugin_skeleton_dbus_interface_flush; + skeleton_class->get_vtable = gsignond_dbus_remote_plugin_skeleton_dbus_interface_get_vtable; +} + +static void +gsignond_dbus_remote_plugin_skeleton_iface_init (GSignondDbusRemotePluginIface *iface) +{ + iface->response = _gsignond_dbus_remote_plugin_on_signal_response; + iface->response_final = _gsignond_dbus_remote_plugin_on_signal_response_final; + iface->store = _gsignond_dbus_remote_plugin_on_signal_store; + iface->error = _gsignond_dbus_remote_plugin_on_signal_error; + iface->user_action_required = _gsignond_dbus_remote_plugin_on_signal_user_action_required; + iface->refreshed = _gsignond_dbus_remote_plugin_on_signal_refreshed; + iface->status_changed = _gsignond_dbus_remote_plugin_on_signal_status_changed; +} + +/** + * gsignond_dbus_remote_plugin_skeleton_new: + * + * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-com-google-code-AccountsSSO-gSingleSignOn-RemotePlugin.top_of_page">com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin</link>. + * + * Returns: (transfer full) (type GSignondDbusRemotePluginSkeleton): The skeleton object. + */ +GSignondDbusRemotePlugin * +gsignond_dbus_remote_plugin_skeleton_new (void) +{ + return GSIGNOND_DBUS_REMOTE_PLUGIN (g_object_new (GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN_SKELETON, NULL)); +} + diff --git a/src/daemon/dbus/gsignond-dbus-remote-plugin-gen.h b/src/daemon/dbus/gsignond-dbus-remote-plugin-gen.h new file mode 100644 index 0000000..f704b0a --- /dev/null +++ b/src/daemon/dbus/gsignond-dbus-remote-plugin-gen.h @@ -0,0 +1,370 @@ +/* + * Generated by gdbus-codegen 2.32.3. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifndef __GSIGNOND_DBUS_REMOTE_PLUGIN_GEN_H__ +#define __GSIGNOND_DBUS_REMOTE_PLUGIN_GEN_H__ + +#include <gio/gio.h> + +G_BEGIN_DECLS + + +/* ------------------------------------------------------------------------ */ +/* Declarations for com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin */ + +#define GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN (gsignond_dbus_remote_plugin_get_type ()) +#define GSIGNOND_DBUS_REMOTE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN, GSignondDbusRemotePlugin)) +#define GSIGNOND_DBUS_IS_REMOTE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN)) +#define GSIGNOND_DBUS_REMOTE_PLUGIN_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN, GSignondDbusRemotePluginIface)) + +struct _GSignondDbusRemotePlugin; +typedef struct _GSignondDbusRemotePlugin GSignondDbusRemotePlugin; +typedef struct _GSignondDbusRemotePluginIface GSignondDbusRemotePluginIface; + +struct _GSignondDbusRemotePluginIface +{ + GTypeInterface parent_iface; + + + gboolean (*handle_cancel) ( + GSignondDbusRemotePlugin *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_get_info) ( + GSignondDbusRemotePlugin *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_refresh) ( + GSignondDbusRemotePlugin *object, + GDBusMethodInvocation *invocation, + GVariant *arg_uiData); + + gboolean (*handle_request) ( + GSignondDbusRemotePlugin *object, + GDBusMethodInvocation *invocation, + GVariant *arg_sessionData); + + gboolean (*handle_request_initial) ( + GSignondDbusRemotePlugin *object, + GDBusMethodInvocation *invocation, + GVariant *arg_sessionData, + const gchar *arg_mechanism); + + gboolean (*handle_user_action_finished) ( + GSignondDbusRemotePlugin *object, + GDBusMethodInvocation *invocation, + GVariant *arg_uiData); + + void (*error) ( + GSignondDbusRemotePlugin *object, + GVariant *arg_error); + + void (*refreshed) ( + GSignondDbusRemotePlugin *object, + GVariant *arg_uiData); + + void (*response) ( + GSignondDbusRemotePlugin *object, + GVariant *arg_sessionData); + + void (*response_final) ( + GSignondDbusRemotePlugin *object, + GVariant *arg_sessionData); + + void (*status_changed) ( + GSignondDbusRemotePlugin *object, + gint arg_state, + const gchar *arg_message); + + void (*store) ( + GSignondDbusRemotePlugin *object, + GVariant *arg_sessionData); + + void (*user_action_required) ( + GSignondDbusRemotePlugin *object, + GVariant *arg_uiData); + +}; + +GType gsignond_dbus_remote_plugin_get_type (void) G_GNUC_CONST; + +GDBusInterfaceInfo *gsignond_dbus_remote_plugin_interface_info (void); +guint gsignond_dbus_remote_plugin_override_properties (GObjectClass *klass, guint property_id_begin); + + +/* D-Bus method call completion functions: */ +void gsignond_dbus_remote_plugin_complete_cancel ( + GSignondDbusRemotePlugin *object, + GDBusMethodInvocation *invocation); + +void gsignond_dbus_remote_plugin_complete_request_initial ( + GSignondDbusRemotePlugin *object, + GDBusMethodInvocation *invocation); + +void gsignond_dbus_remote_plugin_complete_request ( + GSignondDbusRemotePlugin *object, + GDBusMethodInvocation *invocation); + +void gsignond_dbus_remote_plugin_complete_user_action_finished ( + GSignondDbusRemotePlugin *object, + GDBusMethodInvocation *invocation); + +void gsignond_dbus_remote_plugin_complete_refresh ( + GSignondDbusRemotePlugin *object, + GDBusMethodInvocation *invocation); + +void gsignond_dbus_remote_plugin_complete_get_info ( + GSignondDbusRemotePlugin *object, + GDBusMethodInvocation *invocation, + const gchar *type, + const gchar *const *mechanisms); + + + +/* D-Bus signal emissions functions: */ +void gsignond_dbus_remote_plugin_emit_response ( + GSignondDbusRemotePlugin *object, + GVariant *arg_sessionData); + +void gsignond_dbus_remote_plugin_emit_response_final ( + GSignondDbusRemotePlugin *object, + GVariant *arg_sessionData); + +void gsignond_dbus_remote_plugin_emit_store ( + GSignondDbusRemotePlugin *object, + GVariant *arg_sessionData); + +void gsignond_dbus_remote_plugin_emit_error ( + GSignondDbusRemotePlugin *object, + GVariant *arg_error); + +void gsignond_dbus_remote_plugin_emit_user_action_required ( + GSignondDbusRemotePlugin *object, + GVariant *arg_uiData); + +void gsignond_dbus_remote_plugin_emit_refreshed ( + GSignondDbusRemotePlugin *object, + GVariant *arg_uiData); + +void gsignond_dbus_remote_plugin_emit_status_changed ( + GSignondDbusRemotePlugin *object, + gint arg_state, + const gchar *arg_message); + + + +/* D-Bus method calls: */ +void gsignond_dbus_remote_plugin_call_cancel ( + GSignondDbusRemotePlugin *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_remote_plugin_call_cancel_finish ( + GSignondDbusRemotePlugin *proxy, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_remote_plugin_call_cancel_sync ( + GSignondDbusRemotePlugin *proxy, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_remote_plugin_call_request_initial ( + GSignondDbusRemotePlugin *proxy, + GVariant *arg_sessionData, + const gchar *arg_mechanism, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_remote_plugin_call_request_initial_finish ( + GSignondDbusRemotePlugin *proxy, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_remote_plugin_call_request_initial_sync ( + GSignondDbusRemotePlugin *proxy, + GVariant *arg_sessionData, + const gchar *arg_mechanism, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_remote_plugin_call_request ( + GSignondDbusRemotePlugin *proxy, + GVariant *arg_sessionData, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_remote_plugin_call_request_finish ( + GSignondDbusRemotePlugin *proxy, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_remote_plugin_call_request_sync ( + GSignondDbusRemotePlugin *proxy, + GVariant *arg_sessionData, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_remote_plugin_call_user_action_finished ( + GSignondDbusRemotePlugin *proxy, + GVariant *arg_uiData, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_remote_plugin_call_user_action_finished_finish ( + GSignondDbusRemotePlugin *proxy, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_remote_plugin_call_user_action_finished_sync ( + GSignondDbusRemotePlugin *proxy, + GVariant *arg_uiData, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_remote_plugin_call_refresh ( + GSignondDbusRemotePlugin *proxy, + GVariant *arg_uiData, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_remote_plugin_call_refresh_finish ( + GSignondDbusRemotePlugin *proxy, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_remote_plugin_call_refresh_sync ( + GSignondDbusRemotePlugin *proxy, + GVariant *arg_uiData, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_remote_plugin_call_get_info ( + GSignondDbusRemotePlugin *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_remote_plugin_call_get_info_finish ( + GSignondDbusRemotePlugin *proxy, + gchar **out_type, + gchar ***out_mechanisms, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_remote_plugin_call_get_info_sync ( + GSignondDbusRemotePlugin *proxy, + gchar **out_type, + gchar ***out_mechanisms, + GCancellable *cancellable, + GError **error); + + + +/* ---- */ + +#define GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN_PROXY (gsignond_dbus_remote_plugin_proxy_get_type ()) +#define GSIGNOND_DBUS_REMOTE_PLUGIN_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN_PROXY, GSignondDbusRemotePluginProxy)) +#define GSIGNOND_DBUS_REMOTE_PLUGIN_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN_PROXY, GSignondDbusRemotePluginProxyClass)) +#define GSIGNOND_DBUS_REMOTE_PLUGIN_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN_PROXY, GSignondDbusRemotePluginProxyClass)) +#define GSIGNOND_DBUS_IS_REMOTE_PLUGIN_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN_PROXY)) +#define GSIGNOND_DBUS_IS_REMOTE_PLUGIN_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN_PROXY)) + +typedef struct _GSignondDbusRemotePluginProxy GSignondDbusRemotePluginProxy; +typedef struct _GSignondDbusRemotePluginProxyClass GSignondDbusRemotePluginProxyClass; +typedef struct _GSignondDbusRemotePluginProxyPrivate GSignondDbusRemotePluginProxyPrivate; + +struct _GSignondDbusRemotePluginProxy +{ + /*< private >*/ + GDBusProxy parent_instance; + GSignondDbusRemotePluginProxyPrivate *priv; +}; + +struct _GSignondDbusRemotePluginProxyClass +{ + GDBusProxyClass parent_class; +}; + +GType gsignond_dbus_remote_plugin_proxy_get_type (void) G_GNUC_CONST; + +void gsignond_dbus_remote_plugin_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +GSignondDbusRemotePlugin *gsignond_dbus_remote_plugin_proxy_new_finish ( + GAsyncResult *res, + GError **error); +GSignondDbusRemotePlugin *gsignond_dbus_remote_plugin_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_remote_plugin_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +GSignondDbusRemotePlugin *gsignond_dbus_remote_plugin_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error); +GSignondDbusRemotePlugin *gsignond_dbus_remote_plugin_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + + +/* ---- */ + +#define GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN_SKELETON (gsignond_dbus_remote_plugin_skeleton_get_type ()) +#define GSIGNOND_DBUS_REMOTE_PLUGIN_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN_SKELETON, GSignondDbusRemotePluginSkeleton)) +#define GSIGNOND_DBUS_REMOTE_PLUGIN_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN_SKELETON, GSignondDbusRemotePluginSkeletonClass)) +#define GSIGNOND_DBUS_REMOTE_PLUGIN_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN_SKELETON, GSignondDbusRemotePluginSkeletonClass)) +#define GSIGNOND_DBUS_IS_REMOTE_PLUGIN_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN_SKELETON)) +#define GSIGNOND_DBUS_IS_REMOTE_PLUGIN_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSIGNOND_DBUS_TYPE_REMOTE_PLUGIN_SKELETON)) + +typedef struct _GSignondDbusRemotePluginSkeleton GSignondDbusRemotePluginSkeleton; +typedef struct _GSignondDbusRemotePluginSkeletonClass GSignondDbusRemotePluginSkeletonClass; +typedef struct _GSignondDbusRemotePluginSkeletonPrivate GSignondDbusRemotePluginSkeletonPrivate; + +struct _GSignondDbusRemotePluginSkeleton +{ + /*< private >*/ + GDBusInterfaceSkeleton parent_instance; + GSignondDbusRemotePluginSkeletonPrivate *priv; +}; + +struct _GSignondDbusRemotePluginSkeletonClass +{ + GDBusInterfaceSkeletonClass parent_class; +}; + +GType gsignond_dbus_remote_plugin_skeleton_get_type (void) G_GNUC_CONST; + +GSignondDbusRemotePlugin *gsignond_dbus_remote_plugin_skeleton_new (void); + + +G_END_DECLS + +#endif /* __GSIGNOND_DBUS_REMOTE_PLUGIN_GEN_H__ */ diff --git a/src/daemon/dbus/gsignond-dbus-server.c b/src/daemon/dbus/gsignond-dbus-server.c new file mode 100644 index 0000000..b5d2b1d --- /dev/null +++ b/src/daemon/dbus/gsignond-dbus-server.c @@ -0,0 +1,411 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2012 Intel Corporation. + * + * Contact: Amarnath Valluri <amarnath.valluri@linux.intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ +#include <errno.h> +#include <string.h> +#include <glib/gstdio.h> + +#include "config.h" + +#include "gsignond-dbus-server.h" +#include "gsignond-dbus-auth-service-adapter.h" +#include "gsignond-dbus.h" +#include "gsignond/gsignond-log.h" +#include <daemon/gsignond-daemon.h> + +enum +{ + PROP_0, + + PROP_ADDRESS, + N_PROPERTIES +}; + +static GParamSpec *properties[N_PROPERTIES]; + +struct _GSignondDbusServerPrivate +{ + GSignondDaemon *daemon; + GHashTable *auth_services; +#ifdef USE_P2P + GDBusServer *bus_server; + gchar *address; +#else + guint name_owner_id; +#endif +}; + +G_DEFINE_TYPE (GSignondDbusServer, gsignond_dbus_server, G_TYPE_OBJECT) + + +#define GSIGNOND_DBUS_SERVER_GET_PRIV(obj) \ + G_TYPE_INSTANCE_GET_PRIVATE ((obj), GSIGNOND_TYPE_DBUS_SERVER, GSignondDbusServerPrivate) + +#ifdef USE_P2P +static void _on_connection_closed (GDBusConnection *connection, + gboolean remote_peer_vanished, + GError *error, + gpointer user_data); +#endif + +static void +_set_property (GObject *object, + guint property_id, + const GValue *value, GParamSpec *pspec) +{ + GSignondDbusServer *self = GSIGNOND_DBUS_SERVER (object); + + switch (property_id) { + case PROP_ADDRESS: { +#ifdef USE_P2P + self->priv->address = g_value_dup_string (value); +#else + (void)self; +#endif + break; + } + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } +} + +static void +_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + GSignondDbusServer *self = GSIGNOND_DBUS_SERVER (object); + + switch (property_id) { + case PROP_ADDRESS: { +#ifdef USE_P2P + g_value_set_string (value, g_dbus_server_get_client_address ( + self->priv->bus_server)); +#else + (void) self; + g_value_set_string (value, NULL); +#endif + break; + } + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } +} + +#ifdef USE_P2P +static void +_clear_connection (gpointer connection, gpointer value, gpointer userdata) +{ + (void) value; + g_signal_handlers_disconnect_by_func (connection, _on_connection_closed, userdata); +} +#endif + +static void +_dispose (GObject *object) +{ + GSignondDbusServer *self = GSIGNOND_DBUS_SERVER (object); + + if (self->priv->auth_services) { +#ifdef USE_P2P + g_hash_table_foreach (self->priv->auth_services, _clear_connection, self); +#endif + g_hash_table_unref (self->priv->auth_services); + self->priv->auth_services = NULL; + } +#ifdef USE_P2P + if (self->priv->bus_server) { + if (g_dbus_server_is_active (self->priv->bus_server)) + g_dbus_server_stop (self->priv->bus_server); + g_object_unref (self->priv->bus_server); + self->priv->bus_server = NULL; + } +#else + if (self->priv->name_owner_id) { + g_bus_unown_name (self->priv->name_owner_id); + self->priv->name_owner_id = 0; + } +#endif + + if (self->priv->daemon) { + g_object_unref (self->priv->daemon); + self->priv->daemon = NULL; + } + + G_OBJECT_CLASS (gsignond_dbus_server_parent_class)->dispose (object); +} + +static void +_finalize (GObject *object) +{ +#ifdef USE_P2P + GSignondDbusServer *self = GSIGNOND_DBUS_SERVER (object); + if (self->priv->address && g_str_has_prefix (self->priv->address, "unix:path=")) { + const gchar *path = g_strstr_len(self->priv->address, -1, "unix:path=") + 10; + if (path) { + g_unlink (path); + } + g_free (self->priv->address); + self->priv->address = NULL; + } +#endif + G_OBJECT_CLASS (gsignond_dbus_server_parent_class)->finalize (object); +} + +static void +gsignond_dbus_server_class_init (GSignondDbusServerClass *klass) +{ + GObjectClass* object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (GSignondDbusServerPrivate)); + + object_class->get_property = _get_property; + object_class->set_property = _set_property; + object_class->dispose = _dispose; + object_class->finalize = _finalize; + + properties[PROP_ADDRESS] = g_param_spec_string ("address", + "server address", + "Server socket address", + NULL, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS); + + g_object_class_install_properties (object_class, N_PROPERTIES, properties); +} + +static void +gsignond_dbus_server_init (GSignondDbusServer *self) +{ + self->priv = GSIGNOND_DBUS_SERVER_GET_PRIV(self); +#ifdef USE_P2P + self->priv->bus_server = NULL; + self->priv->address = NULL; +#else + self->priv->name_owner_id = 0; +#endif + self->priv->daemon = gsignond_daemon_new (); + self->priv->auth_services = g_hash_table_new_full ( + g_direct_hash, g_direct_equal, NULL, g_object_unref); +} + +const gchar * +gsignond_dbus_server_get_address (GSignondDbusServer *server) +{ + g_return_val_if_fail (server || GSIGNOND_IS_DBUS_SERVER (server), NULL); +#ifdef USE_P2P + return g_dbus_server_get_client_address (server->priv->bus_server); +#else + return NULL; +#endif +} + +static gboolean +_compare_auth_service_by_pointer (gpointer key, gpointer value, gpointer dead_object) +{ + return value == dead_object; +} + +#ifdef USE_P2P +static void +_on_connection_closed (GDBusConnection *connection, + gboolean remote_peer_vanished, + GError *error, + gpointer user_data) +{ + GSignondDbusServer *server = GSIGNOND_DBUS_SERVER (user_data); + + g_signal_handlers_disconnect_by_func (connection, _on_connection_closed, user_data); + DBG("dbus connection(%p) closed (peer vanished : %d)", connection, remote_peer_vanished); + if (error) { + DBG("...reason : %s", error->message); + } + g_hash_table_remove (server->priv->auth_services, connection); +} +#else + +static gboolean +_close_server (gpointer data) +{ + g_object_unref (data); + return FALSE; +} +#endif + +static void +_on_auth_service_dispose (gpointer data, GObject *dead_service) +{ + GSignondDbusServer *server = GSIGNOND_DBUS_SERVER (data); + + g_return_if_fail (server); + + g_hash_table_foreach_steal (server->priv->auth_services, + _compare_auth_service_by_pointer, dead_service); +#ifndef USE_P2P + /* close server if using message bus */ + if (g_hash_table_size(server->priv->auth_services) == 0) + g_idle_add (_close_server, data); +#endif +} + +void +gsignond_dbus_server_start_auth_service (GSignondDbusServer *server, GDBusConnection *connection) +{ + GSignondDbusAuthServiceAdapter *auth_service = NULL; + + DBG("Starting authentication service on connection %p", connection); + + auth_service = gsignond_dbus_auth_service_adapter_new_with_connection ( + g_object_ref (connection), g_object_ref (server->priv->daemon)); + + g_hash_table_insert (server->priv->auth_services, connection, auth_service); +#ifdef USE_P2P + g_signal_connect (connection, "closed", G_CALLBACK(_on_connection_closed), server); +#endif + g_object_weak_ref (G_OBJECT (auth_service), _on_auth_service_dispose, server); +} + +#ifdef USE_P2P +static gboolean +_on_client_request (GDBusServer *dbus_server, GDBusConnection *connection, gpointer userdata) +{ + GSignondDbusServer *server = GSIGNOND_DBUS_SERVER(userdata); + + if (!server) { + ERR ("memory corruption"); + return TRUE; + } + + gsignond_dbus_server_start_auth_service (server, connection); + + return TRUE; +} + +GSignondDbusServer * gsignond_dbus_server_new_with_address (const gchar *address) +{ + GError *err = NULL; + gchar *guid = 0; + const gchar *file_path = NULL; + GSignondDbusServer *server = GSIGNOND_DBUS_SERVER ( + g_object_new (GSIGNOND_TYPE_DBUS_SERVER, "address", address, NULL)); + + if (!server) return NULL; + + if (g_str_has_prefix(address, "unix:path=")) { + file_path = g_strstr_len (address, -1, "unix:path=") + 10; + + if (g_file_test(file_path, G_FILE_TEST_EXISTS)) { + g_unlink (file_path); + } + else { + gchar *base_path = g_path_get_dirname (file_path); + if (g_mkdir_with_parents (base_path, S_IRUSR | S_IWUSR | S_IXUSR) == -1) { + WARN ("Could not create '%s', error: %s", base_path, strerror(errno)); + } + g_free (base_path); + } + } + + guid = g_dbus_generate_guid (); + + server->priv->bus_server = g_dbus_server_new_sync (server->priv->address, + G_DBUS_SERVER_FLAGS_NONE, guid, NULL, NULL, &err); + + g_free (guid); + + if (!server->priv->bus_server) { + ERR ("failed to start server at address '%s':%s", server->priv->address, + err->message); + g_error_free (err); + + g_object_unref (server); + + return NULL; + } + + g_signal_connect (server->priv->bus_server, "new-connection", G_CALLBACK(_on_client_request), server); + + g_dbus_server_start (server->priv->bus_server); + + if (file_path) + g_chmod (file_path, S_IRUSR | S_IWUSR); + + return server; +} + +GSignondDbusServer * gsignond_dbus_server_new () { + GSignondDbusServer *server = NULL; + gchar *address = g_strdup_printf (GSIGNOND_DBUS_ADDRESS, g_get_user_runtime_dir()); + + server = gsignond_dbus_server_new_with_address (address); + g_free (address); + + return server ; +} +#else + +static void +_on_bus_acquired (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ + INFO ("bus aquired on connection '%p'", connection); +} + +static void +_on_name_lost (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ + INFO ("Lost (or failed to acquire) the name '%s' on the on bus connection '%p'", name, connection); + if (user_data) g_object_unref (G_OBJECT (user_data)); +} + +static void +_on_name_acquired (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ + GSignondDbusServer *server = GSIGNOND_DBUS_SERVER (user_data); + INFO ("Acquired the name %s on connection '%p'", name, connection); + gsignond_dbus_server_start_auth_service (server, connection); +} + +GSignondDbusServer * gsignond_dbus_server_new () { + GSignondDbusServer *server = GSIGNOND_DBUS_SERVER ( + g_object_new (GSIGNOND_TYPE_DBUS_SERVER, NULL)); + + server->priv->name_owner_id = g_bus_own_name (GSIGNOND_BUS_TYPE, + GSIGNOND_SERVICE, + G_BUS_NAME_OWNER_FLAGS_REPLACE, + _on_bus_acquired, + _on_name_acquired, + _on_name_lost, + server, NULL); + + return server; +} +#endif diff --git a/src/daemon/dbus/gsignond-dbus-server.h b/src/daemon/dbus/gsignond-dbus-server.h new file mode 100644 index 0000000..d8e4d52 --- /dev/null +++ b/src/daemon/dbus/gsignond-dbus-server.h @@ -0,0 +1,70 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2012 Intel Corporation. + * + * Contact: Amarnath Valluri <amarnath.valluri@linux.intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#ifndef __GSIGNOND_DBUS_SERVER_H_ +#define __GSIGNOND_DBUS_SERVER_H_ + +#include <config.h> +#include <glib.h> +#include <glib-object.h> + +G_BEGIN_DECLS + +#define GSIGNOND_TYPE_DBUS_SERVER (gsignond_dbus_server_get_type()) +#define GSIGNOND_DBUS_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GSIGNOND_TYPE_DBUS_SERVER, GSignondDbusServer)) +#define GSIGNOND_DBUS_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GSIGNOND_TYPE_DBUS_SERVER, GSignondDbusServerClass)) +#define GSIGNOND_IS_DBUS_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GSIGNOND_TYPE_DBUS_SERVER)) +#define GSIGNOND_IS_DBUS_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GSIGNOND_TYPE_DBUS_SERVER)) +#define GSIGNOND_DBUS_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GSIGNOND_TYPE_DBUS_SERVER, GSignondDbusServerClass)) + +typedef struct _GSignondDbusServer GSignondDbusServer; +typedef struct _GSignondDbusServerClass GSignondDbusServerClass; +typedef struct _GSignondDbusServerPrivate GSignondDbusServerPrivate; + +struct _GSignondDbusServer +{ + GObject parent; + + /* priv */ + GSignondDbusServerPrivate *priv; +}; + +struct _GSignondDbusServerClass +{ + GObjectClass parent_class; +}; + +GType gsignond_dbus_server_get_type(); + +#ifdef USE_P2P +GSignondDbusServer * gsignond_dbus_server_new_with_address (const gchar *address); + +const gchar * +gsignond_dbus_server_get_address (GSignondDbusServer *server) G_GNUC_CONST; + +#endif +GSignondDbusServer * gsignond_dbus_server_new (); + +#endif /* __GSIGNOND_DBUS_SERVER_H_ */ diff --git a/src/daemon/dbus/gsignond-dbus-signonui-adapter.c b/src/daemon/dbus/gsignond-dbus-signonui-adapter.c new file mode 100644 index 0000000..db3398f --- /dev/null +++ b/src/daemon/dbus/gsignond-dbus-signonui-adapter.c @@ -0,0 +1,297 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2013 Intel Corporation. + * + * Contact: Amarnath Valluri <amarnath.valluri@linux.intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#include "gsignond-dbus-signonui-adapter.h" +#include "gsignond-dbus-signonui-gen.h" +#include "gsignond/gsignond-log.h" +#include "gsignond-dbus.h" + +struct _GSignondDbusSignonuiAdapterPrivate +{ + GDBusConnection *connection; + GSignondDbusSinglesignonui *proxy; +}; + +G_DEFINE_TYPE (GSignondDbusSignonuiAdapter, gsignond_dbus_signonui_adapter, G_TYPE_OBJECT) + +enum { + SIG_REFRESH, + SIG_MAX +}; + +static guint _signals[SIG_MAX]; + +#define GSIGNOND_DBUS_SIGNONUI_ADAPTER_GET_PRIV(obj) \ + G_TYPE_INSTANCE_GET_PRIVATE ((obj), GSIGNOND_TYPE_DBUS_SIGNONUI_ADAPTER, GSignondDbusSignonuiAdapterPrivate) + +typedef struct +{ + GSignondDbusSignonuiAdapter *adapter; + gpointer cb; + gpointer data; +} _SignonuiDbusInfo; + +static void +_dispose (GObject *object) +{ + GSignondDbusSignonuiAdapter *self = GSIGNOND_DBUS_SIGNONUI_ADAPTER (object); + + if (self->priv->connection) { + g_object_unref (self->priv->connection); + self->priv->connection = NULL; + } + + if (self->priv->proxy) { + g_object_unref (self->priv->proxy); + self->priv->proxy = NULL; + } + + G_OBJECT_CLASS (gsignond_dbus_signonui_adapter_parent_class)->dispose (object); +} + +static void +_finalize (GObject *object) +{ + G_OBJECT_CLASS (gsignond_dbus_signonui_adapter_parent_class)->finalize (object); +} + +static void +gsignond_dbus_signonui_adapter_class_init (GSignondDbusSignonuiAdapterClass *klass) +{ + GObjectClass* object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (GSignondDbusSignonuiAdapterPrivate)); + + object_class->dispose = _dispose; + object_class->finalize = _finalize; + + _signals[SIG_REFRESH] = g_signal_new ("refresh", + GSIGNOND_TYPE_DBUS_SIGNONUI_ADAPTER, + G_SIGNAL_RUN_LAST, + 0, + NULL, + NULL, + NULL, + G_TYPE_NONE, + 1, G_TYPE_STRING); +} + +static void +gsignond_dbus_signonui_adapter_init (GSignondDbusSignonuiAdapter *self) +{ + self->priv = GSIGNOND_DBUS_SIGNONUI_ADAPTER_GET_PRIV(self); + self->priv->connection = 0; + self->priv->proxy = 0; +} + +static void +_on_query_dialog_ready (GObject *proxy, GAsyncResult *res, gpointer user_data) +{ + GError *error = NULL; + GVariant *out_params = NULL; + _SignonuiDbusInfo *info = (_SignonuiDbusInfo *)user_data; + + gsignond_dbus_singlesignonui_call_query_dialog_finish ( + GSIGNOND_DBUS_SINGLESIGNONUI (proxy), &out_params, res, &error); + + if (!info) { + ERR ("Memory curropted"); + return; + } + + if (info->cb) { + ((GSignondDbusSignonuiQueryDialogCb)info->cb) (out_params, error, info->data); + g_object_unref (info->adapter); + g_free (info); + } + else { + if (error) g_error_free (error); + if (out_params) g_variant_unref (out_params); + } +} + +gboolean +gsignond_dbus_signonui_adapter_query_dialog (GSignondDbusSignonuiAdapter *adapter, + GVariant *params, + const GSignondDbusSignonuiQueryDialogCb callback, + gpointer user_data) +{ + if (!adapter || !GSIGNOND_IS_DBUS_SIGNONUI_ADAPTER (adapter)) { + WARN ("assert (!adapter ||!GSIGNOND_IS_DBUS_SIGNONUI_ADAPTER (adapter)) failed"); + return FALSE; + } + _SignonuiDbusInfo *info = g_new0 (_SignonuiDbusInfo, 1); + + info->adapter = g_object_ref (adapter); + info->cb = callback; + info->data = user_data; + gsignond_dbus_singlesignonui_call_query_dialog (adapter->priv->proxy, params, NULL, + _on_query_dialog_ready, (gpointer)info); + + return TRUE; +} + +static void +_on_refresh_dialog_ready (GObject *proxy, GAsyncResult *res, gpointer user_data) +{ + GError *error = NULL; + _SignonuiDbusInfo *info = (_SignonuiDbusInfo *)user_data; + + gsignond_dbus_singlesignonui_call_refresh_dialog_finish ( + GSIGNOND_DBUS_SINGLESIGNONUI (proxy), res, &error); + + if (!info) { + ERR ("Memory curropted"); + g_error_free (error); + return; + } + + if (info->cb) { + ((GSignondDbusSignonuiRefreshDialogCb)info->cb) (error, info->data); + g_object_unref (info->adapter); + g_free (info); + } + else if (error) g_error_free (error); +} + +gboolean +gsignond_dbus_signonui_adapter_refresh_dialog (GSignondDbusSignonuiAdapter *adapter, + GVariant *params, + const GSignondDbusSignonuiRefreshDialogCb callback, + gpointer user_data) +{ + if (!adapter || !GSIGNOND_IS_DBUS_SIGNONUI_ADAPTER (adapter)) { + WARN ("assert (!adapter ||!GSIGNOND_IS_DBUS_SIGNONUI_ADAPTER (adapter)) failed"); + return FALSE; + } + _SignonuiDbusInfo *info = g_new0 (_SignonuiDbusInfo, 1); + + info->adapter = g_object_ref (adapter); + info->cb = callback; + info->data = user_data; + gsignond_dbus_singlesignonui_call_refresh_dialog (adapter->priv->proxy, params, NULL, + _on_refresh_dialog_ready, (gpointer)info); + + return TRUE; +} + +static void +_on_cancel_request_ready (GObject *proxy, GAsyncResult *res, gpointer user_data) +{ + GError *error = NULL; + _SignonuiDbusInfo *info = (_SignonuiDbusInfo *)user_data; + + gsignond_dbus_singlesignonui_call_cancel_ui_request_finish ( + GSIGNOND_DBUS_SINGLESIGNONUI (proxy), res, &error); + + if (!info) { + ERR ("Memory curropted"); + g_error_free (error); + return; + } + + if (info->cb) { + ((GSignondDbusSignonuiCancelRequestCb)info->cb) (error, info->data); + g_object_unref (info->adapter); + g_free (info); + } + else if (error) g_error_free (error); +} + +gboolean +gsignond_dbus_signonui_adapter_cancel_request (GSignondDbusSignonuiAdapter *adapter, + const gchar *request_id, + const GSignondDbusSignonuiCancelRequestCb callback, + gpointer user_data) +{ + if (!adapter || !GSIGNOND_IS_DBUS_SIGNONUI_ADAPTER (adapter)) { + WARN ("assert (!adapter ||!GSIGNOND_IS_DBUS_SIGNONUI_ADAPTER (adapter)) failed"); + return FALSE; + } + _SignonuiDbusInfo *info = g_new0 (_SignonuiDbusInfo, 1); + + info->adapter = g_object_ref (adapter); + info->cb = callback; + info->data = user_data; + gsignond_dbus_singlesignonui_call_cancel_ui_request (adapter->priv->proxy, request_id, NULL, + _on_cancel_request_ready, (gpointer)info); + + return TRUE; +} + +static void +_on_refresh_request (GSignondDbusSignonuiAdapter *proxy, gchar *request_id, gpointer userdata) +{ + GSignondDbusSignonuiAdapter *adapter = GSIGNOND_DBUS_SIGNONUI_ADAPTER (userdata); + + if (!adapter) { + ERR ("DBus-Error: memroy curroption"); + return; + } + + g_signal_emit (adapter, _signals[SIG_REFRESH], 0, request_id); +} + +/** + * gsignond_dbus_signonui_adapter_new: + * + * Creates new instance of #GSignondDbusSignonuiAdapter + * + * Retrurns: (transfer full) new instance of #GSignondDbusSignonuiAdapter + */ +GSignondDbusSignonuiAdapter * +gsignond_dbus_signonui_adapter_new () +{ + GError *err = NULL; + GSignondDbusSignonuiAdapter *adapter = GSIGNOND_DBUS_SIGNONUI_ADAPTER ( + g_object_new (GSIGNOND_TYPE_DBUS_SIGNONUI_ADAPTER, NULL)); + + adapter->priv->connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &err); + if (err) { + ERR ("Error getting session bus :%s", err->message); + goto fail; + } + + adapter->priv->proxy = gsignond_dbus_singlesignonui_proxy_new_sync (adapter->priv->connection, + G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, + SIGNONUI_SERVICE, + SIGNONUI_OBJECTPATH, + NULL, + &err); + if (err) { + WARN ("failed to get ui object : %s", err->message); + goto fail; + } + + g_signal_connect (adapter->priv->proxy, "refresh", G_CALLBACK (_on_refresh_request), adapter); + + return adapter; + +fail: + if (err) g_error_free (err); + g_object_unref (adapter); + return NULL; +} + diff --git a/src/daemon/dbus/gsignond-dbus-signonui-adapter.h b/src/daemon/dbus/gsignond-dbus-signonui-adapter.h new file mode 100644 index 0000000..b12d6bb --- /dev/null +++ b/src/daemon/dbus/gsignond-dbus-signonui-adapter.h @@ -0,0 +1,87 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2013 Intel Corporation. + * + * Contact: Amarnath Valluri <amarnath.valluri@linux.intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#ifndef __GSIGNOND_SIGNONUI_ADAPTER_H_ +#define __GSIGNOND_SIGNONUI_ADAPTER_H_ + +#include <glib.h> +#include <gio/gio.h> + +G_BEGIN_DECLS + +#define GSIGNOND_TYPE_DBUS_SIGNONUI_ADAPTER (gsignond_dbus_signonui_adapter_get_type()) +#define GSIGNOND_DBUS_SIGNONUI_ADAPTER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GSIGNOND_TYPE_DBUS_SIGNONUI_ADAPTER, GSignondDbusSignonuiAdapter)) +#define GSIGNOND_DBUS_SIGNONUI_ADAPTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GSIGNOND_TYPE_DBUS_SIGNONUI_ADAPTER, GSignondDbusSignonuiAdapterClass)) +#define GSIGNOND_IS_DBUS_SIGNONUI_ADAPTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GSIGNOND_TYPE_DBUS_SIGNONUI_ADAPTER)) +#define GSIGNOND_IS_DBUS_SIGNONUI_ADAPTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GSIGNOND_TYPE_DBUS_SIGNONUI_ADAPTER)) +#define GSIGNOND_DBUS_SIGNONUI_ADAPTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GSIGNOND_TYPE_DBUS_SIGNONUI_ADAPTER, GSignondDbusSignonuiAdapterClass)) + +typedef struct _GSignondDbusSignonuiAdapter GSignondDbusSignonuiAdapter; +typedef struct _GSignondDbusSignonuiAdapterClass GSignondDbusSignonuiAdapterClass; +typedef struct _GSignondDbusSignonuiAdapterPrivate GSignondDbusSignonuiAdapterPrivate; + +typedef void (*GSignondDbusSignonuiQueryDialogCb)(GVariant *out_params, GError *error, gpointer user_data); +typedef void (*GSignondDbusSignonuiRefreshDialogCb)(GError *error, gpointer user_data); +typedef void (*GSignondDbusSignonuiCancelRequestCb)(GError *error, gpointer user_data); + +struct _GSignondDbusSignonuiAdapter +{ + GObject parent; + + /* priv */ + GSignondDbusSignonuiAdapterPrivate *priv; +}; + +struct _GSignondDbusSignonuiAdapterClass +{ + GObjectClass parent_class; +}; + +GType gsignond_dbus_signonui_adapter_get_type (void) G_GNUC_CONST; + +GSignondDbusSignonuiAdapter * gsignond_dbus_signonui_adapter_new (); + +gboolean +gsignond_dbus_signonui_adapter_query_dialog (GSignondDbusSignonuiAdapter *adapter, + GVariant *params, + const GSignondDbusSignonuiQueryDialogCb callback, + gpointer user_data); + +gboolean +gsignond_dbus_signonui_adapter_refresh_dialog (GSignondDbusSignonuiAdapter *adapter, + GVariant *params, + const GSignondDbusSignonuiRefreshDialogCb callback, + gpointer user_data); + +gboolean +gsignond_dbus_signonui_adapter_cancel_request (GSignondDbusSignonuiAdapter *adapter, + const gchar *request_id, + const GSignondDbusSignonuiCancelRequestCb callback, + gpointer user_data); + +G_END_DECLS + +#endif /* __GSIGNOND_SIGNONUI_ADAPTER_H_ */ + diff --git a/src/daemon/dbus/gsignond-dbus-signonui-gen.c b/src/daemon/dbus/gsignond-dbus-signonui-gen.c new file mode 100644 index 0000000..437a0e0 --- /dev/null +++ b/src/daemon/dbus/gsignond-dbus-signonui-gen.c @@ -0,0 +1,1466 @@ +/* + * Generated by gdbus-codegen 2.32.3. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "gsignond-dbus-signonui-gen.h" + +#ifdef G_OS_UNIX +# include <gio/gunixfdlist.h> +#endif + +typedef struct +{ + GDBusArgInfo parent_struct; + gboolean use_gvariant; +} _ExtendedGDBusArgInfo; + +typedef struct +{ + GDBusMethodInfo parent_struct; + const gchar *signal_name; + gboolean pass_fdlist; +} _ExtendedGDBusMethodInfo; + +typedef struct +{ + GDBusSignalInfo parent_struct; + const gchar *signal_name; +} _ExtendedGDBusSignalInfo; + +typedef struct +{ + GDBusPropertyInfo parent_struct; + const gchar *hyphen_name; + gboolean use_gvariant; +} _ExtendedGDBusPropertyInfo; + +typedef struct +{ + GDBusInterfaceInfo parent_struct; + const gchar *hyphen_name; +} _ExtendedGDBusInterfaceInfo; + +typedef struct +{ + const _ExtendedGDBusPropertyInfo *info; + guint prop_id; + GValue orig_value; /* the value before the change */ +} ChangedProperty; + +static void +_changed_property_free (ChangedProperty *data) +{ + g_value_unset (&data->orig_value); + g_free (data); +} + +static gboolean +_g_strv_equal0 (gchar **a, gchar **b) +{ + gboolean ret = FALSE; + guint n; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + if (g_strv_length (a) != g_strv_length (b)) + goto out; + for (n = 0; a[n] != NULL; n++) + if (g_strcmp0 (a[n], b[n]) != 0) + goto out; + ret = TRUE; +out: + return ret; +} + +static gboolean +_g_variant_equal0 (GVariant *a, GVariant *b) +{ + gboolean ret = FALSE; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + ret = g_variant_equal (a, b); +out: + return ret; +} + +G_GNUC_UNUSED static gboolean +_g_value_equal (const GValue *a, const GValue *b) +{ + gboolean ret = FALSE; + g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b)); + switch (G_VALUE_TYPE (a)) + { + case G_TYPE_BOOLEAN: + ret = (g_value_get_boolean (a) == g_value_get_boolean (b)); + break; + case G_TYPE_UCHAR: + ret = (g_value_get_uchar (a) == g_value_get_uchar (b)); + break; + case G_TYPE_INT: + ret = (g_value_get_int (a) == g_value_get_int (b)); + break; + case G_TYPE_UINT: + ret = (g_value_get_uint (a) == g_value_get_uint (b)); + break; + case G_TYPE_INT64: + ret = (g_value_get_int64 (a) == g_value_get_int64 (b)); + break; + case G_TYPE_UINT64: + ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b)); + break; + case G_TYPE_DOUBLE: + ret = (g_value_get_double (a) == g_value_get_double (b)); + break; + case G_TYPE_STRING: + ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0); + break; + case G_TYPE_VARIANT: + ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b)); + break; + default: + if (G_VALUE_TYPE (a) == G_TYPE_STRV) + ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b)); + else + g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a))); + break; + } + return ret; +} + +/* ------------------------------------------------------------------------ + * Code for interface org.tizen.SSO.singlesignonui + * ------------------------------------------------------------------------ + */ + +/** + * SECTION:GSignondDbusSinglesignonui + * @title: GSignondDbusSinglesignonui + * @short_description: Generated C code for the org.tizen.SSO.singlesignonui D-Bus interface + * + * This section contains code for working with the <link linkend="gdbus-interface-org-tizen-SSO-singlesignonui.top_of_page">org.tizen.SSO.singlesignonui</link> D-Bus interface in C. + */ + +/* ---- Introspection data for org.tizen.SSO.singlesignonui ---- */ + +static const _ExtendedGDBusArgInfo _gsignond_dbus_singlesignonui_method_info_query_dialog_IN_ARG_parameters = +{ + { + -1, + "parameters", + "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_singlesignonui_method_info_query_dialog_IN_ARG_pointers[] = +{ + &_gsignond_dbus_singlesignonui_method_info_query_dialog_IN_ARG_parameters, + NULL +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_singlesignonui_method_info_query_dialog_OUT_ARG_return_value = +{ + { + -1, + "return_value", + "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_singlesignonui_method_info_query_dialog_OUT_ARG_pointers[] = +{ + &_gsignond_dbus_singlesignonui_method_info_query_dialog_OUT_ARG_return_value, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_singlesignonui_method_info_query_dialog = +{ + { + -1, + "queryDialog", + (GDBusArgInfo **) &_gsignond_dbus_singlesignonui_method_info_query_dialog_IN_ARG_pointers, + (GDBusArgInfo **) &_gsignond_dbus_singlesignonui_method_info_query_dialog_OUT_ARG_pointers, + NULL + }, + "handle-query-dialog", + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_singlesignonui_method_info_refresh_dialog_IN_ARG_parameters = +{ + { + -1, + "parameters", + "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_singlesignonui_method_info_refresh_dialog_IN_ARG_pointers[] = +{ + &_gsignond_dbus_singlesignonui_method_info_refresh_dialog_IN_ARG_parameters, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_singlesignonui_method_info_refresh_dialog = +{ + { + -1, + "refreshDialog", + (GDBusArgInfo **) &_gsignond_dbus_singlesignonui_method_info_refresh_dialog_IN_ARG_pointers, + NULL, + NULL + }, + "handle-refresh-dialog", + FALSE +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_singlesignonui_method_info_cancel_ui_request_IN_ARG_request_id = +{ + { + -1, + "request_id", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_singlesignonui_method_info_cancel_ui_request_IN_ARG_pointers[] = +{ + &_gsignond_dbus_singlesignonui_method_info_cancel_ui_request_IN_ARG_request_id, + NULL +}; + +static const _ExtendedGDBusMethodInfo _gsignond_dbus_singlesignonui_method_info_cancel_ui_request = +{ + { + -1, + "cancelUiRequest", + (GDBusArgInfo **) &_gsignond_dbus_singlesignonui_method_info_cancel_ui_request_IN_ARG_pointers, + NULL, + NULL + }, + "handle-cancel-ui-request", + FALSE +}; + +static const _ExtendedGDBusMethodInfo * const _gsignond_dbus_singlesignonui_method_info_pointers[] = +{ + &_gsignond_dbus_singlesignonui_method_info_query_dialog, + &_gsignond_dbus_singlesignonui_method_info_refresh_dialog, + &_gsignond_dbus_singlesignonui_method_info_cancel_ui_request, + NULL +}; + +static const _ExtendedGDBusArgInfo _gsignond_dbus_singlesignonui_signal_info_refresh_ARG_request_id = +{ + { + -1, + "request_id", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gsignond_dbus_singlesignonui_signal_info_refresh_ARG_pointers[] = +{ + &_gsignond_dbus_singlesignonui_signal_info_refresh_ARG_request_id, + NULL +}; + +static const _ExtendedGDBusSignalInfo _gsignond_dbus_singlesignonui_signal_info_refresh = +{ + { + -1, + "refresh", + (GDBusArgInfo **) &_gsignond_dbus_singlesignonui_signal_info_refresh_ARG_pointers, + NULL + }, + "refresh" +}; + +static const _ExtendedGDBusSignalInfo * const _gsignond_dbus_singlesignonui_signal_info_pointers[] = +{ + &_gsignond_dbus_singlesignonui_signal_info_refresh, + NULL +}; + +static const _ExtendedGDBusInterfaceInfo _gsignond_dbus_singlesignonui_interface_info = +{ + { + -1, + "org.tizen.SSO.singlesignonui", + (GDBusMethodInfo **) &_gsignond_dbus_singlesignonui_method_info_pointers, + (GDBusSignalInfo **) &_gsignond_dbus_singlesignonui_signal_info_pointers, + NULL, + NULL + }, + "singlesignonui", +}; + + +/** + * gsignond_dbus_singlesignonui_interface_info: + * + * Gets a machine-readable description of the <link linkend="gdbus-interface-org-tizen-SSO-singlesignonui.top_of_page">org.tizen.SSO.singlesignonui</link> D-Bus interface. + * + * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. + */ +GDBusInterfaceInfo * +gsignond_dbus_singlesignonui_interface_info (void) +{ + return (GDBusInterfaceInfo *) &_gsignond_dbus_singlesignonui_interface_info; +} + +/** + * gsignond_dbus_singlesignonui_override_properties: + * @klass: The class structure for a #GObject<!-- -->-derived class. + * @property_id_begin: The property id to assign to the first overridden property. + * + * Overrides all #GObject properties in the #GSignondDbusSinglesignonui interface for a concrete class. + * The properties are overridden in the order they are defined. + * + * Returns: The last property id. + */ +guint +gsignond_dbus_singlesignonui_override_properties (GObjectClass *klass, guint property_id_begin) +{ + return property_id_begin - 1; +} + + + +/** + * GSignondDbusSinglesignonui: + * + * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-tizen-SSO-singlesignonui.top_of_page">org.tizen.SSO.singlesignonui</link>. + */ + +/** + * GSignondDbusSinglesignonuiIface: + * @parent_iface: The parent interface. + * @handle_cancel_ui_request: Handler for the #GSignondDbusSinglesignonui::handle-cancel-ui-request signal. + * @handle_query_dialog: Handler for the #GSignondDbusSinglesignonui::handle-query-dialog signal. + * @handle_refresh_dialog: Handler for the #GSignondDbusSinglesignonui::handle-refresh-dialog signal. + * @refresh: Handler for the #GSignondDbusSinglesignonui::refresh signal. + * + * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-tizen-SSO-singlesignonui.top_of_page">org.tizen.SSO.singlesignonui</link>. + */ + +static void +gsignond_dbus_singlesignonui_default_init (GSignondDbusSinglesignonuiIface *iface) +{ + /* GObject signals for incoming D-Bus method calls: */ + /** + * GSignondDbusSinglesignonui::handle-query-dialog: + * @object: A #GSignondDbusSinglesignonui. + * @invocation: A #GDBusMethodInvocation. + * @arg_parameters: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-SSO-singlesignonui.queryDialog">queryDialog()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_singlesignonui_complete_query_dialog() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-query-dialog", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusSinglesignonuiIface, handle_query_dialog), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT); + + /** + * GSignondDbusSinglesignonui::handle-refresh-dialog: + * @object: A #GSignondDbusSinglesignonui. + * @invocation: A #GDBusMethodInvocation. + * @arg_parameters: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-SSO-singlesignonui.refreshDialog">refreshDialog()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_singlesignonui_complete_refresh_dialog() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-refresh-dialog", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusSinglesignonuiIface, handle_refresh_dialog), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT); + + /** + * GSignondDbusSinglesignonui::handle-cancel-ui-request: + * @object: A #GSignondDbusSinglesignonui. + * @invocation: A #GDBusMethodInvocation. + * @arg_request_id: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-SSO-singlesignonui.cancelUiRequest">cancelUiRequest()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsignond_dbus_singlesignonui_complete_cancel_ui_request() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-cancel-ui-request", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusSinglesignonuiIface, handle_cancel_ui_request), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); + + /* GObject signals for received D-Bus signals: */ + /** + * GSignondDbusSinglesignonui::refresh: + * @object: A #GSignondDbusSinglesignonui. + * @arg_request_id: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-tizen-SSO-singlesignonui.refresh">"refresh"</link> is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("refresh", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSignondDbusSinglesignonuiIface, refresh), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 1, G_TYPE_STRING); + +} + +typedef GSignondDbusSinglesignonuiIface GSignondDbusSinglesignonuiInterface; +G_DEFINE_INTERFACE (GSignondDbusSinglesignonui, gsignond_dbus_singlesignonui, G_TYPE_OBJECT); + +/** + * gsignond_dbus_singlesignonui_emit_refresh: + * @object: A #GSignondDbusSinglesignonui. + * @arg_request_id: Argument to pass with the signal. + * + * Emits the <link linkend="gdbus-signal-org-tizen-SSO-singlesignonui.refresh">"refresh"</link> D-Bus signal. + */ +void +gsignond_dbus_singlesignonui_emit_refresh ( + GSignondDbusSinglesignonui *object, + const gchar *arg_request_id) +{ + g_signal_emit_by_name (object, "refresh", arg_request_id); +} + +/** + * gsignond_dbus_singlesignonui_call_query_dialog: + * @proxy: A #GSignondDbusSinglesignonuiProxy. + * @arg_parameters: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-SSO-singlesignonui.queryDialog">queryDialog()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_singlesignonui_call_query_dialog_finish() to get the result of the operation. + * + * See gsignond_dbus_singlesignonui_call_query_dialog_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_singlesignonui_call_query_dialog ( + GSignondDbusSinglesignonui *proxy, + GVariant *arg_parameters, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "queryDialog", + g_variant_new ("(@a{sv})", + arg_parameters), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_singlesignonui_call_query_dialog_finish: + * @proxy: A #GSignondDbusSinglesignonuiProxy. + * @out_return_value: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_singlesignonui_call_query_dialog(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_singlesignonui_call_query_dialog(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_singlesignonui_call_query_dialog_finish ( + GSignondDbusSinglesignonui *proxy, + GVariant **out_return_value, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@a{sv})", + out_return_value); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_singlesignonui_call_query_dialog_sync: + * @proxy: A #GSignondDbusSinglesignonuiProxy. + * @arg_parameters: Argument to pass with the method invocation. + * @out_return_value: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-tizen-SSO-singlesignonui.queryDialog">queryDialog()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_singlesignonui_call_query_dialog() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_singlesignonui_call_query_dialog_sync ( + GSignondDbusSinglesignonui *proxy, + GVariant *arg_parameters, + GVariant **out_return_value, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "queryDialog", + g_variant_new ("(@a{sv})", + arg_parameters), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@a{sv})", + out_return_value); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_singlesignonui_call_refresh_dialog: + * @proxy: A #GSignondDbusSinglesignonuiProxy. + * @arg_parameters: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-SSO-singlesignonui.refreshDialog">refreshDialog()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_singlesignonui_call_refresh_dialog_finish() to get the result of the operation. + * + * See gsignond_dbus_singlesignonui_call_refresh_dialog_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_singlesignonui_call_refresh_dialog ( + GSignondDbusSinglesignonui *proxy, + GVariant *arg_parameters, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "refreshDialog", + g_variant_new ("(@a{sv})", + arg_parameters), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_singlesignonui_call_refresh_dialog_finish: + * @proxy: A #GSignondDbusSinglesignonuiProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_singlesignonui_call_refresh_dialog(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_singlesignonui_call_refresh_dialog(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_singlesignonui_call_refresh_dialog_finish ( + GSignondDbusSinglesignonui *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_singlesignonui_call_refresh_dialog_sync: + * @proxy: A #GSignondDbusSinglesignonuiProxy. + * @arg_parameters: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-tizen-SSO-singlesignonui.refreshDialog">refreshDialog()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_singlesignonui_call_refresh_dialog() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_singlesignonui_call_refresh_dialog_sync ( + GSignondDbusSinglesignonui *proxy, + GVariant *arg_parameters, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "refreshDialog", + g_variant_new ("(@a{sv})", + arg_parameters), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_singlesignonui_call_cancel_ui_request: + * @proxy: A #GSignondDbusSinglesignonuiProxy. + * @arg_request_id: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-SSO-singlesignonui.cancelUiRequest">cancelUiRequest()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_singlesignonui_call_cancel_ui_request_finish() to get the result of the operation. + * + * See gsignond_dbus_singlesignonui_call_cancel_ui_request_sync() for the synchronous, blocking version of this method. + */ +void +gsignond_dbus_singlesignonui_call_cancel_ui_request ( + GSignondDbusSinglesignonui *proxy, + const gchar *arg_request_id, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "cancelUiRequest", + g_variant_new ("(s)", + arg_request_id), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * gsignond_dbus_singlesignonui_call_cancel_ui_request_finish: + * @proxy: A #GSignondDbusSinglesignonuiProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_singlesignonui_call_cancel_ui_request(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with gsignond_dbus_singlesignonui_call_cancel_ui_request(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_singlesignonui_call_cancel_ui_request_finish ( + GSignondDbusSinglesignonui *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_singlesignonui_call_cancel_ui_request_sync: + * @proxy: A #GSignondDbusSinglesignonuiProxy. + * @arg_request_id: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-tizen-SSO-singlesignonui.cancelUiRequest">cancelUiRequest()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_singlesignonui_call_cancel_ui_request() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +gsignond_dbus_singlesignonui_call_cancel_ui_request_sync ( + GSignondDbusSinglesignonui *proxy, + const gchar *arg_request_id, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "cancelUiRequest", + g_variant_new ("(s)", + arg_request_id), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * gsignond_dbus_singlesignonui_complete_query_dialog: + * @object: A #GSignondDbusSinglesignonui. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @return_value: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-SSO-singlesignonui.queryDialog">queryDialog()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_singlesignonui_complete_query_dialog ( + GSignondDbusSinglesignonui *object, + GDBusMethodInvocation *invocation, + GVariant *return_value) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(@a{sv})", + return_value)); +} + +/** + * gsignond_dbus_singlesignonui_complete_refresh_dialog: + * @object: A #GSignondDbusSinglesignonui. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-SSO-singlesignonui.refreshDialog">refreshDialog()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_singlesignonui_complete_refresh_dialog ( + GSignondDbusSinglesignonui *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * gsignond_dbus_singlesignonui_complete_cancel_ui_request: + * @object: A #GSignondDbusSinglesignonui. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-SSO-singlesignonui.cancelUiRequest">cancelUiRequest()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +gsignond_dbus_singlesignonui_complete_cancel_ui_request ( + GSignondDbusSinglesignonui *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/* ------------------------------------------------------------------------ */ + +/** + * GSignondDbusSinglesignonuiProxy: + * + * The #GSignondDbusSinglesignonuiProxy structure contains only private data and should only be accessed using the provided API. + */ + +/** + * GSignondDbusSinglesignonuiProxyClass: + * @parent_class: The parent class. + * + * Class structure for #GSignondDbusSinglesignonuiProxy. + */ + +struct _GSignondDbusSinglesignonuiProxyPrivate +{ + GData *qdata; +}; + +static void gsignond_dbus_singlesignonui_proxy_iface_init (GSignondDbusSinglesignonuiIface *iface); + +G_DEFINE_TYPE_WITH_CODE (GSignondDbusSinglesignonuiProxy, gsignond_dbus_singlesignonui_proxy, G_TYPE_DBUS_PROXY, + G_IMPLEMENT_INTERFACE (GSIGNOND_DBUS_TYPE_SINGLESIGNONUI, gsignond_dbus_singlesignonui_proxy_iface_init)); + +static void +gsignond_dbus_singlesignonui_proxy_finalize (GObject *object) +{ + GSignondDbusSinglesignonuiProxy *proxy = GSIGNOND_DBUS_SINGLESIGNONUI_PROXY (object); + g_datalist_clear (&proxy->priv->qdata); + G_OBJECT_CLASS (gsignond_dbus_singlesignonui_proxy_parent_class)->finalize (object); +} + +static void +gsignond_dbus_singlesignonui_proxy_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ +} + +static void +gsignond_dbus_singlesignonui_proxy_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ +} + +static void +gsignond_dbus_singlesignonui_proxy_g_signal (GDBusProxy *proxy, + const gchar *sender_name, + const gchar *signal_name, + GVariant *parameters) +{ + _ExtendedGDBusSignalInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint n; + guint signal_id; + info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_gsignond_dbus_singlesignonui_interface_info, signal_name); + if (info == NULL) + return; + num_params = g_variant_n_children (parameters); + paramv = g_new0 (GValue, num_params + 1); + g_value_init (¶mv[0], GSIGNOND_DBUS_TYPE_SINGLESIGNONUI); + g_value_set_object (¶mv[0], proxy); + g_variant_iter_init (&iter, parameters); + n = 1; + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, GSIGNOND_DBUS_TYPE_SINGLESIGNONUI); + g_signal_emitv (paramv, signal_id, 0, NULL); + for (n = 0; n < num_params + 1; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static void +gsignond_dbus_singlesignonui_proxy_g_properties_changed (GDBusProxy *_proxy, + GVariant *changed_properties, + const gchar *const *invalidated_properties) +{ + GSignondDbusSinglesignonuiProxy *proxy = GSIGNOND_DBUS_SINGLESIGNONUI_PROXY (_proxy); + guint n; + const gchar *key; + GVariantIter *iter; + _ExtendedGDBusPropertyInfo *info; + g_variant_get (changed_properties, "a{sv}", &iter); + while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsignond_dbus_singlesignonui_interface_info, key); + g_datalist_remove_data (&proxy->priv->qdata, key); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } + g_variant_iter_free (iter); + for (n = 0; invalidated_properties[n] != NULL; n++) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsignond_dbus_singlesignonui_interface_info, invalidated_properties[n]); + g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } +} + +static void +gsignond_dbus_singlesignonui_proxy_init (GSignondDbusSinglesignonuiProxy *proxy) +{ + proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GSIGNOND_DBUS_TYPE_SINGLESIGNONUI_PROXY, GSignondDbusSinglesignonuiProxyPrivate); + g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), gsignond_dbus_singlesignonui_interface_info ()); +} + +static void +gsignond_dbus_singlesignonui_proxy_class_init (GSignondDbusSinglesignonuiProxyClass *klass) +{ + GObjectClass *gobject_class; + GDBusProxyClass *proxy_class; + + g_type_class_add_private (klass, sizeof (GSignondDbusSinglesignonuiProxyPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = gsignond_dbus_singlesignonui_proxy_finalize; + gobject_class->get_property = gsignond_dbus_singlesignonui_proxy_get_property; + gobject_class->set_property = gsignond_dbus_singlesignonui_proxy_set_property; + + proxy_class = G_DBUS_PROXY_CLASS (klass); + proxy_class->g_signal = gsignond_dbus_singlesignonui_proxy_g_signal; + proxy_class->g_properties_changed = gsignond_dbus_singlesignonui_proxy_g_properties_changed; + +} + +static void +gsignond_dbus_singlesignonui_proxy_iface_init (GSignondDbusSinglesignonuiIface *iface) +{ +} + +/** + * gsignond_dbus_singlesignonui_proxy_new: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-tizen-SSO-singlesignonui.top_of_page">org.tizen.SSO.singlesignonui</link>. See g_dbus_proxy_new() for more details. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_singlesignonui_proxy_new_finish() to get the result of the operation. + * + * See gsignond_dbus_singlesignonui_proxy_new_sync() for the synchronous, blocking version of this constructor. + */ +void +gsignond_dbus_singlesignonui_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (GSIGNOND_DBUS_TYPE_SINGLESIGNONUI_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.tizen.SSO.singlesignonui", NULL); +} + +/** + * gsignond_dbus_singlesignonui_proxy_new_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_singlesignonui_proxy_new(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with gsignond_dbus_singlesignonui_proxy_new(). + * + * Returns: (transfer full) (type GSignondDbusSinglesignonuiProxy): The constructed proxy object or %NULL if @error is set. + */ +GSignondDbusSinglesignonui * +gsignond_dbus_singlesignonui_proxy_new_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return GSIGNOND_DBUS_SINGLESIGNONUI (ret); + else + return NULL; +} + +/** + * gsignond_dbus_singlesignonui_proxy_new_sync: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-tizen-SSO-singlesignonui.top_of_page">org.tizen.SSO.singlesignonui</link>. See g_dbus_proxy_new_sync() for more details. + * + * The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_singlesignonui_proxy_new() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type GSignondDbusSinglesignonuiProxy): The constructed proxy object or %NULL if @error is set. + */ +GSignondDbusSinglesignonui * +gsignond_dbus_singlesignonui_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (GSIGNOND_DBUS_TYPE_SINGLESIGNONUI_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.tizen.SSO.singlesignonui", NULL); + if (ret != NULL) + return GSIGNOND_DBUS_SINGLESIGNONUI (ret); + else + return NULL; +} + + +/** + * gsignond_dbus_singlesignonui_proxy_new_for_bus: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Like gsignond_dbus_singlesignonui_proxy_new() but takes a #GBusType instead of a #GDBusConnection. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call gsignond_dbus_singlesignonui_proxy_new_for_bus_finish() to get the result of the operation. + * + * See gsignond_dbus_singlesignonui_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. + */ +void +gsignond_dbus_singlesignonui_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (GSIGNOND_DBUS_TYPE_SINGLESIGNONUI_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.tizen.SSO.singlesignonui", NULL); +} + +/** + * gsignond_dbus_singlesignonui_proxy_new_for_bus_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsignond_dbus_singlesignonui_proxy_new_for_bus(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with gsignond_dbus_singlesignonui_proxy_new_for_bus(). + * + * Returns: (transfer full) (type GSignondDbusSinglesignonuiProxy): The constructed proxy object or %NULL if @error is set. + */ +GSignondDbusSinglesignonui * +gsignond_dbus_singlesignonui_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return GSIGNOND_DBUS_SINGLESIGNONUI (ret); + else + return NULL; +} + +/** + * gsignond_dbus_singlesignonui_proxy_new_for_bus_sync: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Like gsignond_dbus_singlesignonui_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. + * + * The calling thread is blocked until a reply is received. + * + * See gsignond_dbus_singlesignonui_proxy_new_for_bus() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type GSignondDbusSinglesignonuiProxy): The constructed proxy object or %NULL if @error is set. + */ +GSignondDbusSinglesignonui * +gsignond_dbus_singlesignonui_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (GSIGNOND_DBUS_TYPE_SINGLESIGNONUI_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.tizen.SSO.singlesignonui", NULL); + if (ret != NULL) + return GSIGNOND_DBUS_SINGLESIGNONUI (ret); + else + return NULL; +} + + +/* ------------------------------------------------------------------------ */ + +/** + * GSignondDbusSinglesignonuiSkeleton: + * + * The #GSignondDbusSinglesignonuiSkeleton structure contains only private data and should only be accessed using the provided API. + */ + +/** + * GSignondDbusSinglesignonuiSkeletonClass: + * @parent_class: The parent class. + * + * Class structure for #GSignondDbusSinglesignonuiSkeleton. + */ + +struct _GSignondDbusSinglesignonuiSkeletonPrivate +{ + GValue *properties; + GList *changed_properties; + GSource *changed_properties_idle_source; + GMainContext *context; + GMutex lock; +}; + +static void +_gsignond_dbus_singlesignonui_skeleton_handle_method_call ( + GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + GSignondDbusSinglesignonuiSkeleton *skeleton = GSIGNOND_DBUS_SINGLESIGNONUI_SKELETON (user_data); + _ExtendedGDBusMethodInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint num_extra; + guint n; + guint signal_id; + GValue return_value = G_VALUE_INIT; + info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); + g_assert (info != NULL); + num_params = g_variant_n_children (parameters); + num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); + n = 0; + g_value_init (¶mv[n], GSIGNOND_DBUS_TYPE_SINGLESIGNONUI); + g_value_set_object (¶mv[n++], skeleton); + g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); + g_value_set_object (¶mv[n++], invocation); + if (info->pass_fdlist) + { +#ifdef G_OS_UNIX + g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); + g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); +#else + g_assert_not_reached (); +#endif + } + g_variant_iter_init (&iter, parameters); + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, GSIGNOND_DBUS_TYPE_SINGLESIGNONUI); + g_value_init (&return_value, G_TYPE_BOOLEAN); + g_signal_emitv (paramv, signal_id, 0, &return_value); + if (!g_value_get_boolean (&return_value)) + g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); + g_value_unset (&return_value); + for (n = 0; n < num_params + num_extra; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static GVariant * +_gsignond_dbus_singlesignonui_skeleton_handle_get_property ( + GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GError **error, + gpointer user_data) +{ + GSignondDbusSinglesignonuiSkeleton *skeleton = GSIGNOND_DBUS_SINGLESIGNONUI_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + GVariant *ret; + ret = NULL; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsignond_dbus_singlesignonui_interface_info, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + g_value_init (&value, pspec->value_type); + g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); + ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); + g_value_unset (&value); + } + return ret; +} + +static gboolean +_gsignond_dbus_singlesignonui_skeleton_handle_set_property ( + GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GVariant *variant, + GError **error, + gpointer user_data) +{ + GSignondDbusSinglesignonuiSkeleton *skeleton = GSIGNOND_DBUS_SINGLESIGNONUI_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + gboolean ret; + ret = FALSE; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsignond_dbus_singlesignonui_interface_info, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + if (info->use_gvariant) + g_value_set_variant (&value, variant); + else + g_dbus_gvariant_to_gvalue (variant, &value); + g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); + g_value_unset (&value); + ret = TRUE; + } + return ret; +} + +static const GDBusInterfaceVTable _gsignond_dbus_singlesignonui_skeleton_vtable = +{ + _gsignond_dbus_singlesignonui_skeleton_handle_method_call, + _gsignond_dbus_singlesignonui_skeleton_handle_get_property, + _gsignond_dbus_singlesignonui_skeleton_handle_set_property +}; + +static GDBusInterfaceInfo * +gsignond_dbus_singlesignonui_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton) +{ + return gsignond_dbus_singlesignonui_interface_info (); +} + +static GDBusInterfaceVTable * +gsignond_dbus_singlesignonui_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton) +{ + return (GDBusInterfaceVTable *) &_gsignond_dbus_singlesignonui_skeleton_vtable; +} + +static GVariant * +gsignond_dbus_singlesignonui_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) +{ + GSignondDbusSinglesignonuiSkeleton *skeleton = GSIGNOND_DBUS_SINGLESIGNONUI_SKELETON (_skeleton); + + GVariantBuilder builder; + guint n; + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + if (_gsignond_dbus_singlesignonui_interface_info.parent_struct.properties == NULL) + goto out; + for (n = 0; _gsignond_dbus_singlesignonui_interface_info.parent_struct.properties[n] != NULL; n++) + { + GDBusPropertyInfo *info = _gsignond_dbus_singlesignonui_interface_info.parent_struct.properties[n]; + if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) + { + GVariant *value; + value = _gsignond_dbus_singlesignonui_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.tizen.SSO.singlesignonui", info->name, NULL, skeleton); + if (value != NULL) + { + g_variant_take_ref (value); + g_variant_builder_add (&builder, "{sv}", info->name, value); + g_variant_unref (value); + } + } + } +out: + return g_variant_builder_end (&builder); +} + +static void +gsignond_dbus_singlesignonui_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) +{ +} + +static void +_gsignond_dbus_singlesignonui_on_signal_refresh ( + GSignondDbusSinglesignonui *object, + const gchar *arg_request_id) +{ + GSignondDbusSinglesignonuiSkeleton *skeleton = GSIGNOND_DBUS_SINGLESIGNONUI_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("(s)", + arg_request_id)); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.tizen.SSO.singlesignonui", "refresh", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void gsignond_dbus_singlesignonui_skeleton_iface_init (GSignondDbusSinglesignonuiIface *iface); +G_DEFINE_TYPE_WITH_CODE (GSignondDbusSinglesignonuiSkeleton, gsignond_dbus_singlesignonui_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_IMPLEMENT_INTERFACE (GSIGNOND_DBUS_TYPE_SINGLESIGNONUI, gsignond_dbus_singlesignonui_skeleton_iface_init)); + +static void +gsignond_dbus_singlesignonui_skeleton_finalize (GObject *object) +{ + GSignondDbusSinglesignonuiSkeleton *skeleton = GSIGNOND_DBUS_SINGLESIGNONUI_SKELETON (object); + g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); + if (skeleton->priv->changed_properties_idle_source != NULL) + g_source_destroy (skeleton->priv->changed_properties_idle_source); + g_main_context_unref (skeleton->priv->context); + g_mutex_clear (&skeleton->priv->lock); + G_OBJECT_CLASS (gsignond_dbus_singlesignonui_skeleton_parent_class)->finalize (object); +} + +static void +gsignond_dbus_singlesignonui_skeleton_init (GSignondDbusSinglesignonuiSkeleton *skeleton) +{ + skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GSIGNOND_DBUS_TYPE_SINGLESIGNONUI_SKELETON, GSignondDbusSinglesignonuiSkeletonPrivate); + g_mutex_init (&skeleton->priv->lock); + skeleton->priv->context = g_main_context_ref_thread_default (); +} + +static void +gsignond_dbus_singlesignonui_skeleton_class_init (GSignondDbusSinglesignonuiSkeletonClass *klass) +{ + GObjectClass *gobject_class; + GDBusInterfaceSkeletonClass *skeleton_class; + + g_type_class_add_private (klass, sizeof (GSignondDbusSinglesignonuiSkeletonPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = gsignond_dbus_singlesignonui_skeleton_finalize; + + skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); + skeleton_class->get_info = gsignond_dbus_singlesignonui_skeleton_dbus_interface_get_info; + skeleton_class->get_properties = gsignond_dbus_singlesignonui_skeleton_dbus_interface_get_properties; + skeleton_class->flush = gsignond_dbus_singlesignonui_skeleton_dbus_interface_flush; + skeleton_class->get_vtable = gsignond_dbus_singlesignonui_skeleton_dbus_interface_get_vtable; +} + +static void +gsignond_dbus_singlesignonui_skeleton_iface_init (GSignondDbusSinglesignonuiIface *iface) +{ + iface->refresh = _gsignond_dbus_singlesignonui_on_signal_refresh; +} + +/** + * gsignond_dbus_singlesignonui_skeleton_new: + * + * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-tizen-SSO-singlesignonui.top_of_page">org.tizen.SSO.singlesignonui</link>. + * + * Returns: (transfer full) (type GSignondDbusSinglesignonuiSkeleton): The skeleton object. + */ +GSignondDbusSinglesignonui * +gsignond_dbus_singlesignonui_skeleton_new (void) +{ + return GSIGNOND_DBUS_SINGLESIGNONUI (g_object_new (GSIGNOND_DBUS_TYPE_SINGLESIGNONUI_SKELETON, NULL)); +} + diff --git a/src/daemon/dbus/gsignond-dbus-signonui-gen.h b/src/daemon/dbus/gsignond-dbus-signonui-gen.h new file mode 100644 index 0000000..4c1b8ea --- /dev/null +++ b/src/daemon/dbus/gsignond-dbus-signonui-gen.h @@ -0,0 +1,239 @@ +/* + * Generated by gdbus-codegen 2.32.3. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifndef __GSIGNOND_DBUS_SIGNONUI_GEN_H__ +#define __GSIGNOND_DBUS_SIGNONUI_GEN_H__ + +#include <gio/gio.h> + +G_BEGIN_DECLS + + +/* ------------------------------------------------------------------------ */ +/* Declarations for org.tizen.SSO.singlesignonui */ + +#define GSIGNOND_DBUS_TYPE_SINGLESIGNONUI (gsignond_dbus_singlesignonui_get_type ()) +#define GSIGNOND_DBUS_SINGLESIGNONUI(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSIGNOND_DBUS_TYPE_SINGLESIGNONUI, GSignondDbusSinglesignonui)) +#define GSIGNOND_DBUS_IS_SINGLESIGNONUI(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSIGNOND_DBUS_TYPE_SINGLESIGNONUI)) +#define GSIGNOND_DBUS_SINGLESIGNONUI_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GSIGNOND_DBUS_TYPE_SINGLESIGNONUI, GSignondDbusSinglesignonuiIface)) + +struct _GSignondDbusSinglesignonui; +typedef struct _GSignondDbusSinglesignonui GSignondDbusSinglesignonui; +typedef struct _GSignondDbusSinglesignonuiIface GSignondDbusSinglesignonuiIface; + +struct _GSignondDbusSinglesignonuiIface +{ + GTypeInterface parent_iface; + + + gboolean (*handle_cancel_ui_request) ( + GSignondDbusSinglesignonui *object, + GDBusMethodInvocation *invocation, + const gchar *arg_request_id); + + gboolean (*handle_query_dialog) ( + GSignondDbusSinglesignonui *object, + GDBusMethodInvocation *invocation, + GVariant *arg_parameters); + + gboolean (*handle_refresh_dialog) ( + GSignondDbusSinglesignonui *object, + GDBusMethodInvocation *invocation, + GVariant *arg_parameters); + + void (*refresh) ( + GSignondDbusSinglesignonui *object, + const gchar *arg_request_id); + +}; + +GType gsignond_dbus_singlesignonui_get_type (void) G_GNUC_CONST; + +GDBusInterfaceInfo *gsignond_dbus_singlesignonui_interface_info (void); +guint gsignond_dbus_singlesignonui_override_properties (GObjectClass *klass, guint property_id_begin); + + +/* D-Bus method call completion functions: */ +void gsignond_dbus_singlesignonui_complete_query_dialog ( + GSignondDbusSinglesignonui *object, + GDBusMethodInvocation *invocation, + GVariant *return_value); + +void gsignond_dbus_singlesignonui_complete_refresh_dialog ( + GSignondDbusSinglesignonui *object, + GDBusMethodInvocation *invocation); + +void gsignond_dbus_singlesignonui_complete_cancel_ui_request ( + GSignondDbusSinglesignonui *object, + GDBusMethodInvocation *invocation); + + + +/* D-Bus signal emissions functions: */ +void gsignond_dbus_singlesignonui_emit_refresh ( + GSignondDbusSinglesignonui *object, + const gchar *arg_request_id); + + + +/* D-Bus method calls: */ +void gsignond_dbus_singlesignonui_call_query_dialog ( + GSignondDbusSinglesignonui *proxy, + GVariant *arg_parameters, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_singlesignonui_call_query_dialog_finish ( + GSignondDbusSinglesignonui *proxy, + GVariant **out_return_value, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_singlesignonui_call_query_dialog_sync ( + GSignondDbusSinglesignonui *proxy, + GVariant *arg_parameters, + GVariant **out_return_value, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_singlesignonui_call_refresh_dialog ( + GSignondDbusSinglesignonui *proxy, + GVariant *arg_parameters, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_singlesignonui_call_refresh_dialog_finish ( + GSignondDbusSinglesignonui *proxy, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_singlesignonui_call_refresh_dialog_sync ( + GSignondDbusSinglesignonui *proxy, + GVariant *arg_parameters, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_singlesignonui_call_cancel_ui_request ( + GSignondDbusSinglesignonui *proxy, + const gchar *arg_request_id, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gsignond_dbus_singlesignonui_call_cancel_ui_request_finish ( + GSignondDbusSinglesignonui *proxy, + GAsyncResult *res, + GError **error); + +gboolean gsignond_dbus_singlesignonui_call_cancel_ui_request_sync ( + GSignondDbusSinglesignonui *proxy, + const gchar *arg_request_id, + GCancellable *cancellable, + GError **error); + + + +/* ---- */ + +#define GSIGNOND_DBUS_TYPE_SINGLESIGNONUI_PROXY (gsignond_dbus_singlesignonui_proxy_get_type ()) +#define GSIGNOND_DBUS_SINGLESIGNONUI_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSIGNOND_DBUS_TYPE_SINGLESIGNONUI_PROXY, GSignondDbusSinglesignonuiProxy)) +#define GSIGNOND_DBUS_SINGLESIGNONUI_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GSIGNOND_DBUS_TYPE_SINGLESIGNONUI_PROXY, GSignondDbusSinglesignonuiProxyClass)) +#define GSIGNOND_DBUS_SINGLESIGNONUI_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSIGNOND_DBUS_TYPE_SINGLESIGNONUI_PROXY, GSignondDbusSinglesignonuiProxyClass)) +#define GSIGNOND_DBUS_IS_SINGLESIGNONUI_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSIGNOND_DBUS_TYPE_SINGLESIGNONUI_PROXY)) +#define GSIGNOND_DBUS_IS_SINGLESIGNONUI_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSIGNOND_DBUS_TYPE_SINGLESIGNONUI_PROXY)) + +typedef struct _GSignondDbusSinglesignonuiProxy GSignondDbusSinglesignonuiProxy; +typedef struct _GSignondDbusSinglesignonuiProxyClass GSignondDbusSinglesignonuiProxyClass; +typedef struct _GSignondDbusSinglesignonuiProxyPrivate GSignondDbusSinglesignonuiProxyPrivate; + +struct _GSignondDbusSinglesignonuiProxy +{ + /*< private >*/ + GDBusProxy parent_instance; + GSignondDbusSinglesignonuiProxyPrivate *priv; +}; + +struct _GSignondDbusSinglesignonuiProxyClass +{ + GDBusProxyClass parent_class; +}; + +GType gsignond_dbus_singlesignonui_proxy_get_type (void) G_GNUC_CONST; + +void gsignond_dbus_singlesignonui_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +GSignondDbusSinglesignonui *gsignond_dbus_singlesignonui_proxy_new_finish ( + GAsyncResult *res, + GError **error); +GSignondDbusSinglesignonui *gsignond_dbus_singlesignonui_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + +void gsignond_dbus_singlesignonui_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +GSignondDbusSinglesignonui *gsignond_dbus_singlesignonui_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error); +GSignondDbusSinglesignonui *gsignond_dbus_singlesignonui_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + + +/* ---- */ + +#define GSIGNOND_DBUS_TYPE_SINGLESIGNONUI_SKELETON (gsignond_dbus_singlesignonui_skeleton_get_type ()) +#define GSIGNOND_DBUS_SINGLESIGNONUI_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSIGNOND_DBUS_TYPE_SINGLESIGNONUI_SKELETON, GSignondDbusSinglesignonuiSkeleton)) +#define GSIGNOND_DBUS_SINGLESIGNONUI_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GSIGNOND_DBUS_TYPE_SINGLESIGNONUI_SKELETON, GSignondDbusSinglesignonuiSkeletonClass)) +#define GSIGNOND_DBUS_SINGLESIGNONUI_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSIGNOND_DBUS_TYPE_SINGLESIGNONUI_SKELETON, GSignondDbusSinglesignonuiSkeletonClass)) +#define GSIGNOND_DBUS_IS_SINGLESIGNONUI_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSIGNOND_DBUS_TYPE_SINGLESIGNONUI_SKELETON)) +#define GSIGNOND_DBUS_IS_SINGLESIGNONUI_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSIGNOND_DBUS_TYPE_SINGLESIGNONUI_SKELETON)) + +typedef struct _GSignondDbusSinglesignonuiSkeleton GSignondDbusSinglesignonuiSkeleton; +typedef struct _GSignondDbusSinglesignonuiSkeletonClass GSignondDbusSinglesignonuiSkeletonClass; +typedef struct _GSignondDbusSinglesignonuiSkeletonPrivate GSignondDbusSinglesignonuiSkeletonPrivate; + +struct _GSignondDbusSinglesignonuiSkeleton +{ + /*< private >*/ + GDBusInterfaceSkeleton parent_instance; + GSignondDbusSinglesignonuiSkeletonPrivate *priv; +}; + +struct _GSignondDbusSinglesignonuiSkeletonClass +{ + GDBusInterfaceSkeletonClass parent_class; +}; + +GType gsignond_dbus_singlesignonui_skeleton_get_type (void) G_GNUC_CONST; + +GSignondDbusSinglesignonui *gsignond_dbus_singlesignonui_skeleton_new (void); + + +G_END_DECLS + +#endif /* __GSIGNOND_DBUS_SIGNONUI_GEN_H__ */ diff --git a/src/daemon/dbus/gsignond-dbus.h b/src/daemon/dbus/gsignond-dbus.h new file mode 100644 index 0000000..82fb529 --- /dev/null +++ b/src/daemon/dbus/gsignond-dbus.h @@ -0,0 +1,45 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2012 Intel Corporation. + * + * Contact: Amarnath Valluri <amarnath.valluri@linux.intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#ifndef __GSIGNOND_DBUS_H_ +#define __GSIGNOND_DBUS_H_ + +/* + * Common DBUS definitions + */ +#define GSIGNOND_DBUS_ADDRESS "unix:path=%s/gsignond/bus-sock" +#define GSIGNOND_SERVICE_PREFIX "com.google.code.AccountsSSO.gSingleSignOn" +#define GSIGNOND_SERVICE GSIGNOND_SERVICE_PREFIX +#define GSIGNOND_DAEMON_OBJECTPATH "/com/google/code/AccountsSSO/gSingleSignOn" +#define GSIGNOND_DAEMON_INTERFACE GSIGNOND_SERVICE_PREFIX ".AuthService" +#define GSIGNOND_IDENTITY_INTERFACE GSIGNOND_SERVICE_PREFIX ".Identity" +#define GSIGNOND_AUTH_SESSION_INTERFACE GSIGNOND_SERVICE_PREFIX ".AuthSession" +#define GSIGNOND_PLUGIN_OBJECTPATH GSIGNOND_DAEMON_OBJECTPATH "/Plugin" + +#define SIGNONUI_SERVICE "org.tizen.SSO" +#define SIGNONUI_OBJECTPATH "/org/tizen/SSO/SignonUi" +#define SIGNONUI_INTERFACE "org.tizen.SSO.singlesignonui" + +#endif /* __GSIGNOND_DBUS_H_ */ diff --git a/src/daemon/dbus/interfaces/com.google.code.AccountsSSO.gSingleSignOn.AuthService.xml b/src/daemon/dbus/interfaces/com.google.code.AccountsSSO.gSingleSignOn.AuthService.xml new file mode 100644 index 0000000..9fc893c --- /dev/null +++ b/src/daemon/dbus/interfaces/com.google.code.AccountsSSO.gSingleSignOn.AuthService.xml @@ -0,0 +1,42 @@ +<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> +<node> + <interface name="com.google.code.AccountsSSO.gSingleSignOn.AuthService"> + <method name="registerNewIdentity"> + <arg name="applicationContext" type="s" direction="in"/> + <arg name="objectPath" type="o" direction="out"/> + </method> + <method name="getIdentity"> + <arg name="id" type="u" direction="in"/> + <arg name="applicationContext" type="s" direction="in"/> + <arg name="objectPath" type="o" direction="out"/> + <arg name="identityData" type="a{sv}" direction="out"/> + </method> + <method name="queryMethods"> + <arg name="authMethods" type="as" direction="out"/> + </method> + <method name="queryMechanisms"> + <arg name="mechanisms" type="as" direction="out"/> + <arg name="method" type="s" direction="in"/> + </method> + <method name="queryIdentities"> + <arg name="filter" type="a{sv}" direction="in"/> + <arg name="applicationContext" type="s" direction="in"/> + <arg name="identities" type="aa{sv}" direction="out"/> + </method> + <method name="clear"> + <arg type="b" direction="out"/> + </method> + <method name="backupStarts"> + <arg type="y" direction="out"/> + </method> + <method name="backupFinished"> + <arg type="y" direction="out"/> + </method> + <method name="restoreStarts"> + <arg type="y" direction="out"/> + </method> + <method name="restoreFinished"> + <arg type="y" direction="out"/> + </method> + </interface> +</node> diff --git a/src/daemon/dbus/interfaces/com.google.code.AccountsSSO.gSingleSignOn.AuthSession.xml b/src/daemon/dbus/interfaces/com.google.code.AccountsSSO.gSingleSignOn.AuthSession.xml new file mode 100644 index 0000000..7047757 --- /dev/null +++ b/src/daemon/dbus/interfaces/com.google.code.AccountsSSO.gSingleSignOn.AuthSession.xml @@ -0,0 +1,23 @@ +<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> +<node> + <interface name="com.google.code.AccountsSSO.gSingleSignOn.AuthSession"> + <signal name="stateChanged"> + <arg name="state" type="i" direction="out"/> + <arg name="message" type="s" direction="out"/> + </signal> + <signal name="unregistered"> + </signal> + <method name="queryAvailableMechanisms"> + <arg type="as" direction="out"/> + <arg name="wantedMechanisms" type="as" direction="in"/> + </method> + <method name="process"> + <arg type="a{sv}" direction="out"/> + <arg name="sessionDataVa" type="a{sv}" direction="in"/> + <arg name="mechanism" type="s" direction="in"/> + </method> + <method name="cancel"> + <annotation name="org.freedesktop.DBus.Method.NoReply" value="true"/> + </method> + </interface> +</node> diff --git a/src/daemon/dbus/interfaces/com.google.code.AccountsSSO.gSingleSignOn.Identity.xml b/src/daemon/dbus/interfaces/com.google.code.AccountsSSO.gSingleSignOn.Identity.xml new file mode 100644 index 0000000..8e265de --- /dev/null +++ b/src/daemon/dbus/interfaces/com.google.code.AccountsSSO.gSingleSignOn.Identity.xml @@ -0,0 +1,46 @@ +<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> +<node> + <interface name="com.google.code.AccountsSSO.gSingleSignOn.Identity"> + <signal name="unregistered"> + </signal> + <signal name="infoUpdated"> + <arg type="i" direction="out"/> + </signal> + <method name="requestCredentialsUpdate"> + <arg type="u" direction="out"/> + <arg name="message" type="s" direction="in"/> + </method> + <method name="getInfo"> + <arg name="identityInfo" type="a{sv}" direction="out"/> + </method> + <method name="getAuthSession"> + <arg name="objectPath" type="o" direction="out"/> + <arg name="method" type="s" direction="in"/> + </method> + <method name="verifyUser"> + <arg type="b" direction="out"/> + <arg name="params" type="a{sv}" direction="in"/> + </method> + <method name="verifySecret"> + <arg type="b" direction="out"/> + <arg name="secret" type="s" direction="in"/> + </method> + <method name="remove"> + </method> + <method name="signOut"> + <arg type="b" direction="out"/> + </method> + <method name="store"> + <arg type="u" direction="out"/> + <arg type="a{sv}" direction="in"/> + </method> + <method name="addReference"> + <arg type="i" direction="out"/> + <arg name="reference" type="s" direction="in"/> + </method> + <method name="removeReference"> + <arg type="i" direction="out"/> + <arg name="reference" type="s" direction="in"/> + </method> + </interface> +</node> diff --git a/src/daemon/dbus/interfaces/com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin.xml b/src/daemon/dbus/interfaces/com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin.xml new file mode 100644 index 0000000..a7b97d2 --- /dev/null +++ b/src/daemon/dbus/interfaces/com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin.xml @@ -0,0 +1,47 @@ +<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> +<node> + <interface name="com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin"> + <method name="cancel"> + </method> + <method name="requestInitial"> + <arg name="sessionData" type="a{sv}" direction="in"/> + <arg name="mechanism" type="s" direction="in"/> + </method> + <method name="request"> + <arg name="sessionData" type="a{sv}" direction="in"/> + </method> + <method name="userActionFinished"> + <arg name="uiData" type="a{sv}" direction="in"/> + </method> + <method name="refresh"> + <arg name="uiData" type="a{sv}" direction="in"/> + </method> + <method name="getInfo"> + <arg name="type" type="s" direction="out"/> + <arg name="mechanisms" type="as" direction="out"/> + </method> + + <signal name="response"> + <arg name="sessionData" type="a{sv}" direction="out"/> + </signal> + <signal name="responseFinal"> + <arg name="sessionData" type="a{sv}" direction="out"/> + </signal> + <signal name="store"> + <arg name="sessionData" type="a{sv}" direction="out"/> + </signal> + <signal name="error"> + <arg name="error" type="(uis)" direction="out"/> + </signal> + <signal name="userActionRequired"> + <arg name="uiData" type="a{sv}" direction="out"/> + </signal> + <signal name="refreshed"> + <arg name="uiData" type="a{sv}" direction="out"/> + </signal> + <signal name="statusChanged"> + <arg name="state" type="i" direction="out"/> + <arg name="message" type="s" direction="out"/> + </signal> + </interface> +</node> diff --git a/src/daemon/dbus/interfaces/org.tizen.SSO.singlesignonui.xml b/src/daemon/dbus/interfaces/org.tizen.SSO.singlesignonui.xml new file mode 100644 index 0000000..31ec6c1 --- /dev/null +++ b/src/daemon/dbus/interfaces/org.tizen.SSO.singlesignonui.xml @@ -0,0 +1,24 @@ +<node> + <interface name="org.tizen.SSO.singlesignonui"> + + <method name="queryDialog"> + <arg direction="in" type="a{sv}" name="parameters"/> + <arg direction="out" type="a{sv}" name="return_value"/> + </method> + + <method name="refreshDialog"> + <arg direction="in" type="a{sv}" name="parameters"/> + </method> + + <method name="cancelUiRequest"> + <arg direction="in" type="s" name="request_id"/> + </method> + + <!-- user selected 'refresh', regenerate captcha image/url --> + <signal name="refresh"> + <arg type="s" name="request_id"/> + </signal> + + </interface> +</node> + diff --git a/src/daemon/dbus/services/com.google.code.AccountsSSO.gSingleSignOn.service.in b/src/daemon/dbus/services/com.google.code.AccountsSSO.gSingleSignOn.service.in new file mode 100644 index 0000000..dcc3660 --- /dev/null +++ b/src/daemon/dbus/services/com.google.code.AccountsSSO.gSingleSignOn.service.in @@ -0,0 +1,3 @@ +[D-BUS Service] +Name=com.google.code.AccountsSSO.gSingleSignOn +Exec=@prefix@/bin/gsignond diff --git a/src/daemon/gsignond-auth-session.c b/src/daemon/gsignond-auth-session.c new file mode 100644 index 0000000..45dd640 --- /dev/null +++ b/src/daemon/gsignond-auth-session.c @@ -0,0 +1,572 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2013 Intel Corporation. + * + * Contact: Jussi Laako <jussi.laako@linux.intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#include "gsignond-auth-session.h" +#include "gsignond/gsignond-error.h" +#include "gsignond/gsignond-log.h" +#include "gsignond/gsignond-session-data.h" +#include "gsignond/gsignond-identity-info.h" +#include "plugins/gsignond-plugin-proxy-factory.h" +#include "gsignond-daemon.h" + +enum +{ + PROP_0, + PROP_METHOD, + N_PROPERTIES +}; + +static GParamSpec *properties[N_PROPERTIES]; + +enum { + SIG_PROCESS_STORE, + SIG_PROCESS_USER_ACTION_REQUIRED, + SIG_PROCESS_REFRESHED, + + SIG_MAX +}; + +static guint signals[SIG_MAX] = { 0 }; + +typedef struct { + GSignondAuthSession *self; + ProcessReadyCb ready_cb; + StateChangeCb state_change_cb; + gpointer userdata; +} _ProcessData; + +struct _GSignondAuthSessionPrivate +{ + gchar *method; + GSignondPluginProxy *proxy; + GSequence *available_mechanisms; + GSignondIdentityInfo *identity_info; + GSignondDictionary *token_data; +}; + +G_DEFINE_TYPE (GSignondAuthSession, gsignond_auth_session, G_TYPE_OBJECT) + +#define GSIGNOND_AUTH_SESSION_PRIV(obj) \ + G_TYPE_INSTANCE_GET_PRIVATE ((obj), GSIGNOND_TYPE_AUTH_SESSION, \ + GSignondAuthSessionPrivate) + +#define VALIDATE_READ_ACCESS(info, ctx, ret) \ +{ \ + GSignondAccessControlManager *acm = gsignond_get_access_control_manager(); \ + GSignondSecurityContextList *acl = gsignond_identity_info_get_access_control_list (info); \ + GSignondSecurityContext *owner = gsignond_identity_info_get_owner (info); \ + gboolean valid = gsignond_access_control_manager_peer_is_allowed_to_use_identity (acm, ctx, owner, acl); \ + gsignond_security_context_free (owner); \ + gsignond_security_context_list_free (acl); \ + if (!valid) { \ + WARN ("security check failed"); \ + if (error) { \ + *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_PERMISSION_DENIED, "Can not access identity"); \ + } \ + return ret; \ + } \ +} + +static gint +_sort_cmp (gconstpointer str1, gconstpointer str2, gpointer user_data) +{ + (void) user_data; + + return g_strcmp0 ((const gchar *) str1, (const gchar *) str2); +} + +static void +_create_mechanism_cache (GSignondAuthSession *self) +{ + GSignondAuthSessionPrivate *priv = self->priv; + + if (priv->available_mechanisms) + return; + + gchar **mechanisms, **iter; + GSequence *allowed_mechanisms = NULL; + GSequenceIter *wcard = NULL; + + self->priv->available_mechanisms = g_sequence_new (g_free); + if (!gsignond_identity_info_get_is_identity_new (priv->identity_info)) { + allowed_mechanisms = gsignond_identity_info_get_mechanisms ( + priv->identity_info, + priv->method); + if (!allowed_mechanisms) + return; + wcard = g_sequence_lookup (allowed_mechanisms, + (gpointer) "*", + _sort_cmp, NULL); + } + + g_object_get (self->priv->proxy, + "mechanisms", &mechanisms, + NULL); + if (!mechanisms) { + if (allowed_mechanisms) + g_sequence_free (allowed_mechanisms); + return; + } + if (wcard || !allowed_mechanisms) { + DBG ("add all mechanisms to allowed"); + for (iter = mechanisms; *iter != NULL; iter++) { + g_sequence_insert_sorted (priv->available_mechanisms, + (gpointer) *iter, + _sort_cmp, + NULL); + DBG (" allow '%s'", *iter); + } + } else { + DBG ("allow intersection of plugin and ACL mechanisms"); + for (iter = mechanisms; *iter != NULL; iter++) { + GSequenceIter *pos = g_sequence_lookup (allowed_mechanisms, + (gpointer) *iter, + _sort_cmp, + NULL); + DBG (" allow: '%s'", *iter); + if (pos) + g_sequence_insert_sorted (priv->available_mechanisms, + (gpointer) *iter, + _sort_cmp, + NULL); + } + } + if (allowed_mechanisms) + g_sequence_free (allowed_mechanisms); + g_free (mechanisms); +} + +gchar ** +gsignond_auth_session_query_available_mechanisms (GSignondAuthSession *self, + const gchar **wanted_mechanisms, + const GSignondSecurityContext *ctx, + GError **error) +{ + if (!self || !GSIGNOND_IS_AUTH_SESSION (self)) { + WARN ("assertion (iself && GSIGNOND_IS_AUTH_SESSION (self)) failed"); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, "Unknown error"); + return NULL; + } + + VALIDATE_READ_ACCESS (self->priv->identity_info, ctx, NULL); + + gchar **mechanisms, **iter; + const gchar **src_iter; + + _create_mechanism_cache (self); + mechanisms = (gchar **) + g_malloc0 ((g_sequence_get_length (self->priv->available_mechanisms) + + 1) * sizeof(gchar *)); + iter = mechanisms; + for (src_iter = wanted_mechanisms; *src_iter != NULL; src_iter++) { + GSequenceIter *pos = g_sequence_lookup ( + self->priv->available_mechanisms, + (gpointer) *src_iter, + _sort_cmp, + NULL); + if (pos) { + *iter = g_sequence_get (pos); + iter++; + } + } + *iter = NULL; + + return mechanisms; +} + +gboolean +gsignond_auth_session_process (GSignondAuthSession *self, + GSignondSessionData *session_data, + const gchar *mechanism, + const GSignondSecurityContext *ctx, + ProcessReadyCb ready_cb, + StateChangeCb state_change_cb, + gpointer userdata, + GError **error) +{ + if (!self || !GSIGNOND_IS_AUTH_SESSION (self)) { + WARN ("assertion (seöf && GSIGNOND_IS_AUTH_SESSION (self))failed"); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, "Unknown error"); + return FALSE; + } + + VALIDATE_READ_ACCESS (self->priv->identity_info, ctx, FALSE); + + _create_mechanism_cache (self); + if (!g_sequence_lookup (self->priv->available_mechanisms, + (gpointer) mechanism, + _sort_cmp, + NULL)) { + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_MECHANISM_NOT_AVAILABLE, "Mechanism is not available"); + return FALSE; + } + + if (session_data && + !gsignond_session_data_get_username (session_data) + && self->priv->identity_info) { + const gchar *username = gsignond_identity_info_get_username (self->priv->identity_info); + + if (username) { + gsignond_session_data_set_username (session_data, username); + } + } + + /* pass token data to session data */ + if (self->priv->token_data) { + GVariant *token_data = gsignond_dictionary_to_variant (self->priv->token_data); + /* FIXME: better add API GSignondSessionData to support(set/get) token data. + That will be the cleaner solution */ + gsignond_dictionary_set (session_data, "Token", token_data); + } + + _ProcessData * data = g_slice_new0 (_ProcessData); + data->self = self; + data->ready_cb = ready_cb; + data->state_change_cb = state_change_cb; + data->userdata = userdata; + gsignond_plugin_proxy_process(self->priv->proxy, self, session_data, + mechanism, data); + + return TRUE; +} + +gboolean +gsignond_auth_session_cancel (GSignondAuthSession *self, + const GSignondSecurityContext *ctx, + GError **error) +{ + if (!self || !GSIGNOND_IS_AUTH_SESSION (self)) { + WARN ("assertion (self && GSIGNOND_IS_AUTH_SESSION (self)) failed"); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, "Unknown error"); + return FALSE; + } + VALIDATE_READ_ACCESS (self->priv->identity_info, ctx, FALSE); + + gsignond_plugin_proxy_cancel(self->priv->proxy, self); + + return TRUE; +} + +void +gsignond_auth_session_abort_process (GSignondAuthSession *self) +{ + g_return_if_fail (self && GSIGNOND_IS_AUTH_SESSION (self)); + + gsignond_plugin_proxy_cancel (self->priv->proxy, self); +} + +void +gsignond_auth_session_user_action_finished (GSignondAuthSession *self, + GSignondSignonuiData *ui_data) +{ + gsignond_plugin_proxy_user_action_finished(self->priv->proxy, ui_data); +} + +void +gsignond_auth_session_refresh (GSignondAuthSession *self, + GSignondSignonuiData *ui_data) +{ + gsignond_plugin_proxy_refresh(self->priv->proxy, ui_data); +} + +GSignondAccessControlManager * +gsignond_auth_session_get_acm (GSignondAuthSession *session) +{ + return gsignond_get_access_control_manager (); +} + +static void +_get_property (GObject *object, guint property_id, GValue *value, + GParamSpec *pspec) +{ + GSignondAuthSession *self = GSIGNOND_AUTH_SESSION (object); + + switch (property_id) + { + case PROP_METHOD: + g_value_set_string (value, self->priv->method); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } +} + +static void +_set_property (GObject *object, guint property_id, const GValue *value, + GParamSpec *pspec) +{ + GSignondAuthSession *self = GSIGNOND_AUTH_SESSION (object); + + switch (property_id) + { + case PROP_METHOD: + self->priv->method = g_value_dup_string (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } +} + +static void +_dispose (GObject *object) +{ + GSignondAuthSession *self = GSIGNOND_AUTH_SESSION (object); + + if (self->priv->proxy) { + g_object_unref (self->priv->proxy); + self->priv->proxy = NULL; + } + + if (self->priv->identity_info) { + g_hash_table_unref ((GHashTable *)self->priv->identity_info); + self->priv->identity_info = NULL; + } + + if (self->priv->token_data) { + gsignond_dictionary_unref (self->priv->token_data); + self->priv->token_data = NULL; + } + + G_OBJECT_CLASS (gsignond_auth_session_parent_class)->dispose (object); +} + +static void +_finalize (GObject *object) +{ + GSignondAuthSession *self = GSIGNOND_AUTH_SESSION (object); + + if (self->priv->method) { + g_free (self->priv->method); + self->priv->method = NULL; + } + + if (self->priv->available_mechanisms) { + g_sequence_free (self->priv->available_mechanisms); + self->priv->available_mechanisms = NULL; + } + + G_OBJECT_CLASS (gsignond_auth_session_parent_class)->finalize (object); +} + +static void +gsignond_auth_session_init (GSignondAuthSession *self) +{ + self->priv = GSIGNOND_AUTH_SESSION_PRIV (self); + + self->priv->method = NULL; + self->priv->proxy = NULL; + self->priv->identity_info = NULL; + self->priv->token_data = NULL; + self->priv->available_mechanisms = NULL; +} + +static void +gsignond_auth_session_class_init (GSignondAuthSessionClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GSignondAuthSessionPrivate)); + + object_class->get_property = _get_property; + object_class->set_property = _set_property; + object_class->dispose = _dispose; + object_class->finalize = _finalize; + + properties[PROP_METHOD] = + g_param_spec_string ("method", + "authentication method", + "Authentication method used", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY + | G_PARAM_STATIC_STRINGS); + + g_object_class_install_properties (object_class, N_PROPERTIES, properties); + + signals[SIG_PROCESS_STORE] = g_signal_new ("process-store", + GSIGNOND_TYPE_AUTH_SESSION, + G_SIGNAL_RUN_LAST, + 0, + NULL, + NULL, + NULL, + G_TYPE_NONE, + 1, + GSIGNOND_TYPE_DICTIONARY); + + signals[SIG_PROCESS_USER_ACTION_REQUIRED] = g_signal_new ("process-user-action-required", + GSIGNOND_TYPE_AUTH_SESSION, + G_SIGNAL_RUN_LAST, + 0, + NULL, + NULL, + NULL, + G_TYPE_NONE, + 1, + GSIGNOND_TYPE_SIGNONUI_DATA); + + signals[SIG_PROCESS_REFRESHED] = g_signal_new ("process-refreshed", + GSIGNOND_TYPE_AUTH_SESSION, + G_SIGNAL_RUN_LAST, + 0, + NULL, + NULL, + NULL, + G_TYPE_NONE, + 1, + GSIGNOND_TYPE_SIGNONUI_DATA); +} + +/** + * gsignond_auth_session_get_method: + * @session: instance of #GSignondAuthSession + * + * Retrieves authentication method used by #session. + * + * Returns: (transfer none) authenticaiton method if success, NULL otherwise + */ +const gchar * +gsignond_auth_session_get_method (GSignondAuthSession *session) +{ + g_return_val_if_fail (session && GSIGNOND_IS_AUTH_SESSION (session), NULL); + + return session->priv->method; +} + +GSignondDictionary * +gsignond_auth_session_get_token_data (GSignondAuthSession *session) +{ + g_return_val_if_fail (session && GSIGNOND_IS_AUTH_SESSION (session), NULL); + + return session->priv->token_data; +} + +void +gsignond_auth_session_notify_process_result (GSignondAuthSession *iface, + GSignondSessionData *result, + gpointer userdata) +{ + if (!userdata) { + WARN("assert (userdata)"); + return ; + } + _ProcessData *data = (_ProcessData *)userdata; + + if (data->ready_cb) data->ready_cb (result, NULL, data->userdata); + + g_slice_free (_ProcessData, data); +} + +void +gsignond_auth_session_notify_process_error (GSignondAuthSession *iface, + const GError *error, + gpointer userdata) +{ + if (!userdata) { + WARN("assert (userdata)"); + return ; + } + _ProcessData *data = (_ProcessData *)userdata; + + if (data->ready_cb) data->ready_cb (NULL, error, data->userdata); + + g_slice_free (_ProcessData, data); +} + +void +gsignond_auth_session_notify_state_changed (GSignondAuthSession *self, + gint state, + const gchar *message, + gpointer userdata) +{ + if (!userdata) { + WARN("assert (userdata)"); + return ; + } + _ProcessData *data = (_ProcessData *)userdata; + + if (data->state_change_cb) data->state_change_cb (state, message, data->userdata); +} + +void +gsignond_auth_session_notify_store (GSignondAuthSession *self, + GSignondDictionary *token_data) +{ + g_return_if_fail (self && GSIGNOND_IS_AUTH_SESSION (self)); + g_return_if_fail (token_data); + + /* cache token data */ + if (self->priv->token_data) + gsignond_dictionary_unref (self->priv->token_data); + self->priv->token_data = token_data; + gsignond_dictionary_ref (self->priv->token_data); + + g_signal_emit (self, signals[SIG_PROCESS_STORE], 0, token_data); +} + +void +gsignond_auth_session_notify_user_action_required (GSignondAuthSession *self, + GSignondSignonuiData *ui_data) +{ + g_signal_emit (self, signals[SIG_PROCESS_USER_ACTION_REQUIRED], 0, ui_data); +} + +void +gsignond_auth_session_notify_refreshed (GSignondAuthSession *self, + GSignondSignonuiData *ui_data) +{ + g_signal_emit (self, signals[SIG_PROCESS_REFRESHED], 0, ui_data); +} + + +/** + * gsignond_auth_session_new: + * @info: instance of #GSignondIdentityInfo + * @method: authentication method + * @token_data: (transfer full) stored token data stored for #method + * + * Creates instance of #GSignondAuthSession. + * + * Returns: (transfer full) newly created object + */ +GSignondAuthSession * +gsignond_auth_session_new (GSignondIdentityInfo *info, const gchar *method, GSignondDictionary *token_data) +{ + GSignondPluginProxy* proxy = NULL; + + g_return_val_if_fail (method, NULL); + + proxy = gsignond_plugin_proxy_factory_get_plugin( + gsignond_get_plugin_proxy_factory(), method); + if (!proxy) return NULL; + + GSignondAuthSession *auth_session = + g_object_new (GSIGNOND_TYPE_AUTH_SESSION, + "method", method, NULL); + auth_session->priv->proxy = proxy; + auth_session->priv->identity_info = g_hash_table_ref ((GHashTable *)info); + auth_session->priv->token_data = token_data; + + return auth_session; +} diff --git a/src/daemon/gsignond-auth-session.h b/src/daemon/gsignond-auth-session.h new file mode 100644 index 0000000..300da28 --- /dev/null +++ b/src/daemon/gsignond-auth-session.h @@ -0,0 +1,153 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2013 Intel Corporation. + * + * Contact: Jussi Laako <jussi.laako@linux.intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#ifndef _GSIGNOND_AUTH_SESSION_H_ +#define _GSIGNOND_AUTH_SESSION_H_ + +#include <glib-object.h> + +#include "gsignond-types.h" +#include <gsignond/gsignond-dictionary.h> +#include <gsignond/gsignond-identity-info.h> +#include <gsignond/gsignond-signonui-data.h> +#include <gsignond/gsignond-session-data.h> +#include <gsignond/gsignond-access-control-manager.h> + +G_BEGIN_DECLS + +#define GSIGNOND_TYPE_AUTH_SESSION \ + (gsignond_auth_session_get_type()) +#define GSIGNOND_AUTH_SESSION(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), GSIGNOND_TYPE_AUTH_SESSION, \ + GSignondAuthSession)) +#define GSIGNOND_AUTH_SESSION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), GSIGNOND_TYPE_AUTH_SESSION, \ + GSignondAuthSessionClass)) +#define GSIGNOND_IS_AUTH_SESSION(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), GSIGNOND_TYPE_AUTH_SESSION)) +#define GSIGNOND_IS_AUTH_SESSION_CLASS(obj) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), GSIGNOND_TYPE_AUTH_SESSION)) +#define GSIGNOND_AUTH_SESSION_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS((obj), GSIGNOND_TYPE_AUTH_SESSION, \ + GSignondAuthSessionClass)) + +typedef struct _GSignondAuthSessionPrivate GSignondAuthSessionPrivate; +typedef void (*ProcessReadyCb) (GSignondSessionData *results, const GError *error, gpointer user_data); +typedef void (*StateChangeCb) (gint state, const gchar *message, gpointer userdata); + +struct _GSignondAuthSession +{ + GObject parent; + + /* private */ + GSignondAuthSessionPrivate *priv; +}; + +struct _GSignondAuthSessionClass +{ + GObjectClass parent_class; +}; + +GType gsignond_auth_session_get_type (void); + +gchar ** +gsignond_auth_session_query_available_mechanisms (GSignondAuthSession *self, + const gchar **wanted_mechanisms, + const GSignondSecurityContext *ctx, + GError **error); + +gboolean +gsignond_auth_session_process (GSignondAuthSession *self, + GSignondSessionData *session_data, + const gchar *mechanism, + const GSignondSecurityContext *ctx, + ProcessReadyCb ready_cb, + StateChangeCb state_change_cb, + gpointer userdata, + GError **error); +gboolean +gsignond_auth_session_cancel (GSignondAuthSession *self, + const GSignondSecurityContext *ctx, + GError **error); + +void +gsignond_auth_session_abort_process (GSignondAuthSession *self); + +void +gsignond_auth_session_user_action_finished (GSignondAuthSession *self, + GSignondSignonuiData *ui_data); + +void +gsignond_auth_session_refresh (GSignondAuthSession *self, + GSignondSignonuiData *ui_data); + +const gchar * +gsignond_auth_session_get_method (GSignondAuthSession *session); + +GSignondDictionary * +gsignond_auth_session_get_token_data (GSignondAuthSession *session); + +GSignondAccessControlManager * +gsignond_auth_session_get_acm (GSignondAuthSession *session); + +gboolean +gsignond_auth_session_set_id(GSignondAuthSession *session, gint id); + +void +gsignond_auth_session_notify_process_result (GSignondAuthSession *iface, + GSignondSessionData *result, + gpointer userdata); + +void +gsignond_auth_session_notify_process_error (GSignondAuthSession *iface, + const GError *error, + gpointer userdata); +void +gsignond_auth_session_notify_state_changed (GSignondAuthSession *self, + gint state, + const gchar *message, + gpointer userdata); + +void +gsignond_auth_session_notify_store (GSignondAuthSession *self, + GSignondDictionary *token_data); + +void +gsignond_auth_session_notify_user_action_required (GSignondAuthSession *self, + GSignondSignonuiData *ui_data); + +void +gsignond_auth_session_notify_refreshed (GSignondAuthSession *self, + GSignondSignonuiData *ui_data); + +GSignondAuthSession * +gsignond_auth_session_new (GSignondIdentityInfo *info, + const gchar *method, + GSignondDictionary *token_data); + +G_END_DECLS + +#endif /* _GSIGNOND_AUTH_SESSION_H_ */ + diff --git a/src/daemon/gsignond-daemon.c b/src/daemon/gsignond-daemon.c new file mode 100644 index 0000000..ef4177b --- /dev/null +++ b/src/daemon/gsignond-daemon.c @@ -0,0 +1,794 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2012 - 2013 Intel Corporation. + * + * Contact: Jussi Laako <jussi.laako@linux.intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#include "gsignond-daemon.h" + +#include <gmodule.h> + +#include "gsignond/gsignond-config.h" +#include "gsignond/gsignond-log.h" +#include "gsignond/gsignond-error.h" +#include "gsignond/gsignond-extension-interface.h" +#include "gsignond/gsignond-utils.h" +#include "daemon/gsignond-identity.h" +#include "daemon/db/gsignond-db-credentials-database.h" + +struct _GSignondDaemonPrivate +{ + GSignondConfig *config; + GHashTable *identities; + GModule *extension_module; + GSignondExtension *extension; + GSignondStorageManager *storage_manager; + GSignondSecretStorage *secret_storage; + GSignondDbCredentialsDatabase *db; + GSignondAccessControlManager *acm; + GSignondPluginProxyFactory *plugin_proxy_factory; + GSignondSignonuiProxy *ui; +}; + +G_DEFINE_TYPE (GSignondDaemon, gsignond_daemon, G_TYPE_OBJECT) + + +#define GSIGNOND_DAEMON_PRIV(obj) G_TYPE_INSTANCE_GET_PRIVATE ((obj), GSIGNOND_TYPE_DAEMON, GSignondDaemonPrivate) + +static GObject *self = 0; + +static GObject* +_constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + /* + * Signleton daemon + */ + if (!self) { + self = G_OBJECT_CLASS (gsignond_daemon_parent_class)->constructor ( + type, n_construct_params, construct_params); + g_object_add_weak_pointer (self, (gpointer) &self); + } + else { + g_object_ref (self); + } + + return self; +} + +void +_free_identity (gpointer data, gpointer user_data) +{ + (void) user_data; + GObject *identity = G_OBJECT (data); + + DBG ("free identity %p", identity); + g_object_unref (identity); +} + +static void +_dispose (GObject *object) +{ + GSignondDaemon *self = GSIGNOND_DAEMON(object); + + if (self->priv->ui) { + g_object_unref (self->priv->ui); + self->priv->ui = NULL; + } + + if (self->priv->plugin_proxy_factory) { + g_object_unref (self->priv->plugin_proxy_factory); + self->priv->plugin_proxy_factory = NULL; + } + + if (self->priv->identities) { + g_hash_table_unref (self->priv->identities); + self->priv->identities = NULL; + } + + if (self->priv->db) { + + if (!gsignond_db_credentials_database_close_secret_storage ( + self->priv->db)) { + WARN("gsignond_db_credentials_database_close_secret_storage() failed"); + } + g_object_unref (self->priv->db); + self->priv->db = NULL; + } + + if (self->priv->extension) { + if (gsignond_storage_manager_filesystem_is_mounted ( + self->priv->storage_manager)) { + if (!gsignond_storage_manager_unmount_filesystem ( + self->priv->storage_manager)) { + WARN("gsignond_storage_manager_unmount_filesystem() failed"); + } + } + + self->priv->storage_manager = NULL; + self->priv->secret_storage = NULL; + self->priv->acm = NULL; + g_object_unref (self->priv->extension); + self->priv->extension = NULL; + } + + if (self->priv->extension_module) { + g_module_close (self->priv->extension_module); + self->priv->extension_module = NULL; + } + + if (self->priv->config) { + g_object_unref (self->priv->config); + self->priv->config = NULL; + } + + G_OBJECT_CLASS (gsignond_daemon_parent_class)->dispose (object); +} + +static void +_finalize (GObject *object) +{ + G_OBJECT_CLASS (gsignond_daemon_parent_class)->finalize (object); +} + +static gboolean +_init_extension (GSignondDaemon *self) +{ + guint32 ext_ver = gsignond_extension_get_version (self->priv->extension); + + DBG ("Initializing extension '%s' %d.%d.%d.%d", + gsignond_extension_get_name (self->priv->extension), + (ext_ver >> 24), + (ext_ver >> 16) & 0xff, + (ext_ver >> 8) & 0xff, + ext_ver & 0xff); + + self->priv->storage_manager = + gsignond_extension_get_storage_manager (self->priv->extension, + self->priv->config); + self->priv->secret_storage = + gsignond_extension_get_secret_storage (self->priv->extension, + self->priv->config); + self->priv->acm = + gsignond_extension_get_access_control_manager (self->priv->extension, + self->priv->config); + + g_return_val_if_fail (self->priv->storage_manager && + self->priv->secret_storage && + self->priv->acm, + FALSE); + + return TRUE; +} + +static gboolean +_init_extensions (GSignondDaemon *self) +{ + gboolean res = TRUE; + gboolean symfound; + const gchar *ext_path; + const gchar *ext_name; + gchar *mod_name; + gchar *mod_filename; + gchar *initf_name; + GSignondExtensionInit ext_init; + + ext_path = gsignond_config_get_string (self->priv->config, + GSIGNOND_CONFIG_GENERAL_EXTENSIONS_DIR); + ext_name = gsignond_config_get_string (self->priv->config, + GSIGNOND_CONFIG_GENERAL_EXTENSION); + if (ext_name && !ext_path) return FALSE; + + if (ext_name && g_strcmp0 (ext_name, "default") != 0) { + mod_name = g_strdup_printf ("extension-%s", ext_name); + mod_filename = g_module_build_path (ext_path, mod_name); + g_free (mod_name); + if (!mod_filename) return FALSE; + DBG ("Loading extension '%s'", mod_filename); + self->priv->extension_module = + g_module_open (mod_filename, G_MODULE_BIND_LOCAL); + g_free (mod_filename); + if (!self->priv->extension_module) { + DBG("failed to load module : %s", g_module_error()); + return FALSE; + } + initf_name = g_strdup_printf ("%s_extension_init", ext_name); + symfound = g_module_symbol (self->priv->extension_module, + initf_name, + (gpointer *) &ext_init); + g_free(initf_name); + if (!symfound) { + g_module_close (self->priv->extension_module); + self->priv->extension_module = NULL; + return FALSE; + } + } else { + ext_init = default_extension_init; + } + self->priv->extension = ext_init (); + g_return_val_if_fail (self->priv->extension && + GSIGNOND_IS_EXTENSION (self->priv->extension), + FALSE); + + res = _init_extension (self); + + return res; +} + +static gboolean +_init_storage (GSignondDaemon *self) +{ + const gchar *storage_location; + + DBG("Initializing storage"); + + if (!gsignond_storage_manager_storage_is_initialized ( + self->priv->storage_manager)) { + if (!gsignond_storage_manager_initialize_storage ( + self->priv->storage_manager)) + return FALSE; + } + + storage_location = gsignond_storage_manager_mount_filesystem ( + self->priv->storage_manager); + if (storage_location == NULL) + return FALSE; + gsignond_config_set_string (self->priv->config, + GSIGNOND_CONFIG_GENERAL_SECURE_DIR, storage_location); + + return (storage_location != NULL); +} + +static gboolean +_open_database (GSignondDaemon *self) +{ + DBG("Open databases"); + + self->priv->db = gsignond_db_credentials_database_new (self->priv->config, + self->priv->secret_storage); + if (!self->priv->db) + return FALSE; + + return gsignond_db_credentials_database_open_secret_storage ( + self->priv->db); +} + +static gboolean +_clear_identity (gpointer idp, gpointer identityp, gpointer user_data) +{ + (void) user_data; + + return gsignond_identity_clear (GSIGNOND_IDENTITY (identityp)); +} + +static void +gsignond_daemon_init (GSignondDaemon *self) +{ + self->priv = GSIGNOND_DAEMON_PRIV(self); + + self->priv->config = gsignond_config_new (); + self->priv->identities = g_hash_table_new_full ( + g_direct_hash, g_direct_equal, NULL, NULL); + self->priv->plugin_proxy_factory = gsignond_plugin_proxy_factory_new( + self->priv->config); + + if (!_init_extensions (self)) + ERR("gsignond_daemon_init_extensions() failed"); + + if (!_init_storage (self)) + ERR("gsignond_daemon_init_storage() failed"); + if (!_open_database (self)) + ERR("gisgnond_daemon_open_database() failed"); + + self->priv->ui = gsignond_signonui_proxy_new (); +} + +static void +gsignond_daemon_class_init (GSignondDaemonClass *klass) +{ + GObjectClass* object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (GSignondDaemonPrivate)); + + object_class->constructor = _constructor; + object_class->dispose = _dispose; + object_class->finalize = _finalize; +} + +static gboolean +_compare_identity_by_pointer (gpointer key, gpointer value, gpointer dead_object) +{ + return value == dead_object; +} + +static void +_on_identity_disposed (gpointer data, GObject *object) +{ + GSignondDaemon *daemon = GSIGNOND_DAEMON (data); + + DBG ("daemon %p identity %p disposed", daemon, object); + g_hash_table_foreach_remove (daemon->priv->identities, + _compare_identity_by_pointer, object); +} + +guint32 +gsignond_daemon_store_identity (GSignondDaemon *daemon, GSignondIdentity *identity) +{ + g_return_val_if_fail (daemon && GSIGNOND_IS_DAEMON (daemon), 0); + g_return_val_if_fail (identity && GSIGNOND_IS_IDENTITY(identity), 0); + + GSignondIdentityInfo *info = NULL; + guint32 id = 0; + gboolean was_new_identity = FALSE; + + info = gsignond_identity_get_identity_info(identity); + if (!info) return 0; + + was_new_identity = gsignond_identity_info_get_is_identity_new (info); + + id = gsignond_db_credentials_database_update_identity (daemon->priv->db, info); + + if (was_new_identity && id) { + g_hash_table_insert (daemon->priv->identities, GUINT_TO_POINTER(id), identity); + g_object_weak_ref (G_OBJECT (identity), _on_identity_disposed, daemon); + } + + return id; +} + +gboolean +gsignond_daemon_remove_identity (GSignondDaemon *daemon, guint32 id) +{ + g_return_val_if_fail (daemon && GSIGNOND_IS_DAEMON (daemon), FALSE); + + return gsignond_db_credentials_database_remove_identity(daemon->priv->db, id); +} + +guint32 +gsignond_daemon_add_identity_reference (GSignondDaemon *daemon, guint32 identity_id, const GSignondSecurityContext *owner, const gchar *reference) +{ + g_return_val_if_fail (daemon && GSIGNOND_IS_DAEMON (daemon), 0); + + return gsignond_db_credentials_database_insert_reference (daemon->priv->db, identity_id, owner, reference); +} + +gboolean +gsignond_daemon_remove_identity_reference (GSignondDaemon *daemon, guint32 identity_id, const GSignondSecurityContext *owner, const gchar *reference) +{ + g_return_val_if_fail (daemon && GSIGNOND_IS_DAEMON (daemon), FALSE); + + return gsignond_db_credentials_database_remove_reference (daemon->priv->db, identity_id, owner, reference); +} + +gboolean +gsignond_daemon_store_identity_data (GSignondDaemon *daemon, guint32 identity_id, const gchar *method, GSignondDictionary *data) +{ + g_return_val_if_fail (daemon && GSIGNOND_IS_DAEMON (daemon), FALSE); + + return gsignond_db_credentials_database_update_data (daemon->priv->db, identity_id, method, data); +} + +gboolean +gsignond_daemon_clear_identity_data (GSignondDaemon *daemon, guint32 identity_id) +{ + g_return_val_if_fail (daemon && GSIGNOND_IS_DAEMON (daemon), FALSE); + + return gsignond_db_credentials_database_remove_data (daemon->priv->db, identity_id, NULL); +} + +GSignondDictionary * +gsignond_daemon_load_identity_data (GSignondDaemon *daemon, guint32 identity_id, const gchar *method) +{ + g_return_val_if_fail (daemon && GSIGNOND_IS_DAEMON (daemon), NULL); + g_return_val_if_fail (identity_id, NULL); + g_return_val_if_fail (method, NULL); + + return gsignond_db_credentials_database_load_data (daemon->priv->db, identity_id, method); +} + +GSignondIdentity * +gsignond_daemon_register_new_identity (GSignondDaemon *daemon, + const GSignondSecurityContext *ctx, + GError **error) +{ + if (!daemon || !GSIGNOND_IS_DAEMON (daemon) || !ctx) { + WARN ("assertion failed (daemon && GSIGNOND_IS_DAEMON (daemon)) failed"); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, "Unknown error"); + return NULL; + } + + GSignondIdentityInfo *info = gsignond_identity_info_new (); + GSignondIdentity *identity = NULL; + GSignondSecurityContext *owner = NULL; + GSignondSecurityContextList *acl = NULL; + + owner = gsignond_security_context_copy (ctx); + + gsignond_identity_info_set_owner (info, owner); + + acl = (GSignondSecurityContextList *)g_list_append (NULL, owner); + gsignond_identity_info_set_access_control_list (info, acl); + gsignond_security_context_free (owner); + g_list_free (acl); + + DBG("register_new_identity: cache size : %d", g_hash_table_size(daemon->priv->identities)); + identity = gsignond_identity_new (daemon, info); + if (identity == NULL) { + gsignond_dictionary_unref (info); + ERR("Unable to register new identity"); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_INTERNAL_SERVER, "Internal server error"); + return NULL; + } + DBG(" --- registered new identity : %p", identity); + return identity; +} + +GSignondIdentity * +gsignond_daemon_get_identity (GSignondDaemon *daemon, + const guint32 id, + const GSignondSecurityContext *ctx, + GError **error) +{ + if (!daemon || !GSIGNOND_IS_DAEMON (daemon)) { + WARN ("assertion (daemon && GSIGNOND_IS_DAEMON (daemon)) failed"); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, "Unknown error"); + return NULL; + } + if (id <= 0) { + WARN ("client provided invalid identity id"); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_IDENTITY_ERR, "Invalid identity id"); + return NULL; + } + + GSignondIdentity *identity = NULL; + GSignondIdentityInfo *identity_info = NULL; + +#define VALIDATE_IDENTITY_READ_ACCESS(info, ctx, ret) \ +{ \ + GSignondAccessControlManager *acm = daemon->priv->acm; \ + GSignondSecurityContextList *acl = gsignond_identity_info_get_access_control_list (info); \ + GSignondSecurityContext *owner = gsignond_identity_info_get_owner (info); \ + gboolean valid = gsignond_access_control_manager_peer_is_allowed_to_use_identity (acm, ctx, owner, acl); \ + gsignond_security_context_free (owner); \ + gsignond_security_context_list_free (acl); \ + if (!valid) { \ + WARN ("identity access check failed"); \ + gsignond_dictionary_unref (info); \ + if (error) { \ + *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_PERMISSION_DENIED, "Can not read identity"); \ + } \ + return ret; \ + } \ +} + DBG("Get identity for id '%d'\n cache size : %d", id, g_hash_table_size(daemon->priv->identities)); + identity = GSIGNOND_IDENTITY(g_hash_table_lookup (daemon->priv->identities, GUINT_TO_POINTER(id))); + if (identity) { + identity_info = gsignond_identity_get_identity_info (identity); + VALIDATE_IDENTITY_READ_ACCESS (identity_info, ctx, NULL); + DBG ("using cased Identity '%p' for id %d", identity, id); + + return GSIGNOND_IDENTITY (g_object_ref (identity)); + } + + /* identity not found in cache, so try to load form db */ + identity_info = gsignond_db_credentials_database_load_identity ( + daemon->priv->db, id, TRUE); + if (!identity_info) { + if (error) { + const GError *err = gsignond_db_credentials_database_get_last_error (daemon->priv->db); + *error = err ? g_error_copy (err) : gsignond_get_gerror_for_id ( + GSIGNOND_ERROR_IDENTITY_NOT_FOUND, "identity not found with id '%d'", id); + } + return NULL; + } + + VALIDATE_IDENTITY_READ_ACCESS (identity_info, ctx, NULL); + + identity = gsignond_identity_new (daemon, identity_info); + if (!identity) { + gsignond_identity_info_unref (identity_info); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_INTERNAL_SERVER, "Internal server error"); + return NULL; + } + + g_hash_table_insert (daemon->priv->identities, GUINT_TO_POINTER(id), identity); + g_object_weak_ref (G_OBJECT (identity), _on_identity_disposed, daemon); + + DBG("created new identity '%p' for id '%d'", identity, id); + + return identity; + +#undef VALIDATE_IDENTITY_READ_ACCESS +} + +const gchar ** +gsignond_daemon_query_methods (GSignondDaemon *daemon, GError **error) +{ + if (!daemon || !GSIGNOND_IS_DAEMON (daemon)) { + WARN ("assertion (daemon && GSIGNOND_IS_DAEMON(daemon)) failed"); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, "Unknown error"); + return NULL; + } + + return gsignond_plugin_proxy_factory_get_plugin_types ( + daemon->priv->plugin_proxy_factory); +} + +const gchar ** +gsignond_daemon_query_mechanisms (GSignondDaemon *daemon, const gchar *method, GError **error) +{ + if (!daemon || !GSIGNOND_IS_DAEMON (daemon)) { + WARN ("assertion (daemon && GSIGNOND_IS_DAEMON(daemon)) failed"); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, "Unknown error"); + return NULL; + } + + const gchar **mechanisms = gsignond_plugin_proxy_factory_get_plugin_mechanisms ( + daemon->priv->plugin_proxy_factory, method); + + if (!mechanisms || mechanisms[0] == NULL) { + DBG("no mechanisms found for method '%s'", method); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_METHOD_NOT_KNOWN, "method '%s' not found", method); + } + + return mechanisms; +} + +static gboolean +_check_keychain_access (GSignondDaemon *self, + const GSignondSecurityContext *ctx, + GError **error) +{ + GSignondAccessControlManager *acm = self->priv->acm; + GSignondSecurityContext *keychain = + gsignond_access_control_manager_security_context_of_keychain (acm); + gboolean has_access = + (gsignond_security_context_compare (keychain, ctx) == 0); + DBG ("keychain access compare [%s:%s] vs [%s:%s] = %d", + gsignond_security_context_get_system_context (keychain), + gsignond_security_context_get_application_context (keychain), + gsignond_security_context_get_system_context (ctx), + gsignond_security_context_get_application_context (ctx), + has_access); + gsignond_security_context_free (keychain); + if (!has_access) { + WARN ("keychain access check failed"); + if (error) { + *error = gsignond_get_gerror_for_id ( + GSIGNOND_ERROR_PERMISSION_DENIED, + "Can not access keychain functionality"); + } + } + return has_access; +} + +GSignondIdentityInfoList * +gsignond_daemon_query_identities (GSignondDaemon *self, + GVariant *filter, + const GSignondSecurityContext *ctx, + GError **error) +{ + if (!self || !GSIGNOND_IS_DAEMON (self)) { + WARN ("assertion (self && GSIGNOND_IS_DAEMON(self)) failed"); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, + "Unknown error"); + return NULL; + } + + GSignondIdentityInfoList *identities = NULL; + GSignondDictionary *filter_map = + gsignond_dictionary_new_from_variant (filter); + + if (!_check_keychain_access (self, ctx, NULL)) { + /* Other than 'keychain' app, can only get identities owned by it. */ + gsignond_dictionary_set (filter_map, "Owner", + gsignond_security_context_to_variant (ctx)); + } + + identities = gsignond_db_credentials_database_load_identities ( + self->priv->db, filter_map); + + gsignond_dictionary_unref (filter_map); + + if (!identities) { + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, + "Not found"); + } + + return identities; +} + +gboolean +gsignond_daemon_clear (GSignondDaemon *self, + const GSignondSecurityContext *ctx, + GError **error) +{ + if (!self || !GSIGNOND_IS_DAEMON (self)) { + WARN ("assertion (self && GSIGNOND_IS_DAEMON(self)) failed"); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, "Unknown error"); + return FALSE; + } + + if (!_check_keychain_access (self, ctx, error)) + return FALSE; + + gboolean retval = TRUE; + GSignondDaemonPrivate *priv = self->priv; + + DBG ("destroy all identities"); + g_hash_table_foreach_remove (priv->identities, _clear_identity, self); + if (g_hash_table_size (priv->identities) > 0) { + WARN ("g_hash_table_foreach_remove(identities) failed for some items"); + retval = FALSE; + } + DBG ("perform internal clear"); + if (!gsignond_db_credentials_database_clear (priv->db)) { + WARN ("gsignond_db_credentials_database_clear() failed"); + retval = FALSE; + } + + DBG ("close databases"); + if (!gsignond_db_credentials_database_close_secret_storage (priv->db)) { + WARN ("gsignond_db_credentials_database_close_secret_storage() failed"); + retval = FALSE; + } + g_object_unref (priv->db); + priv->db = NULL; + + DBG ("clear data"); + if (!gsignond_storage_manager_delete_storage (priv->storage_manager)) { + WARN ("gsignond_storage_manager_delete_storage() failed"); + retval = FALSE; + } + if (!gsignond_wipe_directory (gsignond_config_get_string (priv->config, + GSIGNOND_CONFIG_GENERAL_STORAGE_PATH))) { + WARN ("gsignond_wipe_directory() failed"); + retval = FALSE; + } + + DBG ("re-create storage"); + if (!_init_storage (self)) { + WARN ("_init_storage() failed"); + retval = FALSE; + } + + if (!_open_database (self)) { + WARN ("_open_database() failed"); + retval = FALSE; + } + + return retval; +} + +/** + * gsignond_daemon_new: + * + * Returns: (transfer full): newly created object of type #GSignondDaemon + */ +GSignondDaemon * +gsignond_daemon_new () +{ + return GSIGNOND_DAEMON(g_object_new (GSIGNOND_TYPE_DAEMON, NULL)); +} + +guint +gsignond_daemon_get_timeout (GSignondDaemon *self) +{ + return gsignond_config_get_integer (self->priv->config, + GSIGNOND_CONFIG_DBUS_DAEMON_TIMEOUT); +} + +guint +gsignond_daemon_get_identity_timeout (GSignondDaemon *self) +{ + return gsignond_config_get_integer (self->priv->config, + GSIGNOND_CONFIG_DBUS_IDENTITY_TIMEOUT); +} + +guint +gsignond_daemon_get_auth_session_timeout (GSignondDaemon *self) +{ + return gsignond_config_get_integer (self->priv->config, + GSIGNOND_CONFIG_DBUS_AUTH_SESSION_TIMEOUT); +} + +GSignondAccessControlManager * +gsignond_daemon_get_access_control_manager (GSignondDaemon *self) +{ + g_assert (self != NULL); + g_assert (self->priv != NULL); + + return self->priv->acm; +} + +GSignondPluginProxyFactory * +gsignond_daemon_get_plugin_proxy_factory (GSignondDaemon *self) +{ + g_assert (self != NULL); + g_assert (self->priv != NULL); + + return self->priv->plugin_proxy_factory; +} + +GSignondConfig * +gsignond_daemon_get_config (GSignondDaemon *self) +{ + g_assert (self != NULL); + g_assert (self->priv != NULL); + + return self->priv->config; +} + +gboolean +gsignond_daemon_show_dialog (GSignondDaemon *self, + GObject *caller, + GSignondSignonuiData *ui_data, + GSignondSignonuiProxyQueryDialogCb handler, + GSignondSignonuiProxyRefreshCb refresh_handler, + gpointer userdata) +{ + g_return_val_if_fail (self && GSIGNOND_IS_DAEMON(self), FALSE); + + return gsignond_signonui_proxy_query_dialog (self->priv->ui, caller, ui_data, handler, refresh_handler, userdata); +} + +gboolean +gsignond_daemon_refresh_dialog (GSignondDaemon *self, + GObject *caller, + GSignondSignonuiData *ui_data, + GSignondSignonuiProxyRefreshDialogCb handler, + gpointer userdata) +{ + g_return_val_if_fail (self && GSIGNOND_IS_DAEMON(self), FALSE); + + return gsignond_signonui_proxy_refresh_dialog (self->priv->ui, caller, ui_data, handler, userdata); +} + +gboolean +gsignond_daemon_cancel_dialog (GSignondDaemon *self, + GObject *caller, + GSignondSignonuiProxyCancelRequestCb handler, + gpointer userdata) +{ + g_return_val_if_fail (self && GSIGNOND_IS_DAEMON(self), FALSE); + + return gsignond_signonui_proxy_cancel_request (self->priv->ui, caller, handler, userdata); +} + +GSignondAccessControlManager * +gsignond_get_access_control_manager () +{ + return gsignond_daemon_get_access_control_manager(GSIGNOND_DAEMON(self)); +} + +GSignondPluginProxyFactory * +gsignond_get_plugin_proxy_factory () +{ + return gsignond_daemon_get_plugin_proxy_factory(GSIGNOND_DAEMON(self)); +} + +GSignondConfig * +gsignond_get_config () +{ + return gsignond_daemon_get_config(GSIGNOND_DAEMON(self)); +} diff --git a/src/daemon/gsignond-daemon.h b/src/daemon/gsignond-daemon.h new file mode 100644 index 0000000..2dd8fa5 --- /dev/null +++ b/src/daemon/gsignond-daemon.h @@ -0,0 +1,166 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2012 Intel Corporation. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#ifndef __GSIGNOND_DAEMON_H_ +#define __GSIGNOND_DAEMON_H_ + +#include <glib.h> +#include <glib-object.h> + +#include "gsignond-types.h" +#include <gsignond/gsignond-access-control-manager.h> +#include <gsignond/gsignond-identity-info.h> +#include "gsignond-signonui-proxy.h" +#include "plugins/gsignond-plugin-proxy-factory.h" + +G_BEGIN_DECLS + +#define GSIGNOND_TYPE_DAEMON (gsignond_daemon_get_type()) +#define GSIGNOND_DAEMON(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GSIGNOND_TYPE_DAEMON, GSignondDaemon)) +#define GSIGNOND_DAEMON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GSIGNOND_TYPE_DAEMON, GSignondDaemonClass)) +#define GSIGNOND_IS_DAEMON(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GSIGNOND_TYPE_DAEMON)) +#define GSIGNOND_IS_DAEMON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GSIGNOND_TYPE_DAEMON)) +#define GSIGNOND_DAEMON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GSIGNOND_TYPE_DAEMON, GSignondDaemonClass)) + +typedef struct _GSignondDaemonPrivate GSignondDaemonPrivate; + +struct _GSignondDaemon +{ + GObject parent; + + /* priv */ + GSignondDaemonPrivate *priv; +}; + +struct _GSignondDaemonClass +{ + GObjectClass parent_class; +}; + +GType gsignond_daemon_get_type (void) G_GNUC_CONST; + +GSignondDaemon * gsignond_daemon_new (); + +GSignondIdentity * +gsignond_daemon_register_new_identity (GSignondDaemon *daemon, + const GSignondSecurityContext *ctx, + GError **error) ; + +GSignondIdentity * +gsignond_daemon_get_identity (GSignondDaemon *daemon, + const guint32 id, + const GSignondSecurityContext *ctx, + GError **error); + +const gchar ** +gsignond_daemon_query_methods (GSignondDaemon *daemon, GError **error); + +const gchar ** +gsignond_daemon_query_mechanisms (GSignondDaemon *daemon, + const gchar *method, + GError **error); + +GSignondIdentityInfoList * +gsignond_daemon_query_identities (GSignondDaemon *daemon, + GVariant *filter, + const GSignondSecurityContext *ctx, + GError **error); + +gboolean +gsignond_daemon_clear (GSignondDaemon *daemon, + const GSignondSecurityContext *ctx, + GError **error); + +guint32 +gsignond_daemon_store_identity (GSignondDaemon *daemon, GSignondIdentity *identity); + +gboolean +gsignond_daemon_remove_identity (GSignondDaemon *daemon, guint32 id); + +guint32 +gsignond_daemon_add_identity_reference (GSignondDaemon *daemon, guint32 identity_id, const GSignondSecurityContext *owner, const gchar *ref); + +gboolean +gsignond_daemon_remove_identity_reference (GSignondDaemon *daemon, guint32 identity_id, const GSignondSecurityContext *owner, const gchar *ref); + +gboolean +gsignond_daemon_store_identity_data (GSignondDaemon *daemon, guint32 identity_id, const gchar *method, GSignondDictionary *data); + +gboolean +gsignond_daemon_clear_identity_data (GSignondDaemon *daemon, guint32 identity_id); + +GSignondDictionary * +gsignond_daemon_load_identity_data (GSignondDaemon *daemon, guint32 identity_id, const gchar *method); + +guint +gsignond_daemon_get_timeout (GSignondDaemon *self) G_GNUC_CONST; + +guint +gsignond_daemon_get_identity_timeout (GSignondDaemon *self) G_GNUC_CONST; + +guint +gsignond_daemon_get_auth_session_timeout (GSignondDaemon *self) G_GNUC_CONST; + +GSignondAccessControlManager * +gsignond_daemon_get_access_control_manager (GSignondDaemon *self) G_GNUC_CONST; + +GSignondPluginProxyFactory * +gsignond_daemon_get_plugin_proxy_factory (GSignondDaemon *self) G_GNUC_CONST; + +GSignondConfig * +gsignond_daemon_get_config (GSignondDaemon *self) G_GNUC_CONST; + +gboolean +gsignond_daemon_show_dialog (GSignondDaemon *self, + GObject *caller, + GSignondSignonuiData *ui_data, + GSignondSignonuiProxyQueryDialogCb handler, + GSignondSignonuiProxyRefreshCb refresh_handler, + gpointer userdata); + +gboolean +gsignond_daemon_refresh_dialog (GSignondDaemon *self, + GObject *caller, + GSignondSignonuiData *ui_data, + GSignondSignonuiProxyRefreshDialogCb handler, + gpointer userdata); + +gboolean +gsignond_daemon_cancel_dialog (GSignondDaemon *self, + GObject *caller, + GSignondSignonuiProxyCancelRequestCb handler, + gpointer userdata); + +GSignondAccessControlManager * +gsignond_get_access_control_manager (); + +GSignondPluginProxyFactory * +gsignond_get_plugin_proxy_factory (); + +GSignondConfig * +gsignond_get_config (); + +G_END_DECLS + +#endif /* __GSIGNOND_DAEMON_H_ */ diff --git a/src/daemon/gsignond-identity-enum-types.c b/src/daemon/gsignond-identity-enum-types.c new file mode 100644 index 0000000..0307956 --- /dev/null +++ b/src/daemon/gsignond-identity-enum-types.c @@ -0,0 +1,30 @@ + +/* Generated data (by glib-mkenums) */ + +#include "gsignond-identity-enum-types.h" +/* enumerations from "gsignond-identity.h" */ +#include "gsignond-identity.h" + +GType +gsignond_identity_change_type_get_type (void) +{ + static GType the_type = 0; + + if (the_type == 0) { + static const GEnumValue values[] = { + { GSIGNOND_IDENTITY_DATA_UPDATED, "GSIGNOND_IDENTITY_DATA_UPDATED", "data-updated" }, + { GSIGNOND_IDENTITY_REMOVED, "GSIGNOND_IDENTITY_REMOVED", "removed" }, + { GSIGNOND_IDENTITY_SIGNED_OUT, "GSIGNOND_IDENTITY_SIGNED_OUT", "signed-out" }, + {0, NULL, NULL} + }; + + the_type = g_enum_register_static ( + g_intern_static_string ("GSignondIdentityChangeType"), + values); + } + + return the_type; +} + +/* Generated data ends here */ + diff --git a/src/daemon/gsignond-identity-enum-types.h b/src/daemon/gsignond-identity-enum-types.h new file mode 100644 index 0000000..f1a002a --- /dev/null +++ b/src/daemon/gsignond-identity-enum-types.h @@ -0,0 +1,21 @@ + +/* Generated data (by glib-mkenums) */ + +#ifndef GSIGNOND_IDENTITY_ENUM_TYPES_H_ +#define GSIGNOND_IDENTITY_ENUM_TYPES_H_ + +#include <glib-object.h> + +G_BEGIN_DECLS +/* Enumeration from "gsignond-identity.h" */ + +#define GSIGNOND_TYPE_IDENTITY_CHANGE_TYPE (gsignond_identity_change_type_get_type()) +GType gsignond_identity_change_type_get_type (void) G_GNUC_CONST; + + +G_END_DECLS + +#endif + +/* Generated data ends here */ + diff --git a/src/daemon/gsignond-identity.c b/src/daemon/gsignond-identity.c new file mode 100644 index 0000000..145b68c --- /dev/null +++ b/src/daemon/gsignond-identity.c @@ -0,0 +1,1055 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2012 Intel Corporation. + * + * Contact: Jussi Laako <jussi.laako@linux.intel.com> + Amarnath Valluri <amarnath.valluri@linux.intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#include "gsignond-identity.h" +#include <string.h> + +#include "gsignond/gsignond-log.h" +#include "gsignond/gsignond-error.h" +#include "gsignond-daemon.h" +#include "gsignond-identity-enum-types.h" +#include "gsignond-auth-session.h" +#include "gsignond/gsignond-config-dbus.h" +#include "gsignond/gsignond-signonui.h" +#include "common/gsignond-identity-info-internal.h" +#include "plugins/gsignond-plugin-proxy-factory.h" + +enum +{ + PROP_0, + PROP_INFO, + N_PROPERTIES +}; + +enum { + SIG_USER_VERIFIED, + SIG_SECRET_VERIFIED, + SIG_CREDENTIALS_UPDATED, + SIG_INFO_UPDATED, + + SIG_MAX +}; + +static GParamSpec *properties[N_PROPERTIES]; +static guint signals[SIG_MAX]; + +struct _GSignondIdentityPrivate +{ + GSignondIdentityInfo *info; + GSignondDaemon *owner; + GHashTable *auth_sessions; // (auth_method,auth_session) table +}; + +typedef struct _GSignondIdentityCbData +{ + GSignondIdentity *identity; + GSignondAuthSession *session; +} GSignondIdentityCbData; + +G_DEFINE_TYPE (GSignondIdentity, gsignond_identity, G_TYPE_OBJECT); + + +static void _on_session_close (gpointer data, GObject *session); +static void _on_refresh_dialog (GSignondAuthSession *session, GSignondSignonuiData *ui_data, gpointer userdata); + +#define GSIGNOND_IDENTITY_PRIV(obj) G_TYPE_INSTANCE_GET_PRIVATE ((obj), GSIGNOND_TYPE_IDENTITY, GSignondIdentityPrivate) + +#define VALIDATE_IDENTITY_READ_ACCESS(identity, ctx, ret) \ +{ \ + GSignondAccessControlManager *acm = gsignond_daemon_get_access_control_manager (identity->priv->owner); \ + GSignondSecurityContextList *acl = gsignond_identity_info_get_access_control_list (identity->priv->info); \ + GSignondSecurityContext *owner = gsignond_identity_info_get_owner (identity->priv->info); \ + gboolean valid = gsignond_access_control_manager_peer_is_allowed_to_use_identity (acm, ctx, owner, acl); \ + gsignond_security_context_free (owner); \ + gsignond_security_context_list_free (acl); \ + if (!valid) { \ + WARN ("cannot access identity."); \ + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_PERMISSION_DENIED, "identity can not be accessed"); \ + return ret; \ + } \ +} + +#define VALIDATE_IDENTITY_WRITE_ACCESS(identity, ctx, ret) \ +{ \ + GSignondAccessControlManager *acm = gsignond_daemon_get_access_control_manager (identity->priv->owner); \ + GSignondSecurityContext *owner = gsignond_identity_info_get_owner (identity->priv->info); \ + gboolean valid = gsignond_access_control_manager_peer_is_owner_of_identity (acm, ctx, owner); \ + gsignond_security_context_free (owner); \ + if (!valid) { \ + WARN ("is_owner_of_identity check failed."); \ + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_PERMISSION_DENIED, "identity can not be accessed"); \ + return ret; \ + } \ +} + +#define VALIDATE_IDENTITY_WRITE_ACL(identity, ctx, ret) \ +{ \ + GSignondAccessControlManager *acm = gsignond_daemon_get_access_control_manager (identity->priv->owner); \ + GSignondSecurityContextList *acl = gsignond_identity_info_get_access_control_list (identity->priv->info); \ + gboolean valid = gsignond_access_control_manager_acl_is_valid (acm, ctx, acl); \ + gsignond_security_context_list_free (acl); \ + if (!valid) { \ + WARN ("acl validity check failed."); \ + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_PERMISSION_DENIED, "invalid access control list"); \ + return ret; \ + } \ +} + +static gboolean +_set_id (GSignondIdentity *identity, guint32 id) +{ + gsignond_identity_info_set_id (identity->priv->info, id); + g_object_notify_by_pspec (G_OBJECT(identity), properties[PROP_INFO]); + + return TRUE; +} + +static void +_get_property (GObject *object, guint property_id, GValue *value, + GParamSpec *pspec) +{ + GSignondIdentity *self = GSIGNOND_IDENTITY (object); + + switch (property_id) + { + case PROP_INFO: + g_value_set_boxed (value, self->priv->info); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } +} + +static void +_set_property (GObject *object, guint property_id, const GValue *value, + GParamSpec *pspec) +{ + GSignondIdentity *self = GSIGNOND_IDENTITY (object); + + switch (property_id) + { + case PROP_INFO: + self->priv->info = + (GSignondIdentityInfo *)g_value_get_boxed (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } +} + +static void +_release_weak_ref_on_session (gpointer key, gpointer value, gpointer data) +{ + g_object_weak_unref (G_OBJECT (value), _on_session_close, data); +} + +static void +_dispose (GObject *object) +{ + GSignondIdentity *self = GSIGNOND_IDENTITY(object); + + if (self->priv->auth_sessions) { + g_hash_table_foreach (self->priv->auth_sessions, _release_weak_ref_on_session, self); + g_hash_table_unref (self->priv->auth_sessions); + self->priv->auth_sessions = NULL; + } + + if (self->priv->owner) { + DBG("unref owner %p", self->priv->owner); + g_object_unref (self->priv->owner); + self->priv->owner = NULL; + } + + if (self->priv->info) { + gsignond_identity_info_unref (self->priv->info); + self->priv->info = NULL; + } + + G_OBJECT_CLASS (gsignond_identity_parent_class)->dispose (object); +} + +static void +_finalize (GObject *object) +{ + G_OBJECT_CLASS (gsignond_identity_parent_class)->finalize (object); +} + +static void +gsignond_identity_init (GSignondIdentity *self) +{ + self->priv = GSIGNOND_IDENTITY_PRIV(self); + + self->priv->auth_sessions = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); +} + +static void +gsignond_identity_class_init (GSignondIdentityClass *klass) +{ + GObjectClass* object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (GSignondIdentityPrivate)); + + object_class->get_property = _get_property; + object_class->set_property = _set_property; + object_class->dispose = _dispose; + object_class->finalize = _finalize; + + properties[PROP_INFO] = + g_param_spec_boxed ("info", + "identity info", + "IdentityInfo structure", + GSIGNOND_TYPE_IDENTITY_INFO, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS); + + g_object_class_install_properties (object_class, N_PROPERTIES, properties); + + signals[SIG_USER_VERIFIED] = g_signal_new ("user-verified", + GSIGNOND_TYPE_IDENTITY, + G_SIGNAL_RUN_LAST, + 0, + NULL, + NULL, + NULL, + G_TYPE_NONE, + 2, + G_TYPE_BOOLEAN, + G_TYPE_ERROR); + + signals[SIG_SECRET_VERIFIED] = g_signal_new ("secret-verified", + GSIGNOND_TYPE_IDENTITY, + G_SIGNAL_RUN_LAST, + 0, + NULL, + NULL, + NULL, + G_TYPE_NONE, + 2, + G_TYPE_BOOLEAN, + G_TYPE_ERROR); + + signals[SIG_CREDENTIALS_UPDATED] = g_signal_new ("credentials-updated", + GSIGNOND_TYPE_IDENTITY, + G_SIGNAL_RUN_LAST, + 0, + NULL, + NULL, + NULL, + G_TYPE_NONE, + 2, + G_TYPE_UINT, + G_TYPE_ERROR); + + signals[SIG_INFO_UPDATED] = g_signal_new ("info-updated", + GSIGNOND_TYPE_IDENTITY, + G_SIGNAL_RUN_LAST, + 0, + NULL, + NULL, + NULL, + G_TYPE_NONE, + 1, + GSIGNOND_TYPE_IDENTITY_CHANGE_TYPE); + +} + +GVariant * +gsignond_identity_get_info (GSignondIdentity *identity, const GSignondSecurityContext *ctx, GError **error) +{ + if (!(identity && GSIGNOND_IS_IDENTITY (identity))) { + WARN ("assertion (identity && GSIGNOND_IS_IDENTITY(identity)) failed"); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, "Unknown error"); + return FALSE; + } + + GSignondIdentityInfo *info = NULL; + GVariant *vinfo = NULL; + + if (!identity->priv->info) { + WARN ("assertion (identity->priv->info) failed"); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_IDENTITY_ERR, "Identity not found."); + return NULL; + } + + VALIDATE_IDENTITY_READ_ACCESS (identity, ctx, NULL); + + info = gsignond_identity_info_copy (identity->priv->info); + + /* remove password */ + gsignond_identity_info_remove_secret (info); + + /* remove username if its secret */ + if (gsignond_identity_info_get_is_username_secret (info)) + gsignond_identity_info_remove_username (info); + + /* prepare identity info, excluding password and username if secret */ + vinfo = gsignond_dictionary_to_variant (identity->priv->info); + gsignond_identity_info_unref (info); + if (!vinfo) { + WARN ("identity info to variant convertion failed."); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_IDENTITY_ERR, "Identity internal eror."); + return NULL; + } + + return vinfo; +} + +static void +_on_dialog_refreshed (GError *error, gpointer user_data) +{ + GSignondIdentityCbData *cb_data = (GSignondIdentityCbData *)user_data; + + g_signal_handlers_disconnect_by_func(cb_data->session, _on_refresh_dialog, user_data); + if (error) { + WARN ("Error : %s", error->message); + g_error_free (error); + } +} + +static void +_on_refresh_dialog (GSignondAuthSession *session, GSignondSignonuiData *ui_data, gpointer userdata) +{ + GSignondIdentityCbData *cb_data = (GSignondIdentityCbData *) userdata; + + gsignond_daemon_refresh_dialog (GSIGNOND_DAEMON (cb_data->identity->priv->owner), + G_OBJECT (cb_data->session), ui_data, _on_dialog_refreshed, userdata); +} + +static void +_on_refresh_requested_by_ui (GSignondSignonuiData *ui_data, gpointer user_data) +{ + GSignondIdentityCbData *cb_data = (GSignondIdentityCbData *) user_data; + + /* check for dialog refresh requests */ + g_signal_connect (cb_data->session, "process-refreshed", G_CALLBACK (_on_refresh_dialog), cb_data); + gsignond_auth_session_refresh (cb_data->session, ui_data); +} + +static void +_on_user_action_completed (GSignondSignonuiData *reply, GError *error, gpointer user_data) +{ + GSignondIdentityCbData *cb_data = (GSignondIdentityCbData *) user_data; + GSignondIdentityPrivate *priv = GSIGNOND_IDENTITY_PRIV (cb_data->identity); + GSignondSignonuiError ui_error = SIGNONUI_ERROR_NONE; + + g_signal_handlers_disconnect_by_func(cb_data->session, _on_refresh_dialog, user_data); + + if (error) { + WARN ("UI-Error: %s on identity %d", + error->message, + gsignond_identity_info_get_id (priv->info)); + g_error_free (error); + g_slice_free (GSignondIdentityCbData, cb_data); + return; + } + + if (!gsignond_signonui_data_get_query_error (reply, &ui_error)) + WARN ("signonui error %d for identity %d", + ui_error, + gsignond_identity_info_get_id (priv->info)); + + if (!gsignond_identity_info_get_validated (priv->info) && + ui_error == SIGNONUI_ERROR_NONE) { + gsignond_identity_info_set_username (priv->info, + gsignond_signonui_data_get_username (reply)); + } + + /* storing secret allowed? */ + if (gsignond_identity_info_get_store_secret (priv->info)) { + gboolean remember = TRUE; + + /* and there was no opt-out? */ + if (!gsignond_signonui_data_get_remember_password (reply, &remember)) + DBG ("identity %d - don't remember password", + gsignond_identity_info_get_id (priv->info)); + if (remember && ui_error == SIGNONUI_ERROR_NONE) { + gsignond_identity_info_set_secret (priv->info, + gsignond_signonui_data_get_password (reply)); + } else if (!remember || + (ui_error == SIGNONUI_ERROR_CANCELED || + ui_error == SIGNONUI_ERROR_FORGOT_PASSWORD)) { + /* reset to empty in case user canceled or forgot, + * or doesn't want password to be remebered anymore */ + gsignond_identity_info_set_secret (priv->info, ""); + } + } + /* TODO: auto-set to validated on successful process() cycle */ + /* store if not a new identity (new is stored later) */ + if (!gsignond_identity_info_get_is_identity_new (priv->info)) { + if (!gsignond_daemon_store_identity (priv->owner, cb_data->identity)) + WARN ("failed to update identity %d", + gsignond_identity_info_get_id (priv->info)); + } + + if (cb_data->session) { + gsignond_auth_session_user_action_finished (cb_data->session, reply); + } + else if (reply) gsignond_signonui_data_unref (reply); + + g_slice_free (GSignondIdentityCbData, cb_data); +} + +static void +_on_user_action_required (GSignondAuthSession *session, GSignondSignonuiData *ui_data, gpointer userdata) +{ + GSignondIdentity *identity = GSIGNOND_IDENTITY (userdata); + GSignondIdentityCbData *cb_data = g_slice_new (GSignondIdentityCbData); + + cb_data->identity = identity; + cb_data->session = session; + + gsignond_daemon_show_dialog (GSIGNOND_DAEMON (identity->priv->owner), G_OBJECT(session), + ui_data, _on_user_action_completed, _on_refresh_requested_by_ui, userdata); +} + +static void +_on_store_token (GSignondAuthSession *session, GSignondDictionary *token_data, gpointer userdata) +{ + GSignondIdentity *identity = GSIGNOND_IDENTITY (userdata); + guint32 identity_id = GSIGNOND_IDENTITY_INFO_NEW_IDENTITY; + + g_return_if_fail (identity && session && GSIGNOND_IS_AUTH_SESSION (session)); + + identity_id = gsignond_identity_info_get_id (identity->priv->info); + + if (identity_id != GSIGNOND_IDENTITY_INFO_NEW_IDENTITY) { + gsignond_daemon_store_identity_data (identity->priv->owner, identity_id, + gsignond_auth_session_get_method (session), token_data); + } +} + +static gboolean +_compare_session_by_pointer (gpointer key, gpointer value, gpointer dead_object) +{ + return value == dead_object; +} + +static void +_on_session_close (gpointer data, GObject *session) +{ + GSignondIdentity *identity = GSIGNOND_IDENTITY (data); + + DBG ("identity %p session %p disposed", identity, session); + + g_hash_table_foreach_remove (identity->priv->auth_sessions, + _compare_session_by_pointer, session); +} + +GSignondAuthSession * +gsignond_identity_get_auth_session (GSignondIdentity *identity, + const gchar *method, + const GSignondSecurityContext *ctx, + GError **error) +{ + if (!(identity && GSIGNOND_IS_IDENTITY (identity))) { + WARN ("assertion (identity && GSIGNOND_IS_IDENTITY(identity)) failed"); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, "Unknown error"); + return FALSE; + } + GSignondAuthSession *session = NULL; + GHashTable *supported_methods = NULL; + gboolean method_available = FALSE; + guint32 identity_id ; + GSignondDictionary *token_data = NULL; + + VALIDATE_IDENTITY_READ_ACCESS (identity, ctx, NULL); + + if (!method) { + WARN ("assertion (method) failed"); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_METHOD_NOT_KNOWN, + "authentication method not provided"); + return NULL; + } + + DBG ("get auth session for method '%s'", method); + session = g_hash_table_lookup (identity->priv->auth_sessions, method); + + if (session && GSIGNOND_IS_AUTH_SESSION (session)) { + DBG("using cashed auth session '%p' for method '%s'", session, method); + return GSIGNOND_AUTH_SESSION(g_object_ref (session)); + } + + if (!gsignond_plugin_proxy_factory_get_plugin_mechanisms (gsignond_get_plugin_proxy_factory (), + method)) { + WARN ("method '%s' doesn't exist", method); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_METHOD_NOT_KNOWN, + "authentication method '%s' doesn't exist", + method); + return NULL; + } + + supported_methods = gsignond_identity_info_get_methods (identity->priv->info); + + if (supported_methods) { + method_available = g_hash_table_contains (supported_methods, method); + g_hash_table_unref (supported_methods); + } else if (gsignond_identity_info_get_is_identity_new ( + identity->priv->info)) + method_available = TRUE; + else + method_available = FALSE; + + + if (!method_available) { + WARN ("authentication method '%s' is not supported", method); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_METHOD_NOT_AVAILABLE, + "authentication method '%s' not supported for this identity", method); + return NULL; + } + + if ( (identity_id = gsignond_identity_info_get_id (identity->priv->info)) != + GSIGNOND_IDENTITY_INFO_NEW_IDENTITY) { + token_data = gsignond_daemon_load_identity_data (identity->priv->owner, identity_id, method); + } + + session = gsignond_auth_session_new (identity->priv->info, method, token_data); + + if (token_data) gsignond_dictionary_unref (token_data); + + if (!session) { + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, "Unknown error"); + return NULL; + } + + /* Handle 'ui' signanls on session */ + g_signal_connect (session, "process-user-action-required", G_CALLBACK (_on_user_action_required), identity); + g_signal_connect (session, "process-store", G_CALLBACK (_on_store_token), identity); + + g_hash_table_insert (identity->priv->auth_sessions, g_strdup (method), session); + g_object_weak_ref (G_OBJECT (session), _on_session_close, identity); + + DBG ("session %p creation for method '%s' complete", session, method); + + return session; +} + +static void +_on_query_dialog_done (GSignondSignonuiData *reply, GError *error, gpointer user_data) +{ + GSignondIdentity *identity = GSIGNOND_IDENTITY (user_data); + guint32 id = 0; + GError *err = NULL; + GSignondSignonuiError err_id = 0; + + if (error) { + WARN ("failed to verfiy user : %s", error->message); + g_error_free (error); + + err = gsignond_get_gerror_for_id (GSIGNOND_ERROR_IDENTITY_OPERATION_CANCELED, "Operation cancled"); + } + + gboolean res = gsignond_signonui_data_get_query_error (reply, &err_id); + g_assert (res == TRUE); + + if (err_id != SIGNONUI_ERROR_NONE) { + switch (err_id) { + case SIGNONUI_ERROR_CANCELED: + err = gsignond_get_gerror_for_id (GSIGNOND_ERROR_IDENTITY_OPERATION_CANCELED, + "Operation cancled"); + break; + default: + err = gsignond_get_gerror_for_id (GSIGNOND_ERROR_INTERNAL_SERVER, + "signon ui returned with error : %d", err_id); + break; + } + } + else { + const gchar *secret = gsignond_signonui_data_get_password (reply); + + if (!secret) { + err = gsignond_get_gerror_for_id (GSIGNOND_ERROR_INTERNAL_SERVER, + "Server internal error occured"); + } else if (identity->priv->info) { + gsignond_identity_info_set_secret (identity->priv->info, secret) ; + + /* Save new secret in db */ + id = gsignond_daemon_store_identity (identity->priv->owner, identity); + if (!id) err = gsignond_get_gerror_for_id (GSIGNOND_ERROR_STORE_FAILED, "Failed to store secret"); + } + } + + gsignond_signonui_data_unref (reply); + + g_signal_emit (identity, signals[SIG_CREDENTIALS_UPDATED], 0 , id, err); + + if (err) g_error_free (err); +} + +gboolean +gsignond_identity_request_credentials_update (GSignondIdentity *identity, + const gchar *message, + const GSignondSecurityContext *ctx, + GError **error) +{ + GSignondSignonuiData *ui_data = NULL; + + if (!(identity && GSIGNOND_IS_IDENTITY (identity))) { + WARN ("assertion (identity && GSIGNOND_IS_IDENTITY(identity)) failed"); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, "Unknown error"); + return FALSE; + } + + if (!identity->priv->info) { + WARN ("assertion (identity->priv->info) failed"); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_IDENTITY_ERR, "Identity not found."); + return FALSE; + } + + VALIDATE_IDENTITY_READ_ACCESS (identity, ctx, FALSE); + + if (!gsignond_identity_info_get_store_secret (identity->priv->info)) { + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_CREDENTIALS_NOT_AVAILABLE, "Password can not be stored."); + return FALSE; + } + + ui_data = gsignond_signonui_data_new (); + + gsignond_signonui_data_set_query_username (ui_data, TRUE); + gsignond_signonui_data_set_username (ui_data, gsignond_identity_info_get_username (identity->priv->info)); + gsignond_signonui_data_set_caption (ui_data, gsignond_identity_info_get_caption (identity->priv->info)); + gsignond_signonui_data_set_message (ui_data, message); + + gsignond_daemon_show_dialog (GSIGNOND_DAEMON (identity->priv->owner), G_OBJECT(identity), + ui_data, _on_query_dialog_done, NULL, identity); + + gsignond_signonui_data_unref (ui_data); + + return TRUE; +} + +static void +_on_user_verfied (GSignondSignonuiData *reply, GError *error, gpointer user_data) +{ + GSignondIdentity *identity = GSIGNOND_IDENTITY (user_data); + gboolean res = FALSE; + GError *err = NULL; + GSignondSignonuiError err_id = 0; + + if (error) { + WARN ("failed to verfiy user : %s", error->message); + g_error_free (error); + + err = gsignond_get_gerror_for_id (GSIGNOND_ERROR_IDENTITY_OPERATION_CANCELED, "Operation cancled"); + } + + gboolean query_res = gsignond_signonui_data_get_query_error (reply, &err_id); + g_assert (query_res == TRUE); + + if (err_id != SIGNONUI_ERROR_NONE) { + switch (err_id) { + case SIGNONUI_ERROR_CANCELED: + err = gsignond_get_gerror_for_id (GSIGNOND_ERROR_IDENTITY_OPERATION_CANCELED, + "Operation cancled"); + break; + case SIGNONUI_ERROR_FORGOT_PASSWORD: + err = gsignond_get_gerror_for_id (GSIGNOND_ERROR_FORGOT_PASSWORD, "Forgot password"); + break; + default: + err = gsignond_get_gerror_for_id (GSIGNOND_ERROR_INTERNAL_SERVER, + "signon ui returned error : %d", err_id); + break; + } + } + else { + const gchar *secret = gsignond_signonui_data_get_password (reply); + + if (!secret) { + err = gsignond_get_gerror_for_id (GSIGNOND_ERROR_INTERNAL_SERVER, + "Server internal error occured"); + } else if (identity->priv->info) { + res = g_strcmp0 (secret, gsignond_identity_info_get_secret + (identity->priv->info)) == 0; + } + } + + gsignond_signonui_data_unref (reply); + + g_signal_emit (identity, signals[SIG_USER_VERIFIED], 0, res, error); + + if (err) g_error_free (err); +} + +gboolean +gsignond_identity_verify_user (GSignondIdentity *identity, + GVariant *params, + const GSignondSecurityContext *ctx, + GError **error) +{ + if (!(identity && GSIGNOND_IS_IDENTITY (identity))) { + WARN ("assertion (identity && GSIGNOND_IS_IDENTITY(identity)) == 0) failed"); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, "Unknown error"); + return FALSE; + } + const gchar *passwd = 0; + GSignondSignonuiData *ui_data = NULL; + + if (!identity->priv->info) { + WARN ("assertion (identity->priv->info) failed"); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_IDENTITY_ERR, "Identity not found."); + return FALSE; + } + + VALIDATE_IDENTITY_READ_ACCESS (identity, ctx, FALSE); + + if (!gsignond_identity_info_get_store_secret (identity->priv->info) || + !(passwd = gsignond_identity_info_get_secret (identity->priv->info)) || + !strlen (passwd)) { + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_CREDENTIALS_NOT_AVAILABLE, + "user can not be verified as credentials are not stored"); + return FALSE; + } + + ui_data = gsignond_signonui_data_new_from_variant (params); + gsignond_signonui_data_set_query_password (ui_data, TRUE); + gsignond_signonui_data_set_username (ui_data, gsignond_identity_info_get_username (identity->priv->info)); + gsignond_signonui_data_set_caption (ui_data, gsignond_identity_info_get_caption (identity->priv->info)); + + gsignond_daemon_show_dialog (GSIGNOND_DAEMON (identity->priv->owner), G_OBJECT (identity), + ui_data, _on_user_verfied, NULL, identity); + + gsignond_signonui_data_unref (ui_data); + + return TRUE; +} + +gboolean +gsignond_identity_verify_secret (GSignondIdentity *identity, + const gchar *secret, + const GSignondSecurityContext *ctx, + GError **error) +{ + if (!(identity && GSIGNOND_IS_IDENTITY (identity))) { + WARN ("assertion (identity && GSIGNOND_IS_IDENTITY(identity)) failed"); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, "Unknown error"); + return FALSE; + } + + VALIDATE_IDENTITY_READ_ACCESS (identity, ctx, FALSE); + + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, "Not supported"); + + return FALSE; +} + +gboolean +gsignond_identity_sign_out (GSignondIdentity *identity, + const GSignondSecurityContext *ctx, + GError **error) +{ + if (!(identity && GSIGNOND_IS_IDENTITY (identity))) { + WARN ("assertion (identity && GSIGNOND_IS_IDENTITY(identity)) failed"); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, "Unknown error"); + return FALSE; + } + gboolean success = FALSE; + guint32 identity_id = GSIGNOND_IDENTITY_INFO_NEW_IDENTITY; + + VALIDATE_IDENTITY_READ_ACCESS (identity, ctx, FALSE); + + identity_id = gsignond_identity_info_get_id (identity->priv->info); + + if (identity_id == GSIGNOND_IDENTITY_INFO_NEW_IDENTITY) { + /* TODO; clear the cached secret for unstored identity */ + success = TRUE; + } + else { + success = gsignond_daemon_clear_identity_data (identity->priv->owner, identity_id); + } + if(!success) { + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, "Failed to clear data"); + return FALSE; + } + + g_signal_emit (identity, signals[SIG_INFO_UPDATED], 0, GSIGNOND_IDENTITY_SIGNED_OUT, NULL); + + return success; +} + +typedef struct _{ + GSignondDaemon *daemon; + guint32 identity_id; +}_StoreCachedTokenCbInfo; +static void +_store_cached_token_data (const gchar *method, GSignondAuthSession *session, _StoreCachedTokenCbInfo *data) +{ + if (!data || !method || !session) return ; + + GSignondDictionary *token_data = gsignond_auth_session_get_token_data (session); + + if (token_data) + gsignond_daemon_store_identity_data (data->daemon, data->identity_id, method, token_data); +} + +guint32 +gsignond_identity_store (GSignondIdentity *identity, + const GVariant *info, + const GSignondSecurityContext *ctx, + GError **error) +{ + GSignondIdentityInfo *identity_info = NULL; + gboolean was_new_identity = FALSE; + GSignondSecurityContextList *contexts = NULL; + GSignondSecurityContext *owner = NULL; + guint32 id; + + if (!(identity && GSIGNOND_IS_IDENTITY (identity))) { + WARN ("assertion (identity && GSIGNOND_IS_IDENTITY(identity)) failed"); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, "Unknown error"); + return 0; + } + + VALIDATE_IDENTITY_WRITE_ACCESS (identity, ctx, 0); + + identity_info = gsignond_dictionary_new_from_variant ((GVariant *)info); + /* dont trust 'identity id' passed via 'info' */ + id = gsignond_identity_info_get_id (identity->priv->info); + gsignond_identity_info_set_id (identity_info, id); + + was_new_identity = gsignond_identity_info_get_is_identity_new (identity_info); + + contexts = gsignond_identity_info_get_access_control_list (identity_info); + if (!contexts) { + contexts = gsignond_identity_info_get_access_control_list (identity->priv->info); + gsignond_identity_info_set_access_control_list (identity_info, contexts); + } + else { + VALIDATE_IDENTITY_WRITE_ACL (identity, ctx, 0); + } + gsignond_security_context_list_free (contexts); + + owner = gsignond_identity_info_get_owner (identity_info); + if (!owner) { + owner = gsignond_identity_info_get_owner (identity->priv->info); + gsignond_identity_info_set_owner (identity_info, owner); + } + gsignond_security_context_free (owner); + + + /* update object cache */ + if (identity->priv->info) + gsignond_identity_info_unref (identity->priv->info); + identity->priv->info = identity_info; + + /* Ask daemon to store identity info to db */ + id = gsignond_daemon_store_identity (identity->priv->owner, identity); + if (!id) { + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_STORE_FAILED, + "Failed to store identity"); + } + else { + if (was_new_identity) { + _set_id (identity, id); + _StoreCachedTokenCbInfo data = { identity->priv->owner, id }; + /* store any cached token data if available at auth sessions */ + g_hash_table_foreach (identity->priv->auth_sessions, (GHFunc)_store_cached_token_data, (gpointer)&data); + } + + g_signal_emit (identity, signals[SIG_INFO_UPDATED], 0, GSIGNOND_IDENTITY_DATA_UPDATED); + } + + return id; +} + +gboolean +gsignond_identity_remove (GSignondIdentity *identity, + const GSignondSecurityContext *ctx, + GError **error) +{ + if (!(identity && GSIGNOND_IS_IDENTITY (identity))) { + WARN ("assertion (identity && GSIGNOND_IS_IDENTITY(identity)) failed"); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, "Unknown error"); + return FALSE; + } + gboolean is_removed = FALSE; + + VALIDATE_IDENTITY_WRITE_ACCESS (identity, ctx, FALSE); + + is_removed = gsignond_identity_clear (identity); + + if (!is_removed && error) + *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_REMOVE_FAILED, "failed to remove identity"); + + return is_removed; +} + + +gboolean +gsignond_identity_clear (GSignondIdentity *identity) +{ + if (!(identity && GSIGNOND_IS_IDENTITY (identity))) { + WARN ("assertion (identity && GSIGNOND_IS_IDENTITY(identity)) failed"); + return FALSE; + } + gboolean is_removed = FALSE; + + if (gsignond_identity_info_get_is_identity_new (identity->priv->info)) + is_removed = TRUE; + else + is_removed = gsignond_daemon_remove_identity ( + identity->priv->owner, + gsignond_identity_info_get_id (identity->priv->info)); + + if (is_removed) + g_signal_emit (identity, signals[SIG_INFO_UPDATED], 0, GSIGNOND_IDENTITY_REMOVED); + else + WARN ("request to remove identity %u failed", + gsignond_identity_info_get_id (identity->priv->info)); + + return is_removed; +} + + +guint32 +gsignond_identity_add_reference (GSignondIdentity *identity, + const gchar *reference, + const GSignondSecurityContext *ctx, + GError **error) +{ + if (!(identity && GSIGNOND_IS_IDENTITY (identity))) { + WARN ("assertion (identity && GSIGNOND_IS_IDENTITY(identity)) failed"); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, "Unknown error"); + return 0; + } + guint32 res = 0; + guint32 identity_id = 0; + + VALIDATE_IDENTITY_READ_ACCESS (identity, ctx, 0); + + identity_id = gsignond_identity_info_get_id (identity->priv->info); + if (!identity_id) { + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_STORE_FAILED, "Cannot add reference to unsaved identity"); + return 0; + } + res = gsignond_daemon_add_identity_reference (identity->priv->owner, identity_id, ctx, reference); + + if (res == 0) { + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, "Unknown error"); + } + + return res; +} + +guint32 +gsignond_identity_remove_reference (GSignondIdentity *identity, + const gchar *reference, + const GSignondSecurityContext *ctx, + GError **error) +{ + if (!(identity && GSIGNOND_IS_IDENTITY (identity))) { + WARN ("assertion (identity && GSIGNOND_IS_IDENTITY(identity)) failed"); + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, "Unknown error"); + return 0; + } + + gboolean res = 0; + guint32 identity_id = 0; + + VALIDATE_IDENTITY_READ_ACCESS (identity, ctx, 0); + + identity_id = gsignond_identity_info_get_id (identity->priv->info); + if (!identity_id) { + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_REFERENCE_NOT_FOUND, "reference not '%s' found", reference); + return 0; + } + + res = gsignond_daemon_remove_identity_reference (identity->priv->owner, identity_id, ctx, reference); + if (res == FALSE) { + if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_REFERENCE_NOT_FOUND, + "reference '%s' not found", reference); + } + return identity_id; +} + +GSignondAccessControlManager * +gsignond_identity_get_acm (GSignondIdentity *identity) +{ + g_return_val_if_fail (identity && GSIGNOND_IS_IDENTITY(identity), NULL); + + return gsignond_daemon_get_access_control_manager (identity->priv->owner); +} + +guint +gsignond_identity_get_auth_session_timeout (GSignondIdentity *identity) +{ + g_return_val_if_fail (identity && GSIGNOND_IS_IDENTITY(identity), 0); + + return gsignond_daemon_get_auth_session_timeout (identity->priv->owner); +} + +/** + * gsignond_identity_get_id: + * @identity: instance of #GSignondIdentity + * + * Retrieves identity id. + * + * Returns: identity id + */ +guint32 +gsignond_identity_get_id (GSignondIdentity *identity) +{ + g_assert (GSIGNOND_IS_IDENTITY (identity)); + + return gsignond_identity_info_get_id (identity->priv->info); +} + +/** + * gsignond_identity_get_identity_info: + * @identity: instance of #GSignondIdentity + * + * Retrieves identity's #GSignondIdentityInfo. + * + * Returns: (transfer none) #GSignondIdentityInfo + */ +GSignondIdentityInfo * +gsignond_identity_get_identity_info (GSignondIdentity *identity) +{ + g_assert (GSIGNOND_IS_IDENTITY (identity)); + g_assert (identity->priv != NULL); + + return identity->priv->info; +} + +/** + * gsignond_identity_new: + * @owner: Owner of this object, instance of #GSignondAuthServiceIface + * @info (transfer full): Identity info, instance of #GSignondIdentityInfo + * + * Creates new instance of #GSignondIdentity + * + * Returns[transfer full]: new instance of #GSignondIdentity + */ +GSignondIdentity * gsignond_identity_new (GSignondDaemon *owner, + GSignondIdentityInfo *info) +{ + GSignondIdentity *identity = + GSIGNOND_IDENTITY(g_object_new (GSIGNOND_TYPE_IDENTITY, + "info", info, + NULL)); + + identity->priv->owner = g_object_ref (owner); + + return identity; +} diff --git a/src/daemon/gsignond-identity.h b/src/daemon/gsignond-identity.h new file mode 100644 index 0000000..b356d83 --- /dev/null +++ b/src/daemon/gsignond-identity.h @@ -0,0 +1,148 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2012 Intel Corporation. + * + * Contact: Amarnath Valluri <amarnath.valluri@linux.intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#ifndef __GSIGNOND_IDENTITY_H_ +#define __GSIGNOND_IDENTITY_H_ + +#include <glib.h> +#include <glib-object.h> + +#include "gsignond-types.h" +#include <gsignond/gsignond-identity-info.h> +#include <gsignond/gsignond-access-control-manager.h> + +G_BEGIN_DECLS + +#define GSIGNOND_TYPE_IDENTITY (gsignond_identity_get_type()) +#define GSIGNOND_IDENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GSIGNOND_TYPE_IDENTITY, GSignondIdentity)) +#define GSIGNOND_IDENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GSIGNOND_TYPE_IDENTITY, GSignondIdentityClass)) +#define GSIGNOND_IS_IDENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GSIGNOND_TYPE_IDENTITY)) +#define GSIGNOND_IS_IDENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GSIGNOND_TYPE_IDENTITY)) +#define GSIGNOND_IDENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GSIGNOND_TYPE_IDENTITY, GSignondIdentityClass)) + +typedef struct _GSignondIdentityPrivate GSignondIdentityPrivate; + +typedef enum { + GSIGNOND_IDENTITY_DATA_UPDATED = 0, + GSIGNOND_IDENTITY_REMOVED, + GSIGNOND_IDENTITY_SIGNED_OUT +} IdentityChangeType; +typedef IdentityChangeType GSignondIdentityChangeType; + +struct _GSignondIdentity +{ + GObject parent; + + /* priv */ + GSignondIdentityPrivate *priv; +}; + +struct _GSignondIdentityClass +{ + GObjectClass parent_class; +}; + +GType +gsignond_identity_get_type (void) G_GNUC_CONST; + +GSignondIdentity * +gsignond_identity_new (GSignondDaemon *owner, + GSignondIdentityInfo *info); + +GVariant * +gsignond_identity_get_info (GSignondIdentity *identity, + const GSignondSecurityContext *ctx, + GError **error); + + +GSignondAuthSession * +gsignond_identity_get_auth_session (GSignondIdentity *identity, + const gchar *method, + const GSignondSecurityContext *ctx, + GError **error); + +gboolean +gsignond_identity_request_credentials_update (GSignondIdentity *identity, + const gchar *message, + const GSignondSecurityContext *ctx, + GError **error); + +gboolean +gsignond_identity_verify_user (GSignondIdentity *identity, + GVariant *params, + const GSignondSecurityContext *ctx, + GError **error); + +gboolean +gsignond_identity_verify_secret (GSignondIdentity *identity, + const gchar *secret, + const GSignondSecurityContext *ctx, + GError **error); + +guint32 +gsignond_identity_store (GSignondIdentity *identity, + const GVariant *info, + const GSignondSecurityContext *ctx, + GError **error); +gboolean +gsignond_identity_remove (GSignondIdentity *identity, + const GSignondSecurityContext *ctx, + GError **error); + +gboolean +gsignond_identity_clear (GSignondIdentity *identity); + +gboolean +gsignond_identity_sign_out (GSignondIdentity *identity, + const GSignondSecurityContext *ctx, + GError **error); + +guint32 +gsignond_identity_add_reference (GSignondIdentity *identity, + const gchar *reference, + const GSignondSecurityContext *ctx, + GError **error); + +guint32 +gsignond_identity_remove_reference (GSignondIdentity *identity, + const gchar *reference, + const GSignondSecurityContext *ctx, + GError **error); + +guint +gsignond_identity_get_auth_session_timeout (GSignondIdentity *identity); + +GSignondAccessControlManager * +gsignond_identity_get_acm (GSignondIdentity *identity); + +guint32 +gsignond_identity_get_id (GSignondIdentity *identity); + +GSignondIdentityInfo * +gsignond_identity_get_identity_info (GSignondIdentity *identity); + +G_END_DECLS + +#endif /* __GSIGNOND_IDENTITY_H_ */ diff --git a/src/daemon/gsignond-signonui-proxy.c b/src/daemon/gsignond-signonui-proxy.c new file mode 100644 index 0000000..ec79fca --- /dev/null +++ b/src/daemon/gsignond-signonui-proxy.c @@ -0,0 +1,336 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2013 Intel Corporation. + * + * Contact: Amarnath Valluri <amarnath.valluri@linux.intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#include "gsignond-signonui-proxy.h" +#include <gsignond/gsignond-log.h> +#include <gsignond/gsignond-signonui.h> +#include "dbus/gsignond-dbus-signonui-adapter.h" + +static void _process_next_request (GSignondSignonuiProxy *proxy); +static void _on_refresh_request (GSignondSignonuiProxy *proxy, + gchar *request_id, gpointer userdata); + +typedef struct { + GObject *caller; + GSignondSignonuiData *ui_data; + GSignondSignonuiProxyQueryDialogCb cb; + GSignondSignonuiProxyRefreshCb refresh_cb; + gpointer userdata; +} _UIQueryRequest; + +typedef struct { + GSignondSignonuiProxyRefreshDialogCb cb; + gpointer userdata; +} _UIRefreshRequest; + +typedef struct { + GSignondSignonuiProxyCancelRequestCb cb; + gpointer userdata; +} _UICancelRequest; + +struct _GSignondSignonuiProxyPrivate +{ + GSignondDbusSignonuiAdapter *signonui; + _UIQueryRequest *active_request; /* Active dialog */ + GQueue *request_queue; /* request queue */ + gboolean is_idle; +}; + +G_DEFINE_TYPE (GSignondSignonuiProxy, gsignond_signonui_proxy, G_TYPE_OBJECT); +#define GSIGNOND_SIGNONUI_PROXY_GET_PRIV(obj) G_TYPE_INSTANCE_GET_PRIVATE ((obj), GSIGNOND_TYPE_SIGNONUI_PROXY, GSignondSignonuiProxyPrivate) + +static _UIQueryRequest * +_ui_query_request_new (GObject *caller, + GSignondSignonuiData *ui_data, + GSignondSignonuiProxyQueryDialogCb cb, + GSignondSignonuiProxyRefreshCb refresh_cb, + gpointer userdata) +{ + _UIQueryRequest *req = g_new0(_UIQueryRequest, 1); + + req->caller = caller; + req->ui_data = gsignond_signonui_data_ref (ui_data); + req->cb = cb; + req->refresh_cb = refresh_cb; + req->userdata = userdata; + + return req; +} + +static _UIRefreshRequest * +_ui_refresh_request_new (GSignondSignonuiProxyRefreshDialogCb cb, gpointer userdata) +{ + _UIRefreshRequest *req = g_new0(_UIRefreshRequest, 1); + + req->cb = cb; + req->userdata = userdata; + + return req; +} + +static _UICancelRequest * +_ui_cancel_request_new (GSignondSignonuiProxyCancelRequestCb cb, gpointer userdata) +{ + _UICancelRequest *req = g_new0(_UICancelRequest, 1); + + req->cb = cb; + req->userdata = userdata; + + return req; +} + +static void +_ui_query_request_free (_UIQueryRequest *req) +{ + if (!req) return; + if (req->ui_data) gsignond_signonui_data_unref (req->ui_data); + g_free (req); +} + +static void +_dispose (GObject *object) +{ + GSignondSignonuiProxy *self = GSIGNOND_SIGNONUI_PROXY (object); + + if (self->priv->signonui) { + g_object_unref (self->priv->signonui); + self->priv->signonui = NULL; + } + + G_OBJECT_CLASS (gsignond_signonui_proxy_parent_class)->dispose (object); +} + +static void +_finalize (GObject *object) +{ + GSignondSignonuiProxy *self = GSIGNOND_SIGNONUI_PROXY (object); + + if (self->priv->request_queue) { + g_queue_free_full (self->priv->request_queue, (GDestroyNotify)_ui_query_request_free); + self->priv->request_queue = NULL; + } + + G_OBJECT_CLASS (gsignond_signonui_proxy_parent_class)->finalize (object); +} + +static void +gsignond_signonui_proxy_class_init (GSignondSignonuiProxyClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (gobject_class, sizeof (GSignondSignonuiProxyPrivate)); + + gobject_class->dispose = _dispose; + gobject_class->finalize = _finalize; +} + +static void +gsignond_signonui_proxy_init (GSignondSignonuiProxy *proxy) +{ + proxy->priv = GSIGNOND_SIGNONUI_PROXY_GET_PRIV (proxy); + + proxy->priv->signonui = gsignond_dbus_signonui_adapter_new (); + + if (proxy->priv->signonui) + g_signal_connect_swapped (proxy->priv->signonui, "refresh", G_CALLBACK(_on_refresh_request), proxy); + proxy->priv->active_request = NULL; + proxy->priv->request_queue = g_queue_new (); + proxy->priv->is_idle = TRUE; +} + +static void +_on_refresh_request (GSignondSignonuiProxy *proxy, gchar *request_id, gpointer userdata) +{ + _UIQueryRequest *req = proxy->priv->active_request; + + if (req && !g_strcmp0 (G_OBJECT_TYPE_NAME (req->caller), request_id)) { + if (req->refresh_cb) req->refresh_cb(req->ui_data, req->userdata); + } + else { + WARN("UI-Error: unhandled refresh request"); + } +} + +static void +_query_dialog_cb (GVariant *reply, GError *error, gpointer user_data) +{ + GSignondSignonuiProxy *proxy = GSIGNOND_SIGNONUI_PROXY (user_data); + + _UIQueryRequest *req = proxy->priv->active_request; + + if (req && req->cb) + req->cb (gsignond_signonui_data_new_from_variant (reply), error, req->userdata); + else if (error) { + WARN ("UI-Error: %s", error->message); + g_error_free (error); + } + + _ui_query_request_free (req); + + proxy->priv->active_request = NULL; + + _process_next_request (proxy); +} + +static void +_process_next_request (GSignondSignonuiProxy *proxy) +{ + _UIQueryRequest *req = g_queue_pop_head (proxy->priv->request_queue); + + if (!req) { + proxy->priv->is_idle = TRUE; + proxy->priv->active_request = NULL; + return; + } + + proxy->priv->active_request = req; + + /* update request id */ + gsignond_signonui_data_set_request_id (req->ui_data, G_OBJECT_TYPE_NAME(req->caller)); + gsignond_dbus_signonui_adapter_query_dialog (proxy->priv->signonui, + gsignond_signonui_data_to_variant(req->ui_data), _query_dialog_cb, proxy); + + proxy->priv->is_idle = FALSE; +} + +gboolean +gsignond_signonui_proxy_query_dialog (GSignondSignonuiProxy *proxy, + GObject *caller, + GSignondSignonuiData *ui_data, + GSignondSignonuiProxyQueryDialogCb cb, + GSignondSignonuiProxyRefreshCb refresh_cb, + gpointer userdata) +{ + + g_queue_push_tail (proxy->priv->request_queue, + _ui_query_request_new (caller, ui_data, cb, refresh_cb, userdata)); + + if (proxy->priv->is_idle) _process_next_request (proxy); + + return TRUE; +} + +static void +_refresh_dialog_cb (GError *error, gpointer user_data) +{ + _UIRefreshRequest *req = (_UIRefreshRequest *)user_data; + + if (req && req->cb){ + req->cb(error, req->userdata); + } else if (error) { + WARN ("UI-Error : %s", error->message); + g_error_free (error); + } + + g_free (req); +} + +gboolean +gsignond_signonui_proxy_refresh_dialog (GSignondSignonuiProxy *proxy, + GObject *caller, + GSignondSignonuiData *ui_data, + GSignondSignonuiProxyRefreshDialogCb cb, + gpointer userdata) +{ + if (proxy->priv->active_request + && proxy->priv->active_request->caller == caller) { + _UIRefreshRequest *req = _ui_refresh_request_new (cb, userdata); + + /* FIXME: Is it required to set refresh id for refresh data */ + gsignond_signonui_data_set_request_id (ui_data, G_OBJECT_TYPE_NAME(caller)); + gsignond_dbus_signonui_adapter_refresh_dialog (proxy->priv->signonui, + gsignond_signonui_data_to_variant (ui_data), _refresh_dialog_cb, req); + + return TRUE; + } + + return FALSE; +} + +static void +_cancel_request_cb (GError *error, gpointer user_data) +{ + _UICancelRequest *req = (_UICancelRequest*)user_data; + + if (req && req->cb) + req->cb (error, req->userdata); + else if (error) { + WARN ("UI-Error : %s", error->message); + g_error_free (error); + } + + g_free (req); +} + +static gint +_find_request_by_caller (gconstpointer a, gconstpointer b) +{ + _UIQueryRequest *req = (_UIQueryRequest *)a; + + return (req && req->caller == b) ? 0 : 1; +} + +gboolean +gsignond_signonui_proxy_cancel_request (GSignondSignonuiProxy *proxy, + GObject *caller, + GSignondSignonuiProxyCancelRequestCb cb, + gpointer userdata) +{ + GList *element = NULL; + _UIQueryRequest *req = NULL; + /* if no active request to cacel */ + if (!proxy->priv->active_request) return FALSE; + + /* cancel active request */ + if (proxy->priv->active_request->caller == caller) { + _UICancelRequest *req = _ui_cancel_request_new (cb, userdata); + gsignond_dbus_signonui_adapter_cancel_request (proxy->priv->signonui, + G_OBJECT_TYPE_NAME (caller), _cancel_request_cb, req); + return TRUE; + } + + /* cancel pending request */ + element = g_queue_find_custom (proxy->priv->request_queue, caller, _find_request_by_caller); + + if (!element) return FALSE; + req = element->data; + + if (req->cb) { + gsignond_signonui_data_ref (req->ui_data); + gsignond_signonui_data_set_query_error(req->ui_data, SIGNONUI_ERROR_CANCELED); + + req->cb (req->ui_data, NULL, req->userdata); + } + + if (cb) cb(NULL, userdata); + + return TRUE; +} + +GSignondSignonuiProxy * +gsignond_signonui_proxy_new () +{ + return g_object_new (GSIGNOND_TYPE_SIGNONUI_PROXY, NULL); +} diff --git a/src/daemon/gsignond-signonui-proxy.h b/src/daemon/gsignond-signonui-proxy.h new file mode 100644 index 0000000..799961b --- /dev/null +++ b/src/daemon/gsignond-signonui-proxy.h @@ -0,0 +1,87 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2013 Intel Corporation. + * + * Contact: Amarnath Valluri<amarnath.valluri@linux.intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#ifndef __GSIGNOND_SIGNONUI_PROXY_H__ +#define __GSIGNOND_SIGNONUI_PROXY_H__ + +#include <glib-object.h> +#include <gsignond/gsignond-signonui-data.h> + +#define GSIGNOND_TYPE_SIGNONUI_PROXY (gsignond_signonui_proxy_get_type ()) +#define GSIGNOND_SIGNONUI_PROXY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSIGNOND_TYPE_SIGNONUI_PROXY, GSignondSignonuiProxy)) +#define GSIGNOND_IS_SIGNONUI_PROXY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSIGNOND_TYPE_SIGNONUI_PROXY)) +#define GSIGNOND_SIGNONUI_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GSIGNOND_TYPE_SIGNONUI_PROXY, GSignondSignonuiProxyClass)) +#define GSIGNOND_IS_SIGNONUI_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GSIGNOND_TYPE_SIGNONUI_PROXY)) +#define GSIGNOND_SIGNONUI_PROXY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GSIGNOND_TYPE_SIGNONUI_PROXY, GSignondSignonuiProxyClass)) + +typedef struct _GSignondSignonuiProxy GSignondSignonuiProxy; +typedef struct _GSignondSignonuiProxyClass GSignondSignonuiProxyClass; +typedef struct _GSignondSignonuiProxyPrivate GSignondSignonuiProxyPrivate; + +typedef void (*GSignondSignonuiProxyQueryDialogCb)(GSignondSignonuiData *reply, GError *error, gpointer userdata); +typedef void (*GSignondSignonuiProxyRefreshCb)(GSignondSignonuiData *ui_data, gpointer userdata); +typedef void (*GSignondSignonuiProxyRefreshDialogCb) (GError *error, gpointer userdata); +typedef void (*GSignondSignonuiProxyCancelRequestCb) (GError *error, gpointer userdata); + +struct _GSignondSignonuiProxy +{ + GObject parent; + + /* Private */ + GSignondSignonuiProxyPrivate *priv; +}; + +struct _GSignondSignonuiProxyClass +{ + GObjectClass parent_class; +}; + +GType gsignond_signonui_proxy_get_type (void); + +GSignondSignonuiProxy * +gsignond_signonui_proxy_new (); + +gboolean +gsignond_signonui_proxy_query_dialog (GSignondSignonuiProxy *proxy, + GObject *caller, + GSignondSignonuiData *ui_data, + GSignondSignonuiProxyQueryDialogCb callback, + GSignondSignonuiProxyRefreshCb refresh_cb, + gpointer userdata); + +gboolean +gsignond_signonui_proxy_refresh_dialog (GSignondSignonuiProxy *proxy, + GObject *caller, + GSignondSignonuiData *ui_data, + GSignondSignonuiProxyRefreshDialogCb callback, + gpointer userdata); + +gboolean +gsignond_signonui_proxy_cancel_request (GSignondSignonuiProxy *proxy, + GObject *caller, + GSignondSignonuiProxyCancelRequestCb callback, + gpointer userdata); + +#endif //__GSIGNOND_SIGNONUI_PROXY_H__ diff --git a/src/daemon/gsignond-types.h b/src/daemon/gsignond-types.h new file mode 100644 index 0000000..e0a2b20 --- /dev/null +++ b/src/daemon/gsignond-types.h @@ -0,0 +1,42 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2013 Intel Corporation. + * + * Contact: Imran Zaman <imran.zaman@linux.intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#ifndef __GSIGNOND_TYPES_H_ +#define __GSIGNOND_TYPES_H_ + +#include <glib.h> + +G_BEGIN_DECLS + +typedef struct _GSignondDaemon GSignondDaemon; +typedef struct _GSignondDaemonClass GSignondDaemonClass; +typedef struct _GSignondIdentity GSignondIdentity; +typedef struct _GSignondIdentityClass GSignondIdentityClass; +typedef struct _GSignondAuthSession GSignondAuthSession; +typedef struct _GSignondAuthSessionClass GSignondAuthSessionClass; + +G_END_DECLS + +#endif /* __GSIGNOND_TYPES_H_ */ diff --git a/src/daemon/main.c b/src/daemon/main.c new file mode 100644 index 0000000..065ac7f --- /dev/null +++ b/src/daemon/main.c @@ -0,0 +1,162 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2012 Intel Corporation. + * + * Contact: Amarnath Valluri <amarnath.valluri@linux.intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#include "config.h" + +#include <errno.h> +#include <signal.h> +#include <string.h> +#include <stdio.h> +#include <glib-unix.h> +#include <glib.h> +#include <gio/gio.h> + +#include "gsignond/gsignond-log.h" +#include "daemon/dbus/gsignond-dbus.h" +#include "daemon/dbus/gsignond-dbus-server.h" + +static GSignondDbusServer *_server = NULL; +static guint _sig_source_id[3]; + +static void +_on_server_closed (gpointer data, GObject *server) +{ + _server = NULL; + if (data) g_main_loop_quit ((GMainLoop *)data); +} + +static gboolean +_handle_quit_signal (gpointer user_data) +{ + GMainLoop *ml = (GMainLoop *) user_data; + + g_return_val_if_fail (ml != NULL, FALSE); + DBG ("Received quit signal"); + if (ml) g_main_loop_quit (ml); + + return FALSE; +} + +static gboolean +_handle_reload_signal (gpointer user_data) +{ + GMainLoop *ml = (GMainLoop *) user_data; + + DBG ("Received reload signal"); + g_return_val_if_fail (ml != NULL, FALSE); + if (_server) { + g_object_weak_unref (G_OBJECT(_server), _on_server_closed, ml); + g_object_unref (_server); + DBG ("Restarting daemon ...."); + _server = gsignond_dbus_server_new (); + g_object_weak_ref (G_OBJECT(_server), _on_server_closed, ml); + } + + return TRUE; +} + +static void +_install_sighandlers (GMainLoop *main_loop) +{ + GSource *source = NULL; + GMainContext *ctx = g_main_loop_get_context (main_loop); + + source = g_unix_signal_source_new (SIGHUP); + g_source_set_callback (source, + _handle_reload_signal, + main_loop, + NULL); + _sig_source_id[0] = g_source_attach (source, ctx); + source = g_unix_signal_source_new (SIGTERM); + g_source_set_callback (source, + _handle_quit_signal, + main_loop, + NULL); + _sig_source_id[1] = g_source_attach (source, ctx); + source = g_unix_signal_source_new (SIGINT); + g_source_set_callback (source, + _handle_quit_signal, + main_loop, + NULL); + _sig_source_id[2] = g_source_attach (source, ctx); +} + +int main (int argc, char **argv) +{ + GError *error = NULL; + GMainLoop *main_loop = NULL; + GOptionContext *opt_context = NULL; + GOptionEntry opt_entries[] = { + {NULL } + }; + + DBG ("before: real uid %d effective uid %d", getuid (), geteuid ()); + if (setreuid (-1, getuid())) + WARN ("setreuid() failed"); + DBG ("after: real uid %d effective uid %d", getuid (), geteuid ()); + DBG ("before: real gid %d effective gid %d", getgid (), getegid ()); + if (setregid (-1, getgid())) + WARN ("setregid() failed"); + DBG ("after: real gid %d effective gid %d", getgid (), getegid ()); + +#if !GLIB_CHECK_VERSION (2, 36, 0) + g_type_init (); +#endif + +#ifdef ENABLE_DEBUG + g_log_set_always_fatal (G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL); +#endif + + opt_context = g_option_context_new ("SSO daemon"); + g_option_context_add_main_entries (opt_context, opt_entries, NULL); + if (!g_option_context_parse (opt_context, &argc, &argv, &error)) { + ERR ("Error parsing options: %s", error->message); + g_error_free (error); + return -1; + } + + main_loop = g_main_loop_new (NULL, FALSE); + + _server = gsignond_dbus_server_new (); + g_option_context_free (opt_context); + if (!_server) { + return -1; + } + g_object_weak_ref (G_OBJECT (_server), _on_server_closed, main_loop); + _install_sighandlers(main_loop); +#ifdef USE_P2P + INFO ("server started at : %s", gsignond_dbus_server_get_address (_server)); +#endif + INFO ("Entering main event loop"); + + g_main_loop_run (main_loop); + + if(_server) g_object_unref (_server); + + if (main_loop) g_main_loop_unref (main_loop); + + DBG("Clean shutdown"); + return 0; +} diff --git a/src/daemon/plugins/Makefile.am b/src/daemon/plugins/Makefile.am new file mode 100644 index 0000000..1892a6a --- /dev/null +++ b/src/daemon/plugins/Makefile.am @@ -0,0 +1,26 @@ +SUBDIRS = plugind + +lib_LTLIBRARIES = libgsignond-plugins.la + +libgsignond_plugins_la_CPPFLAGS = \ + -I$(top_builddir) \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/include \ + -I$(top_builddir)/src \ + $(GSIGNOND_CFLAGS) + +libgsignond_plugins_la_LIBADD = \ + $(top_builddir)/src/common/libgsignond-common.la \ + $(top_builddir)/src/daemon/dbus/libgsignond-dbus-glue.la \ + $(GSIGNOND_LIBS) + +libgsignond_plugins_la_SOURCES = \ + gsignond-plugin-proxy.h \ + gsignond-plugin-proxy.c \ + gsignond-plugin-proxy-factory.h \ + gsignond-plugin-proxy-factory.c \ + gsignond-plugin-remote-private.h \ + gsignond-plugin-remote.h \ + gsignond-plugin-remote.c + +CLEANFILES = diff --git a/src/daemon/plugins/Makefile.in b/src/daemon/plugins/Makefile.in new file mode 100644 index 0000000..9ecd358 --- /dev/null +++ b/src/daemon/plugins/Makefile.in @@ -0,0 +1,777 @@ +# Makefile.in generated by automake 1.11.3 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ +pkglibdir = $(libdir)/@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 = src/daemon/plugins +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_gnu_make.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +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__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libgsignond_plugins_la_DEPENDENCIES = \ + $(top_builddir)/src/common/libgsignond-common.la \ + $(top_builddir)/src/daemon/dbus/libgsignond-dbus-glue.la \ + $(am__DEPENDENCIES_1) +am_libgsignond_plugins_la_OBJECTS = \ + libgsignond_plugins_la-gsignond-plugin-proxy.lo \ + libgsignond_plugins_la-gsignond-plugin-proxy-factory.lo \ + libgsignond_plugins_la-gsignond-plugin-remote.lo +libgsignond_plugins_la_OBJECTS = $(am_libgsignond_plugins_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +DEFAULT_INCLUDES = +depcomp = $(SHELL) $(top_srcdir)/build-aux/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_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +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_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = $(libgsignond_plugins_la_SOURCES) +DIST_SOURCES = $(libgsignond_plugins_la_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHECK_CFLAGS = @CHECK_CFLAGS@ +CHECK_LIBS = @CHECK_LIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBUS_INTERFACES_DIR = @DBUS_INTERFACES_DIR@ +DBUS_SERVICES_DIR = @DBUS_SERVICES_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GREP = @GREP@ +GSIGNOND_CFLAGS = @GSIGNOND_CFLAGS@ +GSIGNOND_LIBS = @GSIGNOND_LIBS@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GTestDBus_CFLAGS = @GTestDBus_CFLAGS@ +GTestDBus_LIBS = @GTestDBus_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBECRYPTFS_CFLAGS = @LIBECRYPTFS_CFLAGS@ +LIBECRYPTFS_LIBS = @LIBECRYPTFS_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSMACK_CFLAGS = @LIBSMACK_CFLAGS@ +LIBSMACK_LIBS = @LIBSMACK_LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MESSAGE_BUS_TYPE = @MESSAGE_BUS_TYPE@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +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@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +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@ +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@ +ifGNUmake = @ifGNUmake@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +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@ +SUBDIRS = plugind +lib_LTLIBRARIES = libgsignond-plugins.la +libgsignond_plugins_la_CPPFLAGS = \ + -I$(top_builddir) \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/include \ + -I$(top_builddir)/src \ + $(GSIGNOND_CFLAGS) + +libgsignond_plugins_la_LIBADD = \ + $(top_builddir)/src/common/libgsignond-common.la \ + $(top_builddir)/src/daemon/dbus/libgsignond-dbus-glue.la \ + $(GSIGNOND_LIBS) + +libgsignond_plugins_la_SOURCES = \ + gsignond-plugin-proxy.h \ + gsignond-plugin-proxy.c \ + gsignond-plugin-proxy-factory.h \ + gsignond-plugin-proxy-factory.c \ + gsignond-plugin-remote-private.h \ + gsignond-plugin-remote.h \ + gsignond-plugin-remote.c + +CLEANFILES = +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(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 src/daemon/plugins/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/daemon/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: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || 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)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_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 +libgsignond-plugins.la: $(libgsignond_plugins_la_OBJECTS) $(libgsignond_plugins_la_DEPENDENCIES) $(EXTRA_libgsignond_plugins_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) -rpath $(libdir) $(libgsignond_plugins_la_OBJECTS) $(libgsignond_plugins_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignond_plugins_la-gsignond-plugin-proxy-factory.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignond_plugins_la-gsignond-plugin-proxy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignond_plugins_la-gsignond-plugin-remote.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +libgsignond_plugins_la-gsignond-plugin-proxy.lo: gsignond-plugin-proxy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_plugins_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgsignond_plugins_la-gsignond-plugin-proxy.lo -MD -MP -MF $(DEPDIR)/libgsignond_plugins_la-gsignond-plugin-proxy.Tpo -c -o libgsignond_plugins_la-gsignond-plugin-proxy.lo `test -f 'gsignond-plugin-proxy.c' || echo '$(srcdir)/'`gsignond-plugin-proxy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgsignond_plugins_la-gsignond-plugin-proxy.Tpo $(DEPDIR)/libgsignond_plugins_la-gsignond-plugin-proxy.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-plugin-proxy.c' object='libgsignond_plugins_la-gsignond-plugin-proxy.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_plugins_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgsignond_plugins_la-gsignond-plugin-proxy.lo `test -f 'gsignond-plugin-proxy.c' || echo '$(srcdir)/'`gsignond-plugin-proxy.c + +libgsignond_plugins_la-gsignond-plugin-proxy-factory.lo: gsignond-plugin-proxy-factory.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_plugins_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgsignond_plugins_la-gsignond-plugin-proxy-factory.lo -MD -MP -MF $(DEPDIR)/libgsignond_plugins_la-gsignond-plugin-proxy-factory.Tpo -c -o libgsignond_plugins_la-gsignond-plugin-proxy-factory.lo `test -f 'gsignond-plugin-proxy-factory.c' || echo '$(srcdir)/'`gsignond-plugin-proxy-factory.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgsignond_plugins_la-gsignond-plugin-proxy-factory.Tpo $(DEPDIR)/libgsignond_plugins_la-gsignond-plugin-proxy-factory.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-plugin-proxy-factory.c' object='libgsignond_plugins_la-gsignond-plugin-proxy-factory.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_plugins_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgsignond_plugins_la-gsignond-plugin-proxy-factory.lo `test -f 'gsignond-plugin-proxy-factory.c' || echo '$(srcdir)/'`gsignond-plugin-proxy-factory.c + +libgsignond_plugins_la-gsignond-plugin-remote.lo: gsignond-plugin-remote.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_plugins_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgsignond_plugins_la-gsignond-plugin-remote.lo -MD -MP -MF $(DEPDIR)/libgsignond_plugins_la-gsignond-plugin-remote.Tpo -c -o libgsignond_plugins_la-gsignond-plugin-remote.lo `test -f 'gsignond-plugin-remote.c' || echo '$(srcdir)/'`gsignond-plugin-remote.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgsignond_plugins_la-gsignond-plugin-remote.Tpo $(DEPDIR)/libgsignond_plugins_la-gsignond-plugin-remote.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-plugin-remote.c' object='libgsignond_plugins_la-gsignond-plugin-remote.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_plugins_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgsignond_plugins_la-gsignond-plugin-remote.lo `test -f 'gsignond-plugin-remote.c' || echo '$(srcdir)/'`gsignond-plugin-remote.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +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: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + 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: ctags-recursive $(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 + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(LTLIBRARIES) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +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-recursive + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags ctags-recursive \ + 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-libLTLIBRARIES install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-libLTLIBRARIES + + +# 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/src/daemon/plugins/gsignond-plugin-proxy-factory.c b/src/daemon/plugins/gsignond-plugin-proxy-factory.c new file mode 100644 index 0000000..4f94e4a --- /dev/null +++ b/src/daemon/plugins/gsignond-plugin-proxy-factory.c @@ -0,0 +1,354 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2012 Intel Corporation. + * + * Contact: Alexander Kanavin <alex.kanavin@gmail.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#include <string.h> +#include <stdio.h> + +#include "gsignond/gsignond-log.h" +#include "common/gsignond-plugin-loader.h" +#include "gsignond-plugin-proxy-factory.h" +#include "gsignond-plugin-remote.h" + +G_DEFINE_TYPE (GSignondPluginProxyFactory, gsignond_plugin_proxy_factory, G_TYPE_OBJECT); + + +enum +{ + PROP_0, + + PROP_CONFIG, + + N_PROPERTIES +}; + +static GParamSpec *obj_properties[N_PROPERTIES] = { NULL, }; + +static void _enumerate_plugins(GSignondPluginProxyFactory* self) +{ + GDir* plugin_dir = g_dir_open(gsignond_config_get_string (self->config, + GSIGNOND_CONFIG_GENERAL_PLUGINS_DIR), 0, NULL); + if (plugin_dir == NULL) { + WARN ("plugin directory empty"); + return; + } + + int n_plugins = 0; + while (g_dir_read_name(plugin_dir) != NULL) + n_plugins++; + g_dir_rewind(plugin_dir); + + self->methods = g_malloc0(sizeof(gchar*) * (n_plugins + 1)); + + DBG ("enumerate plugins in %s (factory=%p)", + gsignond_config_get_string (self->config, + GSIGNOND_CONFIG_GENERAL_PLUGINS_DIR), + self + ); + gchar **method_iter = self->methods; + while (1) { + const gchar* plugin_soname = g_dir_read_name(plugin_dir); + if (plugin_soname == NULL) + break; + if (g_str_has_prefix(plugin_soname, "lib") && + g_str_has_suffix(plugin_soname, ".so")) { + gchar* plugin_name = g_strndup(plugin_soname+3, + strlen(plugin_soname) - 6); + GSignondPlugin* plugin = GSIGNOND_PLUGIN ( + gsignond_plugin_remote_new (self->config, plugin_name)); + if (plugin != NULL) { + gchar* plugin_type; + gchar** mechanisms; + g_object_get(plugin, + "type", &plugin_type, + "mechanisms", &mechanisms, + NULL); + if (g_strcmp0 (plugin_type, plugin_name) == 0) { + *method_iter = plugin_type; + method_iter++; + g_hash_table_insert(self->mechanisms, + plugin_type, mechanisms); + } else { + g_free(plugin_type); + g_strfreev(mechanisms); + } + g_object_unref(plugin); + } + g_free(plugin_name); + } + } + g_dir_close(plugin_dir); +} + +static GObject * +gsignond_plugin_proxy_factory_constructor (GType gtype, + guint n_properties, + GObjectConstructParam *properties) +{ + GObject *obj; + + { + /* Always chain up to the parent constructor */ + obj = G_OBJECT_CLASS (gsignond_plugin_proxy_factory_parent_class)->constructor ( + gtype, n_properties, properties); + } + + return obj; +} + +static void +gsignond_plugin_proxy_factory_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + GSignondPluginProxyFactory *self = GSIGNOND_PLUGIN_PROXY_FACTORY (object); + switch (property_id) + { + case PROP_CONFIG: + g_assert (self->config == NULL); + self->config = g_value_dup_object (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gsignond_plugin_proxy_factory_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GSignondPluginProxyFactory *self = GSIGNOND_PLUGIN_PROXY_FACTORY (object); + + switch (prop_id) + { + case PROP_CONFIG: + g_value_set_object (value, self->config); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gsignond_plugin_proxy_factory_dispose (GObject *gobject) +{ + GSignondPluginProxyFactory *self = GSIGNOND_PLUGIN_PROXY_FACTORY (gobject); + + if (self->config) { + g_object_unref (self->config); + self->config = NULL; + } + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gsignond_plugin_proxy_factory_parent_class)->dispose (gobject); +} + +static void +gsignond_plugin_proxy_factory_finalize (GObject *gobject) +{ + GSignondPluginProxyFactory *self = GSIGNOND_PLUGIN_PROXY_FACTORY (gobject); + + if (self->plugins) { + g_hash_table_destroy (self->plugins); + self->plugins = NULL; + } + if (self->mechanisms) { + g_hash_table_destroy (self->mechanisms); + self->mechanisms = NULL; + } + if (self->methods) { + g_free (self->methods); + self->methods = NULL; + } + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gsignond_plugin_proxy_factory_parent_class)->finalize (gobject); +} + + +static void +gsignond_plugin_proxy_factory_class_init (GSignondPluginProxyFactoryClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->constructor = gsignond_plugin_proxy_factory_constructor; + gobject_class->set_property = gsignond_plugin_proxy_factory_set_property; + gobject_class->get_property = gsignond_plugin_proxy_factory_get_property; + gobject_class->dispose = gsignond_plugin_proxy_factory_dispose; + gobject_class->finalize = gsignond_plugin_proxy_factory_finalize; + + obj_properties[PROP_CONFIG] = g_param_spec_object ("config", + "config", + "Configuration object", + GSIGNOND_TYPE_CONFIG, + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS); + + + g_object_class_install_properties (gobject_class, + N_PROPERTIES, + obj_properties); +} + +static void +gsignond_plugin_proxy_factory_init (GSignondPluginProxyFactory *self) +{ + self->mechanisms = g_hash_table_new_full((GHashFunc)g_str_hash, + (GEqualFunc)g_str_equal, + (GDestroyNotify)g_free, + (GDestroyNotify)g_strfreev); + + self->plugins = g_hash_table_new_full ((GHashFunc)g_str_hash, + (GEqualFunc)g_str_equal, + (GDestroyNotify)g_free, + (GDestroyNotify)g_object_unref); + + self->methods = NULL; +} + +GSignondPluginProxyFactory* +gsignond_plugin_proxy_factory_new(GSignondConfig *config) +{ + GSignondPluginProxyFactory* proxy = g_object_new( + GSIGNOND_TYPE_PLUGIN_PROXY_FACTORY, + "config", config, + NULL); + return proxy; +} + +static gboolean +_find_proxy_by_pointer (gpointer key, gpointer value, gpointer userdata) +{ + if (userdata == value) { + g_free (key); + return TRUE; + } + return FALSE; +} + +static void +_remove_dead_proxy (gpointer data, GObject *dead_proxy) +{ + GSignondPluginProxyFactory *factory = GSIGNOND_PLUGIN_PROXY_FACTORY(data); + if (factory) { + g_hash_table_foreach_steal (factory->plugins, + _find_proxy_by_pointer, dead_proxy); + } +} + +static void +_proxy_toggle_ref_cb (gpointer userdata, GObject *proxy, gboolean is_last_ref) +{ + /* start/stop timeout timer */ + gsignond_disposable_set_auto_dispose (GSIGNOND_DISPOSABLE (proxy), is_last_ref); + + if (is_last_ref) g_object_weak_ref (proxy, _remove_dead_proxy, userdata); + else g_object_weak_unref (proxy, _remove_dead_proxy, userdata); +} + +GSignondPluginProxy* +gsignond_plugin_proxy_factory_get_plugin(GSignondPluginProxyFactory* factory, + const gchar* plugin_type) +{ + g_return_val_if_fail (factory && GSIGNOND_IS_PLUGIN_PROXY_FACTORY(factory), NULL); + g_return_val_if_fail (plugin_type, NULL); + + GSignondPluginProxy* proxy = NULL; + + if (factory->methods == NULL) { + _enumerate_plugins (factory); + } + + if (g_hash_table_lookup(factory->mechanisms, plugin_type) == NULL) { + DBG("Plugin not known %s", plugin_type); + return NULL; + } + + proxy = g_hash_table_lookup(factory->plugins, plugin_type); + if (proxy != NULL) { + DBG("get existing plugin %s -> %p", plugin_type, proxy); + g_object_ref(proxy); + return proxy; + } + + proxy = gsignond_plugin_proxy_new(factory->config, plugin_type); + if (proxy == NULL) { + return NULL; + } + g_hash_table_insert(factory->plugins, g_strdup (plugin_type), proxy); + DBG("get new plugin %s -> %p", plugin_type, proxy); + g_object_add_toggle_ref(G_OBJECT(proxy), _proxy_toggle_ref_cb, factory); + + return proxy; +} + +gboolean gsignond_plugin_proxy_factory_add_plugin( + GSignondPluginProxyFactory* factory, + GSignondPluginProxy* proxy) +{ + g_return_val_if_fail (factory && GSIGNOND_IS_PLUGIN_PROXY_FACTORY(factory), FALSE); + g_return_val_if_fail (proxy && GSIGNOND_IS_PLUGIN_PROXY(proxy), FALSE); + + gchar* plugin_type = NULL; + g_object_get (proxy, "type", &plugin_type, NULL); + + if (g_hash_table_contains(factory->plugins, plugin_type)) { + g_free(plugin_type); + return FALSE; + } + g_object_ref(proxy); + DBG("add plugin %s -> %p", plugin_type, proxy); + g_hash_table_insert(factory->plugins, plugin_type, proxy); + + return TRUE; +} + +const gchar** +gsignond_plugin_proxy_factory_get_plugin_types( + GSignondPluginProxyFactory* factory) +{ + if (factory->methods == NULL) { + _enumerate_plugins (factory); + } + return (const gchar**)factory->methods; +} + +const gchar** +gsignond_plugin_proxy_factory_get_plugin_mechanisms( + GSignondPluginProxyFactory* factory, const gchar* plugin_type) +{ + g_return_val_if_fail(factory->mechanisms, NULL); + + if (factory->methods == NULL) { + _enumerate_plugins (factory); + } + + return g_hash_table_lookup(factory->mechanisms, plugin_type); +} diff --git a/src/daemon/plugins/gsignond-plugin-proxy-factory.h b/src/daemon/plugins/gsignond-plugin-proxy-factory.h new file mode 100644 index 0000000..bed020c --- /dev/null +++ b/src/daemon/plugins/gsignond-plugin-proxy-factory.h @@ -0,0 +1,83 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2012 Intel Corporation. + * + * Contact: Alexander Kanavin <alex.kanavin@gmail.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#ifndef __GSIGNOND_PLUGIN_PROXY_FACTORY_H__ +#define __GSIGNOND_PLUGIN_PROXY_FACTORY_H__ + +#include <glib-object.h> +#include "gsignond-plugin-proxy.h" +#include <gsignond/gsignond-config.h> + +#define GSIGNOND_TYPE_PLUGIN_PROXY_FACTORY (gsignond_plugin_proxy_factory_get_type ()) +#define GSIGNOND_PLUGIN_PROXY_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSIGNOND_TYPE_PLUGIN_PROXY_FACTORY, GSignondPluginProxyFactory)) +#define GSIGNOND_IS_PLUGIN_PROXY_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSIGNOND_TYPE_PLUGIN_PROXY_FACTORY)) +#define GSIGNOND_PLUGIN_PROXY_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GSIGNOND_TYPE_PLUGIN_PROXY_FACTORY, GSignondPluginProxyFactoryClass)) +#define GSIGNOND_IS_PLUGIN_PROXY_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GSIGNOND_TYPE_PLUGIN_PROXY_FACTORY)) +#define GSIGNOND_PLUGIN_PROXY_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GSIGNOND_TYPE_PLUGIN_PROXY_FACTORY, GSignondPluginProxyFactoryClass)) + + +typedef struct _GSignondPluginProxyFactory GSignondPluginProxyFactory; +typedef struct _GSignondPluginProxyFactoryClass GSignondPluginProxyFactoryClass; + +struct _GSignondPluginProxyFactory +{ + GObject parent_instance; + + /* Private */ + GSignondConfig *config; + GHashTable* plugins; + + gchar** methods; + GHashTable* mechanisms; +}; + +struct _GSignondPluginProxyFactoryClass +{ + GObjectClass parent_class; +}; + +GType gsignond_plugin_proxy_factory_get_type (void); + +GSignondPluginProxyFactory* +gsignond_plugin_proxy_factory_new(GSignondConfig *config); + +GSignondPluginProxy* +gsignond_plugin_proxy_factory_get_plugin(GSignondPluginProxyFactory* factory, + const gchar* plugin_type); + +gboolean gsignond_plugin_proxy_factory_add_plugin( + GSignondPluginProxyFactory* factory, + GSignondPluginProxy* proxy); + +const gchar** +gsignond_plugin_proxy_factory_get_plugin_types( + GSignondPluginProxyFactory* factory); + +const gchar** +gsignond_plugin_proxy_factory_get_plugin_mechanisms( + GSignondPluginProxyFactory* factory, const gchar* plugin_type); + + +#endif /* __GSIGNOND_PLUGIN_PROXY_FACTORY_H__ */ diff --git a/src/daemon/plugins/gsignond-plugin-proxy.c b/src/daemon/plugins/gsignond-plugin-proxy.c new file mode 100644 index 0000000..cfb3638 --- /dev/null +++ b/src/daemon/plugins/gsignond-plugin-proxy.c @@ -0,0 +1,615 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2012 Intel Corporation. + * + * Contact: Alexander Kanavin <alex.kanavin@gmail.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#include "gsignond/gsignond-error.h" +#include "gsignond/gsignond-log.h" +#include "gsignond/gsignond-config.h" +#include "common/gsignond-plugin-loader.h" +#include "daemon/gsignond-auth-session.h" +#include "gsignond-plugin-proxy.h" +#include "gsignond-plugin-remote.h" + +#define GSIGNOND_PLUGIN_PROXY_PRIV(obj) \ + G_TYPE_INSTANCE_GET_PRIVATE ((obj), \ + GSIGNOND_TYPE_PLUGIN_PROXY, \ + GSignondPluginProxyPrivate) + +enum +{ + PROP_0, + + PROP_TYPE, + PROP_MECHANISMS, + PROP_CONFIG, + + N_PROPERTIES +}; + +struct _GSignondPluginProxyPrivate +{ + GSignondConfig *config; + gchar* plugin_type; + GSignondPlugin* plugin; + GQueue* session_queue; + GSignondAuthSession* active_session; + gpointer active_process_userdata; + gboolean expecting_request; +}; + +typedef struct { + GSignondAuthSession* auth_session; + GSignondSessionData* session_data; + gchar* mechanism; + gpointer userdata; +} GSignondProcessData; + +static GParamSpec *obj_properties[N_PROPERTIES] = { NULL, }; + +G_DEFINE_TYPE (GSignondPluginProxy, gsignond_plugin_proxy, GSIGNOND_TYPE_DISPOSABLE); + +static GSignondProcessData* +gsignond_process_data_new ( + GSignondAuthSession* auth_session, + GSignondSessionData *session_data, + const gchar* mechanism, + gpointer userdata) +{ + GSignondProcessData* data = g_slice_new0 (GSignondProcessData); + data->auth_session = g_object_ref (auth_session); + data->session_data = gsignond_dictionary_copy (session_data); + data->mechanism = g_strdup (mechanism); + data->userdata = userdata; + return data; +} + +static void +gsignond_process_data_free ( + GSignondProcessData* data) +{ + g_object_unref (data->auth_session); + gsignond_dictionary_unref (data->session_data); + g_free (data->mechanism); + g_slice_free (GSignondProcessData, data); +} + +static void +gsignond_plugin_proxy_process_queue ( + GSignondPluginProxy *self) +{ + g_assert (GSIGNOND_IS_PLUGIN_PROXY (self)); + + GSignondPluginProxyPrivate *priv = self->priv; + GSignondProcessData* next_data = g_queue_pop_head (priv->session_queue); + if (next_data) { + priv->expecting_request = FALSE; + priv->active_process_userdata = next_data->userdata; + priv->active_session = next_data->auth_session; + g_object_ref (priv->active_session); + gsignond_auth_session_notify_state_changed ( + priv->active_session, GSIGNOND_PLUGIN_STATE_STARTED, + "The request is being processed.", + priv->active_process_userdata); + gsignond_plugin_request_initial (priv->plugin, + next_data->session_data, + next_data->mechanism); + gsignond_process_data_free (next_data); + } +} + +static void +gsignond_plugin_proxy_response_final_callback ( + GSignondPlugin *plugin, + GSignondSessionData *result, + gpointer user_data) +{ + GSignondPluginProxy *self = GSIGNOND_PLUGIN_PROXY (user_data); + GSignondPluginProxyPrivate *priv = self->priv; + + DBG (""); + if (priv->active_session == NULL) { + WARN("Error: plugin %s reported 'response_final', but no active session" + " in plugin proxy", priv->plugin_type); + return; + } + gsignond_auth_session_notify_process_result (priv->active_session, result, + priv->active_process_userdata); + g_object_unref (priv->active_session); + priv->active_session = NULL; + priv->active_process_userdata = NULL; + gsignond_plugin_proxy_process_queue (self); +} + +static void +gsignond_plugin_proxy_response_callback( + GSignondPlugin *plugin, + GSignondSessionData *result, + gpointer user_data) +{ + GSignondPluginProxy *self = GSIGNOND_PLUGIN_PROXY (user_data); + GSignondPluginProxyPrivate *priv = self->priv; + + if (priv->active_session == NULL) { + WARN("Error: plugin %s reported 'response', but no active session " + "in plugin proxy", priv->plugin_type); + return; + } + priv->expecting_request = TRUE; + gsignond_auth_session_notify_process_result (priv->active_session, + result, priv->active_process_userdata); +} + +static void +gsignond_plugin_proxy_store_callback ( + GSignondPlugin *plugin, + GSignondSessionData *result, + gpointer user_data) +{ + GSignondPluginProxy *self = GSIGNOND_PLUGIN_PROXY (user_data); + GSignondPluginProxyPrivate *priv = self->priv; + + if (priv->active_session == NULL) { + WARN("Error: plugin %s reported 'store', but no active session " + "in plugin proxy", priv->plugin_type); + return; + } + gsignond_auth_session_notify_store (priv->active_session, result); +} + +static void +gsignond_plugin_proxy_refreshed_callback ( + GSignondPlugin *plugin, + GSignondSignonuiData *ui_result, + gpointer user_data) +{ + GSignondPluginProxy *self = GSIGNOND_PLUGIN_PROXY (user_data); + GSignondPluginProxyPrivate *priv = self->priv; + + if (priv->active_session == NULL) { + WARN("Error: plugin %s reported 'refreshed', but no active session" + " in plugin proxy", priv->plugin_type); + return; + } + gsignond_auth_session_notify_refreshed (priv->active_session, ui_result); +} + +static void +gsignond_plugin_proxy_user_action_required_callback ( + GSignondPlugin *plugin, + GSignondSignonuiData *ui_request, + gpointer user_data) +{ + GSignondPluginProxy *self = GSIGNOND_PLUGIN_PROXY (user_data); + GSignondPluginProxyPrivate *priv = self->priv; + + if (priv->active_session == NULL) { + WARN("Error: plugin %s reported 'user_action_required', but no active" + " session in plugin proxy", priv->plugin_type); + return; + } + gsignond_auth_session_notify_user_action_required( + priv->active_session, ui_request); +} + +static void +gsignond_plugin_proxy_error_callback ( + GSignondPlugin* plugin, + GError* error, + gpointer user_data) +{ + GSignondPluginProxy *self = GSIGNOND_PLUGIN_PROXY (user_data); + GSignondPluginProxyPrivate *priv = self->priv; + + if (priv->active_session == NULL) { + WARN("Error: plugin %s reported error %s, but no active session " + "in plugin proxy", priv->plugin_type, error->message); + return; + } + gsignond_auth_session_notify_process_error (priv->active_session, error, + priv->active_process_userdata); + g_object_unref (priv->active_session); + priv->active_session = NULL; + priv->active_process_userdata = NULL; + gsignond_plugin_proxy_process_queue (self); +} + +static void +gsignond_plugin_proxy_status_changed_callback ( + GSignondPlugin *plugin, + GSignondPluginState state, + const gchar *message, + gpointer user_data) +{ + GSignondPluginProxy *self = GSIGNOND_PLUGIN_PROXY (user_data); + GSignondPluginProxyPrivate *priv = self->priv; + + if (priv->active_session == NULL) { + WARN("Error: plugin %s reported change in state %d with message %s, " + "but no active session in plugin proxy", priv->plugin_type, + state, message); + return; + } + gsignond_auth_session_notify_state_changed (priv->active_session, + (gint) state, message, + priv->active_process_userdata); +} + +static GObject * +gsignond_plugin_proxy_constructor ( + GType gtype, + guint n_properties, + GObjectConstructParam *properties) +{ + GObject *obj; + + /* Always chain up to the parent constructor */ + obj = G_OBJECT_CLASS (gsignond_plugin_proxy_parent_class)-> + constructor (gtype, n_properties, properties); + + /* update the object state depending on constructor properties */ + GSignondPluginProxy* self = GSIGNOND_PLUGIN_PROXY (obj); + GSignondPluginProxyPrivate *priv = self->priv; + priv->plugin = GSIGNOND_PLUGIN (gsignond_plugin_remote_new (priv->config, + priv->plugin_type)); + + if (priv->plugin == NULL) { + g_free (priv->plugin_type); + priv->plugin_type = NULL; + + } else { + gchar *type = NULL; + + g_signal_connect(priv->plugin, "response", G_CALLBACK( + gsignond_plugin_proxy_response_callback), self); + g_signal_connect(priv->plugin, "response-final", G_CALLBACK( + gsignond_plugin_proxy_response_final_callback), self); + g_signal_connect(priv->plugin, "user-action-required", G_CALLBACK( + gsignond_plugin_proxy_user_action_required_callback), self); + g_signal_connect(priv->plugin, "error", G_CALLBACK( + gsignond_plugin_proxy_error_callback), self); + g_signal_connect(priv->plugin, "store", G_CALLBACK( + gsignond_plugin_proxy_store_callback), self); + g_signal_connect(priv->plugin, "refreshed", G_CALLBACK( + gsignond_plugin_proxy_refreshed_callback), self); + g_signal_connect(priv->plugin, "status-changed", G_CALLBACK( + gsignond_plugin_proxy_status_changed_callback), self); + + g_object_get (priv->plugin, "type", &type, NULL); + if (g_strcmp0 (type, priv->plugin_type) != 0) { + g_free (priv->plugin_type); + priv->plugin_type = NULL; + } + g_free (type); + + } + return obj; +} + +static void +gsignond_plugin_proxy_set_property ( + GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + GSignondPluginProxy *self = GSIGNOND_PLUGIN_PROXY (object); + GSignondPluginProxyPrivate *priv = self->priv; + + switch (property_id) + { + case PROP_TYPE: + g_free (self->priv->plugin_type); + priv->plugin_type = g_value_dup_string (value); + break; + case PROP_CONFIG: + g_assert (self->priv->config == NULL); + priv->config = g_value_dup_object (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gsignond_plugin_proxy_get_property ( + GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GSignondPluginProxy *self = GSIGNOND_PLUGIN_PROXY (object); + GSignondPluginProxyPrivate *priv = self->priv; + + switch (prop_id) + { + case PROP_TYPE: + g_value_set_string (value, priv->plugin_type); + break; + case PROP_MECHANISMS: + g_object_get_property (G_OBJECT(priv->plugin), + "mechanisms", value); + break; + case PROP_CONFIG: + g_value_set_object (value, priv->config); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gsignond_plugin_proxy_dispose ( + GObject *gobject) +{ + GSignondPluginProxy *self = GSIGNOND_PLUGIN_PROXY (gobject); + GSignondPluginProxyPrivate *priv = self->priv; + + if (priv->active_session) { + g_object_unref (priv->active_session); + priv->active_session = NULL; + } + if (priv->plugin) { + g_object_unref (priv->plugin); + priv->plugin = NULL; + } + if (priv->config) { + g_object_unref (priv->config); + priv->config = NULL; + } + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gsignond_plugin_proxy_parent_class)->dispose (gobject); +} + +static void +gsignond_plugin_proxy_finalize (GObject *gobject) +{ + GSignondPluginProxy *self = GSIGNOND_PLUGIN_PROXY (gobject); + GSignondPluginProxyPrivate *priv = self->priv; + + if (priv->plugin_type) { + g_free (priv->plugin_type); + priv->plugin_type = NULL; + } + if (priv->session_queue) + { + g_queue_free_full (priv->session_queue, + (GDestroyNotify) gsignond_process_data_free); + priv->session_queue = NULL; + } + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gsignond_plugin_proxy_parent_class)->finalize (gobject); +} + + +static void +gsignond_plugin_proxy_class_init ( + GSignondPluginProxyClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (gobject_class, + sizeof (GSignondPluginProxyPrivate)); + + gobject_class->constructor = gsignond_plugin_proxy_constructor; + gobject_class->set_property = gsignond_plugin_proxy_set_property; + gobject_class->get_property = gsignond_plugin_proxy_get_property; + gobject_class->dispose = gsignond_plugin_proxy_dispose; + gobject_class->finalize = gsignond_plugin_proxy_finalize; + + obj_properties[PROP_TYPE] = + g_param_spec_string ("type", + "Plugin type", + "Set the plugin type for the proxy", + "" /* default value */, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS); + + obj_properties[PROP_MECHANISMS] = g_param_spec_boxed ("mechanisms", + "Mechanisms", + "List of plugin mechanisms", + G_TYPE_STRV, G_PARAM_READABLE); + + obj_properties[PROP_CONFIG] = g_param_spec_object ("config", + "config", + "Configuration object", + GSIGNOND_TYPE_CONFIG, + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS); + + g_object_class_install_properties (gobject_class, + N_PROPERTIES, + obj_properties); + +} + +static void +gsignond_plugin_proxy_init ( + GSignondPluginProxy *self) +{ + GSignondPluginProxyPrivate *priv = GSIGNOND_PLUGIN_PROXY_PRIV (self); + self->priv = priv; + + priv->config = NULL; + priv->plugin_type = NULL; + priv->plugin = NULL; + priv->session_queue = g_queue_new (); + priv->active_session = NULL; + priv->active_process_userdata = NULL; + priv->expecting_request = FALSE; +} + +static const gchar * +gsignond_plugin_proxy_get_plugin_type ( + GSignondPluginProxy *self) +{ + g_assert (GSIGNOND_IS_PLUGIN_PROXY (self)); + + return self->priv->plugin_type; +} + +GSignondPluginProxy* +gsignond_plugin_proxy_new ( + GSignondConfig *config, + const gchar *plugin_type) +{ + g_return_val_if_fail (config && plugin_type, NULL); + + gint timeout = gsignond_config_get_integer (config, GSIGNOND_CONFIG_PLUGIN_TIMEOUT); + GSignondPluginProxy* proxy = g_object_new (GSIGNOND_TYPE_PLUGIN_PROXY, + "config", config, + "type", plugin_type, + "auto-dispose", FALSE, + "timeout", timeout, + NULL); + if (g_strcmp0 (plugin_type, + gsignond_plugin_proxy_get_plugin_type (proxy)) == 0) + return proxy; + + g_object_unref (proxy); + return NULL; +} + +void +gsignond_plugin_proxy_process ( + GSignondPluginProxy *self, + GSignondAuthSession *session, + GSignondSessionData *session_data, + const gchar *mechanism, + gpointer userdata) +{ + g_assert (GSIGNOND_IS_PLUGIN_PROXY (self)); + g_assert (GSIGNOND_IS_AUTH_SESSION (session)); + + GSignondPluginProxyPrivate *priv = self->priv; + + if (session == priv->active_session && priv->expecting_request == TRUE) { + priv->expecting_request = FALSE; + // mechanism is discarded if this is not an initial request + gsignond_plugin_request (priv->plugin, session_data); + return; + } + + g_queue_push_tail (priv->session_queue, + gsignond_process_data_new (session, + session_data, + mechanism, userdata)); + gsignond_auth_session_notify_state_changed ( + session, GSIGNOND_PLUGIN_STATE_PROCESS_PENDING, + "The request has been queued.", userdata); + if (priv->active_session == NULL) { + gsignond_plugin_proxy_process_queue (self); + } +} + +static gint +gsignond_plugin_proxy_compare_process_data ( + gconstpointer process_data, + gconstpointer auth_session) +{ + g_return_val_if_fail (process_data && auth_session, 0); + + if (auth_session == ((GSignondProcessData*) process_data)->auth_session) + return 0; + else + return 1; +} + +static GSignondProcessData* +gsignond_plugin_proxy_find_by_session_iface ( + GSignondPluginProxy *self, + GSignondAuthSession *session) +{ + g_assert (GSIGNOND_IS_PLUGIN_PROXY (self)); + + return (GSignondProcessData*) g_queue_find_custom ( + self->priv->session_queue, + session, + gsignond_plugin_proxy_compare_process_data); +} + +void +gsignond_plugin_proxy_cancel ( + GSignondPluginProxy *self, + GSignondAuthSession *session) +{ + g_assert (GSIGNOND_IS_PLUGIN_PROXY (self)); + g_assert (GSIGNOND_IS_AUTH_SESSION (session)); + + GSignondPluginProxyPrivate *priv = self->priv; + + /* cancel active session */ + if (session == priv->active_session) { + gsignond_plugin_cancel (priv->plugin); + } else { /* cancel by de-queue */ + GSignondProcessData* data = + gsignond_plugin_proxy_find_by_session_iface (self, session); + if (!data) { + GError* error = g_error_new (GSIGNOND_ERROR, + GSIGNOND_ERROR_WRONG_STATE, + "Canceling an unknown session"); + gsignond_auth_session_notify_process_error (session, error, NULL); + g_error_free (error); + return; + } + g_queue_remove (priv->session_queue, data); + gsignond_process_data_free (data); + } +} + +void +gsignond_plugin_proxy_user_action_finished ( + GSignondPluginProxy *self, + GSignondSignonuiData *ui_data) +{ + g_assert (GSIGNOND_IS_PLUGIN_PROXY (self)); + + if (self->priv->active_session == NULL) { + WARN("Error: 'user_action_finished' requested for plugin %s but no " + "active session", self->priv->plugin_type); + return; + } + gsignond_plugin_user_action_finished (self->priv->plugin, ui_data); +} + +void +gsignond_plugin_proxy_refresh ( + GSignondPluginProxy *self, + GSignondSignonuiData *ui_data) +{ + g_assert (GSIGNOND_IS_PLUGIN_PROXY (self)); + + if (self->priv->active_session == NULL) { + WARN("Error: 'refresh' requested for plugin %s but no active session", + self->priv->plugin_type); + return; + } + gsignond_plugin_refresh (self->priv->plugin, ui_data); +} + + diff --git a/src/daemon/plugins/gsignond-plugin-proxy.h b/src/daemon/plugins/gsignond-plugin-proxy.h new file mode 100644 index 0000000..089e125 --- /dev/null +++ b/src/daemon/plugins/gsignond-plugin-proxy.h @@ -0,0 +1,97 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2012 Intel Corporation. + * + * Contact: Alexander Kanavin <alex.kanavin@gmail.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#ifndef __GSIGNOND_PLUGIN_PROXY_H__ +#define __GSIGNOND_PLUGIN_PROXY_H__ + +#include <glib-object.h> + +#include "common/gsignond-disposable.h" +#include "daemon/gsignond-types.h" +#include <gsignond/gsignond-plugin-interface.h> +#include <gsignond/gsignond-config.h> + +#define GSIGNOND_TYPE_PLUGIN_PROXY \ + (gsignond_plugin_proxy_get_type ()) +#define GSIGNOND_PLUGIN_PROXY(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSIGNOND_TYPE_PLUGIN_PROXY, \ + GSignondPluginProxy)) +#define GSIGNOND_IS_PLUGIN_PROXY(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSIGNOND_TYPE_PLUGIN_PROXY)) +#define GSIGNOND_PLUGIN_PROXY_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), GSIGNOND_TYPE_PLUGIN_PROXY, \ + GSignondPluginProxyClass)) +#define GSIGNOND_IS_PLUGIN_PROXY_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), GSIGNOND_TYPE_PLUGIN_PROXY)) +#define GSIGNOND_PLUGIN_PROXY_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), GSIGNOND_TYPE_PLUGIN_PROXY, \ + GSignondPluginProxyClass)) + +typedef struct _GSignondPluginProxy GSignondPluginProxy; +typedef struct _GSignondPluginProxyClass GSignondPluginProxyClass; +typedef struct _GSignondPluginProxyPrivate GSignondPluginProxyPrivate; + +struct _GSignondPluginProxy +{ + GSignondDisposable parent_instance; + + /* Private */ + GSignondPluginProxyPrivate *priv; +}; + +struct _GSignondPluginProxyClass +{ + GSignondDisposableClass parent_class; +}; + +GType +gsignond_plugin_proxy_get_type (void); + +GSignondPluginProxy* +gsignond_plugin_proxy_new( + GSignondConfig *config, + const gchar* plugin_type); + +void +gsignond_plugin_proxy_cancel ( + GSignondPluginProxy *self, + GSignondAuthSession* session); +void +gsignond_plugin_proxy_process ( + GSignondPluginProxy *self, + GSignondAuthSession* session, + GSignondSessionData *session_data, + const gchar *mechanism, + gpointer userdata); +void +gsignond_plugin_proxy_user_action_finished ( + GSignondPluginProxy *self, + GSignondSignonuiData *ui_data); +void +gsignond_plugin_proxy_refresh ( + GSignondPluginProxy *self, + GSignondSignonuiData *ui_data); + +#endif /* __GSIGNOND_PLUGIN_PROXY_H__ */ diff --git a/src/daemon/plugins/gsignond-plugin-remote-private.h b/src/daemon/plugins/gsignond-plugin-remote-private.h new file mode 100644 index 0000000..759c13a --- /dev/null +++ b/src/daemon/plugins/gsignond-plugin-remote-private.h @@ -0,0 +1,64 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2013 Intel Corporation. + * + * Contact: Imran Zaman <imran.zaman@linux.intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#ifndef __GSIGNOND_PLUGIN_REMOTE_PRIVATE_H__ +#define __GSIGNOND_PLUGIN_REMOTE_PRIVATE_H__ + +#include <glib.h> +#include <daemon/dbus/gsignond-dbus-remote-plugin-gen.h> +#include "daemon/dbus/gsignond-dbus.h" + +G_BEGIN_DECLS + +struct _GSignondPluginRemotePrivate +{ + GDBusConnection *connection; + GSignondDbusRemotePlugin *dbus_plugin_proxy; + gchar *plugin_type; + gchar **plugin_mechanisms; + GPid cpid; + guint child_watch_id; + + GIOChannel *err_watch_ch; + guint err_watch_id; + + GMainLoop *main_loop; + gboolean is_plugind_up; + + gboolean unref_in_down_cb; + + /* Signals */ + gulong signal_response; + gulong signal_response_final; + gulong signal_store; + gulong signal_error; + gulong signal_user_action_required; + gulong signal_refreshed; + gulong signal_status_changed; +}; + +G_END_DECLS + +#endif /* __GSIGNOND_PLUGIN_REMOTE_PRIVATE_H__ */ diff --git a/src/daemon/plugins/gsignond-plugin-remote.c b/src/daemon/plugins/gsignond-plugin-remote.c new file mode 100644 index 0000000..6953057 --- /dev/null +++ b/src/daemon/plugins/gsignond-plugin-remote.c @@ -0,0 +1,759 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2013 Intel Corporation. + * + * Contact: Imran Zaman <imran.zaman@intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#include "gsignond/gsignond-log.h" +#include "gsignond/gsignond-error.h" +#include "gsignond/gsignond-plugin-interface.h" +#include "common/gsignond-pipe-stream.h" +#include "daemon/dbus/gsignond-dbus.h" +#include "gsignond-plugin-remote-private.h" +#include "gsignond-plugin-remote.h" + +enum +{ + PROP_0, + PROP_TYPE, + PROP_MECHANISMS, + N_PROPERTIES +}; + +static void +gsignond_plugin_remote_interface_init ( + GSignondPluginInterface *iface); + +G_DEFINE_TYPE_WITH_CODE (GSignondPluginRemote, gsignond_plugin_remote, + G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (GSIGNOND_TYPE_PLUGIN, + gsignond_plugin_remote_interface_init)); + +#define GSIGNOND_PLUGIN_REMOTE_GET_PRIV(obj) \ + G_TYPE_INSTANCE_GET_PRIVATE ((obj), GSIGNOND_TYPE_PLUGIN_REMOTE, \ + GSignondPluginRemotePrivate) + +#define GSIGNOND_PLUGIND_NAME "gsignond-plugind" + +static void +_on_child_down_cb ( + GPid pid, + gint status, + gpointer data) +{ + g_spawn_close_pid (pid); + + GSignondPluginRemote *plugin = GSIGNOND_PLUGIN_REMOTE (data); + + DBG ("Plugind(%p) with pid (%d) closed with status %d", plugin, pid, + status); + + if (!g_source_is_destroyed (g_main_current_source ())) { + if (plugin->priv->main_loop && g_main_loop_is_running ( + plugin->priv->main_loop)) { + g_main_loop_quit (plugin->priv->main_loop); + } + plugin->priv->is_plugind_up = FALSE; + } + + if (plugin->priv->unref_in_down_cb) { + plugin->priv->unref_in_down_cb = FALSE; + g_object_unref (plugin); + } +} + +static gboolean +_on_child_status_cb ( + GIOChannel *channel, + GIOCondition condition, + gpointer data) +{ + GSignondPluginRemote *plugin = GSIGNOND_PLUGIN_REMOTE (data); + DBG ("Plugind(%p) with pid (%d) status cb", plugin, plugin->priv->cpid); + + if (plugin->priv->main_loop && g_main_loop_is_running ( + plugin->priv->main_loop)) { + g_main_loop_quit (plugin->priv->main_loop); + } + + if (g_io_channel_get_flags (channel) & G_IO_FLAG_IS_READABLE) { + gchar string[1]; + GError *error = NULL; + gsize bytes_read = 0; + GIOStatus status = g_io_channel_read_chars (channel, string, 1, + &bytes_read, &error); + if (status == G_IO_STATUS_NORMAL && error == NULL) { + if (*string == '1') { + DBG ("Plugind is UP and READY"); + plugin->priv->is_plugind_up = TRUE; + } else if (*string == '0') { + DBG ("Plugind is DOWN"); + plugin->priv->is_plugind_up = FALSE; + } + } + if (error) { + g_error_free (error); + } + } + + return FALSE; +} + +static gboolean +_on_loop_timeout_cb (gpointer data) +{ + GSignondPluginRemote *self = GSIGNOND_PLUGIN_REMOTE (data); + + if (g_main_loop_is_running (self->priv->main_loop)) { + g_main_loop_quit (self->priv->main_loop); + } + + return FALSE; +} + +static guint +_create_main_loop_with_timeout ( + GSignondPluginRemote *self, + GMainContext *context, + guint timeout) +{ + guint timer_id = 0; + GSource *timer = g_timeout_source_new (timeout); + g_source_set_callback (timer, (GSourceFunc) _on_loop_timeout_cb, self, + NULL); + //g_source_attach increments the ref count of the source + timer_id = g_source_attach (timer, context); + g_source_unref (timer); + + self->priv->main_loop = g_main_loop_new (context, TRUE); + //loop has ref'd the context + if (context) { + g_main_context_unref (context); + } + return timer_id; +} + +static void +_run_main_loop ( + GSignondPluginRemote *self) +{ + if (self->priv->main_loop) { + g_main_loop_run (self->priv->main_loop); + /* attached context gets freed as well, which internally destroys all + * the attached sources */ + g_main_loop_unref (self->priv->main_loop); + self->priv->main_loop = NULL; + } +} + +static void +_run_main_loop_with_timeout ( + GSignondPluginRemote *self, + guint timeout) +{ + guint timer_id = _create_main_loop_with_timeout (self, NULL, timeout); + _run_main_loop (self); + g_source_remove (timer_id); +} + +static void +_run_main_loop_with_ready_watch ( + GSignondPluginRemote *self, + gint fd, + guint timeout) +{ + GIOChannel *ready_watch = NULL; + GSource *up_source = NULL; + + GMainContext *context = g_main_context_new (); + _create_main_loop_with_timeout (self, context, timeout); + + ready_watch = g_io_channel_unix_new (fd); + up_source = g_io_create_watch (ready_watch, G_IO_IN | G_IO_HUP); + g_source_set_callback (up_source, (GSourceFunc)_on_child_status_cb, self, + NULL); + g_source_attach (up_source, context); + g_source_unref (up_source); + + _run_main_loop (self); + + g_io_channel_unref (ready_watch); +} + +static void +gsignond_plugin_remote_set_property ( + GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + switch (property_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } +} + +static void +gsignond_plugin_remote_get_property ( + GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + GSignondPluginRemote *self = GSIGNOND_PLUGIN_REMOTE (object); + + switch (property_id) { + case PROP_TYPE: { + if (!self->priv->plugin_type) { + GError *error = NULL; + gsignond_dbus_remote_plugin_call_get_info_sync ( + self->priv->dbus_plugin_proxy, &self->priv->plugin_type, + &self->priv->plugin_mechanisms, NULL, &error); + if (error) { + DBG ("Plugin type retrieval error :: %s", error->message); + g_error_free (error); + if (self->priv->plugin_type) { + g_free (self->priv->plugin_type); + self->priv->plugin_type = NULL; + } + } + } + g_value_set_string (value, self->priv->plugin_type); + break; + } + case PROP_MECHANISMS: { + if (!self->priv->plugin_mechanisms) { + GError *error = NULL; + gsignond_dbus_remote_plugin_call_get_info_sync ( + self->priv->dbus_plugin_proxy, &self->priv->plugin_type, + &self->priv->plugin_mechanisms, NULL, &error); + if (error) { + DBG ("Plugin mechanisms retrieval error :: %s", + error->message); + g_error_free (error); + if (self->priv->plugin_mechanisms) { + g_strfreev (self->priv->plugin_mechanisms); + self->priv->plugin_mechanisms = NULL; + } + } + } + g_value_set_boxed (value, self->priv->plugin_mechanisms); + break; + } + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } + +} + +static void +gsignond_plugin_remote_dispose (GObject *object) +{ + GSignondPluginRemote *self = GSIGNOND_PLUGIN_REMOTE (object); + + self->priv->unref_in_down_cb = FALSE; + + if (self->priv->main_loop) { + if (g_main_loop_is_running (self->priv->main_loop)) { + g_main_loop_quit (self->priv->main_loop); + } + g_main_loop_unref (self->priv->main_loop); + self->priv->main_loop = NULL; + } + + if (self->priv->cpid > 0 && self->priv->is_plugind_up) { + DBG ("Send SIGTERM to Plugind"); + kill (self->priv->cpid, SIGTERM); + _run_main_loop_with_timeout (self, 1000); //1 sec + + if (kill (self->priv->cpid, 0) == 0) { + WARN ("Plugind have to be killed with SIGKILL"); + kill (self->priv->cpid, SIGKILL); + _run_main_loop_with_timeout (self, 1000); //1 sec + } + + if (self->priv->is_plugind_up) { + WARN ("Plugind did not exit even after SIGKILL"); + } else { + DBG ("Plugind DESTROYED"); + } + } + self->priv->cpid = 0; + + if (self->priv->child_watch_id > 0) { + g_source_remove (self->priv->child_watch_id); + self->priv->child_watch_id = 0; + } + + if (self->priv->connection) { + g_object_unref (self->priv->connection); + self->priv->connection = NULL; + } + + if (self->priv->dbus_plugin_proxy) { + g_signal_handler_disconnect (self->priv->dbus_plugin_proxy, + self->priv->signal_response); + g_signal_handler_disconnect (self->priv->dbus_plugin_proxy, + self->priv->signal_response_final); + g_signal_handler_disconnect (self->priv->dbus_plugin_proxy, + self->priv->signal_store); + g_signal_handler_disconnect (self->priv->dbus_plugin_proxy, + self->priv->signal_error); + g_signal_handler_disconnect (self->priv->dbus_plugin_proxy, + self->priv->signal_user_action_required); + g_signal_handler_disconnect (self->priv->dbus_plugin_proxy, + self->priv->signal_refreshed); + g_signal_handler_disconnect (self->priv->dbus_plugin_proxy, + self->priv->signal_status_changed); + g_object_unref (self->priv->dbus_plugin_proxy); + self->priv->dbus_plugin_proxy = NULL; + } + + if (self->priv->err_watch_ch) { + g_io_channel_shutdown (self->priv->err_watch_ch, FALSE, NULL); + g_io_channel_unref (self->priv->err_watch_ch); + self->priv->err_watch_ch = NULL; + if (self->priv->err_watch_id) { + g_source_remove (self->priv->err_watch_id); + } + } + + G_OBJECT_CLASS (gsignond_plugin_remote_parent_class)->dispose (object); +} + +static void +gsignond_plugin_remote_finalize (GObject *object) +{ + GSignondPluginRemote *self = GSIGNOND_PLUGIN_REMOTE (object); + + if (self->priv->plugin_type) { + g_free (self->priv->plugin_type); + self->priv->plugin_type = NULL; + } + + if (self->priv->plugin_mechanisms) { + g_strfreev (self->priv->plugin_mechanisms); + self->priv->plugin_mechanisms = NULL; + } + + G_OBJECT_CLASS (gsignond_plugin_remote_parent_class)->finalize (object); +} + +static void +gsignond_plugin_remote_class_init (GSignondPluginRemoteClass *klass) +{ + GObjectClass* object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, + sizeof (GSignondPluginRemotePrivate)); + + object_class->get_property = gsignond_plugin_remote_get_property; + object_class->set_property = gsignond_plugin_remote_set_property; + object_class->dispose = gsignond_plugin_remote_dispose; + object_class->finalize = gsignond_plugin_remote_finalize; + + g_object_class_override_property (object_class, PROP_TYPE, "type"); + g_object_class_override_property (object_class, PROP_MECHANISMS, + "mechanisms"); + +} + +static void +gsignond_plugin_remote_init (GSignondPluginRemote *self) +{ + self->priv = GSIGNOND_PLUGIN_REMOTE_GET_PRIV(self); + + self->priv->connection = NULL; + self->priv->dbus_plugin_proxy = NULL; + self->priv->plugin_type = NULL; + self->priv->plugin_mechanisms = NULL; + self->priv->cpid = 0; + + self->priv->err_watch_ch = NULL; + self->priv->child_watch_id = 0; + + self->priv->main_loop = NULL; + self->priv->is_plugind_up = FALSE; + self->priv->unref_in_down_cb = FALSE; +} + +static void +_cancel_async_cb ( + GObject *object, + GAsyncResult *res, + gpointer user_data) +{ + GError *error = NULL; + GSignondDbusRemotePlugin *proxy = GSIGNOND_DBUS_REMOTE_PLUGIN (object); + GSignondPluginRemote *self = GSIGNOND_PLUGIN_REMOTE (user_data); + + gsignond_dbus_remote_plugin_call_cancel_finish (proxy, res, &error); + if (error) { + gsignond_plugin_error (GSIGNOND_PLUGIN(self), error); + g_error_free (error); + } +} + +static void +gsignond_plugin_remote_cancel ( + GSignondPlugin *plugin) +{ + g_return_if_fail (plugin && GSIGNOND_IS_PLUGIN_REMOTE (plugin)); + GSignondPluginRemote *self = GSIGNOND_PLUGIN_REMOTE (plugin); + + gsignond_dbus_remote_plugin_call_cancel ( + self->priv->dbus_plugin_proxy, NULL, _cancel_async_cb, self); +} + +static void +_request_initial_async_cb ( + GObject *object, + GAsyncResult *res, + gpointer user_data) +{ + GError *error = NULL; + GSignondDbusRemotePlugin *proxy = GSIGNOND_DBUS_REMOTE_PLUGIN (object); + GSignondPluginRemote *self = GSIGNOND_PLUGIN_REMOTE (user_data); + gsignond_dbus_remote_plugin_call_request_initial_finish (proxy, + res, &error); + if (error) { + gsignond_plugin_error (GSIGNOND_PLUGIN(self), error); + g_error_free (error); + } +} + +static void +gsignond_plugin_remote_request_initial ( + GSignondPlugin *plugin, + GSignondSessionData *session_data, + const gchar *mechanism) +{ + g_return_if_fail (session_data && plugin && + GSIGNOND_IS_PLUGIN_REMOTE (plugin)); + GSignondPluginRemote *self = GSIGNOND_PLUGIN_REMOTE (plugin); + + GVariant *data = gsignond_dictionary_to_variant (session_data); + gsignond_dbus_remote_plugin_call_request_initial ( + self->priv->dbus_plugin_proxy, data, mechanism, NULL, + _request_initial_async_cb, self); +} + +static void +_request_async_cb ( + GObject *object, + GAsyncResult *res, + gpointer user_data) +{ + GError *error = NULL; + GSignondDbusRemotePlugin *proxy = GSIGNOND_DBUS_REMOTE_PLUGIN (object); + GSignondPluginRemote *self = GSIGNOND_PLUGIN_REMOTE (user_data); + + gsignond_dbus_remote_plugin_call_request_finish (proxy, res, &error); + if (error) { + gsignond_plugin_error (GSIGNOND_PLUGIN(self), error); + g_error_free (error); + } +} + +static void +gsignond_plugin_remote_request ( + GSignondPlugin *plugin, + GSignondSessionData *session_data) +{ + g_return_if_fail (session_data && plugin && + GSIGNOND_IS_PLUGIN_REMOTE (plugin)); + GSignondPluginRemote *self = GSIGNOND_PLUGIN_REMOTE (plugin); + + GVariant *data = gsignond_dictionary_to_variant (session_data); + gsignond_dbus_remote_plugin_call_request ( + self->priv->dbus_plugin_proxy, data, NULL, _request_async_cb, self); +} + +static void +_user_action_finished_async_cb ( + GObject *object, + GAsyncResult *res, + gpointer user_data) +{ + GError *error = NULL; + GSignondDbusRemotePlugin *proxy = GSIGNOND_DBUS_REMOTE_PLUGIN (object); + GSignondPluginRemote *self = GSIGNOND_PLUGIN_REMOTE (user_data); + + gsignond_dbus_remote_plugin_call_user_action_finished_finish (proxy, + res, &error); + if (error) { + gsignond_plugin_error (GSIGNOND_PLUGIN(self), error); + g_error_free (error); + } +} + +static void +gsignond_plugin_remote_user_action_finished ( + GSignondPlugin *plugin, + GSignondSignonuiData *signonui_data) +{ + g_return_if_fail (signonui_data && plugin && + GSIGNOND_IS_PLUGIN_REMOTE (plugin)); + GSignondPluginRemote *self = GSIGNOND_PLUGIN_REMOTE (plugin); + + GVariant *data = gsignond_signonui_data_to_variant (signonui_data); + gsignond_dbus_remote_plugin_call_user_action_finished ( + self->priv->dbus_plugin_proxy, data, NULL, + _user_action_finished_async_cb, self); +} + +static void +_refresh_async_cb ( + GObject *object, + GAsyncResult *res, + gpointer user_data) +{ + GError *error = NULL; + GSignondDbusRemotePlugin *proxy = GSIGNOND_DBUS_REMOTE_PLUGIN (object); + GSignondPluginRemote *self = GSIGNOND_PLUGIN_REMOTE (user_data); + + gsignond_dbus_remote_plugin_call_refresh_finish (proxy, res, &error); + if (error) { + gsignond_plugin_error (GSIGNOND_PLUGIN(self), error); + g_error_free (error); + } +} + +static void +gsignond_plugin_remote_refresh ( + GSignondPlugin *plugin, + GSignondSignonuiData *signonui_data) +{ + g_return_if_fail (signonui_data && plugin && + GSIGNOND_IS_PLUGIN_REMOTE (plugin)); + GSignondPluginRemote *self = GSIGNOND_PLUGIN_REMOTE (plugin); + + GVariant *data = gsignond_signonui_data_to_variant (signonui_data); + gsignond_dbus_remote_plugin_call_refresh ( + self->priv->dbus_plugin_proxy, data, NULL, _refresh_async_cb, self); +} + +static void +gsignond_plugin_remote_interface_init (GSignondPluginInterface *iface) +{ + iface->cancel = gsignond_plugin_remote_cancel; + iface->request_initial = gsignond_plugin_remote_request_initial; + iface->request = gsignond_plugin_remote_request; + iface->user_action_finished = gsignond_plugin_remote_user_action_finished; + iface->refresh = gsignond_plugin_remote_refresh; +} + +static void +_response_cb ( + GSignondPluginRemote *self, + GVariant *session_data, + gpointer user_data) +{ + g_return_if_fail (self && GSIGNOND_IS_PLUGIN_REMOTE (self)); + + GSignondSessionData *data = (GSignondSessionData *) + gsignond_dictionary_new_from_variant (session_data); + gsignond_plugin_response (GSIGNOND_PLUGIN(self), data); + gsignond_dictionary_unref (data); +} + +static void +_response_final_cb ( + GSignondPluginRemote *self, + GVariant *session_data, + gpointer user_data) +{ + g_return_if_fail (self && GSIGNOND_IS_PLUGIN_REMOTE (self)); + + GSignondSessionData *data = (GSignondSessionData *) + gsignond_dictionary_new_from_variant (session_data); + gsignond_plugin_response_final (GSIGNOND_PLUGIN(self), data); + gsignond_dictionary_unref (data); +} + +static void +_store_cb ( + GSignondPluginRemote *self, + GVariant *session_data, + gpointer user_data) +{ + g_return_if_fail (self && GSIGNOND_IS_PLUGIN_REMOTE (self)); + + GSignondSessionData *data = (GSignondSessionData *) + gsignond_dictionary_new_from_variant (session_data); + gsignond_plugin_store (GSIGNOND_PLUGIN(self), data); + gsignond_dictionary_unref (data); +} + +static void +_error_cb ( + GSignondPluginRemote *self, + GVariant *error, + gpointer user_data) +{ + g_return_if_fail (self && GSIGNOND_IS_PLUGIN_REMOTE (self)); + GError *gerror = gsignond_error_new_from_variant (error); + gsignond_plugin_error (GSIGNOND_PLUGIN(self), gerror); + g_error_free (gerror); +} + +static void +_user_action_required_cb ( + GSignondPluginRemote *self, + GVariant *ui_data, + gpointer user_data) +{ + g_return_if_fail (self && GSIGNOND_IS_PLUGIN_REMOTE (self)); + + GSignondSignonuiData *data = (GSignondSignonuiData *) + gsignond_signonui_data_new_from_variant (ui_data); + gsignond_plugin_user_action_required (GSIGNOND_PLUGIN(self), data); + gsignond_signonui_data_unref (data); +} + +static void +_refreshed_cb( + GSignondPluginRemote *self, + GVariant *ui_data, + gpointer user_data) +{ + g_return_if_fail (self && GSIGNOND_IS_PLUGIN_REMOTE (self)); + + GSignondSignonuiData *data = (GSignondSignonuiData *) + gsignond_signonui_data_new_from_variant (ui_data); + gsignond_plugin_refreshed (GSIGNOND_PLUGIN(self), data); + gsignond_signonui_data_unref (data); +} + +static void +_status_changed_cb ( + GSignondPluginRemote *self, + gint status, + gchar *message, + gpointer user_data) +{ + g_return_if_fail (self && GSIGNOND_IS_PLUGIN_REMOTE (self)); + + gsignond_plugin_status_changed (GSIGNOND_PLUGIN(self), + (GSignondPluginState)status, message); +} + +GSignondPluginRemote * +gsignond_plugin_remote_new ( + GSignondConfig *config, + const gchar *plugin_type) +{ + GError *error = NULL; + GPid cpid = 0; + gchar **argv; + gint cin_fd, cout_fd; + GSignondPluginRemote *plugin = NULL; + GSignondPipeStream *stream = NULL; + gboolean ret = FALSE; + + /* This guarantees that writes to a pipe will never cause + * a process terminanation via SIGPIPE, and instead a proper + * error will be returned */ + signal(SIGPIPE, SIG_IGN); + + /* Spawn child process */ + argv = g_malloc0 ((3 + 1) * sizeof (gchar *)); + argv[0] = g_build_filename (gsignond_config_get_string (config, + GSIGNOND_CONFIG_GENERAL_BIN_DIR), GSIGNOND_PLUGIND_NAME, NULL); + argv[1] = g_module_build_path (gsignond_config_get_string (config, + GSIGNOND_CONFIG_GENERAL_PLUGINS_DIR), plugin_type); + argv[2] = g_strdup(plugin_type); + ret = g_spawn_async_with_pipes (NULL, argv, NULL, + G_SPAWN_DO_NOT_REAP_CHILD, NULL, + NULL, &cpid, &cin_fd, &cout_fd, NULL, &error); + g_strfreev (argv); + if (ret == FALSE || (kill(cpid, 0) != 0)) { + DBG ("failed to start plugind: error %s(%d)", + error ? error->message : "(null)", ret); + if (error) g_error_free (error); + return NULL; + } + + /* Create dbus plugin object */ + plugin = GSIGNOND_PLUGIN_REMOTE (g_object_new (GSIGNOND_TYPE_PLUGIN_REMOTE, + NULL)); + + plugin->priv->child_watch_id = g_child_watch_add (cpid, + (GChildWatchFunc)_on_child_down_cb, plugin); + plugin->priv->cpid = cpid; + + _run_main_loop_with_ready_watch (plugin, cout_fd, 1000); + if (!plugin->priv->is_plugind_up) { + DBG ("Plugind (%s) with pid %d process failed to start up", plugin_type, + cpid); + /* moved unref'ng into the cb to avoid zombies */ + plugin->priv->unref_in_down_cb = TRUE; + return NULL; + } + + /* Create dbus connection */ + stream = gsignond_pipe_stream_new (cout_fd, cin_fd, TRUE); + plugin->priv->connection = g_dbus_connection_new_sync (G_IO_STREAM (stream), + NULL, G_DBUS_CONNECTION_FLAGS_NONE, NULL, NULL, NULL); + g_object_unref (stream); + + /* Create dbus proxy */ + plugin->priv->dbus_plugin_proxy = + gsignond_dbus_remote_plugin_proxy_new_sync ( + plugin->priv->connection, + G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, + NULL, + GSIGNOND_PLUGIN_OBJECTPATH, + NULL, + &error); + if (error) { + DBG ("Failed to register object: %s", error->message); + g_error_free (error); + g_object_unref (plugin); + return NULL; + } + DBG("'%s' object exported(%p)", GSIGNOND_PLUGIN_OBJECTPATH, plugin); + + plugin->priv->signal_response = g_signal_connect_swapped ( + plugin->priv->dbus_plugin_proxy, "response", + G_CALLBACK (_response_cb), plugin); + plugin->priv->signal_response_final = g_signal_connect_swapped ( + plugin->priv->dbus_plugin_proxy, "response-final", + G_CALLBACK(_response_final_cb), plugin); + plugin->priv->signal_store = g_signal_connect_swapped ( + plugin->priv->dbus_plugin_proxy, "store", + G_CALLBACK(_store_cb), plugin); + plugin->priv->signal_error = g_signal_connect_swapped ( + plugin->priv->dbus_plugin_proxy, "error", + G_CALLBACK(_error_cb), plugin); + plugin->priv->signal_user_action_required = g_signal_connect_swapped ( + plugin->priv->dbus_plugin_proxy, "user-action-required", + G_CALLBACK(_user_action_required_cb), plugin); + plugin->priv->signal_refreshed = g_signal_connect_swapped ( + plugin->priv->dbus_plugin_proxy, "refreshed", + G_CALLBACK(_refreshed_cb), plugin); + plugin->priv->signal_status_changed = g_signal_connect_swapped ( + plugin->priv->dbus_plugin_proxy, "status-changed", + G_CALLBACK(_status_changed_cb), plugin); + + return plugin; +} + diff --git a/src/daemon/plugins/gsignond-plugin-remote.h b/src/daemon/plugins/gsignond-plugin-remote.h new file mode 100644 index 0000000..59807d8 --- /dev/null +++ b/src/daemon/plugins/gsignond-plugin-remote.h @@ -0,0 +1,77 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2013 Intel Corporation. + * + * Contact: Imran Zaman <imran.zaman@intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#ifndef __GSIGNOND_PLUGIN_REMOTE_H_ +#define __GSIGNOND_PLUGIN_REMOTE_H_ + +#include <glib.h> +#include <daemon/dbus/gsignond-dbus-remote-plugin-gen.h> +#include <gsignond/gsignond-config.h> + +G_BEGIN_DECLS + +#define GSIGNOND_TYPE_PLUGIN_REMOTE \ + (gsignond_plugin_remote_get_type()) +#define GSIGNOND_PLUGIN_REMOTE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),\ + GSIGNOND_TYPE_PLUGIN_REMOTE, GSignondPluginRemote)) +#define GSIGNOND_PLUGIN_REMOTE_CLASS(klass)\ + (G_TYPE_CHECK_CLASS_CAST((klass), GSIGNOND_TYPE_PLUGIN_REMOTE, \ + GSignondPluginRemoteClass)) +#define GSIGNOND_IS_PLUGIN_REMOTE(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), GSIGNOND_TYPE_PLUGIN_REMOTE)) +#define GSIGNOND_IS_PLUGIN_REMOTE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), GSIGNOND_TYPE_PLUGIN_REMOTE)) +#define GSIGNOND_PLUGIN_REMOTE_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS((obj), GSIGNOND_TYPE_PLUGIN_REMOTE, \ + GSignondPluginRemoteClass)) + +typedef struct _GSignondPluginRemote GSignondPluginRemote; +typedef struct _GSignondPluginRemoteClass GSignondPluginRemoteClass; +typedef struct _GSignondPluginRemotePrivate GSignondPluginRemotePrivate; + +struct _GSignondPluginRemote +{ + GObject parent; + + /* priv */ + GSignondPluginRemotePrivate *priv; +}; + +struct _GSignondPluginRemoteClass +{ + GObjectClass parent_class; +}; + +GType +gsignond_plugin_remote_get_type (void) G_GNUC_CONST; + +GSignondPluginRemote * +gsignond_plugin_remote_new ( + GSignondConfig *config, + const gchar *plugin_type); + +G_END_DECLS + +#endif /* __GSIGNOND_PLUGIN_REMOTE_H_ */ diff --git a/src/daemon/plugins/plugind/Makefile.am b/src/daemon/plugins/plugind/Makefile.am new file mode 100644 index 0000000..c48eb15 --- /dev/null +++ b/src/daemon/plugins/plugind/Makefile.am @@ -0,0 +1,44 @@ +SUBDIRS= +NULL= + +lib_LTLIBRARIES = libgsignond-plugind-daemon.la + +libgsignond_plugind_daemon_la_CPPFLAGS = \ + -I$(top_builddir) \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/include \ + -I$(top_builddir)/src \ + $(GSIGNOND_CFLAGS) + +libgsignond_plugind_daemon_la_LIBADD = \ + $(top_builddir)/src/common/libgsignond-common.la \ + $(top_builddir)/src/daemon/dbus/libgsignond-dbus-glue.la \ + $(GSIGNOND_LIBS) + +libgsignond_plugind_daemon_la_SOURCES = \ + gsignond-plugin-daemon.h \ + gsignond-plugin-daemon.c + +bin_PROGRAMS = gsignond-plugind + +gsignond_plugind_SOURCES = \ + main.c \ + $(NULL) + +gsignond_plugind_CFLAGS = \ + -I$(top_builddir) \ + -I$(top_srcdir)/include/ \ + -I$(top_srcdir)/src/ \ + $(GSIGNOND_CFLAGS) \ + $(NULL) + +gsignond_plugind_LDADD = \ + libgsignond-plugind-daemon.la \ + $(GSIGNOND_LIBS) \ + $(NULL) + +all-local: slink + +slink: + $(MKDIR_P) $(abs_top_builddir)/src/daemon/.libs + ln -sf $(abs_top_builddir)/src/daemon/plugins/plugind/.libs/gsignond-plugind $(abs_top_builddir)/src/daemon/.libs/gsignond-plugind diff --git a/src/daemon/plugins/plugind/Makefile.in b/src/daemon/plugins/plugind/Makefile.in new file mode 100644 index 0000000..53bd9fe --- /dev/null +++ b/src/daemon/plugins/plugind/Makefile.in @@ -0,0 +1,855 @@ +# Makefile.in generated by automake 1.11.3 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ +pkglibdir = $(libdir)/@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@ +bin_PROGRAMS = gsignond-plugind$(EXEEXT) +subdir = src/daemon/plugins/plugind +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_gnu_make.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +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__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libgsignond_plugind_daemon_la_DEPENDENCIES = \ + $(top_builddir)/src/common/libgsignond-common.la \ + $(top_builddir)/src/daemon/dbus/libgsignond-dbus-glue.la \ + $(am__DEPENDENCIES_1) +am_libgsignond_plugind_daemon_la_OBJECTS = \ + libgsignond_plugind_daemon_la-gsignond-plugin-daemon.lo +libgsignond_plugind_daemon_la_OBJECTS = \ + $(am_libgsignond_plugind_daemon_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +PROGRAMS = $(bin_PROGRAMS) +am__objects_1 = +am_gsignond_plugind_OBJECTS = gsignond_plugind-main.$(OBJEXT) \ + $(am__objects_1) +gsignond_plugind_OBJECTS = $(am_gsignond_plugind_OBJECTS) +gsignond_plugind_DEPENDENCIES = libgsignond-plugind-daemon.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +gsignond_plugind_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(gsignond_plugind_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +DEFAULT_INCLUDES = +depcomp = $(SHELL) $(top_srcdir)/build-aux/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_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +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_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = $(libgsignond_plugind_daemon_la_SOURCES) \ + $(gsignond_plugind_SOURCES) +DIST_SOURCES = $(libgsignond_plugind_daemon_la_SOURCES) \ + $(gsignond_plugind_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHECK_CFLAGS = @CHECK_CFLAGS@ +CHECK_LIBS = @CHECK_LIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBUS_INTERFACES_DIR = @DBUS_INTERFACES_DIR@ +DBUS_SERVICES_DIR = @DBUS_SERVICES_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GREP = @GREP@ +GSIGNOND_CFLAGS = @GSIGNOND_CFLAGS@ +GSIGNOND_LIBS = @GSIGNOND_LIBS@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GTestDBus_CFLAGS = @GTestDBus_CFLAGS@ +GTestDBus_LIBS = @GTestDBus_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBECRYPTFS_CFLAGS = @LIBECRYPTFS_CFLAGS@ +LIBECRYPTFS_LIBS = @LIBECRYPTFS_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSMACK_CFLAGS = @LIBSMACK_CFLAGS@ +LIBSMACK_LIBS = @LIBSMACK_LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MESSAGE_BUS_TYPE = @MESSAGE_BUS_TYPE@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +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@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +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@ +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@ +ifGNUmake = @ifGNUmake@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +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@ +SUBDIRS = +NULL = +lib_LTLIBRARIES = libgsignond-plugind-daemon.la +libgsignond_plugind_daemon_la_CPPFLAGS = \ + -I$(top_builddir) \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/include \ + -I$(top_builddir)/src \ + $(GSIGNOND_CFLAGS) + +libgsignond_plugind_daemon_la_LIBADD = \ + $(top_builddir)/src/common/libgsignond-common.la \ + $(top_builddir)/src/daemon/dbus/libgsignond-dbus-glue.la \ + $(GSIGNOND_LIBS) + +libgsignond_plugind_daemon_la_SOURCES = \ + gsignond-plugin-daemon.h \ + gsignond-plugin-daemon.c + +gsignond_plugind_SOURCES = \ + main.c \ + $(NULL) + +gsignond_plugind_CFLAGS = \ + -I$(top_builddir) \ + -I$(top_srcdir)/include/ \ + -I$(top_srcdir)/src/ \ + $(GSIGNOND_CFLAGS) \ + $(NULL) + +gsignond_plugind_LDADD = \ + libgsignond-plugind-daemon.la \ + $(GSIGNOND_LIBS) \ + $(NULL) + +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(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 src/daemon/plugins/plugind/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/daemon/plugins/plugind/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: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || 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)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_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 +libgsignond-plugind-daemon.la: $(libgsignond_plugind_daemon_la_OBJECTS) $(libgsignond_plugind_daemon_la_DEPENDENCIES) $(EXTRA_libgsignond_plugind_daemon_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) -rpath $(libdir) $(libgsignond_plugind_daemon_la_OBJECTS) $(libgsignond_plugind_daemon_la_LIBADD) $(LIBS) +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +gsignond-plugind$(EXEEXT): $(gsignond_plugind_OBJECTS) $(gsignond_plugind_DEPENDENCIES) $(EXTRA_gsignond_plugind_DEPENDENCIES) + @rm -f gsignond-plugind$(EXEEXT) + $(AM_V_CCLD)$(gsignond_plugind_LINK) $(gsignond_plugind_OBJECTS) $(gsignond_plugind_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsignond_plugind-main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignond_plugind_daemon_la-gsignond-plugin-daemon.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +libgsignond_plugind_daemon_la-gsignond-plugin-daemon.lo: gsignond-plugin-daemon.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_plugind_daemon_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgsignond_plugind_daemon_la-gsignond-plugin-daemon.lo -MD -MP -MF $(DEPDIR)/libgsignond_plugind_daemon_la-gsignond-plugin-daemon.Tpo -c -o libgsignond_plugind_daemon_la-gsignond-plugin-daemon.lo `test -f 'gsignond-plugin-daemon.c' || echo '$(srcdir)/'`gsignond-plugin-daemon.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgsignond_plugind_daemon_la-gsignond-plugin-daemon.Tpo $(DEPDIR)/libgsignond_plugind_daemon_la-gsignond-plugin-daemon.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsignond-plugin-daemon.c' object='libgsignond_plugind_daemon_la-gsignond-plugin-daemon.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignond_plugind_daemon_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgsignond_plugind_daemon_la-gsignond-plugin-daemon.lo `test -f 'gsignond-plugin-daemon.c' || echo '$(srcdir)/'`gsignond-plugin-daemon.c + +gsignond_plugind-main.o: main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_plugind_CFLAGS) $(CFLAGS) -MT gsignond_plugind-main.o -MD -MP -MF $(DEPDIR)/gsignond_plugind-main.Tpo -c -o gsignond_plugind-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gsignond_plugind-main.Tpo $(DEPDIR)/gsignond_plugind-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='gsignond_plugind-main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_plugind_CFLAGS) $(CFLAGS) -c -o gsignond_plugind-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c + +gsignond_plugind-main.obj: main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_plugind_CFLAGS) $(CFLAGS) -MT gsignond_plugind-main.obj -MD -MP -MF $(DEPDIR)/gsignond_plugind-main.Tpo -c -o gsignond_plugind-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gsignond_plugind-main.Tpo $(DEPDIR)/gsignond_plugind-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='gsignond_plugind-main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gsignond_plugind_CFLAGS) $(CFLAGS) -c -o gsignond_plugind-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +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: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + 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: ctags-recursive $(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 + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) all-local +install-binPROGRAMS: install-libLTLIBRARIES + +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +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-recursive + +clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: install-binPROGRAMS install-libLTLIBRARIES + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am all-local check check-am clean clean-binPROGRAMS \ + clean-generic clean-libLTLIBRARIES clean-libtool ctags \ + ctags-recursive distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + 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-libLTLIBRARIES \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-libLTLIBRARIES + + +all-local: slink + +slink: + $(MKDIR_P) $(abs_top_builddir)/src/daemon/.libs + ln -sf $(abs_top_builddir)/src/daemon/plugins/plugind/.libs/gsignond-plugind $(abs_top_builddir)/src/daemon/.libs/gsignond-plugind + +# 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/src/daemon/plugins/plugind/gsignond-plugin-daemon.c b/src/daemon/plugins/plugind/gsignond-plugin-daemon.c new file mode 100644 index 0000000..641eeca --- /dev/null +++ b/src/daemon/plugins/plugind/gsignond-plugin-daemon.c @@ -0,0 +1,446 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2013 Intel Corporation. + * + * Contact: Imran Zaman <imran.zaman@intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#include "gsignond/gsignond-plugin-interface.h" +#include "gsignond/gsignond-log.h" +#include "gsignond/gsignond-error.h" +#include "common/gsignond-plugin-loader.h" +#include "common/gsignond-pipe-stream.h" +#include "daemon/dbus/gsignond-dbus-remote-plugin-gen.h" +#include "daemon/dbus/gsignond-dbus.h" +#include "gsignond-plugin-daemon.h" + +struct _GSignondPluginDaemonPrivate +{ + GDBusConnection *connection; + GSignondDbusRemotePlugin *dbus_remote_plugin; + GSignondPlugin *plugin; + gchar *plugin_type; +}; + +G_DEFINE_TYPE (GSignondPluginDaemon, gsignond_plugin_daemon, G_TYPE_OBJECT) + + +#define GSIGNOND_PLUGIN_DAEMON_GET_PRIV(obj) \ + G_TYPE_INSTANCE_GET_PRIVATE ((obj), GSIGNOND_TYPE_PLUGIN_DAEMON,\ + GSignondPluginDaemonPrivate) + +static void +_dispose (GObject *object) +{ + GSignondPluginDaemon *self = GSIGNOND_PLUGIN_DAEMON (object); + + if (self->priv->dbus_remote_plugin) { + g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON ( + self->priv->dbus_remote_plugin)); + g_object_unref (self->priv->dbus_remote_plugin); + self->priv->dbus_remote_plugin = NULL; + } + + if (self->priv->connection) { + g_object_unref (self->priv->connection); + self->priv->connection = NULL; + } + + if (self->priv->plugin) { + g_object_unref (self->priv->plugin); + self->priv->plugin = NULL; + } + + G_OBJECT_CLASS (gsignond_plugin_daemon_parent_class)->dispose (object); +} + +static void +_finalize (GObject *object) +{ + GSignondPluginDaemon *self = GSIGNOND_PLUGIN_DAEMON (object); + + if (self->priv->plugin_type) { + g_free (self->priv->plugin_type); + self->priv->plugin_type = NULL; + } + + G_OBJECT_CLASS (gsignond_plugin_daemon_parent_class)->finalize (object); +} + +static void +gsignond_plugin_daemon_class_init ( + GSignondPluginDaemonClass *klass) +{ + GObjectClass* object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof ( + GSignondPluginDaemonPrivate)); + + object_class->dispose = _dispose; + object_class->finalize = _finalize; + +} + +static void +gsignond_plugin_daemon_init ( + GSignondPluginDaemon *self) +{ + self->priv = GSIGNOND_PLUGIN_DAEMON_GET_PRIV(self); + self->priv->connection = NULL; + self->priv->dbus_remote_plugin = NULL; + self->priv->plugin_type = NULL; + self->priv->plugin = NULL; +} + +static void +_on_connection_closed ( + GDBusConnection *connection, + gboolean remote_peer_vanished, + GError *error, + gpointer user_data) +{ + GSignondPluginDaemon *daemon = GSIGNOND_PLUGIN_DAEMON (user_data); + + g_signal_handlers_disconnect_by_func (connection, _on_connection_closed, + user_data); + DBG("dbus connection(%p) closed (peer vanished : %d)", connection, + remote_peer_vanished); + if (error) { + DBG("...reason : %s", error->message); + } + g_object_unref (daemon); +} + +static gboolean +_handle_cancel_from_dbus ( + GSignondPluginDaemon *self, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + DBG (""); + g_return_val_if_fail (self && GSIGNOND_IS_PLUGIN_DAEMON (self), FALSE); + gsignond_dbus_remote_plugin_complete_cancel (self->priv->dbus_remote_plugin, + invocation); + + gsignond_plugin_cancel (self->priv->plugin); + return TRUE; +} + +static gboolean +_handle_request_from_dbus ( + GSignondPluginDaemon *self, + GDBusMethodInvocation *invocation, + const GVariant *session_data, + gpointer user_data) +{ + DBG (""); + g_return_val_if_fail (self && GSIGNOND_IS_PLUGIN_DAEMON (self), FALSE); + + gsignond_dbus_remote_plugin_complete_request ( + self->priv->dbus_remote_plugin, invocation); + + GSignondSessionData *data = (GSignondSessionData *) + gsignond_dictionary_new_from_variant ((GVariant *)session_data); + gsignond_plugin_request (self->priv->plugin, data); + gsignond_dictionary_unref (data); + return TRUE; +} + +static void +_handle_response_final_from_plugin ( + GSignondPluginDaemon *self, + GSignondSessionData *session_data, + gpointer user_data); + +static gboolean +_handle_request_initial_from_dbus ( + GSignondPluginDaemon *self, + GDBusMethodInvocation *invocation, + const GVariant *session_data, + const gchar *mechanism, + gpointer user_data) +{ + DBG (""); + g_return_val_if_fail (self && GSIGNOND_IS_PLUGIN_DAEMON (self), FALSE); + + gsignond_dbus_remote_plugin_complete_request_initial ( + self->priv->dbus_remote_plugin, invocation); + + GSignondSessionData *data = (GSignondSessionData *) + gsignond_dictionary_new_from_variant ((GVariant *)session_data); + gsignond_plugin_request_initial (self->priv->plugin, data, mechanism); + gsignond_dictionary_unref (data); + + return TRUE; +} + +static gboolean +_handle_user_action_finished_from_dbus ( + GSignondPluginDaemon *self, + GDBusMethodInvocation *invocation, + const GVariant *ui_data, + gpointer user_data) +{ + DBG (""); + g_return_val_if_fail (self && GSIGNOND_IS_PLUGIN_DAEMON (self), FALSE); + + gsignond_dbus_remote_plugin_complete_user_action_finished ( + self->priv->dbus_remote_plugin, invocation); + + GSignondSignonuiData *data = (GSignondSignonuiData *) + gsignond_signonui_data_new_from_variant ((GVariant *)ui_data); + gsignond_plugin_user_action_finished (self->priv->plugin, data); + gsignond_signonui_data_unref (data); + return TRUE; +} + +static gboolean +_handle_refresh_from_dbus ( + GSignondPluginDaemon *self, + GDBusMethodInvocation *invocation, + const GVariant *ui_data, + gpointer user_data) +{ + DBG (""); + g_return_val_if_fail (self && GSIGNOND_IS_PLUGIN_DAEMON (self), FALSE); + + gsignond_dbus_remote_plugin_complete_refresh ( + self->priv->dbus_remote_plugin, invocation); + + GSignondSignonuiData *data = (GSignondSignonuiData *) + gsignond_signonui_data_new_from_variant ((GVariant *)ui_data); + gsignond_plugin_refresh (self->priv->plugin, data); + gsignond_signonui_data_unref (data); + return TRUE; +} + +static gboolean +_handle_get_info_from_dbus ( + GSignondPluginDaemon *self, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + DBG (""); + g_return_val_if_fail (self && GSIGNOND_IS_PLUGIN_DAEMON (self), FALSE); + gchar *type = NULL; + gchar **mechanisms = NULL; + + g_object_get (self->priv->plugin, "type", &type, "mechanisms", &mechanisms, + NULL); + gsignond_dbus_remote_plugin_complete_get_info ( + self->priv->dbus_remote_plugin, invocation, (const gchar*)type, + (const gchar *const *)mechanisms); + g_free (type); + g_strfreev (mechanisms); + return TRUE; +} + +static void +_handle_response_from_plugin ( + GSignondPluginDaemon *self, + GSignondSessionData *session_data, + gpointer user_data) +{ + DBG (""); + g_return_if_fail (self && GSIGNOND_IS_PLUGIN_DAEMON (self)); + + GVariant *data = gsignond_dictionary_to_variant ( + (GSignondDictionary *)session_data); + gsignond_dbus_remote_plugin_emit_response (self->priv->dbus_remote_plugin, + data); +} + +static void +_handle_response_final_from_plugin ( + GSignondPluginDaemon *self, + GSignondSessionData *session_data, + gpointer user_data) +{ + DBG (""); + g_return_if_fail (self && GSIGNOND_IS_PLUGIN_DAEMON (self)); + + GVariant *data = gsignond_dictionary_to_variant ( + (GSignondDictionary *)session_data); + gsignond_dbus_remote_plugin_emit_response_final ( + self->priv->dbus_remote_plugin, data); +} + +static void +_handle_store_from_plugin ( + GSignondPluginDaemon *self, + GSignondSessionData *session_data, + gpointer user_data) +{ + DBG (""); + g_return_if_fail (self && GSIGNOND_IS_PLUGIN_DAEMON (self)); + + GVariant *data = gsignond_dictionary_to_variant ( + (GSignondDictionary *)session_data); + gsignond_dbus_remote_plugin_emit_store (self->priv->dbus_remote_plugin, + data); +} + +static void +_handle_error_from_plugin ( + GSignondPluginDaemon *self, + GError *gerror, + gpointer user_data) +{ + DBG (""); + g_return_if_fail (self && GSIGNOND_IS_PLUGIN_DAEMON (self)); + + GVariant *error = gsignond_error_to_variant (gerror); + gsignond_dbus_remote_plugin_emit_error (self->priv->dbus_remote_plugin, + error); +} + +static void +_handle_user_action_required_from_plugin ( + GSignondPluginDaemon *self, + GSignondSignonuiData *ui_data, + gpointer user_data) +{ + DBG (""); + g_return_if_fail (self && GSIGNOND_IS_PLUGIN_DAEMON (self)); + + GVariant *data = gsignond_signonui_data_to_variant (ui_data); + gsignond_dbus_remote_plugin_emit_user_action_required ( + self->priv->dbus_remote_plugin, data); +} + +static void +_handle_refreshed_from_plugin( + GSignondPluginDaemon *self, + GSignondSignonuiData *ui_data, + gpointer user_data) +{ + DBG (""); + g_return_if_fail (self && GSIGNOND_IS_PLUGIN_DAEMON (self)); + + GVariant *data = gsignond_signonui_data_to_variant (ui_data); + gsignond_dbus_remote_plugin_emit_refreshed (self->priv->dbus_remote_plugin, + data); +} + +static void +_handle_status_changed_from_plugin ( + GSignondPluginDaemon *self, + GSignondPluginState status, + gchar *message, + gpointer user_data) +{ + DBG (""); + g_return_if_fail (self && GSIGNOND_IS_PLUGIN_DAEMON (self)); + + gsignond_dbus_remote_plugin_emit_status_changed ( + self->priv->dbus_remote_plugin, (gint)status, + (const gchar *)message); +} + +GSignondPluginDaemon * +gsignond_plugin_daemon_new ( + const gchar* filename, + const gchar* plugin_type, + gint in_fd, + gint out_fd) +{ + GError *error = NULL; + GSignondPipeStream *stream = NULL; + + g_return_val_if_fail (filename != NULL && plugin_type != NULL, NULL); + + GSignondPluginDaemon *daemon = GSIGNOND_PLUGIN_DAEMON (g_object_new ( + GSIGNOND_TYPE_PLUGIN_DAEMON, NULL)); + + /* Load plugin */ + daemon->priv->plugin = gsignond_load_plugin_with_filename ( + (gchar *)plugin_type, (gchar *)filename); + if (!daemon->priv->plugin) { + DBG ("failed to load plugin"); + g_object_unref (daemon); + return NULL; + } + + daemon->priv->plugin_type = g_strdup (plugin_type); + + /* Create dbus connection */ + stream = gsignond_pipe_stream_new (in_fd, out_fd, TRUE); + daemon->priv->connection = g_dbus_connection_new_sync (G_IO_STREAM (stream), + NULL, G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, NULL, NULL, + NULL); + g_object_unref (stream); + + /* Create dbus object */ + daemon->priv->dbus_remote_plugin = + gsignond_dbus_remote_plugin_skeleton_new (); + + g_dbus_interface_skeleton_export ( + G_DBUS_INTERFACE_SKELETON(daemon->priv->dbus_remote_plugin), + daemon->priv->connection, GSIGNOND_PLUGIN_OBJECTPATH, &error); + if (error) { + DBG ("failed to register object: %s", error->message); + g_error_free (error); + g_object_unref (daemon); + return NULL; + } + DBG("Started plugin daemon '%p' at path '%s' on conneciton '%p'", + daemon, GSIGNOND_PLUGIN_OBJECTPATH, daemon->priv->connection); + + /* Connect dbus remote plugin signals to handlers */ + g_signal_connect_swapped (daemon->priv->dbus_remote_plugin, + "handle-cancel", G_CALLBACK (_handle_cancel_from_dbus), daemon); + g_signal_connect_swapped (daemon->priv->dbus_remote_plugin, + "handle-request", G_CALLBACK(_handle_request_from_dbus), daemon); + g_signal_connect_swapped (daemon->priv->dbus_remote_plugin, + "handle-request-initial", + G_CALLBACK(_handle_request_initial_from_dbus), daemon); + g_signal_connect_swapped (daemon->priv->dbus_remote_plugin, + "handle-user-action-finished", + G_CALLBACK(_handle_user_action_finished_from_dbus), daemon); + g_signal_connect_swapped (daemon->priv->dbus_remote_plugin, + "handle-refresh", G_CALLBACK(_handle_refresh_from_dbus), daemon); + g_signal_connect_swapped (daemon->priv->dbus_remote_plugin, + "handle-get-info", G_CALLBACK(_handle_get_info_from_dbus), daemon); + + /* Connect plugin signals to handlers */ + g_signal_connect_swapped (daemon->priv->plugin, "response", + G_CALLBACK (_handle_response_from_plugin), daemon); + g_signal_connect_swapped (daemon->priv->plugin, "response-final", + G_CALLBACK(_handle_response_final_from_plugin), daemon); + g_signal_connect_swapped (daemon->priv->plugin, "store", + G_CALLBACK(_handle_store_from_plugin), daemon); + g_signal_connect_swapped (daemon->priv->plugin, "error", + G_CALLBACK(_handle_error_from_plugin), daemon); + g_signal_connect_swapped (daemon->priv->plugin, "user-action-required", + G_CALLBACK(_handle_user_action_required_from_plugin), daemon); + g_signal_connect_swapped (daemon->priv->plugin, "refreshed", + G_CALLBACK(_handle_refreshed_from_plugin), daemon); + g_signal_connect_swapped (daemon->priv->plugin, "status-changed", + G_CALLBACK(_handle_status_changed_from_plugin), daemon); + + g_signal_connect (daemon->priv->connection, "closed", + G_CALLBACK(_on_connection_closed), daemon); + + g_dbus_connection_start_message_processing (daemon->priv->connection); + + return daemon; +} + diff --git a/src/daemon/plugins/plugind/gsignond-plugin-daemon.h b/src/daemon/plugins/plugind/gsignond-plugin-daemon.h new file mode 100644 index 0000000..9eb2275 --- /dev/null +++ b/src/daemon/plugins/plugind/gsignond-plugin-daemon.h @@ -0,0 +1,72 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2013 Intel Corporation. + * + * Contact: Imran Zaman <imran.zaman@intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#ifndef __GSIGNOND_PLUGIN_DAEMON_H_ +#define __GSIGNOND_PLUGIN_DAEMON_H_ + +#include <glib.h> +#include <glib-object.h> + +G_BEGIN_DECLS + +#define GSIGNOND_TYPE_PLUGIN_DAEMON (gsignond_plugin_daemon_get_type()) +#define GSIGNOND_PLUGIN_DAEMON(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \ + GSIGNOND_TYPE_PLUGIN_DAEMON, GSignondPluginDaemon)) +#define GSIGNOND_PLUGIN_DAEMON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \ + GSIGNOND_TYPE_PLUGIN_DAEMON, GSignondPluginDaemonClass)) +#define GSIGNOND_IS_PLUGIN_DAEMON(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ + GSIGNOND_TYPE_PLUGIN_DAEMON)) +#define GSIGNOND_IS_PLUGIN_DAEMON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),\ + GSIGNOND_TYPE_PLUGIN_DAEMON)) +#define GSIGNOND_PLUGIN_DAEMON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),\ + GSIGNOND_TYPE_PLUGIN_DAEMON, GSignondPluginDaemonClass)) + +typedef struct _GSignondPluginDaemon GSignondPluginDaemon; +typedef struct _GSignondPluginDaemonClass GSignondPluginDaemonClass; +typedef struct _GSignondPluginDaemonPrivate GSignondPluginDaemonPrivate; + +struct _GSignondPluginDaemon +{ + GObject parent; + + /* priv */ + GSignondPluginDaemonPrivate *priv; +}; + +struct _GSignondPluginDaemonClass +{ + GObjectClass parent_class; +}; + +GType gsignond_plugin_daemon_get_type(); + +GSignondPluginDaemon * +gsignond_plugin_daemon_new ( + const gchar* filename, + const gchar* plugin_type, + gint in_fd, + gint out_fd); + +#endif /* __GSIGNOND_PLUGIN_DAEMON_H_ */ diff --git a/src/daemon/plugins/plugind/main.c b/src/daemon/plugins/plugind/main.c new file mode 100644 index 0000000..2c0bfd7 --- /dev/null +++ b/src/daemon/plugins/plugind/main.c @@ -0,0 +1,191 @@ +/* vi: set et sw=4 ts=4 cino=t0,(0: */ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of gsignond + * + * Copyright (C) 2013 Intel Corporation. + * + * Contact: Imran Zaman <imran.zaman@intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#include <config.h> +#include <errno.h> +#include <signal.h> +#include <string.h> +#include <stdio.h> +#include <glib-unix.h> +#include <glib.h> +#include <gio/gio.h> +#include <sys/prctl.h> + +#include "gsignond/gsignond-log.h" +#include "daemon/dbus/gsignond-dbus.h" +#include "gsignond-plugin-daemon.h" + +static GSignondPluginDaemon *_daemon = NULL; +static guint _sig_source_id[3]; + +static void +_on_daemon_closed (gpointer data, GObject *server) +{ + _daemon = NULL; + DBG ("Daemon closed"); + if (data) g_main_loop_quit ((GMainLoop *)data); +} + +static gboolean +_handle_quit_signal (gpointer user_data) +{ + GMainLoop *ml = (GMainLoop *) user_data; + + g_return_val_if_fail (ml != NULL, FALSE); + DBG ("Received quit signal"); + if (ml) g_main_loop_quit (ml); + + return FALSE; +} + +static void +_install_sighandlers (GMainLoop *main_loop) +{ + GSource *source = NULL; + GMainContext *ctx = g_main_loop_get_context (main_loop); + + source = g_unix_signal_source_new (SIGTERM); + g_source_set_callback (source, + _handle_quit_signal, + main_loop, + NULL); + _sig_source_id[0] = g_source_attach (source, ctx); + + source = g_unix_signal_source_new (SIGINT); + g_source_set_callback (source, + _handle_quit_signal, + main_loop, + NULL); + _sig_source_id[1] = g_source_attach (source, ctx); + + source = g_unix_signal_source_new (SIGHUP); + g_source_set_callback (source, + _handle_quit_signal, + main_loop, + NULL); + _sig_source_id[2] = g_source_attach (source, ctx); + + if (prctl(PR_SET_PDEATHSIG, SIGHUP)) + WARN ("failed to set parent death signal"); +} + +int main (int argc, char **argv) +{ + GError *error = NULL; + GMainLoop *main_loop = NULL; + GOptionContext *opt_context = NULL; + gchar **plugin_args = NULL; + gint up_signal = -1; + gint in_fd = 0, out_fd = 1; + GOptionEntry opt_entries[] = { + {G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &plugin_args, + "Plugin Args", NULL}, + {NULL} + }; + + /* Duplicates stdin,stdout,stderr descriptors and point the descriptors + * to /dev/null to avoid anyone writing to descriptors before initial + * "plugind-is-ready" notification is sent to gsignond + * */ + in_fd = dup(0); + if (in_fd == -1) { + WARN ("Failed to dup stdin : %s(%d)", strerror(errno), errno); + in_fd = 0; + } + if (!freopen("/dev/null", "r+", stdin)) { + WARN ("Unable to redirect stdin to /dev/null"); + } + + out_fd = dup(1); + if (out_fd == -1) { + WARN ("Failed to dup stdout : %s(%d)", strerror(errno), errno); + out_fd = 1; + } + + /* Reattach stderr to stdout */ + dup2 (2, 1); + +#if !GLIB_CHECK_VERSION (2, 36, 0) + g_type_init (); +#endif + + opt_context = g_option_context_new ("<plugin_path> <plugin_name>"); + g_option_context_set_summary (opt_context, "gSSO helper plugin daemon"); + g_option_context_add_main_entries (opt_context, opt_entries, NULL); + g_option_context_set_ignore_unknown_options (opt_context, TRUE); + g_option_context_parse (opt_context, &argc, &argv, &error); + g_option_context_free (opt_context); + if (error) { + WARN ("Error in arguments parsing: %s", error->message); + g_error_free (error); + } + if (!plugin_args || !plugin_args[0] || !plugin_args[1]) { + WARN ("plugin path or plugin type missing"); + if (write (out_fd, "0", sizeof(char)) == -1) + WARN ("Unable to write down notification to stdout"); + if (in_fd != 0) close (in_fd); + if (out_fd != 1) close (out_fd); + if (plugin_args) g_strfreev(plugin_args); + return -1; + } + + _daemon = gsignond_plugin_daemon_new (plugin_args[0], plugin_args[1], in_fd, + out_fd); + g_strfreev(plugin_args); + if (_daemon == NULL) { + if (write (out_fd, "0", sizeof(char)) == -1) + WARN ("Unable to write down notification to stdout"); + if (in_fd != 0) close (in_fd); + if (out_fd != 1) close (out_fd); + return -1; + } + + main_loop = g_main_loop_new (NULL, FALSE); + g_object_weak_ref (G_OBJECT (_daemon), _on_daemon_closed, main_loop); + _install_sighandlers (main_loop); + + /* Notification for gsignond that plugind is up and ready */ + up_signal = write (out_fd, "1", sizeof(char)); + + if (up_signal == -1) { + g_main_loop_unref (main_loop); + g_object_unref (_daemon); + return -1; + } + + DBG ("Entering main event loop"); + + g_main_loop_run (main_loop); + + if(_daemon) { + g_object_unref (_daemon); + } + + if (main_loop) { + g_main_loop_unref (main_loop); + } + + return 0; +} |