Hello community,
here is the log from the commit of package yast2-fingerprint-reader
checked in at Fri Sep 26 16:58:42 CEST 2008.
--------
--- yast2-fingerprint-reader/yast2-fingerprint-reader.changes 2008-09-09 11:14:45.000000000 +0200
+++ /mounts/work_src_done/STABLE/yast2-fingerprint-reader/yast2-fingerprint-reader.changes 2008-09-26 16:29:14.771837000 +0200
@@ -1,0 +2,6 @@
+Fri Sep 26 16:17:48 CEST 2008 - jsuchome@suse.cz
+
+- initial version of agent based on linfprint library (fate#300416)
+- 2.17.1
+
+-------------------------------------------------------------------
Old:
----
yast2-fingerprint-reader-2.17.0.tar.bz2
New:
----
yast2-fingerprint-reader-2.17.1.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-fingerprint-reader.spec ++++++
--- /var/tmp/diff_new_pack.R28831/_old 2008-09-26 16:58:21.000000000 +0200
+++ /var/tmp/diff_new_pack.R28831/_new 2008-09-26 16:58:21.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-fingerprint-reader (Version 2.17.0)
+# spec file for package yast2-fingerprint-reader (Version 2.17.1)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,15 +19,15 @@
Name: yast2-fingerprint-reader
-Version: 2.17.0
+Version: 2.17.1
Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-fingerprint-reader-2.17.0.tar.bz2
+Source0: yast2-fingerprint-reader-2.17.1.tar.bz2
Prefix: /usr
Requires: yast2 yast2-pam
-BuildRequires: libthinkfinger libusb-devel
+BuildRequires: libfprint-devel libfprint0 libusb-devel
BuildRequires: doxygen gcc-c++ perl-XML-Writer update-desktop-files yast2 yast2-core-devel yast2-devtools yast2-pam yast2-testsuite
Supplements: modalias(usb:v0483p2016d*dc*dsc*dp*ic*isc*ip*)
Conflicts: yast2-hardware-detection < 2.15.7
@@ -44,7 +44,7 @@
Jiri Suchomel
%prep
-%setup -n yast2-fingerprint-reader-2.17.0
+%setup -n yast2-fingerprint-reader-2.17.1
%build
%{prefix}/bin/y2tool y2autoconf
@@ -77,9 +77,12 @@
/usr/share/YaST2/modules/UsersPluginFingerprintReader.pm
%{prefix}/share/applications/YaST2/fingerprint-reader.desktop
/usr/share/YaST2/scrconf/*.scr
-%{_libdir}/YaST2/plugin/libpy2ag_thinkfinger.*
+%{_libdir}/YaST2/plugin/libpy2ag_fprint.*
%doc %{prefix}/share/doc/packages/yast2-fingerprint-reader
%changelog
+* Fri Sep 26 2008 jsuchome@suse.cz
+- initial version of agent based on linfprint library (fate#300416)
+- 2.17.1
* Tue Sep 09 2008 jsuchome@suse.cz
- merged proofread texts
- 2.17.0
++++++ yast2-fingerprint-reader-2.17.0.tar.bz2 -> yast2-fingerprint-reader-2.17.1.tar.bz2 ++++++
++++ 11203 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-fingerprint-reader-2.17.0/agent-fprint/conf/fprint.scr new/yast2-fingerprint-reader-2.17.1/agent-fprint/conf/fprint.scr
--- old/yast2-fingerprint-reader-2.17.0/agent-fprint/conf/fprint.scr 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-fingerprint-reader-2.17.1/agent-fprint/conf/fprint.scr 2008-09-26 14:34:48.000000000 +0200
@@ -0,0 +1,14 @@
+/**
+ * File: fprint.scr
+ * Summary: FPrint agent
+ * Author: Jiri Suchomel
+ * Access: read / write / execute
+ *
+ * Example: FIXME
+ *
+ */
+.fprint
+
+`ag_fprint(
+ `FPrintAgent()
+)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-fingerprint-reader-2.17.0/agent-fprint/conf/Makefile.am new/yast2-fingerprint-reader-2.17.1/agent-fprint/conf/Makefile.am
--- old/yast2-fingerprint-reader-2.17.0/agent-fprint/conf/Makefile.am 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-fingerprint-reader-2.17.1/agent-fprint/conf/Makefile.am 2008-09-26 14:34:48.000000000 +0200
@@ -0,0 +1,7 @@
+#
+# Makefile.am for .../agent-fprint/conf
+#
+
+scrconf_DATA = fprint.scr
+
+EXTRA_DIST = $(scrconf_DATA)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-fingerprint-reader-2.17.0/agent-fprint/doc/autodocs/Makefile.am new/yast2-fingerprint-reader-2.17.1/agent-fprint/doc/autodocs/Makefile.am
--- old/yast2-fingerprint-reader-2.17.0/agent-fprint/doc/autodocs/Makefile.am 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-fingerprint-reader-2.17.1/agent-fprint/doc/autodocs/Makefile.am 2008-09-26 14:34:48.000000000 +0200
@@ -0,0 +1,13 @@
+#
+# Makefile.am for .../agent-fprint/doc/autodocs
+#
+
+htmldir = $(docdir)/autodocs
+
+html_DATA = index.html $(wildcard *.html *.png) doxygen.css @RPMNAME@.tag
+CLEANFILES = $(html_DATA) doxygen.log doxygen.conf installdox
+
+doxygen.css @RPMNAME@.tag: index.html
+
+index.html: $(srcdir)/../../src/*.h
+ @ybindir@/ydoxygen PROJECT_NAME=@RPMNAME@
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-fingerprint-reader-2.17.0/agent-fprint/doc/Makefile.am new/yast2-fingerprint-reader-2.17.1/agent-fprint/doc/Makefile.am
--- old/yast2-fingerprint-reader-2.17.0/agent-fprint/doc/Makefile.am 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-fingerprint-reader-2.17.1/agent-fprint/doc/Makefile.am 2008-09-26 14:34:48.000000000 +0200
@@ -0,0 +1 @@
+SUBDIRS = autodocs
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-fingerprint-reader-2.17.0/agent-fprint/Makefile.am new/yast2-fingerprint-reader-2.17.1/agent-fprint/Makefile.am
--- old/yast2-fingerprint-reader-2.17.0/agent-fprint/Makefile.am 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-fingerprint-reader-2.17.1/agent-fprint/Makefile.am 2008-09-26 14:34:48.000000000 +0200
@@ -0,0 +1 @@
+SUBDIRS = conf doc src testsuite
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-fingerprint-reader-2.17.0/agent-fprint/src/FPrintAgent.cc new/yast2-fingerprint-reader-2.17.1/agent-fprint/src/FPrintAgent.cc
--- old/yast2-fingerprint-reader-2.17.0/agent-fprint/src/FPrintAgent.cc 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-fingerprint-reader-2.17.1/agent-fprint/src/FPrintAgent.cc 2008-09-26 16:17:45.000000000 +0200
@@ -0,0 +1,434 @@
+/* FPrintAgent.cc
+ *
+ * An agent for FPrint library (access to fingerprint reader)
+ *
+ * Authors: Jiri Suchomel
+ *
+ * $Id$
+ */
+
+#include "FPrintAgent.h"
+
+#define PC(n) (path->component_str(n))
+
+#define INIT_FAILED 500
+#define SET_FILE_FAILED 600
+#define SET_CALLBACK_FAILED 700
+
+
+/**
+ * Constructor
+ */
+FPrintAgent::FPrintAgent() : SCRAgent()
+{
+ child_pid = -1;
+ child_retval = -1;
+}
+
+/**
+ * Destructor
+ */
+FPrintAgent::~FPrintAgent()
+{
+}
+
+// return the only instance of the class
+FPrintAPI& FPrintAPI::instance()
+{
+ static FPrintAPI _instance; // The singleton
+ return _instance;
+}
+
+// handler for SIGTERM signal (it is necessary to kill the process when
+// user his Cancel)
+void FPrintAPI::catch_sigterm (int sig_num)
+{
+ instance().finalize ();
+ exit (256);
+}
+
+// de-initialize finger print reader (must be called at the end!)
+void FPrintAPI::finalize ()
+{
+ y2internal ("finalize");
+ if (instance().data != NULL)
+ {
+ fp_print_data_free (instance().data);
+ instance().data = NULL;
+ }
+ fp_exit();
+ y2internal ("finalized");
+}
+
+FPrintAPI::FPrintAPI()
+{
+ data = NULL;
+}
+
+FPrintAPI::~FPrintAPI ()
+{
+}
+
+/**
+ * wrapper for fp_enroll_finger function;
+ * - we need to take care of the errors and signals
+ * @param file descriptor of the pipe
+ * @param path to the target bir file FIXME
+ */
+int FPrintAPI::acquire (int write_fd, string bir_path)
+{
+ signal (15, catch_sigterm);
+
+// FIXME move initialization to separate call, to differentiate betw.ret values
+
+ struct fp_print_data *enrolled_print = NULL;
+ int r;
+
+ struct fp_dscv_dev *ddev;
+ struct fp_dscv_dev **discovered_devs;
+ struct fp_dev *dev;
+
+ r = fp_init();
+ if (r < 0) {
+ y2error("Failed to initialize libfprint\n");
+ r = INIT_FAILED;
+ write (write_fd, &r, sizeof(int));
+ return r;
+ }
+ discovered_devs = fp_discover_devs();
+ if (!discovered_devs) {
+ y2error("Could not discover devices\n");
+ instance().finalize ();
+ r = INIT_FAILED;
+ write (write_fd, &r, sizeof(int));
+ return r;
+ }
+
+ ddev = discovered_devs[0];
+
+
+ if (!ddev) {
+ y2error("No devices detected.\n");
+ instance().finalize ();
+ r = INIT_FAILED;
+ write (write_fd, &r, sizeof(int));
+ return r;
+ }
+
+ struct fp_driver *drv;
+ drv = fp_dscv_dev_get_driver(ddev);
+ y2milestone ("Found device claimed by %s driver",
+ fp_driver_get_full_name(drv));
+
+ dev = fp_dev_open(ddev);
+ fp_dscv_devs_free(discovered_devs);
+ if (!dev) {
+ y2error("Could not open device.\n");
+ }
+
+ y2milestone("Opened device. It's now time to enroll your finger.\n\n");
+
+ y2milestone ("You will need to successfully scan your finger %d times to "
+ "complete the process.\n", fp_dev_get_nr_enroll_stages (dev));
+
+ do {
+ sleep (1);
+ y2internal ("Scan your finger now.");
+
+ r = fp_enroll_finger (dev, &enrolled_print);
+
+ if (r < 0) {
+ y2error ("Enroll failed with error %d", r);
+// break; FIXME what now?
+ }
+y2internal ("retval: %d", r);
+ if (write (write_fd, &r, sizeof (int)) == -1)
+ y2error ("write to pipe failed: %d (%m)", errno);
+
+
+ switch (r) {
+ case FP_ENROLL_COMPLETE:
+ y2milestone("Enroll complete!");
+ break;
+ case FP_ENROLL_FAIL:
+ y2milestone("Enroll failed, something wen't wrong :(");
+// return NULL; FIXME
+ break;
+ case FP_ENROLL_PASS:
+ y2milestone("Enroll stage passed. Yay!");
+ break;
+ case FP_ENROLL_RETRY:
+ y2milestone("Didn't quite catch that. Please try again.");
+ break;
+ case FP_ENROLL_RETRY_TOO_SHORT:
+ y2milestone("Your swipe was too short, please try again.");
+ break;
+ case FP_ENROLL_RETRY_CENTER_FINGER:
+ y2milestone("Didn't catch that, please center your finger on the sensor and try again.");
+ break;
+ case FP_ENROLL_RETRY_REMOVE_FINGER:
+ y2milestone("Scan failed, please remove your finger and then try again.");
+ break;
+ }
+ } while (r != FP_ENROLL_COMPLETE);
+
+ if (!enrolled_print) {
+ y2error ("Enroll complete but no print?\n");
+ }
+ else {
+ data = enrolled_print;
+ y2milestone ("Enrollment completed, exiting with %d", r);
+ // FIXME save enrolled_print now
+ }
+
+ instance().finalize ();
+ signal (15, SIG_DFL);
+ return r;
+}
+
+/**
+ * Dir
+ */
+YCPList FPrintAgent::Dir(const YCPPath& path)
+{
+ y2error("Wrong path '%s' in Dir().", path->toString().c_str());
+ return YCPNull();
+}
+
+/**
+ * Read
+ */
+YCPValue FPrintAgent::Read(const YCPPath &path, const YCPValue& arg, const YCPValue& opt) {
+
+ y2debug ("Path in Read(): %s", path->toString().c_str());
+ YCPValue ret = YCPVoid();
+
+ if (path->length() == 0) {
+ ret = YCPString("0");
+ }
+ else if (path->length() == 1) {
+
+ if (PC(0) == "error") {
+ // return the last error message
+ ret = YCPString ("error_message");
+ }
+ else if (PC(0) == "state") {
+ YCPMap retmap;
+ if (child_pid == -1)
+ {
+ y2error ("FPrint not initialized yet!");
+ return ret;
+ }
+ int state;
+ size_t size = sizeof (int);
+ int retval = read (data_pipe[0], &state, size);
+ if (retval == -1)
+ {
+ if (errno != EINTR && errno != EAGAIN)
+ y2error ("error reading from pipe: %d (%m)", errno);
+ }
+ else if (retval == size) {
+ if (state == INIT_FAILED ||
+ state == SET_FILE_FAILED || state == SET_CALLBACK_FAILED)
+ {
+ y2warning ("some initialization failed (%d)...", state);
+ return ret;
+ }
+ retmap->add (YCPString ("state"), YCPInteger (state));
+ }
+ else if (retval == 0)
+ {
+ // check if child is still alive
+ int status;
+ if (waitpid (-1, &status, WNOHANG) != 0)
+ {
+ if (WIFSIGNALED (status))
+ {
+ y2error ("child process was killed");
+ child_pid = -1;
+ return ret;
+ }
+ if (WIFEXITED (status))
+ {
+ child_retval = WEXITSTATUS (status);
+ child_pid = -1;
+ return ret;
+ }
+ }
+ }
+ return retmap;
+ }
+ // check if child process exited
+ else if (PC(0) == "check_exit" ) {
+ int status;
+ ret = YCPBoolean (false);
+ if (child_pid != -1)
+ {
+ if (waitpid (child_pid, &status, WNOHANG) != 0)
+ {
+ child_pid = -1;
+ ret = YCPBoolean (true);
+ if (WIFSIGNALED (status))
+ {
+ y2error ("child process was killed");
+ }
+ if (WIFEXITED (status))
+ {
+ child_retval = WEXITSTATUS (status);
+ }
+ }
+ }
+ else
+ {
+ y2milestone ("child process already exited");
+ ret = YCPBoolean (true);
+ }
+ }
+ // wait for child exit if it still not exited (do not use this part)
+ // return child exit value
+ else if (PC(0) == "exit_status" ) {
+ int status;
+ int retval = 255;
+ if (child_pid != -1)
+ {
+ wait (&status);
+ if (WIFSIGNALED (status))
+ y2milestone ("child process was killed");
+ else if (WIFEXITED (status))
+ {
+ retval = WEXITSTATUS (status);
+ y2milestone ("retval is %d", retval);
+ }
+ }
+ else
+ {
+ y2milestone ("child process already exited");
+ if (child_retval)
+ retval = child_retval;
+ child_retval = -1;
+ }
+ ret = YCPInteger (retval);
+ close (data_pipe[0]); // close FD for reading
+ }
+ else {
+ y2error ("Unknown path in Read(): %s", path->toString().c_str());
+ }
+ }
+ else {
+ y2error ("Unknown path in Read(): %s", path->toString().c_str());
+ }
+ return ret;
+}
+
+
+/**
+ * Write - nothing to do
+ */
+YCPBoolean FPrintAgent::Write(const YCPPath &path, const YCPValue& value,
+ const YCPValue& arg)
+{
+ return YCPBoolean(false);
+}
+
+/**
+ * Execute(.fprint.enroll) is action to acquire fingerprint
+ */
+YCPValue FPrintAgent::Execute(const YCPPath &path, const YCPValue& val, const YCPValue& arg)
+{
+ y2milestone ("Path in Execute(): %s", path->toString().c_str());
+ YCPValue ret = YCPBoolean(false);
+
+ if (path->length() == 1) {
+
+ if (PC(0) == "cancel") {
+ y2milestone ("terminanting child process with pid %d", child_pid);
+ if (child_pid)
+ {
+ if (kill (child_pid, 15) != -1)
+ {
+ sleep (3);
+ int status;
+ if (waitpid (-1, &status, WNOHANG) == 0)
+ {
+ y2milestone ("... still alive, killing it");
+ kill (child_pid, 9);
+ wait (&status);
+ }
+ child_pid = -1;
+ }
+ else
+ {
+ y2error ("error while killing: %d (%m)", errno);
+ }
+ }
+ ret = YCPBoolean (true);
+ }
+ /**
+ * parameter is whole path to target bir file, e.g.
+ * /tmp/YaST-123-456/hh.bir
+ */
+ else if (PC(0) == "enroll") {
+ string path;
+ if (!val.isNull())
+ {
+ path = val->asString()->value();
+ }
+ else
+ {
+ y2error ("path to bir file is missing");
+ return ret;
+ }
+ if (pipe (data_pipe) == -1) {
+ y2error ("pipe creation failed");
+ return ret;
+ }
+
+ long arg;
+ arg = fcntl (data_pipe[0], F_GETFL);
+ if (fcntl (data_pipe[0], F_SETFL, arg | O_NONBLOCK ) < 0)
+ {
+ y2error ("Couldn't set O_NONBLOCK: errno=%d: %m", errno);
+ close (data_pipe[0]);
+ close (data_pipe[1]);
+ return ret;
+ }
+ child_pid = fork ();
+ if (child_pid == -1)
+ {
+ y2error ("fork failed");
+ return ret;
+ }
+ else if (child_pid == 0)
+ {
+ close (data_pipe[0]); // close the read-only FD
+ int state =
+ FPrintAPI::instance().acquire (data_pipe[1], path);
+ y2milestone ("acquire done with state %d", state);
+ close (data_pipe[1]);
+ exit (state);
+ }
+ else // parent -> return
+ {
+ close (data_pipe[1]); // close FD for writing
+ ret = YCPBoolean(true);
+ }
+ }
+ }
+ return ret;
+}
+
+/**
+ * otherCommand
+ */
+YCPValue FPrintAgent::otherCommand(const YCPTerm& term)
+{
+ string sym = term->name();
+
+ if (sym == "FPrintAgent") {
+
+ return YCPVoid();
+ }
+
+ return YCPNull();
+}
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-fingerprint-reader-2.17.0/agent-fprint/src/FPrintAgent.h new/yast2-fingerprint-reader-2.17.1/agent-fprint/src/FPrintAgent.h
--- old/yast2-fingerprint-reader-2.17.0/agent-fprint/src/FPrintAgent.h 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-fingerprint-reader-2.17.1/agent-fprint/src/FPrintAgent.h 2008-09-26 14:34:48.000000000 +0200
@@ -0,0 +1,123 @@
+/* FPrintAgent.h
+ *
+ * FPrint agent implementation
+ *
+ * Authors: Jiri Suchomel
+ *
+ * $Id: FPrintAgent.h 26456 2005-12-07 16:11:23Z jsuchome $
+ */
+
+#ifndef _FPrintAgent_h
+#define _FPrintAgent_h
+
+#include
+#include
+
+using namespace std;
+
+#include
+#include
+#include
+#include
+#include
+
+#include <string>
+
+/**
+ * The real interface to fprint library
+ * - extra (singleton) class is used to contain signal handler function
+ */
+class FPrintAPI
+{
+
+private:
+ FPrintAPI ();
+
+ virtual ~FPrintAPI();
+
+public:
+
+ static FPrintAPI & instance();
+
+ static void catch_sigterm (int);
+
+ int acquire (int, string);
+
+ int test_int;
+
+ struct fp_print_data *data;
+
+ void finalize ();
+
+};
+
+/**
+ * @short An interface class between YaST2 and FPrint Agent
+ */
+class FPrintAgent : public SCRAgent
+{
+
+public:
+
+ /**
+ * Default constructor.
+ */
+ FPrintAgent ();
+
+
+ /**
+ * Destructor.
+ */
+ virtual ~FPrintAgent();
+
+ /**
+ * Provides SCR Read ().
+ * @param path Path that should be read.
+ * @param arg Additional parameter.
+ */
+ virtual YCPValue Read(const YCPPath &path,
+ const YCPValue& arg = YCPNull(),
+ const YCPValue& opt = YCPNull());
+
+ /**
+ * Provides SCR Write ().
+ */
+ virtual YCPBoolean Write(const YCPPath &path,
+ const YCPValue& val,
+ const YCPValue& arg = YCPNull());
+
+ /**
+ * Provides SCR Execute ().
+ */
+ virtual YCPValue Execute(const YCPPath &path,
+ const YCPValue& val = YCPNull(),
+ const YCPValue& arg = YCPNull());
+
+ /**
+ * Provides SCR Dir ().
+ */
+ virtual YCPList Dir(const YCPPath& path);
+
+ /**
+ * Used for mounting the agent.
+ */
+ virtual YCPValue otherCommand(const YCPTerm& term);
+
+ /**
+ * array with pipe file descriptors
+ */
+ int data_pipe[2];
+
+ /**
+ * pid of the child process after fork
+ */
+ pid_t child_pid;
+
+ /**
+ * return value of the child process
+ */
+ int child_retval;
+
+};
+
+#endif /* _FPrintAgent_h */
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-fingerprint-reader-2.17.0/agent-fprint/src/Makefile.am new/yast2-fingerprint-reader-2.17.1/agent-fprint/src/Makefile.am
--- old/yast2-fingerprint-reader-2.17.0/agent-fprint/src/Makefile.am 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-fingerprint-reader-2.17.1/agent-fprint/src/Makefile.am 2008-09-26 15:33:05.000000000 +0200
@@ -0,0 +1,24 @@
+
+# Makefile.am for .../agent-fprint/src
+#
+
+AM_CXXFLAGS = -DY2LOG=\"agent-fprint\" -Wall
+
+plugin_LTLIBRARIES = libpy2ag_fprint.la
+noinst_LTLIBRARIES = liby2ag_fprint.la
+
+liby2ag_fprint_la_SOURCES = \
+ FPrintAgent.cc \
+ FPrintAgent.h
+liby2ag_fprint_la_LDFLAGS = -version-info 2:0
+liby2ag_fprint_la_LIBADD = @AGENT_LIBADD@ -lfprint
+
+
+libpy2ag_fprint_la_SOURCES = \
+ $(liby2ag_fprint_la_SOURCES) \
+ Y2CCFPrintAgent.cc
+libpy2ag_fprint_la_LDFLAGS = -version-info 2:0
+libpy2ag_fprint_la_LIBADD = @AGENT_LIBADD@ -lfprint
+
+
+INCLUDES = -I$(includedir)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-fingerprint-reader-2.17.0/agent-fprint/src/Y2CCFPrintAgent.cc new/yast2-fingerprint-reader-2.17.1/agent-fprint/src/Y2CCFPrintAgent.cc
--- old/yast2-fingerprint-reader-2.17.0/agent-fprint/src/Y2CCFPrintAgent.cc 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-fingerprint-reader-2.17.1/agent-fprint/src/Y2CCFPrintAgent.cc 2008-09-26 14:34:48.000000000 +0200
@@ -0,0 +1,14 @@
+/* Y2CCFPrintAgent.cc
+ *
+ * Authors: Jiri Suchomel
+ *
+ */
+
+#include
+#include
+
+#include "FPrintAgent.h"
+
+typedef Y2AgentComp <FPrintAgent> Y2FPrintAgentComp;
+
+Y2CCAgentComp <Y2FPrintAgentComp> g_y2ccag_fprint ("ag_fprint");
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-fingerprint-reader-2.17.0/agent-fprint/testsuite/Makefile.am new/yast2-fingerprint-reader-2.17.1/agent-fprint/testsuite/Makefile.am
--- old/yast2-fingerprint-reader-2.17.0/agent-fprint/testsuite/Makefile.am 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-fingerprint-reader-2.17.1/agent-fprint/testsuite/Makefile.am 2008-09-26 14:34:48.000000000 +0200
@@ -0,0 +1,8 @@
+#
+# Makefile.am for .../agent-thinkfinger/testsuite
+#
+
+AUTOMAKE_OPTIONS = dejagnu
+
+clean-local:
+ rm -f tmp.err.* tmp.out.* site.exp site.bak
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-fingerprint-reader-2.17.0/agent-thinkfinger/conf/Makefile.am new/yast2-fingerprint-reader-2.17.1/agent-thinkfinger/conf/Makefile.am
--- old/yast2-fingerprint-reader-2.17.0/agent-thinkfinger/conf/Makefile.am 2007-10-02 13:27:17.000000000 +0200
+++ new/yast2-fingerprint-reader-2.17.1/agent-thinkfinger/conf/Makefile.am 1970-01-01 01:00:00.000000000 +0100
@@ -1,7 +0,0 @@
-#
-# Makefile.am for .../agent-thinkfinger/conf
-#
-
-scrconf_DATA = thinkfinger.scr
-
-EXTRA_DIST = $(scrconf_DATA)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-fingerprint-reader-2.17.0/agent-thinkfinger/conf/thinkfinger.scr new/yast2-fingerprint-reader-2.17.1/agent-thinkfinger/conf/thinkfinger.scr
--- old/yast2-fingerprint-reader-2.17.0/agent-thinkfinger/conf/thinkfinger.scr 2007-10-02 13:27:17.000000000 +0200
+++ new/yast2-fingerprint-reader-2.17.1/agent-thinkfinger/conf/thinkfinger.scr 1970-01-01 01:00:00.000000000 +0100
@@ -1,16 +0,0 @@
-/**
- * File: thinkfinger.scr
- * Summary: ThinkFinger agent
- * Author: Jiri Suchomel
- * Access: read / write / execute
- *
- * Example: FIXME
- *
- * $Id$
- *
- */
-.thinkfinger
-
-`ag_thinkfinger(
- `ThinkFingerAgent()
-)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-fingerprint-reader-2.17.0/agent-thinkfinger/doc/autodocs/Makefile.am new/yast2-fingerprint-reader-2.17.1/agent-thinkfinger/doc/autodocs/Makefile.am
--- old/yast2-fingerprint-reader-2.17.0/agent-thinkfinger/doc/autodocs/Makefile.am 2007-10-02 13:27:17.000000000 +0200
+++ new/yast2-fingerprint-reader-2.17.1/agent-thinkfinger/doc/autodocs/Makefile.am 1970-01-01 01:00:00.000000000 +0100
@@ -1,13 +0,0 @@
-#
-# Makefile.am for .../agent-thinkfinger/doc/autodocs
-#
-
-htmldir = $(docdir)/autodocs
-
-html_DATA = index.html $(wildcard *.html *.png) doxygen.css @RPMNAME@.tag
-CLEANFILES = $(html_DATA) doxygen.log doxygen.conf installdox
-
-doxygen.css @RPMNAME@.tag: index.html
-
-index.html: $(srcdir)/../../src/*.h
- @ybindir@/ydoxygen PROJECT_NAME=@RPMNAME@
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-fingerprint-reader-2.17.0/agent-thinkfinger/doc/Makefile.am new/yast2-fingerprint-reader-2.17.1/agent-thinkfinger/doc/Makefile.am
--- old/yast2-fingerprint-reader-2.17.0/agent-thinkfinger/doc/Makefile.am 2007-10-02 13:27:17.000000000 +0200
+++ new/yast2-fingerprint-reader-2.17.1/agent-thinkfinger/doc/Makefile.am 1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-SUBDIRS = autodocs
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-fingerprint-reader-2.17.0/agent-thinkfinger/Makefile.am new/yast2-fingerprint-reader-2.17.1/agent-thinkfinger/Makefile.am
--- old/yast2-fingerprint-reader-2.17.0/agent-thinkfinger/Makefile.am 2007-10-02 13:27:17.000000000 +0200
+++ new/yast2-fingerprint-reader-2.17.1/agent-thinkfinger/Makefile.am 1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-SUBDIRS = conf doc src testsuite
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-fingerprint-reader-2.17.0/agent-thinkfinger/src/Makefile.am new/yast2-fingerprint-reader-2.17.1/agent-thinkfinger/src/Makefile.am
--- old/yast2-fingerprint-reader-2.17.0/agent-thinkfinger/src/Makefile.am 2007-10-02 13:27:17.000000000 +0200
+++ new/yast2-fingerprint-reader-2.17.1/agent-thinkfinger/src/Makefile.am 1970-01-01 01:00:00.000000000 +0100
@@ -1,24 +0,0 @@
-
-# Makefile.am for .../agent-thinkfinger/src
-#
-
-AM_CXXFLAGS = -DY2LOG=\"agent-thinkfinger\" -Wall
-
-plugin_LTLIBRARIES = libpy2ag_thinkfinger.la
-noinst_LTLIBRARIES = liby2ag_thinkfinger.la
-
-liby2ag_thinkfinger_la_SOURCES = \
- ThinkFingerAgent.cc \
- ThinkFingerAgent.h
-liby2ag_thinkfinger_la_LDFLAGS = -version-info 2:0
-liby2ag_thinkfinger_la_LIBADD = @AGENT_LIBADD@ -lthinkfinger -L$(libdir)
-
-
-libpy2ag_thinkfinger_la_SOURCES = \
- $(liby2ag_thinkfinger_la_SOURCES) \
- Y2CCThinkFingerAgent.cc
-libpy2ag_thinkfinger_la_LDFLAGS = -version-info 2:0
-libpy2ag_thinkfinger_la_LIBADD = @AGENT_LIBADD@ -lthinkfinger -L$(libdir)
-
-
-INCLUDES = -I$(includedir)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-fingerprint-reader-2.17.0/agent-thinkfinger/src/ThinkFingerAgent.cc new/yast2-fingerprint-reader-2.17.1/agent-thinkfinger/src/ThinkFingerAgent.cc
--- old/yast2-fingerprint-reader-2.17.0/agent-thinkfinger/src/ThinkFingerAgent.cc 2008-03-07 15:16:41.000000000 +0100
+++ new/yast2-fingerprint-reader-2.17.1/agent-thinkfinger/src/ThinkFingerAgent.cc 1970-01-01 01:00:00.000000000 +0100
@@ -1,377 +0,0 @@
-/* ThinkFingerAgent.cc
- *
- * An agent for ThinkFinger library (access to fingerprint reader)
- *
- * Authors: Jiri Suchomel
- *
- * $Id$
- */
-
-#include "ThinkFingerAgent.h"
-
-#define PC(n) (path->component_str(n))
-
-#define INIT_FAILED 500
-#define SET_FILE_FAILED 600
-#define SET_CALLBACK_FAILED 700
-
-// structure to be passed to callback
-typedef struct {
- int write_fd;
-} s_tfdata;
-
-/**
- * callback function to be called from libthinkfinger_acquire
- * @param state current device status
- * @param data void pointer to user data
- */
-static void callback (libthinkfinger_state state, void *data)
-{
- s_tfdata *tfdata = (s_tfdata *) data;
- if (write (tfdata->write_fd, &state, sizeof (libthinkfinger_state)) == -1)
- y2error("write to pipe failed: %d (%m)", errno);
-}
-
-/**
- * Constructor
- */
-ThinkFingerAgent::ThinkFingerAgent() : SCRAgent()
-{
- child_pid = -1;
- child_retval = -1;
-}
-
-/**
- * Destructor
- */
-ThinkFingerAgent::~ThinkFingerAgent()
-{
-}
-
-// return the only instance of the class
-ThinkFingerAPI& ThinkFingerAPI::instance()
-{
- static ThinkFingerAPI _instance; // The singleton
- return _instance;
-}
-
-// handler for SIGTERM signal (it is necessary to kill the process when
-// user his Cancel)
-void ThinkFingerAPI::catch_sigterm (int sig_num)
-{
- instance().finalize ();
- exit (256);
-}
-
-// de-initialize finger print reader (must be called at the end!)
-void ThinkFingerAPI::finalize ()
-{
- if (instance().tf != NULL)
- {
- libthinkfinger_free (instance().tf);
- instance().tf = NULL;
- }
-}
-
-ThinkFingerAPI::ThinkFingerAPI()
-{
- tf = NULL;
-}
-
-ThinkFingerAPI::~ThinkFingerAPI ()
-{
-}
-
-/**
- * wrapper for libthinkfinger_acquire function;
- * - we need to take care of the errors and signals
- * @param file descriptor of the pipe
- * @param path to the target bir file
- */
-int ThinkFingerAPI::acquire (int write_fd, string bir_path)
-{
- signal (15, catch_sigterm);
-
- int retval = 255;
- s_tfdata tfdata;
- tfdata.write_fd = write_fd;
-
- libthinkfinger_init_status init_status;
- instance().tf = libthinkfinger_new (&init_status);
- if (init_status != TF_INIT_SUCCESS) {
- y2error ("libthinkfinger_new failed");
- instance().finalize ();
- retval = INIT_FAILED;
- write (write_fd, &retval, sizeof(libthinkfinger_state));
- return retval;
- }
-
- if (libthinkfinger_set_file (instance().tf, bir_path.c_str ()) < 0)
- {
- y2error ("libthinkfinger_set_file failed");
- instance().finalize ();
- retval = SET_FILE_FAILED;
- write (write_fd, &retval, sizeof(libthinkfinger_state));
- return retval;
- }
- if (libthinkfinger_set_callback (instance().tf, callback, &tfdata) < 0)
- {
- y2error ("libthinkfinger_set_callback failed");
- instance().finalize ();
- retval = SET_CALLBACK_FAILED;
- write (write_fd, &retval, sizeof(libthinkfinger_state));
- return retval;
- }
- retval = libthinkfinger_acquire (ThinkFingerAPI::instance().tf);
- y2milestone ("acquire done with state %d", retval);
- instance().finalize ();
- signal (15, SIG_DFL);
- return retval;
-}
-
-/**
- * Dir
- */
-YCPList ThinkFingerAgent::Dir(const YCPPath& path)
-{
- y2error("Wrong path '%s' in Dir().", path->toString().c_str());
- return YCPNull();
-}
-
-/**
- * Read
- */
-YCPValue ThinkFingerAgent::Read(const YCPPath &path, const YCPValue& arg, const YCPValue& opt) {
-
- y2debug ("Path in Read(): %s", path->toString().c_str());
- YCPValue ret = YCPVoid();
-
- if (path->length() == 0) {
- ret = YCPString("0");
- }
- else if (path->length() == 1) {
-
- if (PC(0) == "error") {
- // return the last error message
- ret = YCPString ("error_message");
- }
- else if (PC(0) == "state") {
- YCPMap retmap;
- if (child_pid == -1)
- {
- y2error ("ThinkFinger not initialized yet!");
- return ret;
- }
- int state;
- size_t size = sizeof (libthinkfinger_state);
- int retval = read (data_pipe[0], &state, size);
- if (retval == -1)
- {
- if (errno != EINTR && errno != EAGAIN)
- y2error ("error reading from pipe: %d (%m)", errno);
- }
- else if (retval == size) {
- if (state == INIT_FAILED ||
- state == SET_FILE_FAILED || state == SET_CALLBACK_FAILED)
- {
- y2warning ("some initialization failed (%d)...", state);
- return ret;
- }
- retmap->add (YCPString ("state"), YCPInteger (state));
- }
- else if (retval == 0)
- {
- // check if child is still alive
- int status;
- if (waitpid (-1, &status, WNOHANG) != 0)
- {
- if (WIFSIGNALED (status))
- {
- y2error ("child process was killed");
- child_pid = -1;
- return ret;
- }
- if (WIFEXITED (status))
- {
- child_retval = WEXITSTATUS (status);
- child_pid = -1;
- return ret;
- }
- }
- }
- return retmap;
- }
- // check if child process exited
- else if (PC(0) == "check_exit" ) {
- int status;
- ret = YCPBoolean (false);
- if (child_pid != -1)
- {
- if (waitpid (child_pid, &status, WNOHANG) != 0)
- {
- child_pid = -1;
- ret = YCPBoolean (true);
- if (WIFSIGNALED (status))
- {
- y2error ("child process was killed");
- }
- if (WIFEXITED (status))
- {
- child_retval = WEXITSTATUS (status);
- }
- }
- }
- else
- {
- y2milestone ("child process already exited");
- ret = YCPBoolean (true);
- }
- }
- // wait for child exit if it still not exited (do not use this part)
- // return child exit value
- else if (PC(0) == "exit_status" ) {
- int status;
- int retval = 255;
- if (child_pid != -1)
- {
- wait (&status);
- if (WIFSIGNALED (status))
- y2milestone ("child process was killed");
- else if (WIFEXITED (status))
- {
- retval = WEXITSTATUS (status);
- y2milestone ("retval is %d", retval);
- }
- }
- else
- {
- y2milestone ("child process already exited");
- if (child_retval)
- retval = child_retval;
- child_retval = -1;
- }
- ret = YCPInteger (retval);
- close (data_pipe[0]); // close FD for reading
- }
- else {
- y2error ("Unknown path in Read(): %s", path->toString().c_str());
- }
- }
- else {
- y2error ("Unknown path in Read(): %s", path->toString().c_str());
- }
- return ret;
-}
-
-
-/**
- * Write - nothing to do
- */
-YCPBoolean ThinkFingerAgent::Write(const YCPPath &path, const YCPValue& value,
- const YCPValue& arg)
-{
- return YCPBoolean(false);
-}
-
-/**
- * Execute(.thinkfinger.add-user) is action to acquire fingerprint
- */
-YCPValue ThinkFingerAgent::Execute(const YCPPath &path, const YCPValue& val, const YCPValue& arg)
-{
- y2milestone ("Path in Execute(): %s", path->toString().c_str());
- YCPValue ret = YCPBoolean(false);
-
- if (path->length() == 1) {
-
- if (PC(0) == "cancel") {
- y2milestone ("terminanting child process with pid %d", child_pid);
- if (child_pid)
- {
- if (kill (child_pid, 15) != -1)
- {
- sleep (3);
- int status;
- if (waitpid (-1, &status, WNOHANG) == 0)
- {
- y2milestone ("... still alive, killing it", child_pid);
- kill (child_pid, 9);
- wait (&status);
- }
- child_pid = -1;
- }
- else
- {
- y2error ("error while killing: %d (%m)", errno);
- }
- }
- ret = YCPBoolean (true);
- }
- /**
- * parameter is whole path to target bir file, e.g.
- * /tmp/YaST-123-456/hh.bir
- */
- else if (PC(0) == "add-user") {
- string path;
- if (!val.isNull())
- {
- path = val->asString()->value();
- }
- else
- {
- y2error ("path to bir file is missing");
- return ret;
- }
- if (pipe (data_pipe) == -1) {
- y2error ("pipe creation failed");
- return ret;
- }
-
- long arg;
- arg = fcntl (data_pipe[0], F_GETFL);
- if (fcntl (data_pipe[0], F_SETFL, arg | O_NONBLOCK ) < 0)
- {
- y2error ("Couldn't set O_NONBLOCK: errno=%d: %m", errno);
- close (data_pipe[0]);
- close (data_pipe[1]);
- return ret;
- }
- child_pid = fork ();
- if (child_pid == -1)
- {
- y2error ("fork failed");
- return ret;
- }
- else if (child_pid == 0)
- {
- close (data_pipe[0]); // close the read-only FD
- int state =
- ThinkFingerAPI::instance().acquire (data_pipe[1], path);
- y2milestone ("acquire done with state %d", state);
- close (data_pipe[1]);
- exit (state);
- }
- else // parent -> return
- {
- close (data_pipe[1]); // close FD for writing
- ret = YCPBoolean(true);
- }
- }
- }
- return ret;
-}
-
-/**
- * otherCommand
- */
-YCPValue ThinkFingerAgent::otherCommand(const YCPTerm& term)
-{
- string sym = term->name();
-
- if (sym == "ThinkFingerAgent") {
-
- return YCPVoid();
- }
-
- return YCPNull();
-}
-
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-fingerprint-reader-2.17.0/agent-thinkfinger/src/ThinkFingerAgent.h new/yast2-fingerprint-reader-2.17.1/agent-thinkfinger/src/ThinkFingerAgent.h
--- old/yast2-fingerprint-reader-2.17.0/agent-thinkfinger/src/ThinkFingerAgent.h 2008-03-03 16:42:04.000000000 +0100
+++ new/yast2-fingerprint-reader-2.17.1/agent-thinkfinger/src/ThinkFingerAgent.h 1970-01-01 01:00:00.000000000 +0100
@@ -1,122 +0,0 @@
-/* ThinkFingerAgent.h
- *
- * ThinkFinger agent implementation
- *
- * Authors: Jiri Suchomel
- *
- * $Id: ThinkFingerAgent.h 26456 2005-12-07 16:11:23Z jsuchome $
- */
-
-#ifndef _ThinkFingerAgent_h
-#define _ThinkFingerAgent_h
-
-#include
-#include
-
-using namespace std;
-
-#include
-#include
-#include
-#include
-
-#include <string>
-
-/**
- * The real interface to thinkfinger library
- * - extra (singleton) class is used to contain signal handler function
- */
-class ThinkFingerAPI
-{
-
-private:
- ThinkFingerAPI ();
-
- virtual ~ThinkFingerAPI();
-
-public:
-
- static ThinkFingerAPI & instance();
-
- static void catch_sigterm (int);
-
- int acquire (int, string);
-
- int test_int;
-
- libthinkfinger *tf;
-
- void finalize ();
-
-};
-
-/**
- * @short An interface class between YaST2 and ThinkFinger Agent
- */
-class ThinkFingerAgent : public SCRAgent
-{
-
-public:
-
- /**
- * Default constructor.
- */
- ThinkFingerAgent ();
-
-
- /**
- * Destructor.
- */
- virtual ~ThinkFingerAgent();
-
- /**
- * Provides SCR Read ().
- * @param path Path that should be read.
- * @param arg Additional parameter.
- */
- virtual YCPValue Read(const YCPPath &path,
- const YCPValue& arg = YCPNull(),
- const YCPValue& opt = YCPNull());
-
- /**
- * Provides SCR Write ().
- */
- virtual YCPBoolean Write(const YCPPath &path,
- const YCPValue& val,
- const YCPValue& arg = YCPNull());
-
- /**
- * Provides SCR Execute ().
- */
- virtual YCPValue Execute(const YCPPath &path,
- const YCPValue& val = YCPNull(),
- const YCPValue& arg = YCPNull());
-
- /**
- * Provides SCR Dir ().
- */
- virtual YCPList Dir(const YCPPath& path);
-
- /**
- * Used for mounting the agent.
- */
- virtual YCPValue otherCommand(const YCPTerm& term);
-
- /**
- * array with pipe file descriptors
- */
- int data_pipe[2];
-
- /**
- * pid of the child process after fork
- */
- pid_t child_pid;
-
- /**
- * return value of the child process
- */
- int child_retval;
-
-};
-
-#endif /* _ThinkFingerAgent_h */
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-fingerprint-reader-2.17.0/agent-thinkfinger/src/Y2CCThinkFingerAgent.cc new/yast2-fingerprint-reader-2.17.1/agent-thinkfinger/src/Y2CCThinkFingerAgent.cc
--- old/yast2-fingerprint-reader-2.17.0/agent-thinkfinger/src/Y2CCThinkFingerAgent.cc 2007-10-02 13:27:17.000000000 +0200
+++ new/yast2-fingerprint-reader-2.17.1/agent-thinkfinger/src/Y2CCThinkFingerAgent.cc 1970-01-01 01:00:00.000000000 +0100
@@ -1,15 +0,0 @@
-/* Y2CCThinkFingerAgent.cc
- *
- * Authors: Jiri Suchomel
- *
- * $Id$
- */
-
-#include
-#include
-
-#include "ThinkFingerAgent.h"
-
-typedef Y2AgentComp <ThinkFingerAgent> Y2ThinkFingerAgentComp;
-
-Y2CCAgentComp <Y2ThinkFingerAgentComp> g_y2ccag_thinkfinger ("ag_thinkfinger");
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-fingerprint-reader-2.17.0/agent-thinkfinger/testsuite/Makefile.am new/yast2-fingerprint-reader-2.17.1/agent-thinkfinger/testsuite/Makefile.am
--- old/yast2-fingerprint-reader-2.17.0/agent-thinkfinger/testsuite/Makefile.am 2007-10-02 13:27:17.000000000 +0200
+++ new/yast2-fingerprint-reader-2.17.1/agent-thinkfinger/testsuite/Makefile.am 1970-01-01 01:00:00.000000000 +0100
@@ -1,8 +0,0 @@
-#
-# Makefile.am for .../agent-thinkfinger/testsuite
-#
-
-AUTOMAKE_OPTIONS = dejagnu
-
-clean-local:
- rm -f tmp.err.* tmp.out.* site.exp site.bak
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-fingerprint-reader-2.17.0/configure.in new/yast2-fingerprint-reader-2.17.1/configure.in
--- old/yast2-fingerprint-reader-2.17.0/configure.in 2008-04-15 11:08:32.000000000 +0200
+++ new/yast2-fingerprint-reader-2.17.1/configure.in 2008-09-26 14:35:22.000000000 +0200
@@ -3,7 +3,7 @@
dnl -- This file is generated by y2autoconf 2.16.8 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-fingerprint-reader, 2.16.7, http://bugs.opensuse.org/, yast2-fingerprint-reader)
+AC_INIT(yast2-fingerprint-reader, 2.17.0, http://bugs.opensuse.org/, yast2-fingerprint-reader)
dnl Check for presence of file 'RPMNAME'
AC_CONFIG_SRCDIR([RPMNAME])
@@ -18,7 +18,7 @@
AM_INIT_AUTOMAKE(tar-ustar -Wno-portability)
dnl Important YaST2 variables
-VERSION="2.16.7"
+VERSION="2.17.0"
RPMNAME="yast2-fingerprint-reader"
MAINTAINER="Jiri Suchomel "
@@ -161,8 +161,14 @@
AC_PROG_CC
AC_PROG_CPP
-CFLAGS="${CFLAGS} -Wall -Wformat=2 -Wmissing-prototypes"
-CXXFLAGS="${CXXFLAGS} -Wall -Wformat=2"
+# If we have core, get its Y2CORE_CFLAGS.
+# When building core itself, it has set Y2CORE_CFLAGS elsewhere already
+PKG_CHECK_EXISTS([yast2-core],[
+ PKG_CHECK_MODULES(Y2CORE, yast2-core)
+])
+
+CFLAGS="${CFLAGS} ${Y2CORE_CFLAGS} -Wall -Wformat=2 -Wmissing-prototypes"
+CXXFLAGS="${CXXFLAGS} ${Y2CORE_CFLAGS} -Wall -Wformat=2"
: ${AGENT_LIBADD:='-L$(libdir) -lscr'}
AC_SUBST(AGENT_LIBADD)
@@ -178,12 +184,12 @@
AC_HEADER_STDC
-AC_CONFIG_FILES(Makefile agent-thinkfinger/conf/Makefile
-agent-thinkfinger/doc/autodocs/Makefile
-agent-thinkfinger/doc/Makefile
-agent-thinkfinger/src/Makefile
-agent-thinkfinger/testsuite/Makefile
-agent-thinkfinger/Makefile
+AC_CONFIG_FILES(Makefile agent-fprint/conf/Makefile
+agent-fprint/doc/autodocs/Makefile
+agent-fprint/doc/Makefile
+agent-fprint/src/Makefile
+agent-fprint/testsuite/Makefile
+agent-fprint/Makefile
doc/autodocs/Makefile
doc/Makefile
src/Makefile
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-fingerprint-reader-2.17.0/Makefile.am new/yast2-fingerprint-reader-2.17.1/Makefile.am
--- old/yast2-fingerprint-reader-2.17.0/Makefile.am 2008-04-15 11:08:32.000000000 +0200
+++ new/yast2-fingerprint-reader-2.17.1/Makefile.am 2008-09-26 14:35:22.000000000 +0200
@@ -214,4 +214,4 @@
test ! -f $(srcdir)/po/Makefile || $(MAKE) -C po checkpo
# test ! -f $(srcdir)/po/Makefile || $(MAKE) -C po checkpo make-pox
# No ./SUBDIRS file found - assuming default: All direct subdirs with Makefile.am
-SUBDIRS = agent-thinkfinger doc src testsuite
+SUBDIRS = agent-fprint doc src testsuite
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-fingerprint-reader-2.17.0/src/dialogs.ycp new/yast2-fingerprint-reader-2.17.1/src/dialogs.ycp
--- old/yast2-fingerprint-reader-2.17.0/src/dialogs.ycp 2008-09-09 11:13:17.000000000 +0200
+++ new/yast2-fingerprint-reader-2.17.1/src/dialogs.ycp 2008-09-09 11:14:56.000000000 +0200
@@ -24,7 +24,7 @@
* Summary: Dialogs definitions
* Authors: Jiri Suchomel
*
- * $Id: dialogs.ycp 46646 2008-04-15 09:19:17Z jsuchome $
+ * $Id: dialogs.ycp 50860 2008-09-09 09:14:56Z jsuchome $
*/
{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-fingerprint-reader-2.17.0/src/FingerprintReader.ycp new/yast2-fingerprint-reader-2.17.1/src/FingerprintReader.ycp
--- old/yast2-fingerprint-reader-2.17.0/src/FingerprintReader.ycp 2008-09-09 11:13:17.000000000 +0200
+++ new/yast2-fingerprint-reader-2.17.1/src/FingerprintReader.ycp 2008-09-09 11:14:56.000000000 +0200
@@ -24,7 +24,7 @@
* Summary: FingerprintReader settings, input and output functions
* Authors: Jiri Suchomel
*
- * $Id: FingerprintReader.ycp 47690 2008-05-20 07:20:48Z jsuchome $
+ * $Id: FingerprintReader.ycp 50860 2008-09-09 09:14:56Z jsuchome $
*
* Representation of the configuration of fingerprint-reader.
* Input and output routines.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-fingerprint-reader-2.17.0/src/users_plugin_fingerprint_reader.ycp new/yast2-fingerprint-reader-2.17.1/src/users_plugin_fingerprint_reader.ycp
--- old/yast2-fingerprint-reader-2.17.0/src/users_plugin_fingerprint_reader.ycp 2008-03-26 10:44:34.000000000 +0100
+++ new/yast2-fingerprint-reader-2.17.1/src/users_plugin_fingerprint_reader.ycp 2008-09-26 16:17:45.000000000 +0200
@@ -12,7 +12,7 @@
* Authors:
* Jiri Suchomel
*
- * $Id: users_plugin_fingerprint_reader.ycp 45722 2008-03-26 09:44:34Z jsuchome $
+ * $Id: users_plugin_fingerprint_reader.ycp 51598 2008-09-26 14:05:42Z jsuchome $
*/
{
@@ -92,22 +92,22 @@
integer swipe_success = 0;
integer swipe_failed = 0;
- // helper function: return exit status of the thinkfinger proccess;
+ // helper function: return exit status of the fprint proccess;
// regulary check user input for `cancel button
integer get_exit_status () {
integer ex = exit_status;
while (true)
{
- boolean exited = (boolean) SCR::Read (.thinkfinger.check_exit);
+ boolean exited = (boolean) SCR::Read (.fprint.check_exit);
if (exited)
{
- ex = (integer) SCR::Read (.thinkfinger.exit_status);
+ ex = (integer) SCR::Read (.fprint.exit_status);
break;
}
ui = UI::PollInput ();
if (ui == `cancel)
{
- SCR::Execute (.thinkfinger.cancel);
+ SCR::Execute (.fprint.cancel);
UI::ReplaceWidget (`id (`rp), `Label (_("Canceled")));
break;
}
@@ -125,7 +125,7 @@
swipe_success, swipe_failed)
));
}
- if (SCR::Execute (.thinkfinger.add-user, bir_path) != true)
+ if (SCR::Execute (.fprint.enroll, bir_path) != true)
{
ui = `cancel;
// status message
@@ -134,7 +134,7 @@
}
while (ui != `cancel)
{
- map statemap = (map) SCR::Read (.thinkfinger.state);
+ map statemap = (map) SCR::Read (.fprint.state);
if (statemap != nil && statemap != $[])
{
integer state = statemap["state"]:0;
@@ -176,6 +176,21 @@
replace_swipe_string ();
break;
}
+
+ case 1: { // FP_ENROLL_COMPLETE
+ UI::ReplaceWidget (`id (`rp),
+ // status label
+ `Label (_("Storing data...")));
+ UI::ReplaceWidget (`id (`rpstatus), `VSpacing ());
+ exit = true;
+ break;
+ }
+ case -1: { // FP_ENROLL_FAIL FIXME
+ UI::ReplaceWidget (`id (`rp),
+ `Label (_("Acquiring fingerprint failed.")));
+ exit = true;
+ break;
+ }
}
}
else if (statemap == nil)
@@ -193,7 +208,7 @@
if (ui == `cancel || ui == `back)
{
- SCR::Execute (.thinkfinger.cancel);
+ SCR::Execute (.fprint.cancel);
// status label (canceled after user action)
UI::ReplaceWidget (`id (`rp), `Label (_("Canceled")));
y2milestone ("canceled");
@@ -202,9 +217,11 @@
sleep (100);
}
y2milestone ("agent exit status: %1", exit_status);
+// FIXME FIXME
// 9 is failed acquire, 253 is USB error, 254 communication error
// FIXME what's the meaning of TF_STATE_ENROLL_SUCCESS (7)?
- if (exit_status == 7 || exit_status == 8)
+// if (exit_status == 7 || exit_status == 8)
+ if (exit_status == 1)
{
// status label
UI::ReplaceWidget (`id (`rp), `Label (_("Fingerprint acquired successfully.")));
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-fingerprint-reader-2.17.0/VERSION new/yast2-fingerprint-reader-2.17.1/VERSION
--- old/yast2-fingerprint-reader-2.17.0/VERSION 2008-09-09 11:13:59.000000000 +0200
+++ new/yast2-fingerprint-reader-2.17.1/VERSION 2008-09-26 16:18:27.000000000 +0200
@@ -1 +1 @@
-2.17.0
+2.17.1
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org