diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2022-10-28 01:50:52 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2022-10-28 01:50:52 +0200 |
commit | a5d7db3b2c6171ea9e76b84155d2dfb66c243e5a (patch) | |
tree | a5f9e2fe200a352b74d2b530799804046978a9a6 /debian/pinentry-tqt/pinentry-tqt-1.2.1/gnome3 | |
parent | c73404a3ea7fc92ba572dd31849727ba7f46b93f (diff) | |
download | extra-dependencies-a5d7db3b2c6171ea9e76b84155d2dfb66c243e5a.tar.gz extra-dependencies-a5d7db3b2c6171ea9e76b84155d2dfb66c243e5a.zip |
pinentry-tqt: updated based on upstream version 1.2.1.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'debian/pinentry-tqt/pinentry-tqt-1.2.1/gnome3')
3 files changed, 1275 insertions, 0 deletions
diff --git a/debian/pinentry-tqt/pinentry-tqt-1.2.1/gnome3/Makefile.am b/debian/pinentry-tqt/pinentry-tqt-1.2.1/gnome3/Makefile.am new file mode 100644 index 00000000..96ae5a61 --- /dev/null +++ b/debian/pinentry-tqt/pinentry-tqt-1.2.1/gnome3/Makefile.am @@ -0,0 +1,37 @@ +# Makefile.am - PIN entry GTK+ frontend. +# Copyright (C) 2002, 2015 g10 Code GmbH +# +# This file is part of PINENTRY. +# +# PINENTRY is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# PINENTRY is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <https://www.gnu.org/licenses/>. +# SPDX-License-Identifier: GPL-2.0+ + +## Process this file with automake to produce Makefile.in + +bin_PROGRAMS = pinentry-gnome3 + +if FALLBACK_CURSES +ncurses_include = $(NCURSES_INCLUDE) +libcurses = ../pinentry/libpinentry-curses.a $(LIBCURSES) $(LIBICONV) +else +ncurses_include = +libcurses = +endif + +AM_CPPFLAGS = $(COMMON_CFLAGS) $(GNOME3_CFLAGS) \ + $(ncurses_include) -I$(top_srcdir)/secmem -I$(top_srcdir)/pinentry +LDADD = ../pinentry/libpinentry.a ../secmem/libsecmem.a \ + $(COMMON_LIBS) $(GNOME3_LIBS) $(libcurses) + +pinentry_gnome3_SOURCES = pinentry-gnome3.c diff --git a/debian/pinentry-tqt/pinentry-tqt-1.2.1/gnome3/Makefile.in b/debian/pinentry-tqt/pinentry-tqt-1.2.1/gnome3/Makefile.in new file mode 100644 index 00000000..9d4c480e --- /dev/null +++ b/debian/pinentry-tqt/pinentry-tqt-1.2.1/gnome3/Makefile.in @@ -0,0 +1,689 @@ +# Makefile.in generated by automake 1.16.3 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2020 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@ + +# Makefile.am - PIN entry GTK+ frontend. +# Copyright (C) 2002, 2015 g10 Code GmbH +# +# This file is part of PINENTRY. +# +# PINENTRY is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# PINENTRY is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <https://www.gnu.org/licenses/>. +# SPDX-License-Identifier: GPL-2.0+ + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +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 = pinentry-gnome3$(EXEEXT) +subdir = gnome3 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \ + $(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/libassuan.m4 $(top_srcdir)/m4/pkg.m4 \ + $(top_srcdir)/m4/qt.m4 $(top_srcdir)/m4/qt4.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am_pinentry_gnome3_OBJECTS = pinentry-gnome3.$(OBJEXT) +pinentry_gnome3_OBJECTS = $(am_pinentry_gnome3_OBJECTS) +pinentry_gnome3_LDADD = $(LDADD) +am__DEPENDENCIES_1 = +@FALLBACK_CURSES_TRUE@am__DEPENDENCIES_2 = \ +@FALLBACK_CURSES_TRUE@ ../pinentry/libpinentry-curses.a \ +@FALLBACK_CURSES_TRUE@ $(am__DEPENDENCIES_1) \ +@FALLBACK_CURSES_TRUE@ $(am__DEPENDENCIES_1) +pinentry_gnome3_DEPENDENCIES = ../pinentry/libpinentry.a \ + ../secmem/libsecmem.a $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/pinentry-gnome3.Po +am__mv = mv -f +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_CC_1 = +CCLD = $(CC) +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_CCLD_1 = +SOURCES = $(pinentry_gnome3_SOURCES) +DIST_SOURCES = $(pinentry_gnome3_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/build-aux/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +COMMON_CFLAGS = @COMMON_CFLAGS@ +COMMON_LIBS = @COMMON_LIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EFL_CFLAGS = @EFL_CFLAGS@ +EFL_LIBS = @EFL_LIBS@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FLTKCFLAGS = @FLTKCFLAGS@ +FLTKCXXFLAGS = @FLTKCXXFLAGS@ +FLTKLIBS = @FLTKLIBS@ +FLTK_CONFIG = @FLTK_CONFIG@ +GITLOG_TO_CHANGELOG = @GITLOG_TO_CHANGELOG@ +GNOME3_CFLAGS = @GNOME3_CFLAGS@ +GNOME3_LIBS = @GNOME3_LIBS@ +GPGRT_CONFIG = @GPGRT_CONFIG@ +GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ +GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ +GPG_ERROR_LIBS = @GPG_ERROR_LIBS@ +GPG_ERROR_MT_CFLAGS = @GPG_ERROR_MT_CFLAGS@ +GPG_ERROR_MT_LIBS = @GPG_ERROR_MT_LIBS@ +GREP = @GREP@ +GTK2_CFLAGS = @GTK2_CFLAGS@ +GTK2_LIBS = @GTK2_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +KF5WAYLANDCLIENT_CFLAGS = @KF5WAYLANDCLIENT_CFLAGS@ +KF5WAYLANDCLIENT_LIBS = @KF5WAYLANDCLIENT_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBASSUAN_CFLAGS = @LIBASSUAN_CFLAGS@ +LIBASSUAN_CONFIG = @LIBASSUAN_CONFIG@ +LIBASSUAN_LIBS = @LIBASSUAN_LIBS@ +LIBCURSES = @LIBCURSES@ +LIBICONV = @LIBICONV@ +LIBNCURSES = @LIBNCURSES@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSECRET_CFLAGS = @LIBSECRET_CFLAGS@ +LIBSECRET_LIBS = @LIBSECRET_LIBS@ +LIBTERMCAP = @LIBTERMCAP@ +LIBX11_CFLAGS = @LIBX11_CFLAGS@ +LIBX11_LIBS = @LIBX11_LIBS@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MOC = @MOC@ +MOC2 = @MOC2@ +MOC4 = @MOC4@ +MOC42 = @MOC42@ +NCURSES_CFLAGS = @NCURSES_CFLAGS@ +NCURSES_INCLUDE = @NCURSES_INCLUDE@ +NCURSES_LIBS = @NCURSES_LIBS@ +OBJEXT = @OBJEXT@ +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@ +PINENTRY_DEFAULT = @PINENTRY_DEFAULT@ +PINENTRY_QT4_CFLAGS = @PINENTRY_QT4_CFLAGS@ +PINENTRY_QT4_LDFLAGS = @PINENTRY_QT4_LDFLAGS@ +PINENTRY_QT4_LIBS = @PINENTRY_QT4_LIBS@ +PINENTRY_QT_CFLAGS = @PINENTRY_QT_CFLAGS@ +PINENTRY_QT_LDFLAGS = @PINENTRY_QT_LDFLAGS@ +PINENTRY_QT_LIBS = @PINENTRY_QT_LIBS@ +PINENTRY_QT_REQUIRE_CPP11_CFLAGS = @PINENTRY_QT_REQUIRE_CPP11_CFLAGS@ +PINENTRY_QT_REQUIRE_CPP11_LIBS = @PINENTRY_QT_REQUIRE_CPP11_LIBS@ +PINENTRY_QT_X11_EXTRAS_CFLAGS = @PINENTRY_QT_X11_EXTRAS_CFLAGS@ +PINENTRY_QT_X11_EXTRAS_LIBS = @PINENTRY_QT_X11_EXTRAS_LIBS@ +PINENTRY_TQT_CFLAGS = @PINENTRY_TQT_CFLAGS@ +PINENTRY_TQT_LIBS = @PINENTRY_TQT_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +QTCHOOSER = @QTCHOOSER@ +RANLIB = @RANLIB@ +RCC = @RCC@ +RCC2 = @RCC2@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TQT_MOC = @TQT_MOC@ +VERSION = @VERSION@ +WINDRES = @WINDRES@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +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@ +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@ +runstatedir = @runstatedir@ +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@ +@FALLBACK_CURSES_FALSE@ncurses_include = +@FALLBACK_CURSES_TRUE@ncurses_include = $(NCURSES_INCLUDE) +@FALLBACK_CURSES_FALSE@libcurses = +@FALLBACK_CURSES_TRUE@libcurses = ../pinentry/libpinentry-curses.a $(LIBCURSES) $(LIBICONV) +AM_CPPFLAGS = $(COMMON_CFLAGS) $(GNOME3_CFLAGS) \ + $(ncurses_include) -I$(top_srcdir)/secmem -I$(top_srcdir)/pinentry + +LDADD = ../pinentry/libpinentry.a ../secmem/libsecmem.a \ + $(COMMON_LIBS) $(GNOME3_LIBS) $(libcurses) + +pinentry_gnome3_SOURCES = pinentry-gnome3.c +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gnome3/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu gnome3/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__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + ; 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) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(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: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + +pinentry-gnome3$(EXEEXT): $(pinentry_gnome3_OBJECTS) $(pinentry_gnome3_DEPENDENCIES) $(EXTRA_pinentry_gnome3_DEPENDENCIES) + @rm -f pinentry-gnome3$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pinentry_gnome3_OBJECTS) $(pinentry_gnome3_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentry-gnome3.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@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)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.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) '$<'` + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + 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-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + 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" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(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 $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; 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-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/pinentry-gnome3.Po + -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-binPROGRAMS + +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 -f ./$(DEPDIR)/pinentry-gnome3.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic 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-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 pdf pdf-am \ + ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-binPROGRAMS + +.PRECIOUS: Makefile + + +# 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/debian/pinentry-tqt/pinentry-tqt-1.2.1/gnome3/pinentry-gnome3.c b/debian/pinentry-tqt/pinentry-tqt-1.2.1/gnome3/pinentry-gnome3.c new file mode 100644 index 00000000..0b8d8d18 --- /dev/null +++ b/debian/pinentry-tqt/pinentry-tqt-1.2.1/gnome3/pinentry-gnome3.c @@ -0,0 +1,549 @@ +/* pinentry-gnome3.c + * Copyright (C) 2015 g10 Code GmbH + * + * pinentry-gnome-3 is a pinentry application for GNOME 3. It tries + * to follow the Gnome Human Interface Guide as close as possible. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see <https://www.gnu.org/licenses/>. + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <gcr/gcr-base.h> + +#include <string.h> +#include <stdlib.h> + +#include <assuan.h> + +#include "memory.h" + +#include "pinentry.h" + +#ifdef FALLBACK_CURSES +#include "pinentry-curses.h" +#endif + + +#define PGMNAME "pinentry-gnome3" + +#ifndef VERSION +# define VERSION +#endif + + +struct pe_gnome3_run_s { + pinentry_t pinentry; + GcrPrompt *prompt; + GMainLoop *main_loop; + int ret; + guint timeout_id; + int timed_out; +}; + +static void pe_gcr_prompt_password_done (GObject *source_object, + GAsyncResult *res, gpointer user_data); + +static void pe_gcr_prompt_confirm_done (GObject *source_object, + GAsyncResult *res, gpointer user_data); +static gboolean pe_gcr_timeout_done (gpointer user_data); + + + +static gchar * +pinentry_utf8_validate (gchar *text) +{ + gchar *result; + + if (!text) + return NULL; + + if (g_utf8_validate (text, -1, NULL)) + return g_strdup (text); + + /* Failure: Assume that it was encoded in the current locale and + convert it to utf-8. */ + result = g_locale_to_utf8 (text, -1, NULL, NULL, NULL); + if (!result) + { + gchar *p; + + result = p = g_strdup (text); + while (!g_utf8_validate (p, -1, (const gchar **) &p)) + *p = '?'; + } + return result; +} + + +static void +_propagate_g_error_to_pinentry (pinentry_t pe, GError *error, + gpg_err_code_t code, const char *loc) +{ + char *t; + + /* We can't return the result of g_strdup_printf directly, because + * this needs to be g_free'd, but the users of PE (e.g., + * pinentry_reset in pinentry/pinentry.c) use free. */ + t = g_strdup_printf ("%d: %s", error->code, error->message); + if (t) + { + /* If strdup fails, then PE->SPECIFIC_ERR_INFO will be NULL, + * which is exactly what we want if strdup fails. So, there is + * no need to check for failure. */ + pe->specific_err_info = strdup (t); + g_free (t); + } + else + { + pe->specific_err_info = NULL; + } + + pe->specific_err = gpg_error (code); + pe->specific_err_loc = loc; +} + +static GcrPrompt * +create_prompt (pinentry_t pe, int confirm) +{ + GcrPrompt *prompt; + GError *error = NULL; + char *msg, *p; + char window_id[32]; + + /* Create the prompt. */ + prompt = GCR_PROMPT (gcr_system_prompt_open (pe->timeout ? pe->timeout : -1, NULL, &error)); + if (! prompt) + { + /* this means the timeout elapsed, but no prompt was ever shown. */ + if (error->code == GCR_SYSTEM_PROMPT_IN_PROGRESS) + { + fprintf (stderr, "Timeout: the Gcr system prompter was already in use.\n"); + pe->specific_err_info = strdup ("Timeout: the Gcr system prompter was already in use."); + /* not using GPG_ERR_TIMEOUT here because the user never saw + a prompt: */ + pe->specific_err = gpg_error (GPG_ERR_PIN_ENTRY); + } + else + { + fprintf (stderr, "couldn't create prompt for gnupg passphrase: %s\n", + error->message); + _propagate_g_error_to_pinentry (pe, error, GPG_ERR_CONFIGURATION, + "gcr_system_prompt_open"); + } + g_error_free (error); + return NULL; + } + + /* Set the messages for the various buttons, etc. */ + p = pinentry_get_title (pe); + if (p) + { + msg = pinentry_utf8_validate (p); + if (msg) + { + gcr_prompt_set_title (prompt, msg); + g_free (msg); + } + free (p); + } + + if (pe->description) + { + msg = pinentry_utf8_validate (pe->description); + gcr_prompt_set_description (prompt, msg); + g_free (msg); + } + + /* An error occurred during the last prompt. */ + if (pe->error) + { + msg = pinentry_utf8_validate (pe->error); + gcr_prompt_set_warning (prompt, msg); + g_free (msg); + } + + if (! pe->prompt && confirm) + gcr_prompt_set_message (prompt, "Message"); + else if (! pe->prompt && ! confirm) + gcr_prompt_set_message (prompt, "Enter Passphrase"); + else + { + msg = pinentry_utf8_validate (pe->prompt); + gcr_prompt_set_message (prompt, msg); + g_free (msg); + } + + if (! confirm) + gcr_prompt_set_password_new (prompt, !!pe->repeat_passphrase); + + if (pe->ok || pe->default_ok) + { + msg = pinentry_utf8_validate (pe->ok ?: pe->default_ok); + gcr_prompt_set_continue_label (prompt, msg); + g_free (msg); + } + /* XXX: Disable this button if pe->one_button is set. */ + if (pe->cancel || pe->default_cancel) + { + msg = pinentry_utf8_validate (pe->cancel ?: pe->default_cancel); + gcr_prompt_set_cancel_label (prompt, msg); + g_free (msg); + } + + if (confirm && pe->notok) + { + /* XXX: Add support for the third option. */ + } + + /* gcr expects a string; we have a int. see gcr's + ui/frob-system-prompt.c for example conversion using %lu */ + snprintf (window_id, sizeof (window_id), "%lu", + (long unsigned int)pe->parent_wid); + gcr_prompt_set_caller_window (prompt, window_id); + +#ifdef HAVE_LIBSECRET + if (! confirm && pe->allow_external_password_cache && pe->keyinfo) + { + if (pe->default_pwmngr) + { + msg = pinentry_utf8_validate (pe->default_pwmngr); + gcr_prompt_set_choice_label (prompt, msg); + g_free (msg); + } + else + gcr_prompt_set_choice_label + (prompt, "Automatically unlock this key, whenever I'm logged in"); + } +#endif + + return prompt; +} + +static int +gnome3_cmd_handler (pinentry_t pe) +{ + struct pe_gnome3_run_s state; + + state.main_loop = g_main_loop_new (NULL, FALSE); + if (!state.main_loop) + { + pe->specific_err_info = strdup ("Failed to create GMainLoop"); + pe->specific_err = gpg_error (GPG_ERR_PIN_ENTRY); + pe->specific_err_loc = "g_main_loop_new"; + pe->canceled = 1; + return -1; + } + state.pinentry = pe; + state.ret = 0; + state.timeout_id = 0; + state.timed_out = 0; + state.prompt = create_prompt (pe, !(pe->pin)); + if (!state.prompt) + { + pe->canceled = 1; + return -1; + } + if (pe->pin) + gcr_prompt_password_async (state.prompt, NULL, pe_gcr_prompt_password_done, + &state); + else + gcr_prompt_confirm_async (state.prompt, NULL, pe_gcr_prompt_confirm_done, + &state); + + if (pe->timeout) + state.timeout_id = g_timeout_add_seconds (pe->timeout, + pe_gcr_timeout_done, &state); + g_main_loop_run (state.main_loop); + + /* clean up state: */ + if (state.timeout_id && !state.timed_out) + g_source_destroy + (g_main_context_find_source_by_id (NULL, state.timeout_id)); + + g_clear_object (&state.prompt); + g_main_loop_unref (state.main_loop); + return state.ret; +}; + + +static void +pe_gcr_prompt_password_done (GObject *source_object, + GAsyncResult *res, gpointer user_data) +{ + struct pe_gnome3_run_s *state = user_data; + GcrPrompt *prompt = GCR_PROMPT (source_object); + + if (state && prompt && state->prompt == prompt) + { + const char *password; + GError *error = NULL; + pinentry_t pe = state->pinentry; + int ret = -1; + + /* "The returned password is valid until the next time a method + is called to display another prompt." */ + password = gcr_prompt_password_finish (prompt, res, &error); + if ((! password && ! error) + || (error && error->code == G_IO_ERROR_CANCELLED)) + { + /* operation was cancelled or timed out. */ + ret = -1; + if (state->timed_out) + state->pinentry->specific_err = gpg_error (GPG_ERR_TIMEOUT); + if (error) + g_error_free (error); + } + else if (error) + { + _propagate_g_error_to_pinentry (pe, error, + GPG_ERR_PIN_ENTRY, + "gcr_system_password_finish"); + g_error_free (error); + ret = -1; + } + else + { + pinentry_setbufferlen (pe, strlen (password) + 1); + if (pe->pin) + strcpy (pe->pin, password); + + if (pe->repeat_passphrase) + pe->repeat_okay = 1; + +#ifdef HAVE_LIBSECRET + if (pe->allow_external_password_cache && pe->keyinfo) + pe->may_cache_password = gcr_prompt_get_choice_chosen (prompt); +#endif + + ret = 1; + } + state->ret = ret; + } + + if (state) + g_main_loop_quit (state->main_loop); +} + +static void +pe_gcr_prompt_confirm_done (GObject *source_object, GAsyncResult *res, + gpointer user_data) +{ + struct pe_gnome3_run_s *state = user_data; + GcrPrompt *prompt = GCR_PROMPT (source_object); + + if (state && prompt && state->prompt == prompt) + { + GcrPromptReply reply; + GError *error = NULL; + pinentry_t pe = state->pinentry; + int ret = -1; + + /* XXX: We don't support a third button! */ + + reply = gcr_prompt_confirm_finish (prompt, res, &error); + if (error) + { + if (error->code == G_IO_ERROR_CANCELLED) + { + pe->canceled = 1; + if (state->timed_out) + state->pinentry->specific_err = gpg_error (GPG_ERR_TIMEOUT); + } + else + _propagate_g_error_to_pinentry (state->pinentry, error, GPG_ERR_PIN_ENTRY, + "gcr_system_confirm_finish"); + g_error_free (error); + ret = 0; + } + else if (reply == GCR_PROMPT_REPLY_CONTINUE + /* XXX: Hack since gcr doesn't yet support one button + message boxes treat cancel the same as okay. */ + || pe->one_button) + { + /* Confirmation. */ + ret = 1; + } + else /* GCR_PROMPT_REPLY_CANCEL */ + { + pe->canceled = 1; + if (state->timed_out) + state->pinentry->specific_err = gpg_error (GPG_ERR_TIMEOUT); + ret = 0; + } + state->ret = ret; + } + + if (state) + g_main_loop_quit (state->main_loop); +} + +static gboolean +pe_gcr_timeout_done (gpointer user_data) +{ + struct pe_gnome3_run_s *state = user_data; + + if (!state) + return FALSE; + + state->timed_out = 1; + gcr_prompt_close (state->prompt); + + return FALSE; +} + +pinentry_cmd_handler_t pinentry_cmd_handler = gnome3_cmd_handler; + +/* Test whether there is a GNOME screensaver running that happens to + * be locked. Note that if there is no GNOME screensaver running at + * all the answer is still FALSE. */ +static gboolean +pe_gnome_screen_locked (void) +{ + GDBusConnection *dbus; + GError *error = NULL; + GVariant *reply, *reply_bool; + gboolean ret; + + dbus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error); + + if (!dbus) + { + fprintf (stderr, "failed to connect to user session D-Bus (%d): %s", + error ? error->code : -1, + error ? error->message : "<no GError>"); + if (error) + g_error_free (error); + return FALSE; + } + + /* this is intended to be the equivalent of: + * dbus-send --print-reply=literal --session \ + * --dest=org.gnome.ScreenSaver \ + * /org/gnome/ScreenSaver \ + * org.gnome.ScreenSaver.GetActive + */ + reply = g_dbus_connection_call_sync (dbus, + "org.gnome.ScreenSaver", + "/org/gnome/ScreenSaver", + "org.gnome.ScreenSaver", + "GetActive", + NULL, + ((const GVariantType *) "(b)"), + G_DBUS_CALL_FLAGS_NO_AUTO_START, + -1, + NULL, + &error); + g_object_unref(dbus); + if (!reply) + { + /* G_IO_ERROR_IS_DIRECTORY is the expected response when there is + * no gnome screensaver at all, don't be noisy in that case: */ + if (!(error && error->code == G_IO_ERROR_IS_DIRECTORY)) + fprintf (stderr, "Failed to get d-bus reply for org.gnome.ScreenSaver.GetActive (%d): %s\n", + error ? error->code : -1, + error ? error->message : "<no GError>"); + if (error) + g_error_free (error); + return FALSE; + } + reply_bool = g_variant_get_child_value (reply, 0); + if (!reply_bool) + { + fprintf (stderr, "Failed to get d-bus boolean from org.gnome.ScreenSaver.GetActive; assuming screensaver is not locked\n"); + ret = FALSE; + } + else + { + ret = g_variant_get_boolean (reply_bool); + g_variant_unref (reply_bool); + } + + g_variant_unref (reply); + return ret; +} + +/* Test whether we can create a system prompt or not. This briefly + * does create a system prompt, which blocks other tools from making + * the same request concurrently, so we just create it to test if it is + * available, and quickly close it. */ +static int +pe_gcr_system_prompt_available (void) +{ + GcrSystemPrompt *prompt; + GError *error = NULL; + int ret = 0; + + prompt = GCR_SYSTEM_PROMPT (gcr_system_prompt_open (0, NULL, &error)); + if (prompt) + { + ret = 1; + if (!gcr_system_prompt_close (prompt, NULL, &error)) + fprintf (stderr, "failed to close test Gcr System Prompt (%d): %s\n", + error ? error->code : -1, + error ? error->message : "<no GError>"); + g_clear_object (&prompt); + } + else if (error && error->code == GCR_SYSTEM_PROMPT_IN_PROGRESS) + { + /* This one particular failure is OK; we're clearly capable of + * making a system prompt, even though someone else has the + * system prompter right now: */ + ret = 1; + } + + if (error) + g_error_free (error); + return ret; +} + +int +main (int argc, char *argv[]) +{ + pinentry_init (PGMNAME); + +#ifdef FALLBACK_CURSES + if (!getenv ("DBUS_SESSION_BUS_ADDRESS")) + { + fprintf (stderr, "No $DBUS_SESSION_BUS_ADDRESS found," + " falling back to curses\n"); + pinentry_cmd_handler = curses_cmd_handler; + pinentry_set_flavor_flag ("curses"); + } + else if (!pe_gcr_system_prompt_available ()) + { + fprintf (stderr, "No Gcr System Prompter available," + " falling back to curses\n"); + pinentry_cmd_handler = curses_cmd_handler; + pinentry_set_flavor_flag ("curses"); + } + else if (pe_gnome_screen_locked ()) + { + fprintf (stderr, "GNOME screensaver is locked," + " falling back to curses\n"); + pinentry_cmd_handler = curses_cmd_handler; + pinentry_set_flavor_flag ("curses"); + } +#endif + + pinentry_parse_opts (argc, argv); + + if (pinentry_loop ()) + return 1; + + return 0; +} |